video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2023-12-26 18a05d269516a5e33d8460291c2f93e73d95adce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef _cffmpeg_stream_hpp_
#define _cffmpeg_stream_hpp_
 
#include <deque>
#include <mutex>
#include <memory>
 
#include "../common.hpp"
 
namespace ffwrapper{
    class FormatIn;
}
 
namespace cffmpeg_wrap{
    class stream
    {
    private:
        std::deque<CPacket> list_pkt_;
        std::mutex mutex_avpkt_;
        ffwrapper::FormatIn *streamRef_;
        const int max_size_;
        bool audio_;
    public:
        stream(ffwrapper::FormatIn *in, const int maxSize);
        ~stream();
 
        int SetPacket(const CPacket &pkt);
        void GetPacket(unsigned char **pktData, int *size, int *key);
        void AudioSwitch(const bool a){audio_ = a;}
    };
    
}
 
#endif