video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2023-12-26 18a05d269516a5e33d8460291c2f93e73d95adce
csrc/worker/stream.hpp
@@ -1,20 +1,21 @@
#ifndef _cffmpeg_stream_hpp_
#define _cffmpeg_stream_hpp_
#include <list>
#include <deque>
#include <mutex>
#include <memory>
#include "../common.hpp"
namespace ffwrapper{
    class FormatIn;
    class CodedData;
}
namespace cffmpeg_wrap{
    class stream
    {
    private:
        std::list<std::shared_ptr<ffwrapper::CodedData> > list_avpkt_;
        std::deque<CPacket> list_pkt_;
        std::mutex mutex_avpkt_;
        ffwrapper::FormatIn *streamRef_;
        const int max_size_;
@@ -23,7 +24,7 @@
        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;}
    };