summaryrefslogtreecommitdiff
path: root/noncore
authorharlekin <harlekin>2002-11-10 13:40:33 (UTC)
committer harlekin <harlekin>2002-11-10 13:40:33 (UTC)
commitddfc3c3073216d6a9ef15b26e3836b9c3eb2085c (patch) (unidiff)
tree5bef89c4dc116d09c1864778127ca9106e1f29ae /noncore
parentea3334042e9625c0f67c9a7293a482849f60e4e2 (diff)
downloadopie-ddfc3c3073216d6a9ef15b26e3836b9c3eb2085c.zip
opie-ddfc3c3073216d6a9ef15b26e3836b9c3eb2085c.tar.gz
opie-ddfc3c3073216d6a9ef15b26e3836b9c3eb2085c.tar.bz2
fixed seeking and further adaption to the new api
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/lib.h3
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c8
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp11
4 files changed, 21 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 1ebbbd8..19b64e8 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -198,13 +198,14 @@ int Lib::length() {
198bool Lib::isSeekable() { 198bool Lib::isSeekable() {
199 return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); 199 return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE );
200} 200}
201 201
202void Lib::seekTo( int time ) { 202void Lib::seekTo( int time ) {
203 //xine_trick_mode ( m_stream, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_( 203 //xine_trick_mode ( m_stream, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_(
204 xine_play( m_stream, 0, time ); 204 // since its now milliseconds we need *1000
205 xine_play( m_stream, 0, time*1000 );
205} 206}
206 207
207 208
208Frame Lib::currentFrame() { 209Frame Lib::currentFrame() {
209 Frame frame; 210 Frame frame;
210 return frame; 211 return frame;
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index 191dbbd..38938a1 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -87,12 +87,13 @@ namespace XINE {
87 87
88 int status() /*const*/; 88 int status() /*const*/;
89 89
90 int currentPosition()/*const*/; 90 int currentPosition()/*const*/;
91 //in seconds 91 //in seconds
92 int currentTime()/*const*/; 92 int currentTime()/*const*/;
93
93 int length() /*const*/; 94 int length() /*const*/;
94 95
95 bool isSeekable()/*const*/; 96 bool isSeekable()/*const*/;
96 97
97 /** 98 /**
98 * Whether or not to show video output 99 * Whether or not to show video output
@@ -169,13 +170,15 @@ namespace XINE {
169 * XINE_ERROR_NO_DEMUXER_PLUGIN 2 170 * XINE_ERROR_NO_DEMUXER_PLUGIN 2
170 * XINE_ERROR_DEMUXER_FAILED 3 171 * XINE_ERROR_DEMUXER_FAILED 3
171 */ 172 */
172 int error() /*const*/; 173 int error() /*const*/;
173 174
174 signals: 175 signals:
176
175 void stopped(); 177 void stopped();
178
176 private: 179 private:
177 int m_bytes_per_pixel; 180 int m_bytes_per_pixel;
178 int m_length, m_pos, m_time; 181 int m_length, m_pos, m_time;
179 int m_major_version, m_minor_version, m_sub_version; 182 int m_major_version, m_minor_version, m_sub_version;
180 bool m_video:1; 183 bool m_video:1;
181 XineVideoWidget *m_wid; 184 XineVideoWidget *m_wid;
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index dcdfae6..b1f4811 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -436,13 +436,13 @@ static void null_get_property_min_max( xine_vo_driver_t* self,
436static int null_gui_data_exchange( xine_vo_driver_t* self, 436static int null_gui_data_exchange( xine_vo_driver_t* self,
437 int data_type, 437 int data_type,
438 void *data ){ 438 void *data ){
439 return 0; 439 return 0;
440} 440}
441 441
442static void null_exit( xine_vo_driver_t* self ){ 442static void null_dispose ( xine_vo_driver_t* self ){
443 null_driver_t* this = (null_driver_t*)self; 443 null_driver_t* this = (null_driver_t*)self;
444 free ( this ); 444 free ( this );
445} 445}
446static int null_redraw_needed( xine_vo_driver_t* self ){ 446static int null_redraw_needed( xine_vo_driver_t* self ){
447 return 0; 447 return 0;
448} 448}
@@ -475,35 +475,37 @@ xine_vo_driver_t* init_video_out_plugin( config_values_t* conf,
475 vo->vo_driver.display_frame = null_display_frame; 475 vo->vo_driver.display_frame = null_display_frame;
476 vo->vo_driver.overlay_blend = null_overlay_blend; 476 vo->vo_driver.overlay_blend = null_overlay_blend;
477 vo->vo_driver.get_property = null_get_property; 477 vo->vo_driver.get_property = null_get_property;
478 vo->vo_driver.set_property = null_set_property; 478 vo->vo_driver.set_property = null_set_property;
479 vo->vo_driver.get_property_min_max = null_get_property_min_max; 479 vo->vo_driver.get_property_min_max = null_get_property_min_max;
480 vo->vo_driver.gui_data_exchange = null_gui_data_exchange; 480 vo->vo_driver.gui_data_exchange = null_gui_data_exchange;
481 vo->vo_driver.exit = null_exit; 481 vo->vo_driver.dispose = null_dispose;
482 vo->vo_driver.redraw_needed = null_redraw_needed; 482 vo->vo_driver.redraw_needed = null_redraw_needed;
483 483
484 484
485 /* capabilities */ 485 /* capabilities */
486 vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; 486 vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12;
487 vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, 487 vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap,
488 vo->yuv2rgb_cmap); 488 vo->yuv2rgb_cmap);
489 489
490 return ( xine_vo_driver_t*) vo; 490 return ( xine_vo_driver_t*) vo;
491} 491}
492 492
493#if 0
493static vo_info_t vo_info_null = { 494static vo_info_t vo_info_null = {
494 5, 495 5,
495 "null plugin",
496 XINE_VISUAL_TYPE_FB 496 XINE_VISUAL_TYPE_FB
497}; 497};
498 498
499vo_info_t *get_video_out_plugin_info(){ 499vo_info_t *get_video_out_plugin_info(){
500 vo_info_null.description = _("xine video output plugin using null device"); 500 vo_info_null.description = _("xine video output plugin using null device");
501 return &vo_info_null; 501 return &vo_info_null;
502} 502}
503 503
504#endif
505
504/* this is special for this device */ 506/* this is special for this device */
505/** 507/**
506 * We know that we will be controled by the XINE LIB++ 508 * We know that we will be controled by the XINE LIB++
507 */ 509 */
508 510
509/** 511/**
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 31ac9dc..03176b3 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -76,12 +76,14 @@ void XineControl::play( const QString& fileName ) {
76 m_fileName = fileName; 76 m_fileName = fileName;
77 77
78 //qDebug("<<FILENAME: " + fileName + ">>>>"); 78 //qDebug("<<FILENAME: " + fileName + ">>>>");
79 79
80 if ( !libXine->play( fileName ) ) { 80 if ( !libXine->play( fileName ) ) {
81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); 81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
82 // toggle stop so the the play button is reset
83 mediaPlayerState->setPlaying( false );
82 return; 84 return;
83 } 85 }
84 mediaPlayerState->setPlaying( true ); 86 mediaPlayerState->setPlaying( true );
85 87
86 char whichGui; 88 char whichGui;
87 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); 89 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) );
@@ -222,16 +224,25 @@ QString XineControl::getMetaInfo() {
222 returnString += tr( " Year: " + libXine->metaInfo( 5 ) ); 224 returnString += tr( " Year: " + libXine->metaInfo( 5 ) );
223 } 225 }
224 return returnString; 226 return returnString;
225} 227}
226 228
227QString XineControl::getErrorCode() { 229QString XineControl::getErrorCode() {
230
228 int errorCode = libXine->error(); 231 int errorCode = libXine->error();
229 232
233 qDebug( QString("ERRORCODE: %1 ").arg(errorCode) );
234
230 if ( errorCode == 1 ) { 235 if ( errorCode == 1 ) {
231 return tr( "No input plugin found for this media type" ); 236 return tr( "No input plugin found for this media type" );
237 } else if ( errorCode == 2 ) {
238 return tr( "No demux plugin found for this media type" );
239 } else if ( errorCode == 3 ) {
240 return tr( "Demuxing failed for this media type" );
241 } else if ( errorCode == 4 ) {
242 return tr( "Malformed MRL" );
232 } else { 243 } else {
233 return tr( "Some other error" ); 244 return tr( "Some other error" );
234 } 245 }
235} 246}
236 247
237/** 248/**