summaryrefslogtreecommitdiffstats
path: root/vrplayer/decoderthread.h
diff options
context:
space:
mode:
authorLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2012-12-08 16:36:41 -0800
committerLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2012-12-08 16:36:41 -0800
commit4c67aad4c46be80466017b082eae8d9ffad2768d (patch)
treea970451c336fa2078d4511ffa9660826f1517ac4 /vrplayer/decoderthread.h
parent309f2225b1f6c56d954c4eaf512474a7d1303a95 (diff)
downloadxrdp-proprietary-4c67aad4c46be80466017b082eae8d9ffad2768d.tar.gz
xrdp-proprietary-4c67aad4c46be80466017b082eae8d9ffad2768d.zip
o development checkin
o added vrplayer
Diffstat (limited to 'vrplayer/decoderthread.h')
-rw-r--r--vrplayer/decoderthread.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/vrplayer/decoderthread.h b/vrplayer/decoderthread.h
new file mode 100644
index 00000000..0f8a1c12
--- /dev/null
+++ b/vrplayer/decoderthread.h
@@ -0,0 +1,72 @@
+#ifndef DECODERTHREAD_H
+#define DECODERTHREAD_H
+
+#ifdef __cplusplus
+#define __STDC_CONSTANT_MACROS
+#ifdef _STDINT_H
+#undef _STDINT_H
+#endif
+#include <stdint.h>
+#endif
+
+#include <QThread>
+#include <QDebug>
+#include <QString>
+#include <QRect>
+#include <QMutex>
+
+#include <xrdpapi.h>
+#include <xrdpvr.h>
+
+/* ffmpeg related stuff */
+extern "C"
+{
+ #include <libavformat/avformat.h>
+ #include <libavcodec/avcodec.h>
+}
+
+class DecoderThread : public QThread
+{
+ Q_OBJECT
+
+public:
+ DecoderThread();
+ void setFilename(QString filename);
+
+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;
+
+ VideoStateInfo *vsi;
+ QString filename;
+ void *channel;
+ int stream_id;
+ QRect geometry;
+ int64_t elapsedTime; /* elapsed time in usecs since play started */
+ QMutex mutex;
+ int64_t la_seekPos; /* locked access; must hold mutex */
+
+ int openVirtualChannel();
+ int closeVirtualChannel();
+ int sendMetadataFile();
+ int sendVideoFormat();
+ int sendAudioFormat();
+ int sendGeometry();
+
+signals:
+ void on_progressUpdate(int percent);
+ void on_decoderErrorMsg(QString title, QString msg);
+ void on_mediaDurationInSeconds(int duration);
+ void on_elapsedtime(int val); /* in hundredth of a sec */
+};
+
+#endif // DECODERTHREAD_H