summaryrefslogtreecommitdiff
authorzecke <zecke>2002-07-06 23:38:54 (UTC)
committer zecke <zecke>2002-07-06 23:38:54 (UTC)
commit4f44b353d8211a51e2f0bfb609f2c2d79c44827f (patch) (unidiff)
tree2178fb8097d7bb09c8a7fdac206dd64318a6b489
parent8703ff76831bf3f971087440b991608d59f429bf (diff)
downloadopie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.zip
opie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.tar.gz
opie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.tar.bz2
Null video fixes
lib updates
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp8
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c54
2 files changed, 55 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 123ca91..0ea85dd 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -30,37 +30,39 @@ Lib::Lib() {
30 else 30 else
31 printf("Success\n"); 31 printf("Success\n");
32 32
33 33
34 // test code 34 // test code
35 m_videoOutput = xine_load_video_output_plugin(m_config, "fb", 35 m_videoOutput = xine_load_video_output_plugin(m_config, "fb",
36 VISUAL_TYPE_FB, 36 VISUAL_TYPE_FB,
37 0 ); 37 0 );
38 38
39 char** files = xine_list_video_output_plugins(3); 39 char** files = xine_list_video_output_plugins(3);
40 char* out; 40 char* out;
41 int i = 0; 41 int i = 0;
42 while ( ( out = files[i] ) != 0 ) { 42 while ( ( out = files[i] ) != 0 ) {
43 printf("Audio %s\n", out ); 43 printf("Audio %s\n", out );
44 i++; 44 i++;
45 } 45 }
46 m_xine = xine_init( m_videoOutput, 46// m_xine = xine_init( m_videoOutput,
47 m_audioOutput, 47// m_audioOutput,
48 m_config ); 48// m_config );
49 // test loading 49 // test loading
50 m_videoOutput = ::init_video_out_plugin( m_config, NULL ); 50 m_videoOutput = ::init_video_out_plugin( m_config, NULL );
51 m_xine = xine_init( m_videoOutput,
52 m_audioOutput, m_config );
51} 53}
52 54
53Lib::~Lib() { 55Lib::~Lib() {
54 delete m_config; 56 delete m_config;
55 xine_exit( m_xine ); 57 xine_exit( m_xine );
56 delete m_videoOutput; 58 delete m_videoOutput;
57 //delete m_audioOutput; 59 //delete m_audioOutput;
58 60
59} 61}
60 62
61QCString Lib::version() { 63QCString Lib::version() {
62 QCString str( xine_get_str_version() ); 64 QCString str( xine_get_str_version() );
63 return str; 65 return str;
64}; 66};
65 67
66int Lib::majorVersion() { 68int Lib::majorVersion() {
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index c97800c..5224862 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -7,92 +7,138 @@
7#include <xine/xine_internal.h> 7#include <xine/xine_internal.h>
8#include <xine/xineutils.h> 8#include <xine/xineutils.h>
9#include <xine/configfile.h> 9#include <xine/configfile.h>
10 10
11typedef struct null_driver_s null_driver_t; 11typedef struct null_driver_s null_driver_t;
12 12
13struct null_driver_s { 13struct null_driver_s {
14 vo_driver_t vo_driver; 14 vo_driver_t vo_driver;
15 uint32_t m_capabilities; 15 uint32_t m_capabilities;
16 16
17}; 17};
18typedef struct opie_frame_s opie_frame_t; 18typedef struct opie_frame_s opie_frame_t;
19struct opie_frame_s { 19struct opie_frame_s {
20 vo_frame_t frame; 20 vo_frame_t frame;
21 char* name; 21 char* name;
22 int version; 22 int version;
23 int m_width;
24 int m_height;
25 uint8_t *chunk[3];
23 null_driver_t *output; 26 null_driver_t *output;
24}; 27};
25 28
26static uint32_t null_get_capabilities(vo_driver_t *self ){ 29static uint32_t null_get_capabilities(vo_driver_t *self ){
27 null_driver_t* this = (null_driver_t*)self; 30 null_driver_t* this = (null_driver_t*)self;
31 printf("capabilities\n");
28 return this->m_capabilities; 32 return this->m_capabilities;
29} 33}
30 34
31/* take care of the frame*/ 35/* take care of the frame*/
32static void null_frame_dispose( vo_frame_t* vo_img){ 36static void null_frame_dispose( vo_frame_t* vo_img){
33 opie_frame_t* frame = (opie_frame_t*)vo_img; 37 opie_frame_t* frame = (opie_frame_t*)vo_img;
38 printf("frame_dispose\n");
34 free (frame); 39 free (frame);
35} 40}
36static void null_frame_field( vo_frame_t* frame, int inti ){ 41static void null_frame_field( vo_frame_t* frame, int inti ){
42 printf("frame_field\n");
37 /* not needed */ 43 /* not needed */
38} 44}
39 45
40/* end take care of frames*/ 46/* end take care of frames*/
41 47
42static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ 48static vo_frame_t* null_alloc_frame( vo_driver_t* self ){
43 null_driver_t* this = (null_driver_t*)self; 49 null_driver_t* this = (null_driver_t*)self;
44 opie_frame_t* frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); 50 opie_frame_t* frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) );
45 memset( frame, 0, sizeof( opie_frame_t) ); 51 memset( frame, 0, sizeof( opie_frame_t) );
52 printf("alloc_frame\n");
46 frame->name = "opie\0"; 53 frame->name = "opie\0";
47 frame->version = 1; 54 frame->version = 1;
48 frame->output = this; 55 frame->output = this;
49 56
50 /* initialize the frame*/ 57 /* initialize the frame*/
51 frame->frame.driver = self; 58 frame->frame.driver = self;
52 /*frame.frame.free = null_frame_free;*/ 59 /*frame.frame.free = null_frame_free;*/
53 frame->frame.copy = NULL; 60 frame->frame.copy = NULL;
54 frame->frame.field = null_frame_field; 61 frame->frame.field = null_frame_field;
55 frame->frame.dispose = null_frame_dispose; 62 frame->frame.dispose = null_frame_dispose;
56 63
64
57 return (vo_frame_t*) frame; 65 return (vo_frame_t*) frame;
58} 66}
59static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, 67static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
60 uint32_t width, uint32_t height, 68 uint32_t width, uint32_t height,
61 int ratio_code, int format, int flags ){ 69 int ratio_code, int format, int flags ){
70 null_driver_t* this = (null_driver_t*) self;
71 opie_frame_t* frame = (opie_frame_t*)img;
62 /* not needed now */ 72 /* not needed now */
73 printf("update_frame_format\n");
74 printf("al crash aye?\n");
75
76 if(frame->chunk[0] ){
77 free( frame->chunk[0] );
78 frame->chunk[0] = NULL;
79 }
80 if(frame->chunk[1] ){
81 free ( frame->chunk[1] );
82 frame->chunk[1] = NULL;
83 }
84 if(frame->chunk[2] ){
85 free ( frame->chunk[2] );
86 frame->chunk[2] = NULL;
87 }
88
89
90 if( format == IMGFMT_YV12 ) {
91 int image_size = width * height; /* cast ouch*/
92 frame->frame.base[0] = xine_xmalloc_aligned(16, image_size,
93 (void **)&frame->chunk[0] );
94 frame->frame.base[1] = xine_xmalloc_aligned(16, image_size,
95 (void **)&frame->chunk[1] );
96 frame->frame.base[2] = xine_xmalloc_aligned(16, image_size,
97 (void **)&frame->chunk[2] );
98 }else{
99 int image_size = width * height; /* cast ouch*/
100 frame->frame.base[0] = xine_xmalloc_aligned(16, image_size,
101 (void **)&frame->chunk[0] );
102 frame->chunk[1] = NULL;
103 frame->chunk[2] = NULL;
104 }
105
63} 106}
64static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){ 107static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){
65 printf("display frame"); 108 printf("display frame\n");
66} 109}
67static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, 110static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame,
68 vo_overlay_t* overlay ){ 111 vo_overlay_t* overlay ){
69 /* sure */ 112 /* sure */
70} 113}
71static int null_get_property( vo_driver_t* self, 114static int null_get_property( vo_driver_t* self,
72 int property ){ 115 int property ){
116 printf("property get]n");
73 return 0; 117 return 0;
74} 118}
75static int null_set_property( vo_driver_t* self, 119static int null_set_property( vo_driver_t* self,
76 int property, 120 int property,
77 int value ){ 121 int value ){
122 printf("set property\n");
78 return value; 123 return value;
79} 124}
80static void null_get_property_min_max( vo_driver_t* self, 125static void null_get_property_min_max( vo_driver_t* self,
81 int property, int *min, 126 int property, int *min,
82 int *max ){ 127 int *max ){
128 printf("min max\n");
83 *max = 0; 129 *max = 0;
84 *min = 0; 130 *min = 0;
85} 131}
86static int null_gui_data_exchange( vo_driver_t* self, 132static int null_gui_data_exchange( vo_driver_t* self,
87 int data_type, 133 int data_type,
88 void *data ){ 134 void *data ){
89 return 0; 135 return 0;
90} 136}
91static void null_exit( vo_driver_t* self ){ 137static void null_exit( vo_driver_t* self ){
92 null_driver_t* this = (null_driver_t*)self; 138 null_driver_t* this = (null_driver_t*)self;
93 free ( this ); 139 free ( this );
94} 140}
95static int null_redraw_needed( vo_driver_t* self ){ 141static int null_redraw_needed( vo_driver_t* self ){
96 return 0; 142 return 0;
97} 143}
98 144