video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-04-29 9cb9e4adbd073007e25c18afe14e662dec43580a
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _goffmpeg_lib_c_wrapper_cffmpeg_h_
#define _goffmpeg_lib_c_wrapper_cffmpeg_h_
 
#ifdef __cplusplus
extern "C"{
#endif
 
#include <stdlib.h>
#include <stdint.h>
 
typedef void* cffmpeg;
 
typedef void(*rec_func)(char*, int);
typedef void(*dec_func)(void*,int,int);
 
typedef cffmpeg(*lib_cffmpeg_create)();
typedef void (*lib_cffmpeg_destroy)(const cffmpeg);
typedef void (*lib_cffmpeg_run)(const cffmpeg, const char*);
typedef void (*lib_cffmpeg_recorder)(const cffmpeg, const char*, int, int);
typedef void (*lib_cffmpeg_fire_recorder)(const cffmpeg, const int64_t);
typedef char*(*lib_cffmpeg_info_recorder)(const cffmpeg, int*, int*);
typedef void (*lib_cffmpeg_decoder)(const cffmpeg);
typedef void*(*lib_cffmpeg_pic)(const cffmpeg, int*, int*);
typedef void (*lib_cffmpeg_active_recorder)(const cffmpeg, const char*, int, int, rec_func);
typedef void (*lib_cffmpeg_active_decoder)(const cffmpeg, dec_func);
typedef void*(*lib_cffmpeg_decode_jpeg)(const cffmpeg, const char*, int*, int*);
 
static lib_cffmpeg_create              fn_create = NULL;
static lib_cffmpeg_destroy             fn_destroy = NULL;
static lib_cffmpeg_run                 fn_run = NULL;
static lib_cffmpeg_recorder            fn_recorder = NULL;
static lib_cffmpeg_fire_recorder       fn_fire_recorder = NULL;
static lib_cffmpeg_info_recorder       fn_info_recorder = NULL;
static lib_cffmpeg_decoder             fn_decoder = NULL;
static lib_cffmpeg_pic                 fn_decoder_pic = NULL;
static lib_cffmpeg_active_recorder     fn_active_recorder = NULL;
static lib_cffmpeg_active_decoder      fn_active_decoder = NULL;
static lib_cffmpeg_decode_jpeg         fn_dec_jpeg = NULL;
 
typedef void* libcffmpeg;
libcffmpeg init_libcffmpeg(const char *so_file);
void release_libcffmpeg(libcffmpeg lib);
 
cffmpeg wrap_fn_create();
void wrap_fn_destroy(const cffmpeg h);
void wrap_fn_run(const cffmpeg h, const char* input);
void wrap_fn_recorder(const cffmpeg h, const char* dir, int mind, int maxd);
void wrap_fn_fire_recorder(const cffmpeg h, const int64_t id);
char* wrap_fn_info_recorder(const cffmpeg, int*, int*);
void wrap_fn_decoder(const cffmpeg h);
void* wrap_fn_decoder_pic(const cffmpeg h, int* wid, int* hei);
void wrap_fn_active_recorder(const cffmpeg h, const char* dir, int mind, int maxd, rec_func fn);
void wrap_fn_active_decoder(const cffmpeg h, dec_func fn);
void* wrap_fn_decode_jpeg(const cffmpeg h, const char* file, int* wid, int* hei);
 
#ifdef __cplusplus
}
#endif
 
#endif