首次提交,可运行。但有两问题:1.画质不佳, 2.无音频

This commit is contained in:
2025-03-29 14:50:44 +08:00
commit 5248f60e55
87 changed files with 103804 additions and 0 deletions

54
FrameRecviver.h Normal file
View File

@@ -0,0 +1,54 @@
#pragma once
#include"DataType.h"
#include"FrameConvert.h"
extern "C"
{
#include<libavcodec/avcodec.h>
}
class FrameRecviver
{
protected:
uint width=0;
uint height=0;
AVRational frame_rate;
public:
virtual ~FrameRecviver()=default;
virtual void SetFrameRate(const AVRational &fr){frame_rate=fr;}
virtual bool OnFrame(const AVFrame *frame)=0;
public:
const uint GetWidth()const{return width;}
const uint GetHeight()const{return height;}
};//
class RGBAFrameRecviver:public FrameRecviver
{
private:
AVPixelFormat src_format=AV_PIX_FMT_NONE;
FrameConvert *convert=nullptr;
private:
bool OnFrame(const AVFrame *frame);
public:
virtual ~RGBAFrameRecviver()
{
if(convert)
delete convert;
}
virtual bool OnFrameRGBA(const uint8 *)=0;
};//class RGBAFrameRecviver:public FrameRecviver