From b7c7b479c278e74955a1a0a6c949a4d3cf32903a Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期二, 16 七月 2019 17:32:07 +0800 Subject: [PATCH] add encoder --- libcffmpeg.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/libcffmpeg.h b/libcffmpeg.h index ee54ead..16cb761 100644 --- a/libcffmpeg.h +++ b/libcffmpeg.h @@ -56,6 +56,22 @@ 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); + +// for encoder +typedef void* cencoder; + +typedef cencoder (*lib_cffmpeg_create_encoder)(const int w, const int h, const int fps, const int br, const int scale_flag, const int gi); +typedef void (*lib_cffmpeg_destroy_encoder)(cencoder h); +typedef int (*lib_cffmpeg_encode)(cencoder hdl, uint8_t *in, const int w, const int h, uint8_t **out, int *size, int *key); + +static lib_cffmpeg_create_encoder fn_create_encoder = NULL; +static lib_cffmpeg_destroy_encoder fn_destroy_encoder = NULL; +static lib_cffmpeg_encode fn_encode = NULL; + +cencoder wrap_fn_create_encoder(const int w, const int h, const int fps, const int br, const int scale_flag, const int gi); +void wrap_fn_destroy_encoder(const cencoder h); +void* wrap_fn_encode(cencoder hdl, void *in, const int w, const int h, int *out_size, int *key); + #ifdef __cplusplus } #endif -- Gitblit v1.8.0