summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp16
-rw-r--r--noncore/multimedia/opieplayer2/lib.h2
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp2
4 files changed, 19 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 84194b7..299239b 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -119,28 +119,25 @@ void Lib::initialize()
m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this );
//xine_open_video_driver( m_xine, NULL, XINE_VISUAL_TYPE_FB, NULL);
// null_display_handler( m_videoOutput, xine_display_frame, this );
m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput );
if (m_wid != 0 ) {
printf( "!0\n" );
- resize ( m_wid-> size ( ) );
- ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() );
-
-// m_wid->repaint();
+ setWidget( m_wid );
}
m_queue = xine_event_new_queue (m_stream);
xine_event_create_listener_thread (m_queue, xine_event_handler, this);
m_duringInitialization = false;
}
Lib::~Lib() {
assert( isRunning() == false );
assert( m_initialized );
@@ -285,24 +282,32 @@ int Lib::error() const {
};
void Lib::ensureInitialized()
{
if ( m_initialized )
return;
qDebug( "waiting for initialization thread to finish" );
wait();
qDebug( "initialization thread finished!" );
}
+void Lib::setWidget( XineVideoWidget *widget )
+{
+ m_wid = widget;
+ resize ( m_wid-> size ( ) );
+ ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() );
+ m_wid->repaint();
+}
+
void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType )
{
assert( sendType == ThreadUtil::Channel::OneWay );
handleXineEvent( msg->type() );
delete msg;
}
void Lib::handleXineEvent( const xine_event_t* t ) {
send( new ThreadUtil::ChannelMessage( t->type ), OneWay );
}
void Lib::handleXineEvent( int type ) {
@@ -372,14 +377,17 @@ void Lib::xine_event_handler( void* user_data, const xine_event_t* t ) {
void Lib::xine_display_frame( void* user_data, uint8_t *frame,
int width, int height, int bytes ) {
( (Lib*)user_data)->drawFrame( frame, width, height, bytes );
}
void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
assert( m_initialized );
if ( !m_video ) {
qWarning("not showing video now");
return;
}
+
+ assert( m_wid );
+
m_wid-> setVideoFrame ( frame, width, height, bytes );
}
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index 6b67f67..181735c 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -170,24 +170,26 @@ namespace XINE {
/**
* Returns the error code
* XINE_ERROR_NONE 0
* XINE_ERROR_NO_INPUT_PLUGIN 1
* XINE_ERROR_NO_DEMUXER_PLUGIN 2
* XINE_ERROR_DEMUXER_FAILED 3
*/
int error() const;
void ensureInitialized();
+ void setWidget( XineVideoWidget *widget );
+
signals:
void stopped();
void initialized();
protected:
virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType );
virtual void run();
private:
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 963e783..d6fbb53 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -6,24 +6,25 @@
#include <qfileinfo.h>
#include <qmainwindow.h>
#include <qmessagebox.h>
#include <qwidgetstack.h>
#include <qfile.h>
#include "mediaplayer.h"
#include "playlistwidget.h"
#include "audiowidget.h"
#include "videowidget.h"
#include "volumecontrol.h"
+#include "lib.h"
#include "mediaplayerstate.h"
// for setBacklight()
#include <linux/fb.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#define FBIOBLANK 0x4611
@@ -361,25 +362,26 @@ void MediaPlayer::recreateAudioAndVideoWidgets() const
m_videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" );
connect( m_audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
connect( m_audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
connect( m_audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
connect( m_audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
connect( m_videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
connect( m_videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
connect( m_videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
connect( m_videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
- m_xineControl = new XineControl( m_videoUI->vidWidget(), mediaPlayerState );
+ XINE::Lib *xine = new XINE::Lib( XINE::Lib::InitializeImmediately );
+ m_xineControl = new XineControl( xine, m_videoUI->vidWidget(), mediaPlayerState );
}
AudioWidget *MediaPlayer::audioUI() const
{
if ( !m_audioUI )
recreateAudioAndVideoWidgets();
return m_audioUI;
}
VideoWidget *MediaPlayer::videoUI() const
{
if ( !m_videoUI )
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 7c54499..1c489e3 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -48,24 +48,26 @@ XineControl::XineControl( XineVideoWidget *xineWidget,
libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget );
init();
}
XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget,
MediaPlayerState &_mediaPlayerState,
QObject *parent, const char *name )
: QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget )
{
xine->ensureInitialized();
+ xine->setWidget( xineWidget );
+
init();
}
void XineControl::init()
{
connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) );
connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) );
connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) );
connect( &mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) );
connect( &mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) );
connect( &mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) );
connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) );