aboutsummaryrefslogtreecommitdiffstats
path: root/videocodec/OMXVideoDecoderBase.cpp
diff options
context:
space:
mode:
authorYu, Linda <linda.yu@intel.com>2013-10-24 12:22:22 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 22:02:54 -0700
commitc6439c546556e18f0b9ccb760109cb362d05658c (patch)
tree9fd85c7626e5b3b7b74b3e2fd0a2148bc07a247a /videocodec/OMXVideoDecoderBase.cpp
parentf6e051517175c02fb493a6a75e7d92a328df6e91 (diff)
downloadandroid_hardware_intel_common_omx-components-c6439c546556e18f0b9ccb760109cb362d05658c.tar.gz
android_hardware_intel_common_omx-components-c6439c546556e18f0b9ccb760109cb362d05658c.tar.bz2
android_hardware_intel_common_omx-components-c6439c546556e18f0b9ccb760109cb362d05658c.zip
add set/get function for VPPBufferNum in OMX
BZ: 145717 1. add set/get function for VPPBufferNum in OMX 2. vpp buffer num should omit in decoder buffer comparison Change-Id: Id4bb404b4f001b1f27b72692a4ae1efc81db9531 Signed-off-by: Yu, Linda <linda.yu@intel.com>
Diffstat (limited to 'videocodec/OMXVideoDecoderBase.cpp')
-rwxr-xr-xvideocodec/OMXVideoDecoderBase.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp
index a4dbe63..7823c85 100755
--- a/videocodec/OMXVideoDecoderBase.cpp
+++ b/videocodec/OMXVideoDecoderBase.cpp
@@ -29,6 +29,9 @@ OMXVideoDecoderBase::OMXVideoDecoderBase()
mNativeBufferCount(OUTPORT_NATIVE_BUFFER_COUNT),
mOMXBufferHeaderTypePtrNum(0),
mRotationDegrees(0),
+#ifdef TARGET_HAS_VPP
+ mVppBufferNum(0),
+#endif
mWorkingMode(RAWDATA_MODE) {
memset(&mGraphicBufferParam, 0, sizeof(mGraphicBufferParam));
}
@@ -216,6 +219,9 @@ OMX_ERRORTYPE OMXVideoDecoderBase::ProcessorDeinit(void) {
mOMXBufferHeaderTypePtrNum = 0;
memset(&mGraphicBufferParam, 0, sizeof(mGraphicBufferParam));
mRotationDegrees = 0;
+#ifdef TARGET_HAS_VPP
+ mVppBufferNum = 0;
+#endif
return OMXComponentCodecBase::ProcessorDeinit();
}
@@ -450,6 +456,9 @@ OMX_ERRORTYPE OMXVideoDecoderBase::PrepareConfigBuffer(VideoConfigBuffer *p) {
}
p->rotationDegrees = mRotationDegrees;
+#ifdef TARGET_HAS_VPP
+ p->vppBufferNum = mVppBufferNum;
+#endif
p->width = paramPortDefinitionInput->format.video.nFrameWidth;
p->height = paramPortDefinitionInput->format.video.nFrameHeight;
return OMX_ErrorNone;
@@ -580,7 +589,12 @@ OMX_ERRORTYPE OMXVideoDecoderBase::HandleFormatChange(void) {
int sliceHeightCropped = heightCropped;
int force_realloc = 0;
+#ifdef TARGET_HAS_VPP
+ LOGI("============== mVppBufferNum = %d\n", mVppBufferNum);
+ if (paramPortDefinitionOutput.nBufferCountActual - mVppBufferNum < formatInfo->actualBufferNeeded) {
+#else
if (paramPortDefinitionOutput.nBufferCountActual < formatInfo->actualBufferNeeded) {
+#endif
if (mWorkingMode == GRAPHICBUFFER_MODE) {
LOGV("output port buffer number is not enough: %d to %d",
paramPortDefinitionOutput.nBufferCountActual,
@@ -700,6 +714,9 @@ OMX_ERRORTYPE OMXVideoDecoderBase::BuildHandlerList(void) {
AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtUseNativeBuffer), GetNativeBuffer, SetNativeBuffer);
AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtEnableNativeBuffer), GetNativeBufferMode, SetNativeBufferMode);
AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtRotationDegrees), GetDecoderRotation, SetDecoderRotation);
+#ifdef TARGET_HAS_VPP
+ AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtVppBufferNum), GetDecoderVppBufferNum, SetDecoderVppBufferNum);
+#endif
AddHandler(OMX_IndexConfigCommonOutputCrop, GetDecoderOutputCrop, SetDecoderOutputCrop);
return OMX_ErrorNone;
@@ -832,6 +849,21 @@ OMX_ERRORTYPE OMXVideoDecoderBase::SetDecoderRotation(OMX_PTR pStructure) {
return OMX_ErrorBadParameter;
}
+#ifdef TARGET_HAS_VPP
+OMX_ERRORTYPE OMXVideoDecoderBase::GetDecoderVppBufferNum(OMX_PTR pStructure) {
+ return OMX_ErrorBadParameter;
+}
+OMX_ERRORTYPE OMXVideoDecoderBase::SetDecoderVppBufferNum(OMX_PTR pStructure) {
+ CHECK_SET_PARAM_STATE();
+ int32_t num = 0;
+
+ num = *(static_cast<int32_t*>(pStructure));
+ mVppBufferNum = num;
+
+ return OMX_ErrorNone;
+}
+#endif
+
OMX_ERRORTYPE OMXVideoDecoderBase::GetDecoderOutputCrop(OMX_PTR pStructure) {
OMX_ERRORTYPE ret;