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
35
36
37
#ifndef _FFMPEG_DATA_AVPICTURE_H_
#define _FFMPEG_DATA_AVPICTURE_H_
 
#include <stdint.h>
 
struct AVFrame;
 
namespace ffwrapper{
    class PicData
    {
    public:
        PicData(const int width, const int height, const int pix_fmt);
        ~PicData();
    
    public:
        AVFrame* &getAVFrame(){return frame_;}
 
        const uint8_t* getAVPictureData()const{return data_;}
        const int getAVPictureSize()const{return data_size_;}
        const int getPixelFormat()const{return pix_fmt_;}
        const int getPictureWidth()const{return width_;}
        const int getPictureHeight()const{return height_;}
    private:
        bool init_frame();
        void free_frame();
 
        bool init_AVPicture();
    private:
        AVFrame         *frame_;
        uint8_t         *data_;
        int             data_size_;
        int             pix_fmt_;
        int             width_;
        int             height_;
    };
}
#endif