From a2d19baaa3996bc63edc042230074fb84a2433a1 Mon Sep 17 00:00:00 2001 From: chenshijun <csj_sky@126.com> Date: 星期二, 03 十二月 2019 19:57:03 +0800 Subject: [PATCH] 修改bug --- csrc/cffmpeg.cpp | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/csrc/cffmpeg.cpp b/csrc/cffmpeg.cpp index f42d753..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){ @@ -102,6 +118,11 @@ return data; } +void c_ffmpeg_close_stream(const cffmpeg h){ + Wrapper *s = (Wrapper*)h; + s->CloseStream(); +} + void* c_ffmpeg_get_avpacket(const cffmpeg h, int *size, int *key){ Wrapper *s = (Wrapper*)h; unsigned char *data = NULL; -- Gitblit v1.8.0