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.

36 lines
567 B

#ifndef DECODER_H
#define DECODER_H
#include <QObject>
extern "C"
{
#include "libavcodec/avcodec.h"
}
class VideoBuffer;
class Decoder : public QObject
{
Q_OBJECT
public:
Decoder(VideoBuffer* vb);
virtual ~Decoder();
bool open(const AVCodec *codec);
void close();
bool push(const AVPacket *packet);
void interrupt();
signals:
void onNewFrame();
protected:
void pushFrame();
private:
VideoBuffer* m_vb = Q_NULLPTR;
AVCodecContext* m_codecCtx = Q_NULLPTR;
bool m_isCodecCtxOpen = false;
};
#endif // DECODER_H