author | zecke <zecke> | 2004-09-23 19:02:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-23 19:02:47 (UTC) |
commit | 9a7e9427062e820f7b654e77e051213c3f53e134 (patch) (unidiff) | |
tree | b37f5d9dd37a846551c44feca40c24c56ffc7a05 | |
parent | 69bf1d25b253167f3d2ef4b162c42aec4d8bbf7a (diff) | |
download | opie-9a7e9427062e820f7b654e77e051213c3f53e134.zip opie-9a7e9427062e820f7b654e77e051213c3f53e134.tar.gz opie-9a7e9427062e820f7b654e77e051213c3f53e134.tar.bz2 |
-OTicker is in libqtaux so we need to link it to avoid weird crashes
-Some function names have changed in xine update them
-Start to merge video_out_fb.c changes into nullvideo and give credit
to the source of it
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 253 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/opieplayer2.pro | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 1 |
4 files changed, 176 insertions, 81 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 1ab5c96..248221b 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -48,2 +48,3 @@ using namespace Opie::Core; | |||
48 | #include <assert.h> | 48 | #include <assert.h> |
49 | #include <unistd.h> | ||
49 | 50 | ||
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index 378bbd4..6769a37 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -6,2 +6,3 @@ | |||
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | Copyright (c) 2002-2003 Miguel Freitas of xine | ||
7 | =. | 8 | =. |
@@ -115,3 +116,3 @@ static uint32_t null_get_capabilities( vo_driver_t *self ){ | |||
115 | 116 | ||
116 | static void null_frame_copy (vo_frame_t *vo_img, uint8_t **src) { | 117 | static void null_frame_proc_slice (vo_frame_t *vo_img, uint8_t **src) { |
117 | opie_frame_t *frame = (opie_frame_t *) vo_img ; | 118 | opie_frame_t *frame = (opie_frame_t *) vo_img ; |
@@ -177,5 +178,4 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
177 | 178 | ||
178 | frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); | 179 | frame = (opie_frame_t*)xine_xmalloc ( sizeof(opie_frame_t) ); |
179 | 180 | ||
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)); |
@@ -188,3 +188,3 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
188 | frame->frame.driver = self; | 188 | frame->frame.driver = self; |
189 | frame->frame.proc_slice = null_frame_copy; | 189 | frame->frame.proc_slice = null_frame_proc_slice; |
190 | frame->frame.field = null_frame_field; | 190 | frame->frame.field = null_frame_field; |
@@ -200,47 +200,30 @@ static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | |||
200 | 200 | ||
201 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | ||
202 | uint32_t width, uint32_t height, | ||
203 | double ratio_code, int format, | ||
204 | int flags ){ | ||
205 | null_driver_t* this = (null_driver_t*) self; | ||
206 | opie_frame_t* frame = (opie_frame_t*)img; | ||
207 | /* not needed now */ | ||
208 | 201 | ||
209 | #ifdef LOG | 202 | static void null_frame_compute_ideal_size( null_driver_t *this, |
210 | fprintf (stderr, "nullvideo: update_frame_format\n"); | 203 | opie_frame_t *frame ) { |
211 | #endif | 204 | this = this; |
212 | 205 | ||
213 | flags &= VO_BOTH_FIELDS; | 206 | _x_vo_scale_compute_ideal_size(&frame->sc); |
207 | } | ||
214 | 208 | ||
215 | /* find out if we need to adapt this frame */ | 209 | static void null_frame_compute_rgb_size( null_driver_t *this, |
210 | opie_frame_t *frame ){ | ||
211 | this = this; | ||
216 | 212 | ||
217 | if ((width != frame->sc.delivered_width) | 213 | _x_vo_scale_compute_output_size(&frame->sc); |
218 | || (height != frame->sc.delivered_height) | ||
219 | || (ratio_code != frame->sc.delivered_ratio) | ||
220 | || (flags != frame->flags) | ||
221 | || (format != frame->format) | ||
222 | || (this->sc.user_ratio != frame->sc.user_ratio) | ||
223 | || (this->gui_width != frame->sc.gui_width) | ||
224 | || (this->gui_height != frame->sc.gui_height)) { | ||
225 | 214 | ||
226 | frame->sc.delivered_width = width; | 215 | /* avoid problems in yuv2rgb */ |
227 | frame->sc.delivered_height = height; | 216 | if(frame->sc.output_height < (frame->sc.delivered_height+15) >> 4) |
228 | frame->sc.delivered_ratio = ratio_code; | 217 | frame->sc.output_height = (frame->sc.delivered_height+15) >> 4; |
229 | frame->flags = flags; | ||
230 | frame->format = format; | ||
231 | frame->sc.user_ratio = this->sc.user_ratio; | ||
232 | frame->sc.gui_width = this->gui_width; | ||
233 | frame->sc.gui_height = this->gui_height; | ||
234 | frame->sc.gui_pixel_aspect = 1.0; | ||
235 | 218 | ||
236 | vo_scale_compute_ideal_size ( &frame->sc ); | 219 | if (frame->sc.output_width < 8) |
237 | vo_scale_compute_output_size( &frame->sc ); | 220 | frame->sc.output_width = 8; |
238 | 221 | ||
239 | #ifdef LOG | 222 | /* yuv2rgb_mlib needs an even YUV2 width */ |
240 | fprintf (stderr, "nullvideo: gui %dx%d delivered %dx%d output %dx%d\n", | 223 | if (frame->sc.output_width & 1) |
241 | frame->sc.gui_width, frame->sc.gui_height, | 224 | frame->sc.output_width++; |
242 | frame->sc.delivered_width, frame->sc.delivered_height, | 225 | } |
243 | frame->sc.output_width, frame->sc.output_height); | ||
244 | #endif | ||
245 | 226 | ||
227 | static void null_frame_reallocate( null_driver_t *this, opie_frame_t *frame, | ||
228 | uint32_t width, uint32_t height, int format){ | ||
246 | /* | 229 | /* |
@@ -285,9 +268,5 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
285 | 268 | ||
286 | frame->stripe_height = 16 * frame->sc.output_height / frame->sc.delivered_height; | 269 | } |
287 | frame->bytes_per_line = frame->sc.output_width * this->bytes_per_pixel; | ||
288 | |||
289 | /* | ||
290 | * set up colorspace converter | ||
291 | */ | ||
292 | 270 | ||
271 | static void null_setup_colorspace_converter(opie_frame_t *frame, int flags ) { | ||
293 | switch (flags) { | 272 | switch (flags) { |
@@ -322,2 +301,59 @@ static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | |||
322 | 301 | ||
302 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | ||
303 | uint32_t width, uint32_t height, | ||
304 | double ratio_code, int format, | ||
305 | int flags ){ | ||
306 | null_driver_t* this = (null_driver_t*) self; | ||
307 | opie_frame_t* frame = (opie_frame_t*)img; | ||
308 | |||
309 | #ifdef LOG | ||
310 | fprintf (stderr, "nullvideo: update_frame_format\n"); | ||
311 | #endif | ||
312 | |||
313 | flags &= VO_BOTH_FIELDS; | ||
314 | |||
315 | /* find out if we need to adapt this frame */ | ||
316 | |||
317 | if ((width != frame->sc.delivered_width) | ||
318 | || (height != frame->sc.delivered_height) | ||
319 | || (ratio_code != frame->sc.delivered_ratio) | ||
320 | || (flags != frame->flags) | ||
321 | || (format != frame->format) | ||
322 | || (this->sc.user_ratio != frame->sc.user_ratio) | ||
323 | || (this->gui_width != frame->sc.gui_width) | ||
324 | || (this->gui_height != frame->sc.gui_height)) { | ||
325 | |||
326 | frame->sc.delivered_width = width; | ||
327 | frame->sc.delivered_height = height; | ||
328 | frame->sc.delivered_ratio = ratio_code; | ||
329 | frame->flags = flags; | ||
330 | frame->format = format; | ||
331 | frame->sc.user_ratio = this->sc.user_ratio; | ||
332 | frame->sc.gui_width = this->gui_width; | ||
333 | frame->sc.gui_height = this->gui_height; | ||
334 | frame->sc.gui_pixel_aspect = 1.0; | ||
335 | |||
336 | |||
337 | null_frame_compute_ideal_size(this, frame); | ||
338 | null_frame_compute_rgb_size(this, frame); | ||
339 | null_frame_reallocate(this, frame, width, height, format); | ||
340 | |||
341 | #ifdef LOG | ||
342 | fprintf (stderr, "nullvideo: gui %dx%d delivered %dx%d output %dx%d\n", | ||
343 | frame->sc.gui_width, frame->sc.gui_height, | ||
344 | frame->sc.delivered_width, frame->sc.delivered_height, | ||
345 | frame->sc.output_width, frame->sc.output_height); | ||
346 | #endif | ||
347 | |||
348 | |||
349 | |||
350 | frame->stripe_height = 16 * frame->sc.output_height / frame->sc.delivered_height; | ||
351 | frame->bytes_per_line = frame->sc.output_width * this->bytes_per_pixel; | ||
352 | |||
353 | /* | ||
354 | * set up colorspace converter | ||
355 | */ | ||
356 | null_setup_colorspace_converter(frame, flags); | ||
357 | |||
358 | } | ||
323 | /* | 359 | /* |
@@ -366,2 +402,5 @@ static void null_overlay_clut_yuv2rgb (null_driver_t *this, | |||
366 | opie_frame_t *frame) { | 402 | opie_frame_t *frame) { |
403 | this = this; | ||
404 | |||
405 | |||
367 | int i; | 406 | int i; |
@@ -371,3 +410,4 @@ static void null_overlay_clut_yuv2rgb (null_driver_t *this, | |||
371 | *((uint32_t *)&clut[i]) = | 410 | *((uint32_t *)&clut[i]) = |
372 | frame->yuv2rgb->yuv2rgb_single_pixel_fun (frame->yuv2rgb, | 411 | frame->yuv2rgb-> |
412 | yuv2rgb_single_pixel_fun (frame->yuv2rgb, | ||
373 | clut[i].y, clut[i].cb, | 413 | clut[i].y, clut[i].cb, |
@@ -404,15 +444,24 @@ static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, | |||
404 | case 16: | 444 | case 16: |
405 | blend_rgb16( (uint8_t *)frame->data, overlay, | 445 | blend_rgb16((uint8_t *)frame->data, |
406 | frame->sc.output_width, frame->sc.output_height, | 446 | overlay, |
407 | frame->sc.delivered_width, frame->sc.delivered_height); | 447 | frame->sc.output_width, |
448 | frame->sc.output_height, | ||
449 | frame->sc.delivered_width, | ||
450 | frame->sc.delivered_height); | ||
408 | break; | 451 | break; |
409 | case 24: | 452 | case 24: |
410 | blend_rgb24( (uint8_t *)frame->data, overlay, | 453 | blend_rgb24((uint8_t *)frame->data, |
411 | frame->sc.output_width, frame->sc.output_height, | 454 | overlay, |
412 | frame->sc.delivered_width, frame->sc.delivered_height); | 455 | frame->sc.output_width, |
456 | frame->sc.output_height, | ||
457 | frame->sc.delivered_width, | ||
458 | frame->sc.delivered_height); | ||
413 | break; | 459 | break; |
414 | case 32: | 460 | case 32: |
415 | blend_rgb32( (uint8_t *)frame->data, overlay, | 461 | blend_rgb32((uint8_t *)frame->data, |
416 | frame->sc.output_width, frame->sc.output_height, | 462 | overlay, |
417 | frame->sc.delivered_width, frame->sc.delivered_height); | 463 | frame->sc.output_width, |
464 | frame->sc.output_height, | ||
465 | frame->sc.delivered_width, | ||
466 | frame->sc.delivered_height); | ||
418 | break; | 467 | break; |
@@ -426,9 +475,51 @@ static void null_overlay_blend ( vo_driver_t *this_gen, vo_frame_t *frame_gen, | |||
426 | 475 | ||
427 | static int null_get_property( vo_driver_t* self, | 476 | static int null_get_property( vo_driver_t* self, int property ){ |
428 | int property ){ | 477 | #if 0 |
478 | null_driver_t *this = (null_driver_t *)self; | ||
479 | |||
480 | switch(property) | ||
481 | { | ||
482 | case VO_PROP_ASPECT_RATIO: | ||
483 | return this->sc.user_ratio; | ||
484 | case VO_PROP_BRIGHTNESS: | ||
485 | return this->yuv2rgb_brightness; | ||
486 | case VO_PROP_WINDOW_WIDTH: | ||
487 | return this->sc.gui_width; | ||
488 | case VO_PROP_WINDOW_HEIGHT: | ||
489 | return this->sc.gui_height; | ||
490 | default: | ||
491 | break; | ||
492 | } | ||
493 | #else | ||
494 | property = property; | ||
495 | self = self; | ||
496 | #endif | ||
497 | |||
429 | return 0; | 498 | return 0; |
430 | } | 499 | } |
431 | static int null_set_property( vo_driver_t* self, | 500 | static int null_set_property( vo_driver_t* self, int property, |
432 | int property, | ||
433 | int value ){ | 501 | int value ){ |
502 | #if 0 | ||
503 | null_driver_t *this = (null_driver_t *)self; | ||
504 | |||
505 | switch(property) | ||
506 | { | ||
507 | case VO_PROP_ASPECT_RATIO: | ||
508 | if(value>=XINE_VO_ASPECT_NUM_RATIOS) | ||
509 | value = XINE_VO_ASPECT_AUTO; | ||
510 | this->sc.user_ratio = value; | ||
511 | break; | ||
512 | case VO_PROP_BRIGHTNESS: | ||
513 | this->yuv2rgb_brightness = value; | ||
514 | this->yuv2rgb_factory-> | ||
515 | set_csc_levels(this->yuv2rgb_factory, value, 128, 128); | ||
516 | break; | ||
517 | default: | ||
518 | break; | ||
519 | } | ||
520 | #else | ||
521 | self = self; | ||
522 | property = property; | ||
523 | #endif | ||
524 | |||
434 | return value; | 525 | return value; |
@@ -438,2 +529,5 @@ static void null_get_property_min_max( vo_driver_t* self, | |||
438 | int *max ){ | 529 | int *max ){ |
530 | self = self; | ||
531 | property = property; | ||
532 | |||
439 | *max = 0; | 533 | *max = 0; |
@@ -444,2 +538,6 @@ static int null_gui_data_exchange( vo_driver_t* self, | |||
444 | void *data ){ | 538 | void *data ){ |
539 | self = self; | ||
540 | data_type = data_type; | ||
541 | data = data; | ||
542 | |||
445 | return 0; | 543 | return 0; |
@@ -452,2 +550,4 @@ static void null_dispose ( vo_driver_t* self ){ | |||
452 | static int null_redraw_needed( vo_driver_t* self ){ | 550 | static int null_redraw_needed( vo_driver_t* self ){ |
551 | self = self; | ||
552 | |||
453 | return 0; | 553 | return 0; |
@@ -456,3 +556,3 @@ static int null_redraw_needed( vo_driver_t* self ){ | |||
456 | 556 | ||
457 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | 557 | xine_video_port_t* init_video_out_plugin( xine_t *xine, |
458 | void* video, | 558 | void* video, |
@@ -460,2 +560,5 @@ xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | |||
460 | void *userData ){ | 560 | void *userData ){ |
561 | video = video; | ||
562 | |||
563 | |||
461 | null_driver_t *vo; | 564 | null_driver_t *vo; |
@@ -466,3 +569,3 @@ xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | |||
466 | 569 | ||
467 | vo_scale_init (&vo->sc, 0, 0, xine->config); | 570 | _x_vo_scale_init (&vo->sc, 0, 0, xine->config); |
468 | 571 | ||
@@ -493,3 +596,3 @@ xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | |||
493 | /* capabilities */ | 596 | /* capabilities */ |
494 | vo->m_capabilities = /* VO_CAP_COPIES_IMAGE | */ VO_CAP_YUY2 | VO_CAP_YV12; | 597 | vo->m_capabilities = VO_CAP_YUY2 | VO_CAP_YV12; |
495 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, | 598 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, |
@@ -500,18 +603,5 @@ xine_vo_driver_t* init_video_out_plugin( xine_t *xine, | |||
500 | 603 | ||
501 | /* return ( vo_driver_t*) vo; */ | 604 | return _x_vo_new_port(xine, &vo->vo_driver, 0); |
502 | return vo_new_port( xine, ( vo_driver_t* )vo, 0 ); | ||
503 | } | 605 | } |
504 | 606 | ||
505 | #if 0 | ||
506 | static vo_info_t vo_info_null = { | ||
507 | 5, | ||
508 | XINE_VISUAL_TYPE_FB | ||
509 | }; | ||
510 | |||
511 | vo_info_t *get_video_out_plugin_info(){ | ||
512 | vo_info_null.description = ("xine video output plugin using null device"); | ||
513 | return &vo_info_null; | ||
514 | } | ||
515 | |||
516 | #endif | ||
517 | 607 | ||
@@ -566,4 +656,3 @@ void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { | |||
566 | this->depth = depth; | 656 | this->depth = depth; |
567 | printf("depth %d %d\n", depth, this->bpp); | 657 | |
568 | printf("pixeltype %d\n", rgb ); | ||
569 | switch ( this->depth ) { | 658 | switch ( this->depth ) { |
@@ -630,2 +719,3 @@ void null_preload_decoders( xine_stream_t *stream ) | |||
630 | uint8_t i; | 719 | uint8_t i; |
720 | #if 0 | ||
631 | 721 | ||
@@ -633,2 +723,3 @@ void null_preload_decoders( xine_stream_t *stream ) | |||
633 | audio_decoder_t *decoder = get_audio_decoder( stream, ( preloadedAudioDecoders[ i ] >> 16 ) & 0xff ); | 723 | audio_decoder_t *decoder = get_audio_decoder( stream, ( preloadedAudioDecoders[ i ] >> 16 ) & 0xff ); |
724 | decoder = decoder; | ||
634 | /* free_audio_decoder( stream, decoder ); */ | 725 | /* free_audio_decoder( stream, decoder ); */ |
@@ -638,4 +729,6 @@ void null_preload_decoders( xine_stream_t *stream ) | |||
638 | video_decoder_t *decoder = get_video_decoder( stream, ( preloadedVideoDecoders[ i ] >> 16 ) & 0xff ); | 729 | video_decoder_t *decoder = get_video_decoder( stream, ( preloadedVideoDecoders[ i ] >> 16 ) & 0xff ); |
730 | decoder = decoder; | ||
639 | /* free_video_decoder( stream, decoder ); */ | 731 | /* free_video_decoder( stream, decoder ); */ |
640 | } | 732 | } |
733 | #endif | ||
641 | } | 734 | } |
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index b9a8d6d..8166658 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro | |||
@@ -17,3 +17,3 @@ INCLUDEPATH += $(OPIEDIR)/include | |||
17 | DEPENDPATH += $(OPIEDIR)/include | 17 | DEPENDPATH += $(OPIEDIR)/include |
18 | LIBS += -lqpe -lpthread -lopiecore2 -lopieui2 -lxine -lstdc++ | 18 | LIBS += -lqpe -lpthread -lopiecore2 -lopieui2 -lqtaux2 -lxine |
19 | MOC_DIR = qpeobj | 19 | MOC_DIR = qpeobj |
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 15c611f..1ac9277 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -53,2 +53,3 @@ static inline void memcpy_rev ( void *_dst, void *_src, size_t len ) | |||
53 | { | 53 | { |
54 | |||
54 | /* | 55 | /* |