diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-01-03 12:39:32 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-01-03 12:39:32 +0700 |
commit | 04cf4e8deb9b71df1b32b490a2a6a2bc9836d66d (patch) | |
tree | 0cef07c13f7103a92ab7eff87e2dc46aaeae2076 /sec_mm/sec_omx | |
parent | 3c95db1c6cceff1bad0954a0a60dde4639c0ef00 (diff) | |
download | device_samsung_aries-common-04cf4e8deb9b71df1b32b490a2a6a2bc9836d66d.zip device_samsung_aries-common-04cf4e8deb9b71df1b32b490a2a6a2bc9836d66d.tar.gz device_samsung_aries-common-04cf4e8deb9b71df1b32b490a2a6a2bc9836d66d.tar.bz2 |
sec_mm: Disable HW decoding when TV-Out is enabled
Diffstat (limited to 'sec_mm/sec_omx')
4 files changed, 25 insertions, 0 deletions
diff --git a/sec_mm/sec_omx/sec_omx_component/video/dec/h264dec/SEC_OMX_H264dec.c b/sec_mm/sec_omx/sec_omx_component/video/dec/h264dec/SEC_OMX_H264dec.c index 07e1a89..32c5cf0 100644 --- a/sec_mm/sec_omx/sec_omx_component/video/dec/h264dec/SEC_OMX_H264dec.c +++ b/sec_mm/sec_omx/sec_omx_component/video/dec/h264dec/SEC_OMX_H264dec.c @@ -699,6 +699,14 @@ OMX_ERRORTYPE SEC_MFC_H264Dec_GetExtensionIndex( ret = OMX_ErrorNone; #ifdef USE_ANDROID_EXTENSION } else if (SEC_OSAL_Strcmp(cParameterName, SEC_INDEX_PARAM_ENABLE_ANB) == 0) { + if (isTvOutEnabled()) { + // Samsung normally pushes HW-decoded frames to the TV Out driver + // but it's hard for us to do that without source, so return an error + // and let Android fallback to software decoding + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } + *pIndexType = OMX_IndexParamEnableAndroidBuffers; ret = OMX_ErrorNone; } else if (SEC_OSAL_Strcmp(cParameterName, SEC_INDEX_PARAM_GET_ANB) == 0) { diff --git a/sec_mm/sec_omx/sec_omx_component/video/dec/mpeg4dec/SEC_OMX_Mpeg4dec.c b/sec_mm/sec_omx/sec_omx_component/video/dec/mpeg4dec/SEC_OMX_Mpeg4dec.c index 052a4c9..b9b29cc 100644 --- a/sec_mm/sec_omx/sec_omx_component/video/dec/mpeg4dec/SEC_OMX_Mpeg4dec.c +++ b/sec_mm/sec_omx/sec_omx_component/video/dec/mpeg4dec/SEC_OMX_Mpeg4dec.c @@ -836,6 +836,14 @@ OMX_ERRORTYPE SEC_MFC_Mpeg4Dec_GetExtensionIndex( ret = OMX_ErrorNone; #ifdef USE_ANDROID_EXTENSION } else if (SEC_OSAL_Strcmp(cParameterName, SEC_INDEX_PARAM_ENABLE_ANB) == 0) { + if (isTvOutEnabled()) { + // Samsung normally pushes HW-decoded frames to the TV Out driver + // but it's hard for us to do that without source, so return an error + // and let Android fallback to software decoding + ret = OMX_ErrorInsufficientResources; + goto EXIT; + } + *pIndexType = OMX_IndexParamEnableAndroidBuffers; ret = OMX_ErrorNone; } else if (SEC_OSAL_Strcmp(cParameterName, SEC_INDEX_PARAM_GET_ANB) == 0) { diff --git a/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.cpp b/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.cpp index 949fc19..65c5b4f 100644 --- a/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.cpp +++ b/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.cpp @@ -47,6 +47,7 @@ extern "C" { } #endif +#include <cutils/properties.h> #include <ui/android_native_buffer.h> #include <ui/GraphicBuffer.h> #include <ui/GraphicBufferMapper.h> @@ -447,4 +448,10 @@ EXIT: return ret; } +int isTvOutEnabled() { + char value[PROPERTY_VALUE_MAX]; + property_get("init.svc.tvouthack", value, ""); + return (strcmp(value, "running") == 0); +} + #endif diff --git a/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.h b/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.h index da7e8f3..4ab32a3 100644 --- a/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.h +++ b/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.h @@ -56,6 +56,8 @@ OMX_ERRORTYPE enableStoreMetaDataInBuffers(OMX_HANDLETYPE hComponent, OMX_PTR Co OMX_BOOL isMetadataBufferTypeGrallocSource(OMX_BYTE pInputDataBuffer);
OMX_ERRORTYPE preprocessMetaDataInBuffers(OMX_HANDLETYPE hComponent, OMX_BYTE pInputDataBuffer, BUFFER_ADDRESS_INFO *pInputInfo);
+int isTvOutEnabled();
+
#ifdef __cplusplus
}
#endif
|