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

---
 RtspFace/PL_AndroidMediaCodecEncoder.h |  258 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 257 insertions(+), 1 deletions(-)

diff --git a/RtspFace/PL_AndroidMediaCodecEncoder.h b/RtspFace/PL_AndroidMediaCodecEncoder.h
index 90ec190..b2420f1 100644
--- a/RtspFace/PL_AndroidMediaCodecEncoder.h
+++ b/RtspFace/PL_AndroidMediaCodecEncoder.h
@@ -3,6 +3,259 @@
 
 #include "PipeLine.h"
 
+
+// copy from D:\Android\sdk\sources\android-25\android\media\MediaCodecInfo.java
+struct Android_CodecProfileLevel
+{
+	// typeof int
+	enum _OMX_VIDEO_AVCPROFILETYPE
+	{
+		// from OMX_VIDEO_AVCPROFILETYPE
+				AVCProfileBaseline = 0x01,
+		AVCProfileMain     = 0x02,
+		AVCProfileExtended = 0x04,
+		AVCProfileHigh     = 0x08,
+		AVCProfileHigh10   = 0x10,
+		AVCProfileHigh422  = 0x20,
+		AVCProfileHigh444  = 0x40
+	};
+
+
+	enum _OMX_VIDEO_AVCLEVELTYPE
+	{
+		// from OMX_VIDEO_AVCLEVELTYPE
+				AVCLevel1       = 0x01,
+		AVCLevel1b      = 0x02,
+		AVCLevel11      = 0x04,
+		AVCLevel12      = 0x08,
+		AVCLevel13      = 0x10,
+		AVCLevel2       = 0x20,
+		AVCLevel21      = 0x40,
+		AVCLevel22      = 0x80,
+		AVCLevel3       = 0x100,
+		AVCLevel31      = 0x200,
+		AVCLevel32      = 0x400,
+		AVCLevel4       = 0x800,
+		AVCLevel41      = 0x1000,
+		AVCLevel42      = 0x2000,
+		AVCLevel5       = 0x4000,
+		AVCLevel51      = 0x8000,
+		AVCLevel52      = 0x10000,
+	};
+
+	enum _OMX_VIDEO_H263PROFILETYPE
+	{
+		// from OMX_VIDEO_H263PROFILETYPE
+				H263ProfileBaseline             = 0x01,
+		H263ProfileH320Coding           = 0x02,
+		H263ProfileBackwardCompatible   = 0x04,
+		H263ProfileISWV2                = 0x08,
+		H263ProfileISWV3                = 0x10,
+		H263ProfileHighCompression      = 0x20,
+		H263ProfileInternet             = 0x40,
+		H263ProfileInterlace            = 0x80,
+		H263ProfileHighLatency          = 0x100
+	};
+
+	enum _OMX_VIDEO_H263LEVELTYPE
+	{
+		// from OMX_VIDEO_H263LEVELTYPE
+				H263Level10      = 0x01,
+		H263Level20      = 0x02,
+		H263Level30      = 0x04,
+		H263Level40      = 0x08,
+		H263Level45      = 0x10,
+		H263Level50      = 0x20,
+		H263Level60      = 0x40,
+		H263Level70      = 0x80
+	};
+
+	enum _OMX_VIDEO_MPEG4PROFILETYPE
+	{
+		// from OMX_VIDEO_MPEG4PROFILETYPE
+				MPEG4ProfileSimple              = 0x01,
+		MPEG4ProfileSimpleScalable      = 0x02,
+		MPEG4ProfileCore                = 0x04,
+		MPEG4ProfileMain                = 0x08,
+		MPEG4ProfileNbit                = 0x10,
+		MPEG4ProfileScalableTexture     = 0x20,
+		MPEG4ProfileSimpleFace          = 0x40,
+		MPEG4ProfileSimpleFBA           = 0x80,
+		MPEG4ProfileBasicAnimated       = 0x100,
+		MPEG4ProfileHybrid              = 0x200,
+		MPEG4ProfileAdvancedRealTime    = 0x400,
+		MPEG4ProfileCoreScalable        = 0x800,
+		MPEG4ProfileAdvancedCoding      = 0x1000,
+		MPEG4ProfileAdvancedCore        = 0x2000,
+		MPEG4ProfileAdvancedScalable    = 0x4000,
+		MPEG4ProfileAdvancedSimple      = 0x8000
+	};
+
+	enum _OMX_VIDEO_MPEG4LEVELTYPE
+	{
+		// from OMX_VIDEO_MPEG4LEVELTYPE
+				MPEG4Level0      = 0x01,
+		MPEG4Level0b     = 0x02,
+		MPEG4Level1      = 0x04,
+		MPEG4Level2      = 0x08,
+		MPEG4Level3      = 0x10,
+		MPEG4Level3b     = 0x18,
+		MPEG4Level4      = 0x20,
+		MPEG4Level4a     = 0x40,
+		MPEG4Level5      = 0x80,
+		MPEG4Level6      = 0x100
+	};
+
+	enum _OMX_VIDEO_MPEG2PROFILETYPE
+	{
+		// from OMX_VIDEO_MPEG2PROFILETYPE
+				MPEG2ProfileSimple              = 0x00,
+		MPEG2ProfileMain                = 0x01,
+		MPEG2Profile422                 = 0x02,
+		MPEG2ProfileSNR                 = 0x03,
+		MPEG2ProfileSpatial             = 0x04,
+		MPEG2ProfileHigh                = 0x05
+	};
+
+	enum _OMX_VIDEO_MPEG2LEVELTYPE
+	{
+		// from OMX_VIDEO_MPEG2LEVELTYPE
+				MPEG2LevelLL     = 0x00,
+		MPEG2LevelML     = 0x01,
+		MPEG2LevelH14    = 0x02,
+		MPEG2LevelHL     = 0x03,
+		MPEG2LevelHP     = 0x04
+	};
+
+	enum _OMX_AUDIO_AACPROFILETYPE
+	{
+		// from OMX_AUDIO_AACPROFILETYPE
+				AACObjectMain       = 1,
+		AACObjectLC         = 2,
+		AACObjectSSR        = 3,
+		AACObjectLTP        = 4,
+		AACObjectHE         = 5,
+		AACObjectScalable   = 6,
+		AACObjectERLC       = 17,
+		AACObjectLD         = 23,
+		AACObjectHE_PS      = 29,
+		AACObjectELD        = 39
+	};
+
+	enum _OMX_VIDEO_VP8LEVELTYPE
+	{
+		// from OMX_VIDEO_VP8LEVELTYPE
+				VP8Level_Version0 = 0x01,
+		VP8Level_Version1 = 0x02,
+		VP8Level_Version2 = 0x04,
+		VP8Level_Version3 = 0x08
+	};
+
+//	// from OMX_VIDEO_VP8PROFILETYPE
+//VP8ProfileMain = 0x01,
+//
+//	// from OMX_VIDEO_VP9PROFILETYPE
+//VP9Profile0 = 0x01,
+//VP9Profile1 = 0x02,
+//VP9Profile2 = 0x04,
+//VP9Profile3 = 0x08,
+//	// HDR profiles also support passing HDR metadata
+//VP9Profile2HDR = 0x1000,
+//VP9Profile3HDR = 0x2000,
+//
+//	// from OMX_VIDEO_VP9LEVELTYPE
+//VP9Level1  = 0x1,
+//VP9Level11 = 0x2,
+//VP9Level2  = 0x4,
+//VP9Level21 = 0x8,
+//VP9Level3  = 0x10,
+//VP9Level31 = 0x20,
+//VP9Level4  = 0x40,
+//VP9Level41 = 0x80,
+//VP9Level5  = 0x100,
+//VP9Level51 = 0x200,
+//VP9Level52 = 0x400,
+//VP9Level6  = 0x800,
+//VP9Level61 = 0x1000,
+//VP9Level62 = 0x2000,
+//
+//	// from OMX_VIDEO_HEVCPROFILETYPE
+//HEVCProfileMain        = 0x01,
+//HEVCProfileMain10      = 0x02,
+//HEVCProfileMain10HDR10 = 0x1000,
+//
+//	// from OMX_VIDEO_HEVCLEVELTYPE
+//HEVCMainTierLevel1  = 0x1,
+//HEVCHighTierLevel1  = 0x2,
+//HEVCMainTierLevel2  = 0x4,
+//HEVCHighTierLevel2  = 0x8,
+//HEVCMainTierLevel21 = 0x10,
+//HEVCHighTierLevel21 = 0x20,
+//HEVCMainTierLevel3  = 0x40,
+//HEVCHighTierLevel3  = 0x80,
+//HEVCMainTierLevel31 = 0x100,
+//HEVCHighTierLevel31 = 0x200,
+//HEVCMainTierLevel4  = 0x400,
+//HEVCHighTierLevel4  = 0x800,
+//HEVCMainTierLevel41 = 0x1000,
+//HEVCHighTierLevel41 = 0x2000,
+//HEVCMainTierLevel5  = 0x4000,
+//HEVCHighTierLevel5  = 0x8000,
+//HEVCMainTierLevel51 = 0x10000,
+//HEVCHighTierLevel51 = 0x20000,
+//HEVCMainTierLevel52 = 0x40000,
+//HEVCHighTierLevel52 = 0x80000,
+//HEVCMainTierLevel6  = 0x100000,
+//HEVCHighTierLevel6  = 0x200000,
+//HEVCMainTierLevel61 = 0x400000,
+//HEVCHighTierLevel61 = 0x800000,
+//HEVCMainTierLevel62 = 0x1000000,
+//HEVCHighTierLevel62 = 0x2000000,
+//
+//private static final int HEVCHighTierLevels =
+//			HEVCHighTierLevel1 | HEVCHighTierLevel2 | HEVCHighTierLevel21 | HEVCHighTierLevel3 |
+//			HEVCHighTierLevel31 | HEVCHighTierLevel4 | HEVCHighTierLevel41 | HEVCHighTierLevel5 |
+//			HEVCHighTierLevel51 | HEVCHighTierLevel52 | HEVCHighTierLevel6 | HEVCHighTierLevel61 |
+//			HEVCHighTierLevel62,
+//
+//	// from OMX_VIDEO_DOLBYVISIONPROFILETYPE
+//DolbyVisionProfileDvavPer = 0x1,
+//DolbyVisionProfileDvavPen = 0x2,
+//DolbyVisionProfileDvheDer = 0x4,
+//DolbyVisionProfileDvheDen = 0x8,
+//DolbyVisionProfileDvheDtr = 0x10,
+//DolbyVisionProfileDvheStn = 0x20,
+//DolbyVisionProfileDvheDth = 0x40,
+//DolbyVisionProfileDvheDtb = 0x80,
+//
+//	// from OMX_VIDEO_DOLBYVISIONLEVELTYPE
+//DolbyVisionLevelHd24    = 0x1,
+//DolbyVisionLevelHd30    = 0x2,
+//DolbyVisionLevelFhd24   = 0x4,
+//DolbyVisionLevelFhd30   = 0x8,
+//DolbyVisionLevelFhd60   = 0x10,
+//DolbyVisionLevelUhd24   = 0x20,
+//DolbyVisionLevelUhd30   = 0x40,
+//DolbyVisionLevelUhd48   = 0x80,
+//DolbyVisionLevelUhd60   = 0x100,
+
+
+	// Defined in the OpenMAX IL specs, depending on the type of media
+	// this can be OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE,
+	// OMX_VIDEO_MPEG4PROFILETYPE, OMX_VIDEO_VP8PROFILETYPE or OMX_VIDEO_VP9PROFILETYPE.
+	int profile;
+
+	// Defined in the OpenMAX IL specs, depending on the type of media
+	// this can be OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE // OMX_VIDEO_MPEG4LEVELTYPE, OMX_VIDEO_VP8LEVELTYPE or OMX_VIDEO_VP9LEVELTYPE.
+	//
+	// Note that VP9 decoder on platforms before {@link android.os.Build.VERSION_CODES#N} may
+	// not advertise a profile level support. For those VP9 decoders, please use
+	// {@link VideoCapabilities} to determine the codec capabilities.
+	int level;
+
+	Android_CodecProfileLevel() : profile(0), level(0) { }
+};
+
 struct PL_AndroidMediaCodecEncoder_Config
 {
 	// D:\adk\ndk-bundle\platforms\android-21\arch-arm64\usr\include\media\NdkMediaFormat.h
@@ -31,6 +284,8 @@
 	int32_t ak_width; // AMEDIAFORMAT_KEY_WIDTH;
 	// AMEDIAFORMAT_KEY_STRIDE;
 
+	Android_CodecProfileLevel codecProfileLevel;
+
 	PL_AndroidMediaCodecEncoder_Config() : 
 		ak_bit_rate(0), 
 		ak_color_format(0), 
@@ -38,7 +293,8 @@
 		ak_height(0), 
 		ak_i_frame_interval(0), 
 		ak_mime(),
-		ak_width(0)
+		ak_width(0),
+		codecProfileLevel()
 	{}
 };
 

--
Gitblit v1.8.0