11 #include "cores/VideoPlayer/DVDCodecs/DVDCodecs.h" 12 #include "cores/VideoPlayer/DVDStreamInfo.h" 13 #include "DVDVideoCodec.h" 14 #include "DVDVideoPPFFmpeg.h" 19 #include <libavfilter/avfilter.h> 20 #include <libavcodec/avcodec.h> 21 #include <libavformat/avformat.h> 22 #include <libavutil/avutil.h> 23 #include <libswscale/swscale.h> 24 #include <libpostproc/postprocess.h> 36 void Reset()
override;
39 const char*
GetName()
override {
return m_name.c_str(); };
42 bool GetCodecStats(
double &pts,
int &droppedFrames,
int &skippedPics)
override;
50 static enum AVPixelFormat GetFormat(
struct AVCodecContext * avctx,
const AVPixelFormat *
fmt);
52 int FilterOpen(
const std::string& filters,
bool scale);
54 CDVDVideoCodec::VCReturn FilterProcess(AVFrame* frame);
59 bool HasHardware() {
return m_pHardware !=
nullptr; }
62 AVFrame* m_pFrame =
nullptr;;
63 AVFrame* m_pDecodedFrame =
nullptr;;
64 AVCodecContext* m_pCodecContext =
nullptr;;
65 std::shared_ptr<CVideoBufferPoolFFmpeg> m_videoBufferPool;
67 std::string m_filters;
68 std::string m_filters_next;
69 AVFilterGraph* m_pFilterGraph =
nullptr;
70 AVFilterContext* m_pFilterIn =
nullptr;
71 AVFilterContext* m_pFilterOut =
nullptr;;
72 AVFrame* m_pFilterFrame =
nullptr;;
73 bool m_filterEof =
false;
78 int m_iPictureWidth = 0;
79 int m_iPictureHeight = 0;
80 int m_iScreenWidth = 0;
81 int m_iScreenHeight = 0;
82 int m_iOrientation = 0;
87 int m_iLastKeyframe = 0;
88 double m_dts = DVD_NOPTS_VALUE;
89 bool m_started =
false;
90 bool m_startedInput =
false;
91 std::vector<AVPixelFormat> m_formats;
92 double m_decoderPts = DVD_NOPTS_VALUE;
93 int m_skippedDeint = 0;
94 int m_droppedFrames = 0;
95 bool m_requestSkipDeint =
false;
96 int m_codecControlFlags = 0;
97 bool m_interlaced =
false;
105 void Reset(
bool init);
106 void Process(int64_t pts,
bool drop);
unsigned GetConvergeCount() override
How many packets should player remember, so codec can recover should something cause it to flush outs...
Definition: DVDVideoCodecFFmpeg.cpp:1305
Definition: DVDStreamInfo.h:23
void SetCodecControl(int flags) override
Codec can be informed by player with the following flags:
Definition: DVDVideoCodecFFmpeg.cpp:1340
Definition: DVDCodecs.h:23
Definition: DVDVideoCodec.h:245
bool GetPictureCommon(VideoPicture *pVideoPicture) override
Definition: DVDVideoCodecFFmpeg.cpp:945
const char * GetName() override
should return codecs name
Definition: DVDVideoCodecFFmpeg.h:39
Definition: DVDVideoCodecFFmpeg.h:102
bool AddData(const DemuxPacket &packet) override
add data, decoder has to consume the entire packet returns true if the packet was consumed or if resu...
Definition: DVDVideoCodecFFmpeg.cpp:561
Definition: DVDVideoCodec.h:261
Definition: DVDVideoCodecFFmpeg.cpp:123
void Reopen() override
Re-open the decoder.
Definition: DVDVideoCodecFFmpeg.cpp:936
Definition: ProcessInfo.h:26
void Reset() override
Reset the decoder.
Definition: DVDVideoCodecFFmpeg.cpp:915
Definition: DVDVideoCodecFFmpeg.h:29
Definition: DVDVideoCodec.h:36
Definition: DemuxPacket.h:22
bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) override
Open the decoder, returns true on success Decoders not capable of running multiple instances should r...
Definition: DVDVideoCodecFFmpeg.cpp:321
unsigned GetAllowedReferences() override
Number of references to old pictures that are allowed to be retained when calling decode on the next ...
Definition: DVDVideoCodecFFmpeg.cpp:1310
Definition: DVDVideoPPFFmpeg.h:17
CDVDVideoCodec::VCReturn GetPicture(VideoPicture *pVideoPicture) override
GetPicture controls decoding.
Definition: DVDVideoCodecFFmpeg.cpp:636
Definition: DVDVideoCodec.h:107
bool GetCodecStats(double &pts, int &droppedFrames, int &skippedPics) override
For calculation of dropping requirements player asks for some information.
Definition: DVDVideoCodecFFmpeg.cpp:1318