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

---
 RtspFace/PL_AndroidMediaCodecDecoder_ndk.cpp |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/RtspFace/PL_AndroidMediaCodecDecoder_ndk.cpp b/RtspFace/PL_AndroidMediaCodecDecoder_ndk.cpp
index c7e624e..79a8a46 100644
--- a/RtspFace/PL_AndroidMediaCodecDecoder_ndk.cpp
+++ b/RtspFace/PL_AndroidMediaCodecDecoder_ndk.cpp
@@ -38,12 +38,15 @@
 
 	AMediaCodec* codec;
 
+	bool auxIsSet;
+
 	PL_AMCD_Internal() : 
 		buffSize(0), buffSizeMax(sizeof(buffer)), 
 		inputFrameCount(0), lastOutputBuffIdx(-1), 
 		lastMbfBuffIdx(), lastMbfBuffer(),
 		config(), 
-		codec(nullptr)
+		codec(nullptr),
+		auxIsSet(false)
 	{
 	}
 	
@@ -193,7 +196,21 @@
 	
 	if (pm.buffer == nullptr)
 		return false;
-	
+
+	if (!in->auxIsSet)
+	{
+		//#todo
+		// find PLGP_DEC_SPS_B64 PLGP_DEC_PPS_B64 in this->manager else nothing
+		// base64 decode
+
+		//AMediaFormat* format = AMediaCodec_getOutputFormat(in->codec);
+		//AMediaFormat_setBuffer(format, "csd-1", pps, sizeof(pps)); // pps
+		//AMediaCodec_setParameters
+		// #todo delete format
+
+		in->auxIsSet = true;
+	}
+
 	MB_Frame* frame = (MB_Frame*)pm.buffer;
 	if (frame->type != MB_Frame::MBFT_H264_NALU)
 	{

--
Gitblit v1.8.0