26 lines
538 B
C++
26 lines
538 B
C++
#ifndef H264PALYER_H
|
|
#define H264PALYER_H
|
|
|
|
#include <QImage>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
typedef struct AVFrame AVFrame;
|
|
typedef struct AVPacket AVPacket;
|
|
typedef struct AVCodecContext AVCodecContext;
|
|
|
|
class H264Palyer {
|
|
public:
|
|
H264Palyer();
|
|
~H264Palyer();
|
|
void open();
|
|
std::optional<QImage> decode(const uint8_t *data, uint32_t size);
|
|
|
|
private:
|
|
AVPacket *m_packet = nullptr;
|
|
AVFrame *m_frame = nullptr;
|
|
AVCodecContext *m_codecContext = nullptr;
|
|
};
|
|
|
|
#endif // H264PALYER_H
|