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 | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/libcffmpeg.c b/libcffmpeg.c index 6cb7e5a..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"); @@ -35,16 +37,14 @@ release_if_err(fn_fire_recorder, lib); fn_info_recorder = (lib_cffmpeg_info_recorder)dlsym(lib, "c_ffmpeg_get_info_recorder"); release_if_err(fn_info_recorder, lib); - fn_rec_id = (lib_cffmpeg_rec_id)dlsym(lib, "c_ffmpeg_get_rec_id"); - release_if_err(fn_rec_id, lib); fn_decoder = (lib_cffmpeg_decoder)dlsym(lib, "c_ffmpeg_build_decoder"); release_if_err(fn_decoder, lib); fn_decoder_pic = (lib_cffmpeg_pic)dlsym(lib, "c_ffmpeg_get_pic_decoder"); 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); @@ -69,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); } @@ -89,20 +93,16 @@ 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){ fn_fire_recorder(h, sid, id); } -char* wrap_fn_info_recorder(const cffmpeg h, int* index, int* length){ - return fn_info_recorder(h, index, length); -} - -char* wrap_fn_rec_id(const cffmpeg h, const char* path, int*length){ - return fn_rec_id(h, path, length); +void wrap_fn_info_recorder(const cffmpeg h, int* index, char** recid, int* recidLen, char** fpath, int* pathLen){ + return fn_info_recorder(h, index, recid, recidLen, fpath, pathLen); } void wrap_fn_decoder(const cffmpeg h){ @@ -117,8 +117,9 @@ return fn_get_avpacket(h, size, key); } -void* wrap_fn_decode_jpeg(const cffmpeg h, const char* file, int* wid, int* hei){ - return fn_dec_jpeg(h, 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