You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
807 B
49 lines
807 B
#ifndef DECODER_H
|
|
#define DECODER_H
|
|
|
|
#include <QThread>
|
|
#include <QPointer>
|
|
#include <QMutex>
|
|
|
|
extern "C"
|
|
{
|
|
#include "libavcodec/avcodec.h"
|
|
#include "libavformat/avformat.h"
|
|
}
|
|
|
|
class Frames;
|
|
class DeviceSocket;
|
|
class Decoder : public QThread
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
Decoder();
|
|
virtual ~Decoder();
|
|
|
|
public:
|
|
static bool init();
|
|
static void deInit();
|
|
|
|
void setFrames(Frames* frames);
|
|
void setDeviceSocket(DeviceSocket* deviceSocket);
|
|
qint32 recvData(quint8* buf, qint32 bufSize);
|
|
bool startDecode();
|
|
void stopDecode();
|
|
|
|
signals:
|
|
void onNewFrame();
|
|
void onDecodeStop();
|
|
|
|
protected:
|
|
void run();
|
|
void pushFrame();
|
|
|
|
private:
|
|
QPointer<DeviceSocket> m_deviceSocket;
|
|
QMutex m_mutex;
|
|
bool m_quit = false;
|
|
Frames* m_frames;
|
|
};
|
|
|
|
#endif // DECODER_H
|