From 9b12b43b25fd5a476205bc693be0cf836c281bc1 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期四, 21 十一月 2019 13:36:58 +0800 Subject: [PATCH] remove code not used --- libcffmpeg.c | 46 +++++++++------------------------------------- 1 files changed, 9 insertions(+), 37 deletions(-) diff --git a/libcffmpeg.c b/libcffmpeg.c index edc7b5c..6237dde 100644 --- a/libcffmpeg.c +++ b/libcffmpeg.c @@ -63,6 +63,14 @@ fn_run(h, input); } +int wrap_fn_fps(void *lib, const cffmpeg h){ + if(!fn_fps){ + fn_fps = (lib_cffmpeg_fps)dlsym(lib, "c_ffmpeg_get_fps"); + if (!fn_fps) return 25; + } + return fn_fps(h); +} + void wrap_fn_run_gb28181(void *lib, const cffmpeg h){ if (!fn_gb28181){ fn_gb28181 = (lib_cffmpeg_gb28181)dlsym(lib, "c_ffmpeg_run_gb28181"); @@ -135,15 +143,6 @@ return fn_get_avpacket(h, size, key); } -// return val: -1 open error; -2, find stream error; -3, converter create error -void* wrap_fn_decode(void *lib, const char* file, const int gb, int* wid, int* hei){ - if (!fn_decode){ - fn_decode = (lib_cffmpeg_decode)dlsym(lib, "c_ffmpeg_decode"); - release_if_err(fn_decode, lib); - } - return fn_decode(file, gb, wid, hei); -} - // for encoder cencoder wrap_fn_create_encoder(void *lib, const int w, const int h, const int fps, const int br, const int scale_flag, const int gi){ if (!fn_create_encoder){ @@ -169,37 +168,10 @@ uint8_t *out = NULL; const int flag = fn_encode(hdl, (uint8_t*)in, w, h, &out, out_size, key); - if (flag > 0 && out != NULL) { + if (flag == 0 && out != NULL) { return out; } *out_size = 0; *key = 0; return NULL; -} - -// for conv -cconv wrap_fn_create_conv(void *lib, const int srcW, const int srcH, const int srcFormat, - const int dstW, const int dstH, const int dstFormat, const int flag){ - if (!fn_create_conv){ - fn_create_conv = (lib_cffmpeg_create_conv)dlsym(lib, "c_ffmpeg_create_conv"); - release_if_err(fn_create_conv, lib); - } - return fn_create_conv(srcW, srcH, srcFormat, dstW, dstH, dstFormat, flag); -} - -void wrap_fn_destroy_conv(void *lib, const cconv h){ - if (!fn_destroy_conv){ - fn_destroy_conv = (lib_cffmpeg_destroy_conv)dlsym(lib, "c_ffmpeg_destroy_conv"); - if(!fn_destroy_conv) return; - } - fn_destroy_conv(h); -} - -void* wrap_fn_conv(void *lib, const cconv h, uint8_t *in){ - if (!fn_conv){ - fn_conv = (lib_cffmpeg_conv)dlsym(lib, "c_ffmpeg_conv"); - release_if_err(fn_conv, lib); - } - - return fn_conv(h, in); } -- Gitblit v1.8.0