From 2ec7bb8c87f1598ba390f99d01fea059c02a966a Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期四, 25 七月 2019 17:41:51 +0800
Subject: [PATCH] update

---
 csrc/cffmpeg.cpp |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/csrc/cffmpeg.cpp b/csrc/cffmpeg.cpp
index e083e8b..423ef01 100644
--- a/csrc/cffmpeg.cpp
+++ b/csrc/cffmpeg.cpp
@@ -36,6 +36,17 @@
     s->ScalePicture(wid, hei, flags);
 }
 
+void c_ffmpeg_run_gb28181(const cffmpeg h){
+    Wrapper *s = (Wrapper*)h;
+    s->UseGB28181();
+}
+
+void c_ffmepg_use_cpu(const cffmpeg h){
+    Wrapper *s = (Wrapper*)h;
+    s->UseCPU();
+}
+
+
 //////passive api
 void c_ffmpeg_build_recorder(const cffmpeg h, const char *dir, int mind, int maxd){
     Wrapper *s = (Wrapper*)h;
@@ -75,6 +86,13 @@
     s->GetPicDecoder(&data, wid, hei);
     return data;
 }
+
+void* c_ffmpeg_get_avpacket(const cffmpeg h, int *size, int *key){
+    Wrapper *s = (Wrapper*)h;
+    unsigned char *data = NULL;
+    s->GetPacket(&data, size, key);
+    return data;
+}
 /////////////////////active api
 void c_ffmpeg_active_recorder(const cffmpeg h, const char *dir, int mind, int maxd, 
                                     rec_func fn){
@@ -101,4 +119,17 @@
         *wid = *hei = 0;
     }
     return p;
-}
\ No newline at end of file
+}
+
+// pic encoder
+void *c_ffmpeg_create_encoder(const int w, const int h, const int fps, const int br, const int scale_flag, const int gi){
+    return CreateEncoder(w, h, fps, br, scale_flag, gi);
+}
+
+void c_ffmpeg_destroy_encoder(void *h){
+    DestroyEncoder(h);
+}
+
+int c_ffmpeg_encode(void *hdl, uint8_t *in, const int w, const int h, uint8_t **out, int *size, int *key){
+    return Encode(hdl, in, w, h, out, size, key);
+}

--
Gitblit v1.8.0