From a97b6c212920c2d14f506169ef0cdea27112c8c1 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期六, 09 三月 2019 18:24:44 +0800
Subject: [PATCH] 解决按国标或本地类型获取camera设备

---
 QiaoJiaSystem/VideoAnalysFromHC/RtspAnalysElement.cpp  |    2 +-
 QiaoJiaSystem/VideoToImage/CMakeLists.txt              |    2 +-
 QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp |    5 ++++-
 QiaoJiaSystem/VideoToImageMulth/RtspAnalysManager.cpp  |    2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp b/QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp
index 859ddd8..81d4fa7 100644
--- a/QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp
+++ b/QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp
@@ -198,12 +198,15 @@
 #ifdef TestCode
         ClockTimer Test("while time");
 #endif
+        av_packet_unref(&p_this->pkt);
+        p_this->pkt.data = NULL;
+        p_this->pkt.size = 0;
+
         int err5 = av_read_frame(p_this->ic, &p_this->pkt);
         //# todo save package
         p_this->frame_number++;
 
         int err6 = avcodec_send_packet(p_this->ctx, &p_this->pkt);
-//        av_packet_unref(&pkt);
         int err7 = avcodec_receive_frame(p_this->ctx, p_this->frame);
         if ((err7 == AVERROR(EAGAIN)) || (err5 < 0) || (err6 < 0)) {
             ERR(" error << err7:" << err7 << "  err5: " << err5 << " err6: " << err6);
diff --git a/QiaoJiaSystem/VideoAnalysFromHC/RtspAnalysElement.cpp b/QiaoJiaSystem/VideoAnalysFromHC/RtspAnalysElement.cpp
index be430a9..e850153 100644
--- a/QiaoJiaSystem/VideoAnalysFromHC/RtspAnalysElement.cpp
+++ b/QiaoJiaSystem/VideoAnalysFromHC/RtspAnalysElement.cpp
@@ -117,7 +117,7 @@
 
     } else {
 
-        auto lst = m_lDBTool->searchCamDevTableAll();
+        auto lst = m_lDBTool->searchCamDevTableByType(0);
 
         appPref.setIntData("n_cut_max_duration", lst_dev.n_cut_max_duration);
         appPref.setIntData("n_cut_min_duration", lst_dev.n_cut_min_duration);
diff --git a/QiaoJiaSystem/VideoToImage/CMakeLists.txt b/QiaoJiaSystem/VideoToImage/CMakeLists.txt
index 1fe405c..6ca2f70 100644
--- a/QiaoJiaSystem/VideoToImage/CMakeLists.txt
+++ b/QiaoJiaSystem/VideoToImage/CMakeLists.txt
@@ -68,7 +68,7 @@
     /usr/include/x86_64-linux-gnu/qt5/QtCore/
     /usr/include/x86_64-linux-gnu/qt5/QtSql/
 
-    ../../BasicPlatForm/libs/hiredis-master/include
+    ../../../BasicPlatForm/libs/hiredis-master/include
     ../../../BasicPlatForm/basic/timer_counter/
 )
 
diff --git a/QiaoJiaSystem/VideoToImageMulth/RtspAnalysManager.cpp b/QiaoJiaSystem/VideoToImageMulth/RtspAnalysManager.cpp
index 1959a8a..dc1cf0a 100644
--- a/QiaoJiaSystem/VideoToImageMulth/RtspAnalysManager.cpp
+++ b/QiaoJiaSystem/VideoToImageMulth/RtspAnalysManager.cpp
@@ -65,7 +65,7 @@
         }
 
     } else {
-        auto lst = m_lDBTool->searchCamDevTableAll();
+        auto lst = m_lDBTool->searchCamDevTableByType(0);
         Record_Config lst_dev = m_lDBTool->searchConfigTableWithinServerInfo();
 
         //璁剧疆瑙嗛鐨勬渶闀垮拰鏈�鐭椂闂撮棿闅�

--
Gitblit v1.8.0