summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/lib.h
authorsimon <simon>2002-12-11 00:29:22 (UTC)
committer simon <simon>2002-12-11 00:29:22 (UTC)
commit7d5782ef4fd19498a141ed68c23145dcc6128146 (patch) (side-by-side diff)
tree8cdbd360962b3fa161823fa88b43e9584b23a464 /noncore/multimedia/opieplayer2/lib.h
parent6c71f5ccd9506234a317d9ff3d119613c457e769 (diff)
downloadopie-7d5782ef4fd19498a141ed68c23145dcc6128146.zip
opie-7d5782ef4fd19498a141ed68c23145dcc6128146.tar.gz
opie-7d5782ef4fd19498a141ed68c23145dcc6128146.tar.bz2
- initialized xine in a background thread. much time is still spend in
skin loading though.
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index 4b8dc81..34b85b9 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -46,25 +46,26 @@
class XineVideoWidget;
namespace XINE {
/**
* Lib wrapps the simple interface
* of libxine for easy every day use
* This will become a full C++ Wrapper
* 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);
~Lib();
static int majorVersion();
static int minorVersion();
static int subVersion();
void resize ( const QSize &s );
int play( const QString& fileName,
@@ -168,32 +169,47 @@ 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;
signals:
void stopped();
+ void initialized();
+
protected:
virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType );
+ virtual void run();
+
private:
void initialize();
void assertInitialized() const;
+ enum { XineMessageType = 1, InitializationMessageType };
+
+ struct XineMessage : public ThreadUtil::ChannelMessage
+ {
+ XineMessage( int _xineEvent ) : ThreadUtil::ChannelMessage( XineMessageType ),
+ xineEvent( _xineEvent )
+ {}
+
+ int xineEvent;
+ };
+
mutable ThreadUtil::Mutex m_initGuard;
bool m_initialized : 1;
int m_bytes_per_pixel;
bool m_video:1;
XineVideoWidget *m_wid;
xine_t *m_xine;
xine_stream_t *m_stream;
xine_cfg_entry_t *m_config;
xine_vo_driver_t *m_videoOutput;
xine_ao_driver_t* m_audioOutput;
xine_event_queue_t *m_queue;