author | zecke <zecke> | 2002-07-06 23:38:54 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-07-06 23:38:54 (UTC) |
commit | 4f44b353d8211a51e2f0bfb609f2c2d79c44827f (patch) (unidiff) | |
tree | 2178fb8097d7bb09c8a7fdac206dd64318a6b489 /noncore | |
parent | 8703ff76831bf3f971087440b991608d59f429bf (diff) | |
download | opie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.zip opie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.tar.gz opie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.tar.bz2 |
Null video fixes
lib updates
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 54 |
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 | |||
@@ -43,11 +43,13 @@ Lib::Lib() { | |||
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 | ||
53 | Lib::~Lib() { | 55 | Lib::~Lib() { |
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 | |||
@@ -20,29 +20,36 @@ struct 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 | ||
26 | static uint32_t null_get_capabilities(vo_driver_t *self ){ | 29 | static 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*/ |
32 | static void null_frame_dispose( vo_frame_t* vo_img){ | 36 | static 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 | } |
36 | static void null_frame_field( vo_frame_t* frame, int inti ){ | 41 | static 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 | ||
42 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | 48 | static 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; |
@@ -54,15 +61,51 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
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 | } |
59 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | 67 | static 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 | } |
64 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){ | 107 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){ |
65 | printf("display frame"); | 108 | printf("display frame\n"); |
66 | } | 109 | } |
67 | static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, | 110 | static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, |
68 | vo_overlay_t* overlay ){ | 111 | vo_overlay_t* overlay ){ |
@@ -70,16 +113,19 @@ static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, | |||
70 | } | 113 | } |
71 | static int null_get_property( vo_driver_t* self, | 114 | static 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 | } |
75 | static int null_set_property( vo_driver_t* self, | 119 | static 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 | } |
80 | static void null_get_property_min_max( vo_driver_t* self, | 125 | static 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 | } |