summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/lib.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp74
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
@@ -51,18 +51,13 @@ typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame,
int width, int height,int bytes );
+typedef void (*vo_scale_cb) (void*, int, int, double,
+ int*, int*, int*, int*, double*, int*, int* );
+typedef void (*dest_size_cb) (void*, int, int, double, int*, int*, double*);
+
extern "C" {
- xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * );
+ xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void *, vo_scale_cb, dest_size_cb );
int null_is_showing_video( const xine_vo_driver_t* self );
void null_set_show_video( const xine_vo_driver_t* self, int show );
- int null_is_fullscreen( const xine_vo_driver_t* self );
- void null_set_fullscreen( const xine_vo_driver_t* self, int screen );
- int null_is_scaling( const xine_vo_driver_t* self );
- void null_set_scaling( const xine_vo_driver_t* self, int scale );
- void null_set_gui_width( const xine_vo_driver_t* self, int width );
- void null_set_gui_height( const xine_vo_driver_t* self, int height );
void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb );
- void null_set_videoGamma( const xine_vo_driver_t* self , int value );
void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data );
-
- void null_preload_decoders( xine_stream_t *stream );
}
@@ -129,3 +124,6 @@ void Lib::initialize()
m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL );
- m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this );
+ m_videoOutput = ::init_video_out_plugin( m_xine, NULL,
+ xine_display_frame, this,
+ xine_vo_scale_cb,
+ xine_dest_cb );
@@ -141,4 +139,2 @@ void Lib::initialize()
- ::null_preload_decoders( m_stream );
-
m_duringInitialization = false;
@@ -167,6 +163,4 @@ void Lib::resize ( const QSize &s ) {
- if ( s. width ( ) && s. height ( ) ) {
- ::null_set_gui_width( m_videoOutput, s. width() );
- ::null_set_gui_height( m_videoOutput, s. height() );
- }
+ if ( s. width ( ) && s. height ( ) )
+ m_videoSize = s;
}
@@ -424,3 +418,3 @@ void Lib::showVideoFullScreen( bool fullScreen ) {
- ::null_set_fullscreen( m_videoOutput, fullScreen );
+ #warning use xine
}
@@ -430,3 +424,4 @@ bool Lib::isVideoFullScreen() const {
- return ::null_is_fullscreen( m_videoOutput );
+ #warning use xine
+ return false;
}
@@ -436,3 +431,4 @@ void Lib::setScaling( bool scale ) {
- ::null_set_scaling( m_videoOutput, scale );
+ xine_set_param( m_stream, XINE_PARAM_VO_ASPECT_RATIO,
+ scale ? XINE_VO_ASPECT_AUTO : XINE_VO_ASPECT_SQUARE );
}
@@ -441,4 +437,3 @@ void Lib::setGamma( int value ) {
assert( m_initialized );
-
- ::null_set_videoGamma( m_videoOutput, value );
+ xine_set_param( m_stream, XINE_PARAM_VO_BRIGHTNESS, value );
}
@@ -448,3 +443,4 @@ bool Lib::isScaling() const {
- return ::null_is_scaling( m_videoOutput );
+ int aratio = xine_get_param( m_stream, XINE_PARAM_VO_ASPECT_RATIO );
+ return aratio == XINE_VO_ASPECT_AUTO;
}
@@ -460,10 +456,34 @@ void Lib::xine_display_frame( void* user_data, uint8_t *frame,
-void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
- assert( m_initialized );
+void Lib::xine_vo_scale_cb( void *user_data, int video_with, int video_height,
+ double video_pixel_aspect,
+ int *dest_x, int *dest_y, int *dest_width,
+ int *dest_height, double *dest_pixel_aspect,
+ int *win_x, int *win_y ) {
+ QSize size = ((Lib*)user_data)->m_videoSize;
+ if (!size.isValid())
+ return;
- if ( !m_video ) {
+ *dest_x = 0;
+ *dest_y = 0;
+ *dest_width = size.width();
+ *dest_height = size.height();
+ *win_x = 0;
+ *win_y = 0;
+}
+
+void Lib::xine_dest_cb( void* user_data, int, int, double,
+ int *dest_width, int* dest_height, double* ) {
+ QSize size = ((Lib*)user_data)->m_videoSize;
+ if ( !size.isValid() )
return;
+
+ *dest_width = size.width();
+ *dest_height = size.height();
}
-// assert( m_wid );
+void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
+ assert( m_initialized );
+
+ if ( !m_video )
+ return;