video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-09-20 be9c1d1f659b0ff31f656424c478e83a4f7c53b5
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
#ifndef _cffmpeg_stream_hpp_
#define _cffmpeg_stream_hpp_
 
#include <list>
#include <mutex>
#include <memory>
 
namespace ffwrapper{
    class FormatIn;
    class CodedData;
}
 
namespace cffmpeg_wrap{
    class stream
    {
    private:
        std::list<std::shared_ptr<ffwrapper::CodedData> > list_avpkt_;
        std::mutex mutex_avpkt_;
        ffwrapper::FormatIn *streamRef_;
        const int max_size_;
        bool audio_;
    public:
        stream(ffwrapper::FormatIn *in, const int maxSize);
        ~stream();
 
        int SetPacket(std::shared_ptr<ffwrapper::CodedData> data);
        void GetPacket(unsigned char **pktData, int *size, int *key);
        void AudioSwitch(const bool a){audio_ = a;}
    };
    
}
 
#endif