From 6faf88ba05f174a80c68f01c0412cae9789dbc8c Mon Sep 17 00:00:00 2001
From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期四, 17 八月 2017 17:55:01 +0800
Subject: [PATCH] aaaaa

---
 RtspFace/PL_RTSPClient.cpp |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/RtspFace/PL_RTSPClient.cpp b/RtspFace/PL_RTSPClient.cpp
index 7bcf9d9..df36683 100644
--- a/RtspFace/PL_RTSPClient.cpp
+++ b/RtspFace/PL_RTSPClient.cpp
@@ -219,6 +219,17 @@
 	pm.buffSize = 0;
 	pm.former = this;
 
+//	if(nullptr!=pm.buffer)
+//	{
+//		MB_Frame* frame = (MB_Frame*)pm.buffer;
+//		if (frame->type == MB_Frame::MBFT_H264_NALU)
+//		{
+//			static FILE *pFile = fopen("/data/bb1.264", "wb");
+//			fwrite(frame->buffer, sizeof(char), frame->buffSize, pFile);
+//			fflush(pFile);
+//		}
+//	}
+
 	return true;
 }
 
@@ -249,6 +260,19 @@
 	sprintf(tmp, "%u", param.height); client->manager->set_param(PLGP_RTSP_HEIGHT, std::string(tmp));
 	sprintf(tmp, "%u", param.fps); client->manager->set_param(PLGP_RTSP_FPS, std::string(tmp));
 
+	size_t _flag = 0;
+	if (param.fmtp.find_first_of(',') != std::string::npos)
+	{
+		//#todo
+		// split fmpt to base64 of sps,pps
+		// set to PLGP_DEC_SPS_B64 PLGP_DEC_PPS_B64
+		_flag = param.fmtp.find_first_of(',');
+		std::string _base64_sps = param.fmtp.substr(0,_flag);
+		std::string _base64_pps = param.fmtp.substr(_flag,param.fmtp.length());
+		client->manager->set_param(PLGP_DEC_SPS_B64,_base64_sps);
+		client->manager->set_param(PLGP_DEC_PPS_B64,_base64_pps);
+	}
+
 	/*
 	std::string fmtp(client->manager->get_param(PLGP_RTSP_FMTP));
 	if (fmtp.empty())

--
Gitblit v1.8.0