From f6aa35eedbc76e7467a68dbe3aba63ec8cb352a5 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期五, 26 七月 2019 10:51:03 +0800
Subject: [PATCH] add log

---
 csrc/ffmpeg/format/FormatIn.cpp |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/csrc/ffmpeg/format/FormatIn.cpp b/csrc/ffmpeg/format/FormatIn.cpp
index d61fbc7..4df2c0f 100644
--- a/csrc/ffmpeg/format/FormatIn.cpp
+++ b/csrc/ffmpeg/format/FormatIn.cpp
@@ -21,7 +21,6 @@
 #include "../data/FrameData.hpp"
 
 #include "../../common/gpu/info.h"
-#include "PsToEs.hpp"
 
 using namespace logif;
 
@@ -34,6 +33,7 @@
 	,io_ctx_(NULL)
 	,read_io_buff_(NULL)
 	,read_io_buff_size_(32768)
+	,handle_gb28181(NULL)
 	{}
 
 	FormatIn::~FormatIn()
@@ -54,6 +54,9 @@
 				avcodec_close(dec_ctx_);
 				dec_ctx_ = NULL;
 			}
+		}
+		if (handle_gb28181){
+			delete handle_gb28181;
 		}
 	}
 
@@ -90,9 +93,14 @@
 	int FormatIn::openGb28181(const char *filename, AVDictionary **options){
 
 	    std::string fn = filename;
-		addCamera(fn);
+		//GB28181API gb28181(fn);
+		if (handle_gb28181){
+			delete handle_gb28181;
+		}
+		handle_gb28181 = new GB28181API;
+		handle_gb28181->addCamera(fn);
 
-        int ret = openWithCustomIO(NULL, readData, options);
+        int ret = openWithCustomIO((void *)&handle_gb28181, handle_gb28181->readData, options);
         if(ret < 0){
             logIt("do openWithCustomIO failed:%d",ret);
         }

--
Gitblit v1.8.0