video analysis2.0拆分,ffmpeg封装go接口库
chenshijun
2019-12-03 f29f269d999fc4bb8a9bfa85629f08b89971a2ef
csrc/wrapper.hpp
@@ -53,16 +53,21 @@
        int GetFPS(){return fps_;}
    public: //decoder
        void BuildDecoder();
        void OpenDecoder();
        void GetPicDecoder(unsigned char **data, int *w, int *h, int *format, int *length, int64_t *id);
    public: // push stream
        void CloseStream();
        void GetPacket(unsigned char **pktData, int *size, int *key);
    public: // recorder
        void OpenRecorder();
    private:
        // stream 参数
        std::string input_url_;
        bool audio_;
        int gb_, cpu_;
        bool run_dec_;
        bool run_stream_;
        bool run_rec_;
        // decoder 参数
        std::unique_ptr<std::thread> thread_;
        std::atomic_bool    stop_stream_;
@@ -84,12 +89,6 @@
    void *CreateEncoder(const int w, const int h, const int fps, const int br, const int scale_flag, const int gi);
    void DestroyEncoder(void *h);
    int Encode(void *hdl, uint8_t *in, const int w, const int h, uint8_t **out, int *size, int *key);
    void *CreateConvertor(const int srcW, const int srcH, const int srcFormat,
                          const int dstW, const int dstH, const int dstFormat, const int flag);
    uint8_t *Convert(void *h, uint8_t *src);
    void DestoryConvertor(void *h);
    int GetGb28181Pic(const char *filename, char *retData, int *retDataLen);
}