From 77513d0db1242f30821f94ae97e272055e5ae0bc Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期四, 23 二月 2017 17:02:25 +0800
Subject: [PATCH] 更新产品原型

---
 RtspFace/main.cpp |   92 +++++++++++++++++++++++----------------------
 1 files changed, 47 insertions(+), 45 deletions(-)

diff --git a/RtspFace/main.cpp b/RtspFace/main.cpp
index 8d2d693..bbedf4d 100644
--- a/RtspFace/main.cpp
+++ b/RtspFace/main.cpp
@@ -15,9 +15,11 @@
 
 #include "logger.h"
 
+Logger g_logger(stdout);
+
 int main(int argc, char** argv)
 {
-	initLogger(LV_DEBUG);
+	g_logger.set_level(VERBOSE);
 
 	PipeLine pipeLine;
 	
@@ -46,7 +48,7 @@
 		bool ret = rtspClient->init(&rtspConfig);
 		if (!ret)
 		{
-			LOG_ERROR << "rtspClient.init error";
+			LOG_ERROR << "rtspClient.init error" << std::endl;
 			exit(EXIT_FAILURE);
 		}
 	}
@@ -56,7 +58,7 @@
 		bool ret = h264Decoder->init(nullptr);
 		if (!ret)
 		{
-			LOG_ERROR << "PL_H264Decoder.init error";
+			LOG_ERROR << "PL_H264Decoder.init error" << std::endl;
 			exit(EXIT_FAILURE);
 		}
 	}
@@ -66,30 +68,30 @@
 		bool ret = avFrameYUV420->init(nullptr);
 		if (!ret)
 		{
-			LOG_ERROR << "PL_AVFrameYUV420.init error";
+			LOG_ERROR << "PL_AVFrameYUV420.init error" << std::endl;
 			exit(EXIT_FAILURE);
 		}
 	}
 	
-	//{
-	//	PL_Scale_Config config;
-	//	config.toWidth = 800;
-	//	config.toHeight = 600;
-	//	PL_Scale* ple = (PL_Scale*)pipeLine.push_elem("PL_Scale");
-	//	bool ret = ple->init(&config);
-	//	if (!ret)
-	//	{
-	//		LOG_ERROR << "PL_Scale.init error";
-	//		exit(EXIT_FAILURE);
-	//	}
-	//}
+	{
+		PL_Scale_Config config;
+		config.toWidth = 800;
+		config.toHeight = 600;
+		PL_Scale* ple = (PL_Scale*)pipeLine.push_elem("PL_Scale");
+		bool ret = ple->init(&config);
+		if (!ret)
+		{
+			LOG_ERROR << "PL_Scale.init error" << std::endl;
+			exit(EXIT_FAILURE);
+		}
+	}
 
-	//{
-	//	SensetimeFaceTrackConfig config;
-	//	//config.generate_face_feature = true;
-	//	PL_SensetimeFaceTrack* ple = (PL_SensetimeFaceTrack*)pipeLine.push_elem("PL_SensetimeFaceTrack");
-	//	ple->init(&config);
-	//}
+	{
+		SensetimeFaceTrackConfig config;
+		//config.generate_face_feature = true;
+		PL_SensetimeFaceTrack* ple = (PL_SensetimeFaceTrack*)pipeLine.push_elem("PL_SensetimeFaceTrack");
+		ple->init(&config);
+	}
 	
 	//PipeLine pipeLine2;
 	//{
@@ -119,36 +121,36 @@
 	//	bool ret = queue1->init(&config);
 	//	if (!ret)
 	//	{
-	//		LOG_ERROR << "queue1.init error";
+	//		LOG_ERROR << "queue1.init error" << std::endl;
 	//		exit(EXIT_FAILURE);
 	//	}
 	//}
 
-	//{
-	//	PL_H264Encoder_Config config;
-	//	PL_H264Encoder* h264Encoder = (PL_H264Encoder*)pipeLine.push_elem("PL_H264Encoder");
-	//	bool ret = h264Encoder->init(&config);
-	//	if (!ret)
-	//	{
-	//		LOG_ERROR << "PL_H264Encoder.init error";
-	//		exit(EXIT_FAILURE);
-	//	}
-	//}
-    //
-	//{
-	//	PL_RTSPServer* rtspServer = (PL_RTSPServer*)pipeLine.push_elem("PL_RTSPServer");
-	//	bool ret = rtspServer->init(nullptr);
-	//	if (!ret)
-	//	{
-	//		LOG_ERROR << "rtspServer.init error";
-	//		exit(EXIT_FAILURE);
-	//	}
-	//}
+	{
+		PL_H264Encoder_Config config;
+		PL_H264Encoder* h264Encoder = (PL_H264Encoder*)pipeLine.push_elem("PL_H264Encoder");
+		bool ret = h264Encoder->init(&config);
+		if (!ret)
+		{
+			LOG_ERROR << "PL_H264Encoder.init error" << std::endl;
+			exit(EXIT_FAILURE);
+		}
+	}
+    
+	{
+		PL_RTSPServer* rtspServer = (PL_RTSPServer*)pipeLine.push_elem("PL_RTSPServer");
+		bool ret = rtspServer->init(nullptr);
+		if (!ret)
+		{
+			LOG_ERROR << "rtspServer.init error" << std::endl;
+			exit(EXIT_FAILURE);
+		}
+	}
 	
 	while(true)
 	{
-		//LOG_ERROR << "begin pipe";
+		//LOG_ERROR << "begin pipe" << std::endl;
 		pipeLine.pipe();
-		//LOG_ERROR << "end pipe";
+		//LOG_ERROR << "end pipe" << std::endl;
 	}
 }

--
Gitblit v1.8.0