shithub: openh264

Download patch

ref: ced6ca5fab2c7195755b2754ff218e46acea5b94
parent: f421aab6a3bc615d3d1d3e496aeccde7b947f86b
author: Karina <ruil2@cisco.com>
date: Fri Dec 23 06:09:17 EST 2016

add getting profile and level info in GetOption

--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -162,7 +162,8 @@
 
   DECODER_OPTION_GET_STATISTICS,        ///< feedback decoder statistics
   DECODER_OPTION_GET_SAR_INFO,          ///< feedback decoder Sample Aspect Ratio info in Vui
-
+  DECODER_OPTION_PROFILE,               ///< get current AU profile info, only is used in GetOption
+  DECODER_OPTION_LEVEL                  ///< get current AU level info,only is used in GetOption
 } DECODER_OPTION;
 
 /**
--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -425,6 +425,20 @@
       pVuiSarInfo->bOverscanAppropriateFlag = m_pDecContext->pSps->sVui.bOverscanAppropriateFlag;
       return cmResultSuccess;
     }
+  } else if (DECODER_OPTION_PROFILE == eOptID) {
+    if (!m_pDecContext->pSps) {
+      return cmInitExpected;
+    }
+    iVal = (int) m_pDecContext->pSps->uiProfileIdc;
+    * ((int*)pOption) = iVal;
+    return cmResultSuccess;
+  } else if (DECODER_OPTION_LEVEL == eOptID) {
+    if (!m_pDecContext->pSps) {
+      return cmInitExpected;
+    }
+    iVal = (int) m_pDecContext->pSps->uiLevelIdc;
+    * ((int*)pOption) = iVal;
+    return cmResultSuccess;
   }
 
   return cmInitParaError;