video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-09-24 93f44a10e2e8942e57e62bb210a2ca7d206a51b7
csrc/ffmpeg/format/FormatIn.hpp
@@ -19,8 +19,6 @@
namespace ffwrapper{
   class VideoProp;
   class CodedData;
   class FrameData;
   class FormatIn
   {
@@ -35,25 +33,20 @@
      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);
   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_;}
   private:
       AVFormatContext    *ctx_;