summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp16
-rw-r--r--noncore/multimedia/opieplayer2/lib.h13
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp2
3 files changed, 26 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 1e0dc21..6431de7 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -69,9 +69,9 @@ extern "C" {
}
using namespace XINE;
-Lib::Lib( XineVideoWidget* widget )
+Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
{
m_video = false;
m_wid = widget;
printf("Lib");
@@ -86,10 +86,24 @@ Lib::Lib( XineVideoWidget* widget )
ts << "misc.memcpy_method:glibc\n";
f.close();
}
+ if ( initMode == InitializeImmediately )
+ initialize();
+ else
+ assert( false );
+}
+
+void Lib::run()
+{
+ assert( false );
+}
+
+void Lib::initialize()
+{
m_xine = xine_new( );
+ QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
xine_config_load( m_xine, QFile::encodeName( configPath ) );
xine_init( m_xine );
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index aba2ec9..6363918 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -54,20 +54,23 @@ namespace XINE {
* It supports playing, pausing, info,
* stooping, seeking.
*/
class Frame;
- class Lib : public ThreadUtil::Channel
+ class Lib : public ThreadUtil::Channel, private ThreadUtil::Thread
{
Q_OBJECT
public:
- Lib(XineVideoWidget* = 0);
+ enum InitializationMode { InitializeImmediately, InitializeInThread };
+
+ Lib( InitializationMode initMode, XineVideoWidget* = 0);
+
~Lib();
static int majorVersion();
static int minorVersion();
static int subVersion();
- void resize ( const QSize &s );
+ void resize ( const QSize &s );
int play( const QString& fileName,
int startPos = 0,
int start_time = 0 );
@@ -182,9 +185,13 @@ namespace XINE {
protected:
virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType );
+ virtual void run();
+
private:
+ void initialize();
+
int m_bytes_per_pixel;
bool m_video:1;
XineVideoWidget *m_wid;
xine_t *m_xine;
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index efa9934..1aa3daa 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -45,9 +45,9 @@ XineControl::XineControl( XineVideoWidget *xineWidget,
QObject *parent, const char *name )
: QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget )
{
- libXine = new XINE::Lib( xineWidget );
+ libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget );
init();
}