This commit is contained in:
Jie
2024-02-20 11:16:08 +08:00
commit 7be6ecc9a3
13 changed files with 482 additions and 0 deletions

25
include/decoder.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef DECODER_H
#define DECODER_H
extern "C"{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavutil/imgutils.h"
}
struct DecoderParam{
AVFormatContext* fmtCtx;
AVCodecContext* codecCtx;
int width;
int height;
int videoStreamIndex;
};
extern "C"{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavutil/imgutils.h"
}
void InitDecoder(const char* filepath, DecoderParam& param);
AVFrame* RequestFrame(DecoderParam& param);
#endif