if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) &&
(nPortIndex == INPUT_PORT_INDEX)) {
mem_type = SECURE_MEMORY;
+ } else if (pExynosPort->bNeedContigMem == OMX_TRUE) {
+ mem_type = CONTIG_MEMORY;
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pExynosPort->bufferProcessType & BUFFER_SHARE)) {
mem_type = NORMAL_MEMORY;
}
break;
#endif
+ case OMX_IndexVendorNeedContigMemory:
+ {
+ EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE *pPortMemType = (EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE *)ComponentParameterStructure;
+ OMX_U32 nPortIndex = pPortMemType->nPortIndex;
+ EXYNOS_OMX_BASEPORT *pExynosPort;
+
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
+ ret = OMX_ErrorBadPortIndex;
+ goto EXIT;
+ }
+
+ ret = Exynos_OMX_Check_SizeVersion(pPortMemType, sizeof(EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE));
+ if (ret != OMX_ErrorNone)
+ goto EXIT;
+
+ pExynosPort = &pExynosComponent->pExynosPort[nPortIndex];
+
+ pPortMemType->bNeedContigMem = pExynosPort->bNeedContigMem;
+ }
+ break;
default:
{
ret = Exynos_OMX_GetParameter(hComponent, nParamIndex, ComponentParameterStructure);
}
break;
#endif
+ case OMX_IndexVendorNeedContigMemory:
+ {
+ EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE *pPortMemType = (EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE *)ComponentParameterStructure;
+ OMX_U32 nPortIndex = pPortMemType->nPortIndex;
+ EXYNOS_OMX_BASEPORT *pExynosPort;
+
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
+ ret = OMX_ErrorBadPortIndex;
+ goto EXIT;
+ }
+
+ ret = Exynos_OMX_Check_SizeVersion(pPortMemType, sizeof(EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE));
+ if (ret != OMX_ErrorNone)
+ goto EXIT;
+
+ pExynosPort = &pExynosComponent->pExynosPort[nPortIndex];
+
+ if ((pExynosComponent->currentState != OMX_StateLoaded) && (pExynosComponent->currentState != OMX_StateWaitForResources)) {
+ if (pExynosPort->portDefinition.bEnabled == OMX_TRUE) {
+ ret = OMX_ErrorIncorrectStateOperation;
+ goto EXIT;
+ }
+ }
+
+ pExynosPort->bNeedContigMem = pPortMemType->bNeedContigMem;
+ }
+ break;
default:
{
ret = Exynos_OMX_SetParameter(hComponent, nIndex, ComponentParameterStructure);
goto EXIT;
}
+ if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_NEED_CONTIG_MEMORY) == 0) {
+ *pIndexType = (OMX_INDEXTYPE) OMX_IndexVendorNeedContigMemory;
+ ret = OMX_ErrorNone;
+ goto EXIT;
+ }
+
#ifdef USE_ANB
if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_ANB) == 0)
*pIndexType = (OMX_INDEXTYPE) OMX_IndexParamEnableAndroidBuffers;
goto EXIT;
}
- if ((nPortIndex == INPUT_PORT_INDEX) &&
+ if (pExynosPort->bNeedContigMem == OMX_TRUE) {
+ eMemType = CONTIG_MEMORY;
+ } else if ((nPortIndex == INPUT_PORT_INDEX) &&
(pExynosPort->bufferProcessType & BUFFER_SHARE)) {
eMemType = NORMAL_MEMORY;
}
pPortDef->nBufferSize = MAX_INPUT_METADATA_BUFFER_SIZE;
}
#endif
+ }
+ break;
+ case OMX_IndexVendorNeedContigMemory:
+ {
+ EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE *pPortMemType = (EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE *)pComponentParameterStructure;
+ OMX_U32 nPortIndex = pPortMemType->nPortIndex;
+ EXYNOS_OMX_BASEPORT *pExynosPort;
+
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
+ ret = OMX_ErrorBadPortIndex;
+ goto EXIT;
+ }
+
+ ret = Exynos_OMX_Check_SizeVersion(pPortMemType, sizeof(EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE));
+ if (ret != OMX_ErrorNone)
+ goto EXIT;
+
+ pExynosPort = &pExynosComponent->pExynosPort[nPortIndex];
+
+ pPortMemType->bNeedContigMem = pExynosPort->bNeedContigMem;
}
break;
default:
}
break;
#endif
+ case OMX_IndexVendorNeedContigMemory:
+ {
+ EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE *pPortMemType = (EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE *)pComponentParameterStructure;
+ OMX_U32 nPortIndex = pPortMemType->nPortIndex;
+ EXYNOS_OMX_BASEPORT *pExynosPort;
+
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
+ ret = OMX_ErrorBadPortIndex;
+ goto EXIT;
+ }
+
+ ret = Exynos_OMX_Check_SizeVersion(pPortMemType, sizeof(EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE));
+ if (ret != OMX_ErrorNone)
+ goto EXIT;
+
+ pExynosPort = &pExynosComponent->pExynosPort[nPortIndex];
+
+ if ((pExynosComponent->currentState != OMX_StateLoaded) && (pExynosComponent->currentState != OMX_StateWaitForResources)) {
+ if (pExynosPort->portDefinition.bEnabled == OMX_TRUE) {
+ ret = OMX_ErrorIncorrectStateOperation;
+ goto EXIT;
+ }
+ }
+
+ pExynosPort->bNeedContigMem = pPortMemType->bNeedContigMem;
+ }
+ break;
default:
{
ret = Exynos_OMX_SetParameter(hComponent, nParamIndex, pComponentParameterStructure);
goto EXIT;
}
+ if (Exynos_OSAL_Strcmp(szParamName, EXYNOS_INDEX_PARAM_NEED_CONTIG_MEMORY) == 0) {
+ *pIndexType = (OMX_INDEXTYPE) OMX_IndexVendorNeedContigMemory;
+ ret = OMX_ErrorNone;
+ goto EXIT;
+ }
+
#ifdef USE_STOREMETADATA
if (Exynos_OSAL_Strcmp(szParamName, EXYNOS_INDEX_PARAM_STORE_METADATA_BUFFER) == 0) {
*pIndexType = (OMX_INDEXTYPE)OMX_IndexParamStoreMetaDataBuffer;
OMX_U32 nGroupID;
} EXYNOS_OMX_PRIORITYMGMTTYPE;
+typedef struct _EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bNeedContigMem;
+} EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE;
+
typedef enum _EXYNOS_OMX_INDEXTYPE
{
#define EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL "OMX.SEC.index.ThumbnailMode"
#define EXYNOS_INDEX_PARAM_GET_S3D "OMX.SEC.index.S3DMode"
OMX_IndexVendorS3DMode = 0x7F000003,
#endif
+#define EXYNOS_INDEX_PARAM_NEED_CONTIG_MEMORY "OMX.SEC.index.NeedContigMemory"
+ OMX_IndexVendorNeedContigMemory = 0x7F000004,
/* for Android Native Window */
#define EXYNOS_INDEX_PARAM_ENABLE_ANB "OMX.google.android.index.enableAndroidNativeBuffers"