diff options
author | Arun Menon <avmenon@codeaurora.org> | 2015-12-16 12:05:00 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-01-06 11:20:24 -0800 |
commit | 889598543966665356be02cb378e318efc286b6d (patch) | |
tree | a9d05cfc18acc6052ea1b00c70d89ed0cde14083 | |
parent | 675af75e516e59e5e8a6e7924bfcde9ae340e5c0 (diff) | |
download | android_hardware_qcom_media-889598543966665356be02cb378e318efc286b6d.tar.gz android_hardware_qcom_media-889598543966665356be02cb378e318efc286b6d.tar.bz2 android_hardware_qcom_media-889598543966665356be02cb378e318efc286b6d.zip |
mm-video-v4l2: vidc: vdec: Add property to disable UBWC for OPB
The default mode for OPB is UBWC mode, if OMX Client wants to
explicitly disable UBWC mode then it should set the following
property OMX_QTIIndexParamForceUnCompressedForOPB.
Change-Id: I7f8364f8b5ec60fca57bb8717b1af8c50a935f73
-rw-r--r-- | mm-core/inc/OMX_QCOMExtns.h | 17 | ||||
-rw-r--r-- | mm-video-v4l2/vidc/vdec/inc/omx_vdec.h | 6 | ||||
-rw-r--r-- | mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 18 |
3 files changed, 36 insertions, 5 deletions
diff --git a/mm-core/inc/OMX_QCOMExtns.h b/mm-core/inc/OMX_QCOMExtns.h index efe8cf48..8eb50a23 100644 --- a/mm-core/inc/OMX_QCOMExtns.h +++ b/mm-core/inc/OMX_QCOMExtns.h @@ -547,6 +547,9 @@ enum OMX_QCOM_EXTN_INDEXTYPE /* Configure ROI info */ OMX_QTIIndexConfigVideoRoiInfo = 0x7F000059, + + /* Force OPB to UnCompressed mode */ + OMX_QTIIndexParamForceUnCompressedForOPB = 0x7F00005A, }; /** @@ -1089,6 +1092,20 @@ typedef struct OMX_QTI_VIDEO_PARAM_FORCE_COMPRESSED_FOR_DPB_TYPE { OMX_BOOL bEnable; /** Enable/disable the setting */ } OMX_QTI_VIDEO_PARAM_FORCE_COMPRESSED_FOR_DPB_TYPE; +/** + * This structure describes the parameters corresponding + * to OMX_QTIIndexParamForceUnCompressedForOPB extension. Enabling this + * extension will force the OPB to be linear for the current video session. + * If this property is not set, then the OPB will be set to linear or compressed + * based on resolution selected and/or if cpu access is requested on the + * OPB buffer. + */ +typedef struct OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE { + OMX_U32 nSize; /** Sizeo f the structure in bytes */ + OMX_VERSIONTYPE nVersion; /** OMX specification version information */ + OMX_BOOL bEnable; /** Enable/disable the setting */ +} OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE; + typedef struct OMX_VENDOR_EXTRADATATYPE { OMX_U32 nPortIndex; OMX_U32 nDataSize; diff --git a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h index a0305454..2478338a 100644 --- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h +++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h @@ -982,7 +982,7 @@ class omx_vdec: public qc_omx_component OMX_ERRORTYPE enable_smoothstreaming(); OMX_ERRORTYPE enable_adaptive_playback(unsigned long width, unsigned long height); bool is_thulium_v1; - static bool m_disable_ubwc_mode; + bool m_disable_ubwc_mode; OMX_U32 m_downscalar_width; OMX_U32 m_downscalar_height; int decide_downscalar(); @@ -1125,11 +1125,11 @@ class omx_vdec: public qc_omx_component formatsNonSurfaceMode[index] : OMX_COLOR_FormatMax; } - static OMX_COLOR_FORMATTYPE getPreferredColorFormatDefaultMode(OMX_U32 index) { + OMX_COLOR_FORMATTYPE getPreferredColorFormatDefaultMode(OMX_U32 index) { //for surface mode (normal playback), advertise native/accelerated formats first OMX_COLOR_FORMATTYPE format = (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m; - if (!omx_vdec::m_disable_ubwc_mode) { + if (!m_disable_ubwc_mode) { OMX_COLOR_FORMATTYPE formatsDefault[] = { [0] = (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed, [1] = (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m, diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp index b33a7651..9922ec69 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -149,8 +149,6 @@ extern "C" { static OMX_U32 maxSmoothStreamingWidth = 1920; static OMX_U32 maxSmoothStreamingHeight = 1088; -bool omx_vdec::m_disable_ubwc_mode; - void* async_message_thread (void *input) { OMX_BUFFERHEADERTYPE *buffer; @@ -4746,6 +4744,20 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp, m_force_compressed_for_dpb = pParam->bEnable; break; } + case OMX_QTIIndexParamForceUnCompressedForOPB: + { + DEBUG_PRINT_LOW("set_parameter: OMX_QTIIndexParamForceUnCompressedForOPB"); + OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE *pParam = + (OMX_QTI_VIDEO_PARAM_FORCE_UNCOMPRESSED_FOR_OPB_TYPE *)paramData; + if (!paramData) { + DEBUG_PRINT_ERROR("set_parameter: OMX_QTIIndexParamForceUnCompressedForOPB paramData is NULL"); + eRet = OMX_ErrorBadParameter; + break; + } + m_disable_ubwc_mode = pParam->bEnable; + DEBUG_PRINT_LOW("set_parameter: UBWC %s for OPB", pParam->bEnable ? "disabled" : "enabled"); + break; + } default: { @@ -5274,6 +5286,8 @@ OMX_ERRORTYPE omx_vdec::get_extension_index(OMX_IN OMX_HANDLETYPE hComp, *indexType = (OMX_INDEXTYPE)OMX_QTIIndexParamPassInputBufferFd; } else if (extn_equals(paramName, "OMX.QTI.index.param.video.ForceCompressedForDPB")) { *indexType = (OMX_INDEXTYPE)OMX_QTIIndexParamForceCompressedForDPB; + } else if (extn_equals(paramName, "OMX.QTI.index.param.video.ForceUnCompressedForOPB")) { + *indexType = (OMX_INDEXTYPE)OMX_QTIIndexParamForceUnCompressedForOPB; } else { DEBUG_PRINT_ERROR("Extension: %s not implemented", paramName); return OMX_ErrorNotImplemented; |