|
|
|
|
@ -17,7 +17,7 @@ class Stream : public QThread
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
Stream(QObject *parent = Q_NULLPTR);
|
|
|
|
|
Stream(std::function<qint32(quint8*, qint32)> recvData, QObject *parent = Q_NULLPTR);
|
|
|
|
|
virtual ~Stream();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
@ -26,8 +26,6 @@ public:
|
|
|
|
|
|
|
|
|
|
void setDecoder(Decoder *decoder);
|
|
|
|
|
void setRecoder(Recorder *recorder);
|
|
|
|
|
void setVideoSocket(VideoSocket *deviceSocket);
|
|
|
|
|
qint32 recvData(quint8 *buf, qint32 bufSize);
|
|
|
|
|
bool startDecode();
|
|
|
|
|
void stopDecode();
|
|
|
|
|
|
|
|
|
|
@ -41,9 +39,10 @@ protected:
|
|
|
|
|
bool processConfigPacket(AVPacket *packet);
|
|
|
|
|
bool parse(AVPacket *packet);
|
|
|
|
|
bool processFrame(AVPacket *packet);
|
|
|
|
|
qint32 recvData(quint8 *buf, qint32 bufSize);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QPointer<VideoSocket> m_videoSocket;
|
|
|
|
|
std::function<qint32(quint8*, qint32)> m_recvData = nullptr;
|
|
|
|
|
// for recorder
|
|
|
|
|
Recorder *m_recorder = Q_NULLPTR;
|
|
|
|
|
Decoder *m_decoder = Q_NULLPTR;
|
|
|
|
|
|