video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-07-16 b7c7b479c278e74955a1a0a6c949a4d3cf32903a
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
#include "FrameData.hpp"
 
extern "C" {
#include <libavcodec/avcodec.h>
}
 
namespace ffwrapper{
    FrameData::FrameData()
    :frame_(NULL)
    {
        init_frame();
    }
 
 
    FrameData::~FrameData()
    {
        free_frame();
    }
 
 
    void FrameData::init_frame(){
        frame_ = av_frame_alloc();
    }
 
    void FrameData::free_frame(){
        av_frame_free(&frame_);
        frame_ = NULL;
    }
}