-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 183 |
1 files changed, 94 insertions, 89 deletions
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index 90f62f2..378bbd4 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -106,3 +106,3 @@ struct opie_frame_s { | |||
106 | int stripe_height, stripe_inc; | 106 | int stripe_height, stripe_inc; |
107 | 107 | ||
108 | null_driver_t *output; | 108 | null_driver_t *output; |
@@ -110,3 +110,3 @@ struct opie_frame_s { | |||
110 | 110 | ||
111 | static uint32_t null_get_capabilities( vo_driver_t *self ){ | 111 | static uint32_t null_get_capabilities( vo_driver_t *self ){ |
112 | null_driver_t* this = (null_driver_t*)self; | 112 | null_driver_t* this = (null_driver_t*)self; |
@@ -117,9 +117,9 @@ static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | |||
117 | opie_frame_t *frame = (opie_frame_t *) vo_img ; | 117 | opie_frame_t *frame = (opie_frame_t *) vo_img ; |
118 | 118 | ||
119 | vo_img->proc_called = 1; | 119 | vo_img->proc_called = 1; |
120 | 120 | ||
121 | if (!frame->output->m_show_video) { | 121 | if (!frame->output->m_show_video) { |
122 | /* printf("nullvideo: no video\n"); */ | 122 | /* printf("nullvideo: no video\n"); */ |
123 | return; | 123 | return; |
124 | } | 124 | } |
125 | 125 | ||
@@ -127,3 +127,3 @@ static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | |||
127 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 127 | frame->yuv2rgb->yuv2rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
128 | src[0], src[1], src[2]); | 128 | src[0], src[1], src[2]); |
129 | } else { | 129 | } else { |
@@ -131,6 +131,6 @@ static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | |||
131 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, | 131 | frame->yuv2rgb->yuy22rgb_fun (frame->yuv2rgb, frame->rgb_dst, |
132 | src[0]); | 132 | src[0]); |
133 | } | 133 | } |
134 | 134 | ||
135 | frame->rgb_dst += frame->stripe_inc; | 135 | frame->rgb_dst += frame->stripe_inc; |
136 | } | 136 | } |
@@ -158,3 +158,3 @@ static void null_frame_field (vo_frame_t *vo_img, int which_field) { | |||
158 | /* take care of the frame*/ | 158 | /* take care of the frame*/ |
159 | static void null_frame_dispose( vo_frame_t* vo_img){ | 159 | static void null_frame_dispose( vo_frame_t* vo_img){ |
160 | opie_frame_t* frame = (opie_frame_t*)vo_img; | 160 | opie_frame_t* frame = (opie_frame_t*)vo_img; |
@@ -168,3 +168,3 @@ static void null_frame_dispose( vo_frame_t* vo_img){ | |||
168 | 168 | ||
169 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | 169 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ |
170 | 170 | ||
@@ -173,15 +173,15 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
173 | 173 | ||
174 | #ifdef LOG | 174 | #ifdef LOG |
175 | fprintf (stderr, "nullvideo: alloc_frame\n"); | 175 | fprintf (stderr, "nullvideo: alloc_frame\n"); |
176 | #endif | 176 | #endif |
177 | 177 | ||
178 | frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); | 178 | frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); |
179 | 179 | ||
180 | memset( frame, 0, sizeof( opie_frame_t) ); | 180 | memset( frame, 0, sizeof( opie_frame_t) ); |
181 | memcpy (&frame->sc, &this->sc, sizeof(vo_scale_t)); | 181 | memcpy (&frame->sc, &this->sc, sizeof(vo_scale_t)); |
182 | 182 | ||
183 | pthread_mutex_init (&frame->frame.mutex, NULL); | 183 | pthread_mutex_init (&frame->frame.mutex, NULL); |
184 | 184 | ||
185 | frame->output = this; | 185 | frame->output = this; |
186 | 186 | ||
187 | /* initialize the frame*/ | 187 | /* initialize the frame*/ |
@@ -191,8 +191,8 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
191 | frame->frame.dispose = null_frame_dispose; | 191 | frame->frame.dispose = null_frame_dispose; |
192 | 192 | ||
193 | /* | 193 | /* |
194 | * colorspace converter for this frame | 194 | * colorspace converter for this frame |
195 | */ | 195 | */ |
196 | frame->yuv2rgb = this->yuv2rgb_factory->create_converter (this->yuv2rgb_factory); | 196 | frame->yuv2rgb = this->yuv2rgb_factory->create_converter (this->yuv2rgb_factory); |
197 | 197 | ||
198 | return (vo_frame_t*) frame; | 198 | return (vo_frame_t*) frame; |
@@ -201,4 +201,5 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
201 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | 201 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, |
202 | uint32_t width, uint32_t height, | 202 | uint32_t width, uint32_t height, |
203 | double ratio_code, int format, int flags ){ | 203 | double ratio_code, int format, |
204 | int flags ){ | ||
204 | null_driver_t* this = (null_driver_t*) self; | 205 | null_driver_t* this = (null_driver_t*) self; |
@@ -237,3 +238,3 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
237 | 238 | ||
238 | #ifdef LOG | 239 | #ifdef LOG |
239 | fprintf (stderr, "nullvideo: gui %dx%d delivered %dx%d output %dx%d\n", | 240 | fprintf (stderr, "nullvideo: gui %dx%d delivered %dx%d output %dx%d\n", |
@@ -245,3 +246,3 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
245 | /* | 246 | /* |
246 | * (re-) allocate | 247 | * (re-) allocate |
247 | */ | 248 | */ |
@@ -249,12 +250,12 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
249 | if( frame->chunk[0] ){ | 250 | if( frame->chunk[0] ){ |
250 | free( frame->chunk[0] ); | 251 | free( frame->chunk[0] ); |
251 | frame->chunk[0] = NULL; | 252 | frame->chunk[0] = NULL; |
252 | } | 253 | } |
253 | if( frame->chunk[1] ){ | 254 | if( frame->chunk[1] ){ |
254 | free ( frame->chunk[1] ); | 255 | free ( frame->chunk[1] ); |
255 | frame->chunk[1] = NULL; | 256 | frame->chunk[1] = NULL; |
256 | } | 257 | } |
257 | if( frame->chunk[2] ){ | 258 | if( frame->chunk[2] ){ |
258 | free ( frame->chunk[2] ); | 259 | free ( frame->chunk[2] ); |
259 | frame->chunk[2] = NULL; | 260 | frame->chunk[2] = NULL; |
260 | } | 261 | } |
@@ -263,5 +264,5 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
263 | 264 | ||
264 | frame->data = xine_xmalloc (frame->sc.output_width | 265 | frame->data = xine_xmalloc (frame->sc.output_width |
265 | * frame->sc.output_height | 266 | * frame->sc.output_height |
266 | * this->bytes_per_pixel ); | 267 | * this->bytes_per_pixel ); |
267 | 268 | ||
@@ -277,5 +278,5 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
277 | frame->frame.pitches[0] = 8*((width + 3) / 4); | 278 | frame->frame.pitches[0] = 8*((width + 3) / 4); |
278 | 279 | ||
279 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height, | 280 | frame->frame.base[0] = xine_xmalloc_aligned (16, frame->frame.pitches[0] * height, |
280 | (void **)&frame->chunk[0]); | 281 | (void **)&frame->chunk[0]); |
281 | frame->chunk[1] = NULL; | 282 | frame->chunk[1] = NULL; |
@@ -286,4 +287,4 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
286 | frame->bytes_per_line = frame->sc.output_width * this->bytes_per_pixel; | 287 | frame->bytes_per_line = frame->sc.output_width * this->bytes_per_pixel; |
287 | 288 | ||
288 | /* | 289 | /* |
289 | * set up colorspace converter | 290 | * set up colorspace converter |
@@ -295,9 +296,9 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
295 | frame->yuv2rgb->configure (frame->yuv2rgb, | 296 | frame->yuv2rgb->configure (frame->yuv2rgb, |
296 | frame->sc.delivered_width, | 297 | frame->sc.delivered_width, |
297 | 16, | 298 | 16, |
298 | 2*frame->frame.pitches[0], | 299 | 2*frame->frame.pitches[0], |
299 | 2*frame->frame.pitches[1], | 300 | 2*frame->frame.pitches[1], |
300 | frame->sc.output_width, | 301 | frame->sc.output_width, |
301 | frame->stripe_height, | 302 | frame->stripe_height, |
302 | frame->bytes_per_line*2); | 303 | frame->bytes_per_line*2); |
303 | frame->yuv_stride = frame->bytes_per_line*2; | 304 | frame->yuv_stride = frame->bytes_per_line*2; |
@@ -306,9 +307,9 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
306 | frame->yuv2rgb->configure (frame->yuv2rgb, | 307 | frame->yuv2rgb->configure (frame->yuv2rgb, |
307 | frame->sc.delivered_width, | 308 | frame->sc.delivered_width, |
308 | 16, | 309 | 16, |
309 | frame->frame.pitches[0], | 310 | frame->frame.pitches[0], |
310 | frame->frame.pitches[1], | 311 | frame->frame.pitches[1], |
311 | frame->sc.output_width, | 312 | frame->sc.output_width, |
312 | frame->stripe_height, | 313 | frame->stripe_height, |
313 | frame->bytes_per_line); | 314 | frame->bytes_per_line); |
314 | frame->yuv_stride = frame->bytes_per_line; | 315 | frame->yuv_stride = frame->bytes_per_line; |
@@ -340,6 +341,6 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
340 | } | 341 | } |
341 | } | 342 | } |
342 | } | 343 | } |
343 | 344 | ||
344 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | 345 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ |
345 | null_driver_t* this = (null_driver_t*) self; | 346 | null_driver_t* this = (null_driver_t*) self; |
@@ -347,4 +348,4 @@ static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | |||
347 | display_xine_frame_t display = this->frameDis; | 348 | display_xine_frame_t display = this->frameDis; |
348 | 349 | ||
349 | if (!this->m_show_video) | 350 | if (!this->m_show_video) |
350 | return; | 351 | return; |
@@ -353,6 +354,6 @@ static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | |||
353 | (*display)(this->caller, frame->data, | 354 | (*display)(this->caller, frame->data, |
354 | frame->sc.output_width, frame->sc.output_height, | 355 | frame->sc.output_width, frame->sc.output_height, |
355 | frame->bytes_per_line ); | 356 | frame->bytes_per_line ); |
356 | } | 357 | } |
357 | 358 | ||
358 | frame->frame.free(&frame->frame); | 359 | frame->frame.free(&frame->frame); |
@@ -362,5 +363,5 @@ static void null_display_frame( vo_driver_t* self, vo_frame_t *frame_gen ){ | |||
362 | /* blending related */ | 363 | /* blending related */ |
363 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, | 364 | static void null_overlay_clut_yuv2rgb (null_driver_t *this, |
364 | vo_overlay_t *overlay, | 365 | vo_overlay_t *overlay, |
365 | opie_frame_t *frame) { | 366 | opie_frame_t *frame) { |
366 | int i; | 367 | int i; |
@@ -370,4 +371,5 @@ static void null_overlay_clut_yuv2rgb (null_driver_t *this, | |||
370 | *((uint32_t *)&clut[i]) = | 371 | *((uint32_t *)&clut[i]) = |
371 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, | 372 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, |
372 | clut[i].y, clut[i].cb, clut[i].cr); | 373 | clut[i].y, clut[i].cb, |
374 | clut[i].cr); | ||
373 | } | 375 | } |
@@ -380,3 +382,3 @@ static void null_overlay_clut_yuv2rgb (null_driver_t *this, | |||
380 | frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, | 382 | frame->yuv2rgb->yuv2rgb_single_pixel_fun(frame->yuv2rgb, |
381 | clut[i].y, clut[i].cb, clut[i].cr); | 383 | clut[i].y, clut[i].cb, clut[i].cr); |
382 | } | 384 | } |
@@ -386,3 +388,4 @@ static void null_overlay_clut_yuv2rgb (null_driver_t *this, | |||
386 | 388 | ||
387 | static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { | 389 | static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, |
390 | vo_overlay_t *overlay) { | ||
388 | null_driver_t *this = (null_driver_t *) this_gen; | 391 | null_driver_t *this = (null_driver_t *) this_gen; |
@@ -390,3 +393,3 @@ static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, v | |||
390 | 393 | ||
391 | if(!this->m_show_video || frame->sc.output_width == 0 | 394 | if(!this->m_show_video || frame->sc.output_width == 0 |
392 | || frame->sc.output_height== 0) | 395 | || frame->sc.output_height== 0) |
@@ -398,3 +401,3 @@ static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, v | |||
398 | null_overlay_clut_yuv2rgb(this,overlay,frame); | 401 | null_overlay_clut_yuv2rgb(this,overlay,frame); |
399 | 402 | ||
400 | switch(this->bpp) { | 403 | switch(this->bpp) { |
@@ -418,3 +421,3 @@ static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, v | |||
418 | break; | 421 | break; |
419 | } | 422 | } |
420 | } | 423 | } |
@@ -424,3 +427,3 @@ static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, v | |||
424 | static int null_get_property( vo_driver_t* self, | 427 | static int null_get_property( vo_driver_t* self, |
425 | int property ){ | 428 | int property ){ |
426 | return 0; | 429 | return 0; |
@@ -428,4 +431,4 @@ static int null_get_property( vo_driver_t* self, | |||
428 | static int null_set_property( vo_driver_t* self, | 431 | static int null_set_property( vo_driver_t* self, |
429 | int property, | 432 | int property, |
430 | int value ){ | 433 | int value ){ |
431 | return value; | 434 | return value; |
@@ -433,4 +436,4 @@ static int null_set_property( vo_driver_t* self, | |||
433 | static void null_get_property_min_max( vo_driver_t* self, | 436 | static void null_get_property_min_max( vo_driver_t* self, |
434 | int property, int *min, | 437 | int property, int *min, |
435 | int *max ){ | 438 | int *max ){ |
436 | *max = 0; | 439 | *max = 0; |
@@ -439,4 +442,4 @@ static void null_get_property_min_max( vo_driver_t* self, | |||
439 | static int null_gui_data_exchange( vo_driver_t* self, | 442 | static int null_gui_data_exchange( vo_driver_t* self, |
440 | int data_type, | 443 | int data_type, |
441 | void *data ){ | 444 | void *data ){ |
442 | return 0; | 445 | return 0; |
@@ -451,6 +454,8 @@ static int null_redraw_needed( vo_driver_t* self ){ | |||
451 | } | 454 | } |
452 | 455 | ||
453 | 456 | ||
454 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | 457 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, |
455 | void* video, display_xine_frame_t frameDisplayFunc, void *userData ){ | 458 | void* video, |
459 | display_xine_frame_t frameDisplayFunc, | ||
460 | void *userData ){ | ||
456 | null_driver_t *vo; | 461 | null_driver_t *vo; |
@@ -489,4 +494,4 @@ xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | |||
489 | vo->m_capabilities = /* VO_CAP_COPIES_IMAGE | */ VO_CAP_YUY2 | VO_CAP_YV12; | 494 | vo->m_capabilities = /* VO_CAP_COPIES_IMAGE | */ VO_CAP_YUY2 | VO_CAP_YV12; |
490 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, | 495 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, |
491 | vo->yuv2rgb_cmap); | 496 | vo->yuv2rgb_cmap); |
492 | 497 | ||
@@ -546,3 +551,3 @@ void null_set_scaling( xine_vo_driver_t* self, int scale ) { | |||
546 | } | 551 | } |
547 | 552 | ||
548 | void null_set_gui_width( xine_vo_driver_t* self, int width ) { | 553 | void null_set_gui_width( xine_vo_driver_t* self, int width ) { |
@@ -557,3 +562,3 @@ void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { | |||
557 | null_driver_t* this = (null_driver_t*)self->driver; | 562 | null_driver_t* this = (null_driver_t*)self->driver; |
558 | 563 | ||
559 | this->bytes_per_pixel = (depth + 7 ) / 8; | 564 | this->bytes_per_pixel = (depth + 7 ) / 8; |
@@ -567,9 +572,9 @@ void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { | |||
567 | this->yuv2rgb_mode = MODE_32_RGB; | 572 | this->yuv2rgb_mode = MODE_32_RGB; |
568 | else | 573 | else |
569 | this->yuv2rgb_mode = MODE_32_BGR; | 574 | this->yuv2rgb_mode = MODE_32_BGR; |
570 | case 24: | 575 | case 24: |
571 | if( this->bpp == 32 ) { | 576 | if( this->bpp == 32 ) { |
572 | if( rgb == 0 ) { | 577 | if( rgb == 0 ) { |
573 | this->yuv2rgb_mode = MODE_32_RGB; | 578 | this->yuv2rgb_mode = MODE_32_RGB; |
574 | } else { | 579 | } else { |
575 | this->yuv2rgb_mode = MODE_32_BGR; | 580 | this->yuv2rgb_mode = MODE_32_BGR; |