author | zecke <zecke> | 2005-04-17 13:56:34 (UTC) |
---|---|---|
committer | zecke <zecke> | 2005-04-17 13:56:34 (UTC) |
commit | 3d5e5c098ccb686588380bc1f220beafbc5a6d76 (patch) (unidiff) | |
tree | 92fad8a98ea341ec290dc7f9fca7759470b795f6 /noncore/multimedia/opieplayer2/lib.cpp | |
parent | 49335d66d8e96b1fc86ecfe95cd343c8960126bc (diff) | |
download | opie-3d5e5c098ccb686588380bc1f220beafbc5a6d76.zip opie-3d5e5c098ccb686588380bc1f220beafbc5a6d76.tar.gz opie-3d5e5c098ccb686588380bc1f220beafbc5a6d76.tar.bz2 |
Opie Player2 XINE update:
-update xine code alphablend, yuv2rgb to be up to date
-XINELib:
-use the XINE infrastructure to change the gui width/height
-use the XINE infrastructure to change the brightness
-Update the NULL Video Driver:
-make use of frame_dest_cb and and dest_size_cb (callback)
to update the size of the gui
-use alphablend
-merge the video_out_fb xine driver
To Alwin: your testvideo now lockups op2. with valgrind I see
it has to do with the yuv2rgb conversion methods
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 74 |
1 files changed, 47 insertions, 27 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 4ae8490..84d28ce 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -50,20 +50,15 @@ _;:, .> :=|. This program is free software; you can | |||
50 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, | 50 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, |
51 | int width, int height,int bytes ); | 51 | int width, int height,int bytes ); |
52 | typedef void (*vo_scale_cb) (void*, int, int, double, | ||
53 | int*, int*, int*, int*, double*, int*, int* ); | ||
54 | typedef void (*dest_size_cb) (void*, int, int, double, int*, int*, double*); | ||
55 | |||
52 | 56 | ||
53 | extern "C" { | 57 | extern "C" { |
54 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * ); | 58 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void *, vo_scale_cb, dest_size_cb ); |
55 | int null_is_showing_video( const xine_vo_driver_t* self ); | 59 | int null_is_showing_video( const xine_vo_driver_t* self ); |
56 | void null_set_show_video( const xine_vo_driver_t* self, int show ); | 60 | void null_set_show_video( const xine_vo_driver_t* self, int show ); |
57 | int null_is_fullscreen( const xine_vo_driver_t* self ); | ||
58 | void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); | ||
59 | int null_is_scaling( const xine_vo_driver_t* self ); | ||
60 | void null_set_scaling( const xine_vo_driver_t* self, int scale ); | ||
61 | void null_set_gui_width( const xine_vo_driver_t* self, int width ); | ||
62 | void null_set_gui_height( const xine_vo_driver_t* self, int height ); | ||
63 | void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); | 61 | void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); |
64 | void null_set_videoGamma( const xine_vo_driver_t* self , int value ); | ||
65 | void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); | 62 | void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); |
66 | |||
67 | void null_preload_decoders( xine_stream_t *stream ); | ||
68 | } | 63 | } |
69 | 64 | ||
@@ -128,5 +123,8 @@ void Lib::initialize() | |||
128 | // and fb for framebuffer | 123 | // and fb for framebuffer |
129 | m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); | 124 | m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); |
130 | m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this ); | 125 | m_videoOutput = ::init_video_out_plugin( m_xine, NULL, |
126 | xine_display_frame, this, | ||
127 | xine_vo_scale_cb, | ||
128 | xine_dest_cb ); | ||
131 | 129 | ||
132 | m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); | 130 | m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); |
@@ -140,6 +138,4 @@ void Lib::initialize() | |||
140 | xine_event_create_listener_thread (m_queue, xine_event_handler, this); | 138 | xine_event_create_listener_thread (m_queue, xine_event_handler, this); |
141 | 139 | ||
142 | ::null_preload_decoders( m_stream ); | ||
143 | |||
144 | m_duringInitialization = false; | 140 | m_duringInitialization = false; |
145 | } | 141 | } |
@@ -166,8 +162,6 @@ void Lib::resize ( const QSize &s ) { | |||
166 | assert( m_initialized || m_duringInitialization ); | 162 | assert( m_initialized || m_duringInitialization ); |
167 | 163 | ||
168 | if ( s. width ( ) && s. height ( ) ) { | 164 | if ( s. width ( ) && s. height ( ) ) |
169 | ::null_set_gui_width( m_videoOutput, s. width() ); | 165 | m_videoSize = s; |
170 | ::null_set_gui_height( m_videoOutput, s. height() ); | ||
171 | } | ||
172 | } | 166 | } |
173 | 167 | ||
@@ -423,5 +417,5 @@ void Lib::showVideoFullScreen( bool fullScreen ) { | |||
423 | assert( m_initialized ); | 417 | assert( m_initialized ); |
424 | 418 | ||
425 | ::null_set_fullscreen( m_videoOutput, fullScreen ); | 419 | #warning use xine |
426 | } | 420 | } |
427 | 421 | ||
@@ -429,5 +423,6 @@ bool Lib::isVideoFullScreen() const { | |||
429 | assert( m_initialized ); | 423 | assert( m_initialized ); |
430 | 424 | ||
431 | return ::null_is_fullscreen( m_videoOutput ); | 425 | #warning use xine |
426 | return false; | ||
432 | } | 427 | } |
433 | 428 | ||
@@ -435,11 +430,11 @@ void Lib::setScaling( bool scale ) { | |||
435 | assert( m_initialized ); | 430 | assert( m_initialized ); |
436 | 431 | ||
437 | ::null_set_scaling( m_videoOutput, scale ); | 432 | xine_set_param( m_stream, XINE_PARAM_VO_ASPECT_RATIO, |
433 | scale ? XINE_VO_ASPECT_AUTO : XINE_VO_ASPECT_SQUARE ); | ||
438 | } | 434 | } |
439 | 435 | ||
440 | void Lib::setGamma( int value ) { | 436 | void Lib::setGamma( int value ) { |
441 | assert( m_initialized ); | 437 | assert( m_initialized ); |
442 | 438 | xine_set_param( m_stream, XINE_PARAM_VO_BRIGHTNESS, value ); | |
443 | ::null_set_videoGamma( m_videoOutput, value ); | ||
444 | } | 439 | } |
445 | 440 | ||
@@ -447,5 +442,6 @@ bool Lib::isScaling() const { | |||
447 | assert( m_initialized ); | 442 | assert( m_initialized ); |
448 | 443 | ||
449 | return ::null_is_scaling( m_videoOutput ); | 444 | int aratio = xine_get_param( m_stream, XINE_PARAM_VO_ASPECT_RATIO ); |
445 | return aratio == XINE_VO_ASPECT_AUTO; | ||
450 | } | 446 | } |
451 | 447 | ||
@@ -459,12 +455,36 @@ void Lib::xine_display_frame( void* user_data, uint8_t *frame, | |||
459 | } | 455 | } |
460 | 456 | ||
457 | void Lib::xine_vo_scale_cb( void *user_data, int video_with, int video_height, | ||
458 | double video_pixel_aspect, | ||
459 | int *dest_x, int *dest_y, int *dest_width, | ||
460 | int *dest_height, double *dest_pixel_aspect, | ||
461 | int *win_x, int *win_y ) { | ||
462 | QSize size = ((Lib*)user_data)->m_videoSize; | ||
463 | if (!size.isValid()) | ||
464 | return; | ||
465 | |||
466 | *dest_x = 0; | ||
467 | *dest_y = 0; | ||
468 | *dest_width = size.width(); | ||
469 | *dest_height = size.height(); | ||
470 | *win_x = 0; | ||
471 | *win_y = 0; | ||
472 | } | ||
473 | |||
474 | void Lib::xine_dest_cb( void* user_data, int, int, double, | ||
475 | int *dest_width, int* dest_height, double* ) { | ||
476 | QSize size = ((Lib*)user_data)->m_videoSize; | ||
477 | if ( !size.isValid() ) | ||
478 | return; | ||
479 | |||
480 | *dest_width = size.width(); | ||
481 | *dest_height = size.height(); | ||
482 | } | ||
483 | |||
461 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | 484 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { |
462 | assert( m_initialized ); | 485 | assert( m_initialized ); |
463 | 486 | ||
464 | if ( !m_video ) { | 487 | if ( !m_video ) |
465 | return; | 488 | return; |
466 | } | ||
467 | |||
468 | // assert( m_wid ); | ||
469 | 489 | ||
470 | if (m_wid) m_wid-> setVideoFrame ( frame, width, height, bytes ); | 490 | if (m_wid) m_wid-> setVideoFrame ( frame, width, height, bytes ); |