diff options
| author | xiao <fengx.xiao@intel.com> | 2012-02-28 11:50:10 +0800 |
|---|---|---|
| committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:02:46 -0700 |
| commit | f7313d45a85df2d51f084f2ec9992207428df27e (patch) | |
| tree | 3b0f08cb7c7c7d4034dca36c7d3b41d231610a67 | |
| parent | d01f11592baa374bf1c38ee2d57e42b9f3ddc28d (diff) | |
| download | android_hardware_intel_common_omx-components-f7313d45a85df2d51f084f2ec9992207428df27e.tar.gz android_hardware_intel_common_omx-components-f7313d45a85df2d51f084f2ec9992207428df27e.tar.bz2 android_hardware_intel_common_omx-components-f7313d45a85df2d51f084f2ec9992207428df27e.zip | |
Add video rotation parameter setting and getting method
BZ: 23620
Pass down video clip rotation to psb_video in order
to implement hw rotation feature
Change-Id: I1dd8218d12643920ff9cafc962feaee9678cad24
Signed-off-by: xiao <fengx.xiao@intel.com>
Reviewed-on: http://android.intel.com:8080/36818
Reviewed-by: Hu, Jason <jason.hu@intel.com>
Reviewed-by: Ding, Haitao <haitao.ding@intel.com>
Tested-by: Ding, Haitao <haitao.ding@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
| -rw-r--r-- | videocodec/OMXVideoDecoderBase.cpp | 27 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderBase.h | 2 |
2 files changed, 25 insertions, 4 deletions
diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp index 17b7a3c..56eca00 100644 --- a/videocodec/OMXVideoDecoderBase.cpp +++ b/videocodec/OMXVideoDecoderBase.cpp @@ -30,7 +30,8 @@ OMXVideoDecoderBase::OMXVideoDecoderBase() mNativeBufferCount(OUTPORT_NATIVE_BUFFER_COUNT), mOMXBufferHeaderTypePtrNum(0), mGraphicBuffercolorformat(0), - mGraphicBufferStride(0) { + mGraphicBufferStride(0), + mRotationDegrees(0) { } OMXVideoDecoderBase::~OMXVideoDecoderBase() { @@ -205,6 +206,7 @@ OMX_ERRORTYPE OMXVideoDecoderBase::ProcessorDeinit(void) { mOMXBufferHeaderTypePtrNum = 0; mGraphicBuffercolorformat = 0; mGraphicBufferStride = 0; + mRotationDegrees = 0; return OMXComponentCodecBase::ProcessorDeinit(); } @@ -402,6 +404,7 @@ OMX_ERRORTYPE OMXVideoDecoderBase::PrepareConfigBuffer(VideoConfigBuffer *p) { } } + p->rotationDegrees = mRotationDegrees; p->width = paramPortDefinitionInput->format.video.nFrameWidth; p->height = paramPortDefinitionInput->format.video.nFrameHeight; return OMX_ErrorNone; @@ -603,9 +606,10 @@ OMX_ERRORTYPE OMXVideoDecoderBase::BuildHandlerList(void) { OMXComponentCodecBase::BuildHandlerList(); AddHandler(OMX_IndexParamVideoPortFormat, GetParamVideoPortFormat, SetParamVideoPortFormat); //AddHandler(PV_OMX_COMPONENT_CAPABILITY_TYPE_INDEX, GetCapabilityFlags, SetCapabilityFlags); - AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtGetNativeBufferUsage),GetNativeBufferUsage,SetNativeBufferUsage); - AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtUseNativeBuffer),GetNativeBuffer,SetNativeBuffer); - AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtEnableNativeBuffer),GetNativeBufferMode,SetNativeBufferMode); + AddHandler(static_cast<OMX_INDEXTYPE>(OMX_IndexExtGetNativeBufferUsage), GetNativeBufferUsage, SetNativeBufferUsage); + 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); return OMX_ErrorNone; } @@ -707,6 +711,21 @@ OMX_ERRORTYPE OMXVideoDecoderBase::SetNativeBufferMode(OMX_PTR pStructure) { return OMX_ErrorNone; } +OMX_ERRORTYPE OMXVideoDecoderBase::GetDecoderRotation(OMX_PTR pStructure) { + OMX_ERRORTYPE ret; + return OMX_ErrorBadParameter; +} +OMX_ERRORTYPE OMXVideoDecoderBase::SetDecoderRotation(OMX_PTR pStructure) { + OMX_ERRORTYPE ret; + CHECK_SET_PARAM_STATE(); + int32_t rotationDegrees = 0; + + rotationDegrees = *(static_cast<int32_t*>(pStructure)); + mRotationDegrees = rotationDegrees; + + return OMX_ErrorNone; +} + OMX_ERRORTYPE OMXVideoDecoderBase::MapRawNV12(const VideoRenderBuffer* renderBuffer, OMX_U8 *rawData, OMX_U32& size) { VAStatus vaStatus; diff --git a/videocodec/OMXVideoDecoderBase.h b/videocodec/OMXVideoDecoderBase.h index 49449cc..18858fb 100644 --- a/videocodec/OMXVideoDecoderBase.h +++ b/videocodec/OMXVideoDecoderBase.h @@ -66,6 +66,7 @@ protected: DECLARE_HANDLER(OMXVideoDecoderBase, NativeBufferUsage); DECLARE_HANDLER(OMXVideoDecoderBase, NativeBuffer); DECLARE_HANDLER(OMXVideoDecoderBase, NativeBufferMode); + DECLARE_HANDLER(OMXVideoDecoderBase, DecoderRotation); private: enum { @@ -85,6 +86,7 @@ private: OMX_BUFFERHEADERTYPE *mOMXBufferHeaderTypePtrArray[MAX_GRAPHIC_NUM]; uint32_t mGraphicBufferStride; uint32_t mGraphicBuffercolorformat; + uint32_t mRotationDegrees; protected: IVideoDecoder *mVideoDecoder; |
