video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2020-10-09 a8b447be656145c9ba2a2d8319a10ae8f726de1f
csrc/ffmpeg/format/FormatIn.hpp
@@ -13,6 +13,7 @@
struct AVFrame;
struct AVCodec;
struct AVIOContext;
struct AVBSFContext;
typedef int(* read_packet)(void *opaque,uint8_t *buf, int buf_size);
@@ -24,6 +25,7 @@
   {
   public:
      explicit FormatIn(bool hw=true);
      explicit FormatIn(const VideoProp &prop, bool hw=true);
      ~FormatIn();
      
   public:
@@ -41,6 +43,7 @@
      
      bool isVideoPkt(AVPacket *pkt);
      bool isAudioPkt(AVPacket *pkt);
      bool notVideoAudio(AVPacket *pkt);
   private:
      bool allocCodec(AVCodec *dec, AVStream *s, AVDictionary **options);
   public:
@@ -48,12 +51,17 @@
      AVCodecContext *getCodecContext(int type = 0);
      AVFormatContext *getFromatContext(){return ctx_;}
      const double getFPS()const{return fps_;}
      const bool IsHEVC()const;
      const bool isAVC1()const;
   private:
       AVFormatContext    *ctx_;
       AVCodecContext       *dec_ctx_;
       int             vs_idx_;
      int             as_idx_;
        AVBSFContext         *bsf_h264, *bsf_hevc;
      VideoProp          *prop_;
       bool             hw_accl_;
      double             fps_;
   private: