video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-11-12 c5a01eed95f1837e93fee27bce4da78c79f4ed10
csrc/worker/stream.hpp
@@ -5,23 +5,28 @@
#include <mutex>
#include <memory>
#include "../common.hpp"
namespace ffwrapper{
    class CodedData;
    class FormatIn;
}
namespace cffmpeg_wrap{
    class stream
    {
    private:
        std::list<std::shared_ptr<ffwrapper::CodedData> > list_avpkt_;
        std::list<CPacket> list_pkt_;
        std::mutex mutex_avpkt_;
        ffwrapper::FormatIn *streamRef_;
        const int max_size_;
        bool audio_;
    public:
        explicit stream(const int maxSize);
        stream(ffwrapper::FormatIn *in, const int maxSize);
        ~stream();
        int SetPacket(std::shared_ptr<ffwrapper::CodedData> data);
        int SetPacket(const CPacket &pkt);
        void GetPacket(unsigned char **pktData, int *size, int *key);
        void AudioSwitch(const bool a){audio_ = a;}
    };
    
}