From 6f9d46539bce25828e3229db6cd9c0dbae1f3e11 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期日, 19 一月 2020 11:43:34 +0800 Subject: [PATCH] update ffmpeg --- csrc/cffmpeg.cpp | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/csrc/cffmpeg.cpp b/csrc/cffmpeg.cpp index 293df1d..fc92229 100644 --- a/csrc/cffmpeg.cpp +++ b/csrc/cffmpeg.cpp @@ -43,6 +43,18 @@ s->GB28181(); } +char * c_ffmpeg_get_gb28181_pic(const char *rtspUrl, int *retDataLen){ + char * retData = (char *)malloc(sizeof(char) * 3000000); + int flag = GetGb28181Pic(rtspUrl, retData, retDataLen); + if(flag == -1){ + free(retData); + *retDataLen = 0; + return NULL; + } + + return retData; +} + void c_ffmepg_use_cpu(const cffmpeg h){ Wrapper *s = (Wrapper*)h; s->CPUDec(); @@ -50,6 +62,10 @@ //////passive api +void c_ffmpeg_open_recorder(const cffmpeg h){ + Wrapper *s = (Wrapper*)h; + s->OpenRecorder(); +} void c_ffmpeg_set_record_duration(const cffmpeg h, const int min, const int max){ Wrapper *s = (Wrapper*)h; s->SetRecMinCacheTime(min); @@ -92,7 +108,7 @@ void c_ffmpeg_build_decoder(const cffmpeg h){ Wrapper *s = (Wrapper*)h; - s->BuildDecoder(); + s->OpenDecoder(); } void* c_ffmpeg_get_pic_decoder(const cffmpeg h, int *wid, int *hei, int *format, int *length, int64_t *id){ -- Gitblit v1.8.0