video analysis2.0拆分,ffmpeg封装go接口库
554325746@qq.com
2020-03-10 278634c0d2eeba9e3fcc3b4cd56ddfb3323277d7
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
#ifndef _FFMPEG_SWSCALE_WRAPPER_H_
#define _FFMPEG_SWSCALE_WRAPPER_H_
 
#include <stdlib.h>
 
struct SwsContext;
struct SwsFilter;
struct AVFrame;
 
namespace ffwrapper{
    class swscale_wrapper
    {
    public:
        swscale_wrapper();
        ~swscale_wrapper();
    bool initContext(int srcW, int srcH, int srcFmt, 
                     int dstW, int dstH, int dstFmt, int flags,
                     SwsFilter *srcFilter=NULL,
                     SwsFilter *dstFilter=NULL,
                     double *param=NULL);
 
    bool scaleFrame(AVFrame* &in, AVFrame* &out);
 
    private:
        SwsContext         *ctx_;
    public:
        int             srcW_,srcH_,srcFmt_;
        int             dstW_,dstH_,dstFmt_;
        int             flags_;
    };
}
#endif