diff options
author | Laxmikant Rashinkar <lk@maya-vm-64.(none)> | 2012-12-26 18:48:17 -0800 |
---|---|---|
committer | Laxmikant Rashinkar <lk@maya-vm-64.(none)> | 2012-12-26 18:48:17 -0800 |
commit | cae2adb75e2b339017746436c63f7d2b8c35fb63 (patch) | |
tree | 7fa8fc022ef3a52f069332642dc0e9c428c9c94c /vrplayer/decoderthread.h | |
parent | d1fc67102a273a8e0b170d0c613cf0d611cfa7f8 (diff) | |
download | xrdp-proprietary-cae2adb75e2b339017746436c63f7d2b8c35fb63.tar.gz xrdp-proprietary-cae2adb75e2b339017746436c63f7d2b8c35fb63.zip |
o developer checkin
o modified vrplayer to use threads
Diffstat (limited to 'vrplayer/decoderthread.h')
-rw-r--r-- | vrplayer/decoderthread.h | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/vrplayer/decoderthread.h b/vrplayer/decoderthread.h index 0f8a1c12..e7116fa4 100644 --- a/vrplayer/decoderthread.h +++ b/vrplayer/decoderthread.h @@ -14,9 +14,14 @@ #include <QString> #include <QRect> #include <QMutex> +#include <QTimer> +#include <QQueue> #include <xrdpapi.h> #include <xrdpvr.h> +#include <mediapacket.h> +#include <playvideo.h> +#include <playaudio.h> /* ffmpeg related stuff */ extern "C" @@ -25,28 +30,34 @@ extern "C" #include <libavcodec/avcodec.h> } -class DecoderThread : public QThread +class DecoderThread : public QObject { Q_OBJECT public: + /* public methods */ DecoderThread(); + void setFilename(QString filename); + void stopPlayer(); + void pausePlayer(); + void resumePlayer(); + void oneTimeDeinit(); + void close(); + void run(); + void startMediaPlay(); public slots: - void on_geometryChanged(int x, int y, int width, int height); void on_mediaSeek(int value); -protected: - void run(); - private: - typedef struct _VideoStateInfo - { - AVFormatContext *pFormatCtx; - } VideoStateInfo; + /* private variables */ + QQueue<MediaPacket *> audioQueue; + QQueue<MediaPacket *> videoQueue; - VideoStateInfo *vsi; + QTimer *videoTimer; + QTimer *audioTimer; + QTimer *pktTimer; QString filename; void *channel; int stream_id; @@ -55,14 +66,26 @@ private: QMutex mutex; int64_t la_seekPos; /* locked access; must hold mutex */ - int openVirtualChannel(); - int closeVirtualChannel(); - int sendMetadataFile(); - int sendVideoFormat(); - int sendAudioFormat(); - int sendGeometry(); + PlayVideo *playVideo; + QThread *playVideoThread; + PlayAudio *playAudio; + QThread *playAudioThread; + + /* private functions */ + int sendMetadataFile(); + int sendAudioFormat(); + int sendVideoFormat(); + int sendGeometry(); + void updateSlider(); + +private slots: + /* private slots */ + void audioTimerCallback(); + void videoTimerCallback(); + void pktTimerCallback(); signals: + /* private signals */ void on_progressUpdate(int percent); void on_decoderErrorMsg(QString title, QString msg); void on_mediaDurationInSeconds(int duration); |