From e878e92811a2dbfb6b4d3f7b2c357435f56e28db Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期日, 29 九月 2019 10:27:21 +0800 Subject: [PATCH] add trytime --- libcffmpeg.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/libcffmpeg.c b/libcffmpeg.c index fda4217..69fcbb9 100644 --- a/libcffmpeg.c +++ b/libcffmpeg.c @@ -19,6 +19,8 @@ if(lib){ fn_create = (lib_cffmpeg_create)dlsym(lib, "c_ffmpeg_create"); release_if_err(fn_create, lib); + fn_create2 = (lib_cffmpeg_create)dlsym(lib, "c_ffmpeg_create2"); + release_if_err(fn_create2, lib); fn_destroy = (lib_cffmpeg_destroy)dlsym(lib, "c_ffmpeg_destroy"); release_if_err(fn_destroy, lib); fn_run = (lib_cffmpeg_run)dlsym(lib, "c_ffmpeg_run"); @@ -41,8 +43,8 @@ release_if_err(fn_decoder_pic, lib); fn_get_avpacket = (lib_cffmpeg_avpacket)dlsym(lib, "c_ffmpeg_get_avpacket"); release_if_err(fn_get_avpacket, lib); - fn_dec_jpeg = (lib_cffmpeg_decode_jpeg)dlsym(lib, "c_ffmpeg_decode_jpeg"); - release_if_err(fn_dec_jpeg, lib); + fn_decode = (lib_cffmpeg_decode)dlsym(lib, "c_ffmpeg_decode"); + release_if_err(fn_decode, lib); fn_create_encoder = (lib_cffmpeg_create_encoder)dlsym(lib, "c_ffmpeg_create_encoder"); release_if_err(fn_create_encoder, lib); @@ -67,6 +69,10 @@ return fn_create(); } +cffmpeg wrap_fn_create2(const char *logfile){ + return fn_create2(logfile); +} + void wrap_fn_destroy(const cffmpeg h){ fn_destroy(h); } @@ -87,8 +93,8 @@ fn_cpu(h); } -void wrap_fn_recorder(const cffmpeg h, const char* id, const char* dir, int mind, int maxd){ - fn_recorder(h, id, dir, mind, maxd); +void wrap_fn_recorder(const cffmpeg h, const char* id, const char* dir, int mind, int maxd, int audio){ + fn_recorder(h, id, dir, mind, maxd, audio); } void wrap_fn_fire_recorder(const cffmpeg h, const char* sid, const int64_t id){ @@ -111,8 +117,9 @@ return fn_get_avpacket(h, size, key); } -void* wrap_fn_decode_jpeg(const char* file, int* wid, int* hei){ - return fn_dec_jpeg(file, wid, hei); +// return val: -1 open error; -2, find stream error; -3, converter create error +void* wrap_fn_decode(const char* file, const int gb, int* wid, int* hei){ + return fn_decode(file, gb, wid, hei); } // for encoder -- Gitblit v1.8.0