From cd3fe8cc1ae9028acb4f630ed16c12f4fb327f3c Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期四, 10 十月 2019 17:35:12 +0800 Subject: [PATCH] add interface out --- csrc/ffmpeg/format/FormatIn.hpp | 21 ++++++++------------- 1 files changed, 8 insertions(+), 13 deletions(-) diff --git a/csrc/ffmpeg/format/FormatIn.hpp b/csrc/ffmpeg/format/FormatIn.hpp index ca14f81..e904145 100644 --- a/csrc/ffmpeg/format/FormatIn.hpp +++ b/csrc/ffmpeg/format/FormatIn.hpp @@ -19,8 +19,6 @@ namespace ffwrapper{ class VideoProp; - class CodedData; - class FrameData; class FormatIn { @@ -35,26 +33,23 @@ int open(const char *filename, AVDictionary **options); bool findStreamInfo(AVDictionary **options); - bool openCodec(const int type, AVDictionary **options); + bool openCodec(AVDictionary **options); - bool readPacket(AVPacket &pkt_out); - bool readPacket(std::shared_ptr<CodedData> &data); + int readPacket(AVPacket *pkt_out); - int decode(AVFrame* &frame, AVPacket &pkt); - int decode(std::shared_ptr<FrameData> &frame_data, - std::shared_ptr<CodedData> &data); + int decode(AVFrame* frame, AVPacket *pkt); - int readFrame(AVFrame* &frame); - int readFrame(std::shared_ptr<FrameData> &frame_data); - - bool isVideoPkt(AVPacket &pkt); - bool isAudioPkt(AVPacket &pkt); + bool isVideoPkt(AVPacket *pkt); + bool isAudioPkt(AVPacket *pkt); + bool notVideoAudio(AVPacket *pkt); private: bool allocCodec(AVCodec *dec, AVStream *s, AVDictionary **options); public: AVStream *getStream(int type = -1); AVCodecContext *getCodecContext(int type = 0); + AVFormatContext *getFromatContext(){return ctx_;} const double getFPS()const{return fps_;} + const bool IsHEVC()const; private: AVFormatContext *ctx_; AVCodecContext *dec_ctx_; -- Gitblit v1.8.0