| | |
| | | release_if_err(fn_destroy, lib); |
| | | fn_run = (lib_cffmpeg_run)dlsym(lib, "c_ffmpeg_run"); |
| | | release_if_err(fn_run, lib); |
| | | fn_scale = (lib_cffmpeg_scale)dlsym(lib, "c_ffmpeg_scale"); |
| | | release_if_err(fn_scale, lib); |
| | | fn_gb28181 = (lib_cffmpeg_gb28181)dlsym(lib, "c_ffmpeg_run_gb28181"); |
| | | release_if_err(fn_gb28181, lib); |
| | | fn_cpu = (lib_cffmpeg_cpu)dlsym(lib, "c_ffmepg_use_cpu"); |
| | |
| | | release_if_err(fn_destroy_encoder, lib); |
| | | fn_encode = (lib_cffmpeg_encode)dlsym(lib, "c_ffmpeg_encode"); |
| | | release_if_err(fn_encode, lib); |
| | | |
| | | fn_create_conv = (lib_cffmpeg_create_conv)dlsym(lib, "c_ffmpeg_create_conv"); |
| | | release_if_err(fn_create_conv, lib); |
| | | fn_destroy_conv = (lib_cffmpeg_destroy_conv)dlsym(lib, "c_ffmpeg_destroy_conv"); |
| | | release_if_err(fn_destroy_conv, lib); |
| | | fn_conv = (lib_cffmpeg_conv)dlsym(lib, "c_ffmpeg_conv"); |
| | | release_if_err(fn_conv, lib); |
| | | |
| | | fn_gpu_conv = (lib_gpu_conv)dlsym(lib, "c_gpu_conv"); |
| | | release_if_err(fn_gpu_conv, lib); |
| | | |
| | | }else{ |
| | | printf("dlopen - %s\n", dlerror()); |
| | |
| | | fn_run(h, input); |
| | | } |
| | | |
| | | void wrap_fn_scale(const cffmpeg h, const int wid, const int hei, const int flags){ |
| | | fn_scale(h, wid, hei, flags); |
| | | } |
| | | |
| | | void wrap_fn_run_gb28181(const cffmpeg h){ |
| | | fn_gb28181(h); |
| | | } |
| | |
| | | fn_decoder(h); |
| | | } |
| | | |
| | | void* wrap_fn_decoder_pic(const cffmpeg h, int* wid, int* hei, int64_t *id){ |
| | | return fn_decoder_pic(h, wid, hei, id); |
| | | void* wrap_fn_decoder_pic(const cffmpeg h, int *wid, int *hei, int *format, int *length, int64_t *id){ |
| | | return fn_decoder_pic(h, wid, hei, format, length, id); |
| | | } |
| | | |
| | | void* wrap_fn_get_avpacket(const cffmpeg h, int* size, int* key){ |
| | |
| | | // 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); |
| | | } |
| | | |
| | | void* wran_fn_gpu_conv(void *in, const int w, const int h, const int dst_w, const int dst_h, int *length){ |
| | | return fn_gpu_conv(in, w, h, dst_w, dst_h, length); |
| | | } |
| | | |
| | | // for encoder |
| | |
| | | *key = 0; |
| | | return NULL; |
| | | } |
| | | |
| | | // for conv |
| | | cconv wrap_fn_create_conv(const int srcW, const int srcH, const int srcFormat, |
| | | const int dstW, const int dstH, const int flag){ |
| | | return fn_create_conv(srcW, srcH, srcFormat, dstW, dstH, flag); |
| | | } |
| | | |
| | | void wrap_fn_destroy_conv(const cconv h){ |
| | | fn_destroy_conv(h); |
| | | } |
| | | void* wrap_fn_conv(const cconv h, uint8_t *in){ |
| | | return fn_conv(h, in); |
| | | } |