video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-09-27 0c98249d381d6e56c78d6e752a49e768a4c4d22e
csrc/buz/recorder.hpp
@@ -13,21 +13,17 @@
#include "../common/callback.hpp"
#include "../common.hpp"
struct AVPacket;
namespace ffwrapper{
    class FormatIn;
    class FormatOut;
    class CodedData;
}
namespace cffmpeg_wrap{
    namespace buz{
        // 缓存的视频帧,等待fire触发开始录像
        typedef struct _cache_pkt{
            std::shared_ptr<ffwrapper::CodedData> data;
            int64_t id;
        }CPacket;
        class Recorder{
            public:
@@ -35,7 +31,7 @@
                ~Recorder();
            public: 
                int Run(const char* output, const int mind, const int maxd);
                int Run(const char* output, const int mind, const int maxd, const bool audio);
                int PushPacket(const CPacket &pkt);
                int PushPackets(std::list<CPacket> &lst);
                int FireRecorder(const int64_t &id);
@@ -49,7 +45,7 @@
            private:
                void run_thread();
                int init_writer();
                int init_writer(const bool audio);
                int write_correctly(const CPacket &pkt);
                void end_writer();
@@ -80,6 +76,8 @@
                FUNC_REC_INFO           func_rec_info_;
                bool                    error_occured_;
                bool                    audio_;
        };
    }
}