2012-12-27 06:48:17 +04:00
|
|
|
#ifndef OURINTERFACE_H
|
|
|
|
#define OURINTERFACE_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define __STDC_CONSTANT_MACROS
|
|
|
|
#ifdef _STDINT_H
|
|
|
|
#undef _STDINT_H
|
|
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QDebug> // LK_TODO
|
|
|
|
|
|
|
|
#include "xrdpvr.h"
|
|
|
|
#include "xrdpapi.h"
|
|
|
|
#include "demuxmedia.h"
|
|
|
|
#include "playvideo.h"
|
|
|
|
|
|
|
|
/* ffmpeg related stuff */
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#include <libavformat/avformat.h>
|
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
}
|
|
|
|
|
|
|
|
class OurInterface : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit OurInterface(QObject *parent = 0);
|
|
|
|
|
|
|
|
/* public methods */
|
|
|
|
int oneTimeInit();
|
|
|
|
void oneTimeDeinit();
|
|
|
|
void initRemoteClient();
|
|
|
|
void deInitRemoteClient();
|
|
|
|
int sendGeometry(QRect rect);
|
|
|
|
void setFilename(QString filename);
|
|
|
|
void playMedia();
|
2013-11-11 13:52:14 +04:00
|
|
|
//PlayVideo *getPlayVideoInstance();
|
|
|
|
DemuxMedia *getDemuxMediaInstance();
|
2012-12-27 06:48:17 +04:00
|
|
|
void setVcrOp(int op);
|
2013-07-20 04:38:36 +04:00
|
|
|
int setVolume(int volume);
|
2012-12-27 06:48:17 +04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void onGeometryChanged(int x, int y, int width, int height);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void on_ErrorMsg(QString title, QString msg);
|
|
|
|
void onMediaDurationInSeconds(int duration);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
/* private stuff */
|
2013-11-11 13:52:14 +04:00
|
|
|
|
2012-12-27 06:48:17 +04:00
|
|
|
QQueue<MediaPacket *> videoQueue;
|
|
|
|
|
|
|
|
DemuxMedia *demuxMedia;
|
|
|
|
QThread *demuxMediaThread;
|
2013-11-11 13:52:14 +04:00
|
|
|
//PlayVideo *playVideo;
|
2012-12-27 06:48:17 +04:00
|
|
|
QString filename;
|
|
|
|
void *channel;
|
|
|
|
int stream_id;
|
|
|
|
QRect savedGeometry;
|
|
|
|
|
|
|
|
/* private methods */
|
|
|
|
int openVirtualChannel();
|
|
|
|
int closeVirtualChannel();
|
|
|
|
int sendMetadataFile();
|
|
|
|
int sendVideoFormat();
|
|
|
|
int sendAudioFormat();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INTERFACE_H
|