aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuanjun Huang <yuanjun.huang@intel.com>2015-05-09 01:12:57 +0800
committerRonghua Wu <ronghuawu@google.com>2015-05-12 10:16:46 -0700
commit7579ae2fa6c1b95605f651892a1adfd6eed7c946 (patch)
treeb07f12e9b1173e6d764743c466fbfa06caa13b95
parent38f95570ed3065fffc256481b52990024c354df1 (diff)
downloadandroid_hardware_intel_common_omx-components-7579ae2fa6c1b95605f651892a1adfd6eed7c946.tar.gz
android_hardware_intel_common_omx-components-7579ae2fa6c1b95605f651892a1adfd6eed7c946.tar.bz2
android_hardware_intel_common_omx-components-7579ae2fa6c1b95605f651892a1adfd6eed7c946.zip
omx-component:
a. Add support of OMX index - media codec priority config. config type is OMX_IndexConfigPriority. b. Add support of OMX index - media decoder operating rate. config type is OMX_IndexConfigOperatingRate. Bug: 20165525 Bug: 20165726 Change-Id: Ide80507f907b3ed78792f15fafdf19b0691ec786 Signed-off-by: Yuanjun Huang <yuanjun.huang@intel.com>
-rw-r--r--videocodec/OMXVideoDecoderBase.cpp38
-rw-r--r--videocodec/OMXVideoDecoderBase.h12
2 files changed, 50 insertions, 0 deletions
diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp
index 7d1d830..49c68f1 100644
--- a/videocodec/OMXVideoDecoderBase.cpp
+++ b/videocodec/OMXVideoDecoderBase.cpp
@@ -31,6 +31,8 @@ OMXVideoDecoderBase::OMXVideoDecoderBase()
#ifdef TARGET_HAS_ISV
mVppBufferNum(0),
#endif
+ mCodecPriority(1),
+ mOperatingRate(0),
mVideoDecoder(NULL),
mNativeBufferCount(OUTPORT_NATIVE_BUFFER_COUNT),
mWorkingMode(RAWDATA_MODE),
@@ -777,6 +779,8 @@ OMX_ERRORTYPE OMXVideoDecoderBase::BuildHandlerList(void) {
#endif
AddHandler(OMX_IndexConfigCommonOutputCrop, GetDecoderOutputCrop, SetDecoderOutputCrop);
AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtEnableErrorReport), GetErrorReportMode, SetErrorReportMode);
+ AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexConfigPriority), GetCodecPriority, SetCodecPriority);
+ AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexConfigOperatingRate), GetDecoderOperatingRate, SetDecoderOperatingRate);
return OMX_ErrorNone;
}
@@ -984,6 +988,40 @@ OMX_ERRORTYPE OMXVideoDecoderBase::GetDecoderOutputCrop(OMX_PTR pStructure) {
return this->GetDecoderOutputCropSpecific(pStructure);
}
+
+OMX_ERRORTYPE OMXVideoDecoderBase::SetCodecPriority(OMX_PTR pStructure) {
+ OMX_ERRORTYPE ret;
+ OMX_PARAM_U32TYPE *priorityParam = (OMX_PARAM_U32TYPE *)pStructure;
+ mCodecPriority = priorityParam->nU32;
+ return OMX_ErrorNone;
+}
+
+
+OMX_ERRORTYPE OMXVideoDecoderBase::GetCodecPriority(OMX_PTR pStructure) {
+ OMX_ERRORTYPE ret;
+ OMX_PARAM_U32TYPE *priorityParam = (OMX_PARAM_U32TYPE *)pStructure;
+ CHECK_TYPE_HEADER(priorityParam);
+ priorityParam->nU32 = mCodecPriority;
+ return OMX_ErrorNone;
+}
+
+
+OMX_ERRORTYPE OMXVideoDecoderBase::SetDecoderOperatingRate(OMX_PTR pStructure) {
+ OMX_ERRORTYPE ret;
+ OMX_PARAM_U32TYPE *operatingRateParam = (OMX_PARAM_U32TYPE *)pStructure;
+ CHECK_TYPE_HEADER(operatingRateParam);
+ mOperatingRate = operatingRateParam->nU32;
+ return OMX_ErrorNone;
+}
+
+OMX_ERRORTYPE OMXVideoDecoderBase::GetDecoderOperatingRate(OMX_PTR pStructure) {
+ OMX_ERRORTYPE ret;
+ OMX_PARAM_U32TYPE *operatingRateParam = (OMX_PARAM_U32TYPE *)pStructure;
+ CHECK_TYPE_HEADER(operatingRateParam);
+ operatingRateParam->nU32 = mOperatingRate;
+ return OMX_ErrorNone;
+}
+
OMX_ERRORTYPE OMXVideoDecoderBase::GetErrorReportMode(OMX_PTR) {
LOGE("GetErrorReportMode is not implemented");
return OMX_ErrorNotImplemented;
diff --git a/videocodec/OMXVideoDecoderBase.h b/videocodec/OMXVideoDecoderBase.h
index 48706b8..ee1cff3 100644
--- a/videocodec/OMXVideoDecoderBase.h
+++ b/videocodec/OMXVideoDecoderBase.h
@@ -84,6 +84,8 @@ protected:
DECLARE_HANDLER(OMXVideoDecoderBase, DecoderVppBufferNum);
#endif
DECLARE_HANDLER(OMXVideoDecoderBase, ErrorReportMode);
+ DECLARE_HANDLER(OMXVideoDecoderBase, CodecPriority);
+ DECLARE_HANDLER(OMXVideoDecoderBase, DecoderOperatingRate);
private:
enum {
@@ -111,6 +113,16 @@ private:
uint32_t mVppBufferNum;
#endif
+ // Codec priority. Higher value means lower priority
+ // Currently, only two levels are supported:
+ // 0: realtime priority - This will only be used by
+ // media playback, capture, and possibly by realtime
+ // communication scenarios if best effort performance is not suitable.
+ // 1: non-realtime priority (best effort). This is the default value.
+ uint32_t mCodecPriority;
+
+ uint32_t mOperatingRate;
+
protected:
IVideoDecoder *mVideoDecoder;
int mNativeBufferCount;