summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeungBeom Kim <sbcrux.kim@samsung.com>2011-09-01 09:10:55 +0900
committerJames Dong <jdong@google.com>2011-08-31 19:05:48 -0700
commitf38b9bd310db9fdb94940c4660f078ce367bbada (patch)
tree09afd019e3aef72f5525a5718037dc399365ef1f
parent6f37557f029f5b7c2801dee6944c1539bde9c89d (diff)
downloaddevice_samsung_crespo-f38b9bd310db9fdb94940c4660f078ce367bbada.zip
device_samsung_crespo-f38b9bd310db9fdb94940c4660f078ce367bbada.tar.gz
device_samsung_crespo-f38b9bd310db9fdb94940c4660f078ce367bbada.tar.bz2
Fix for surface texture encoder.
Add OMX_COLOR_FormatAndroidOpaque = 0x7F000789 Change-Id: I65c3b765ddabd18182d520992293a1ad917715fb Signed-off-by: SeungBeom Kim <sbcrux.kim@samsung.com>
-rw-r--r--sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c13
-rw-r--r--sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h4
-rw-r--r--sec_mm/sec_omx/sec_omx_include/sec/SEC_OMX_Def.h4
-rw-r--r--sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.cpp13
4 files changed, 25 insertions, 9 deletions
diff --git a/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c b/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c
index 87f5c3e..310064b 100644
--- a/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c
+++ b/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c
@@ -1088,7 +1088,7 @@ OMX_ERRORTYPE SEC_OMX_VideoEncodeGetParameter(
case supportFormat_0:
portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
portFormat->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
- portFormat->xFramerate = portDefinition->format.video.xFramerate;
+ portFormat->xFramerate = portDefinition->format.video.xFramerate;
break;
case supportFormat_1:
portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
@@ -1098,8 +1098,15 @@ OMX_ERRORTYPE SEC_OMX_VideoEncodeGetParameter(
case supportFormat_2:
portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
portFormat->eColorFormat = OMX_SEC_COLOR_FormatNV12TPhysicalAddress;
- portFormat->xFramerate = portDefinition->format.video.xFramerate;
+ portFormat->xFramerate = portDefinition->format.video.xFramerate;
break;
+#ifdef USE_ANDROID_EXTENSION
+ case supportFormat_3:
+ portFormat->eCompressionFormat = OMX_VIDEO_CodingUnused;
+ portFormat->eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ portFormat->xFramerate = portDefinition->format.video.xFramerate;
+ break;
+#endif
}
} else if (portIndex == OUTPUT_PORT_INDEX) {
supportFormatNum = OUTPUT_PORT_SUPPORTFORMAT_NUM_MAX - 1;
@@ -1113,7 +1120,7 @@ OMX_ERRORTYPE SEC_OMX_VideoEncodeGetParameter(
portFormat->eCompressionFormat = portDefinition->format.video.eCompressionFormat;
portFormat->eColorFormat = portDefinition->format.video.eColorFormat;
- portFormat->xFramerate = portDefinition->format.video.xFramerate;
+ portFormat->xFramerate = portDefinition->format.video.xFramerate;
}
ret = OMX_ErrorNone;
}
diff --git a/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h b/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h
index be439c8..2c9ad54 100644
--- a/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h
+++ b/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h
@@ -44,7 +44,11 @@
/* (DEFAULT_FRAME_WIDTH * DEFAULT_FRAME_HEIGHT * 3) / 2 */
#define DEFAULT_VIDEO_OUTPUT_BUFFER_SIZE DEFAULT_VIDEO_INPUT_BUFFER_SIZE
+#ifdef USE_ANDROID_EXTENSION
+#define INPUT_PORT_SUPPORTFORMAT_NUM_MAX 4
+#else
#define INPUT_PORT_SUPPORTFORMAT_NUM_MAX 3
+#endif
#define OUTPUT_PORT_SUPPORTFORMAT_NUM_MAX 1
#ifdef USE_ANDROID_EXTENSION
diff --git a/sec_mm/sec_omx/sec_omx_include/sec/SEC_OMX_Def.h b/sec_mm/sec_omx/sec_omx_include/sec/SEC_OMX_Def.h
index cf154ff..10b6144 100644
--- a/sec_mm/sec_omx/sec_omx_include/sec/SEC_OMX_Def.h
+++ b/sec_mm/sec_omx/sec_omx_include/sec/SEC_OMX_Def.h
@@ -110,7 +110,9 @@ typedef enum _SEC_OMX_TRANS_STATETYPE {
typedef enum _SEC_OMX_COLOR_FORMATTYPE {
OMX_SEC_COLOR_FormatNV12TPhysicalAddress = 0x7F000001, /**< Reserved region for introducing Vendor Extensions */
/* for Android Native Window */
- OMX_SEC_COLOR_FormatANBYUV420SemiPlanar = 0x100
+ OMX_SEC_COLOR_FormatANBYUV420SemiPlanar = 0x100,
+ /* for Android surface texture encode */
+ OMX_COLOR_FormatAndroidOpaque = 0x7F000789
}SEC_OMX_COLOR_FORMATTYPE;
typedef enum _SEC_OMX_SUPPORTFORMAT_TYPE
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 799b550..949fc19 100644
--- a/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.cpp
+++ b/sec_mm/sec_omx/sec_osal/SEC_OSAL_Buffer.cpp
@@ -104,7 +104,9 @@ OMX_U32 checkPortIndexANB(OMX_PTR ComponentParameterStructure)
OMX_U32 getMetadataBufferType(const uint8_t *ptr)
{
- return ptr[0] << 24 | ptr[1] << 16 | ptr[2] << 8 | ptr[3];
+ OMX_U32 type = *(OMX_U32 *) ptr;
+ SEC_OSAL_Log(SEC_LOG_TRACE, "getMetadataBufferType: %ld", type);
+ return type;
}
OMX_U32 getVADDRfromANB(OMX_PTR pUnreadableBuffer, OMX_U32 Width, OMX_U32 Height, void *pVirAddrs[])
@@ -403,11 +405,12 @@ OMX_ERRORTYPE preprocessMetaDataInBuffers(OMX_HANDLETYPE hComponent, OMX_BYTE pI
IMG_gralloc_module_public_t *module = (IMG_gralloc_module_public_t *)pSECPort->pIMGGrallocModule;
OMX_PTR pUnreadableBuffer = NULL;
OMX_PTR pReadableBuffer = NULL;
- OMX_PTR pVirAddrs[2];
+ OMX_PTR pVirAddrs[3];
int err = 0;
pVirAddrs[0] = pSECComponent->processData[INPUT_PORT_INDEX].specificBufferHeader.YVirAddr;
pVirAddrs[1] = pSECComponent->processData[INPUT_PORT_INDEX].specificBufferHeader.CVirAddr;
+ pVirAddrs[2] = NULL;
if (module == NULL) {
err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, (const hw_module_t **)&module);
@@ -422,9 +425,9 @@ OMX_ERRORTYPE preprocessMetaDataInBuffers(OMX_HANDLETYPE hComponent, OMX_BYTE pI
/**************************************/
/* IMG CSC RGB to NV12 */
/**************************************/
- SEC_OSAL_Memcpy(&pUnreadableBuffer, pInputDataBuffer + 4, sizeof(void *));
- android_native_buffer_t *buf = (android_native_buffer_t *)pUnreadableBuffer;
- err = module->Blit(module, buf->handle, pVirAddrs, HAL_PIXEL_FORMAT_C110_NV12);
+ buffer_handle_t buf = *((buffer_handle_t *) (pInputDataBuffer + 4));
+ SEC_OSAL_Log(SEC_LOG_TRACE, "buffer handle %p)\n", buf);
+ err = module->Blit(module, buf, pVirAddrs, HAL_PIXEL_FORMAT_C110_NV12);
if(err) {
SEC_OSAL_Log(SEC_LOG_ERROR, "module->Blit() failed (err=%d)\n", err);
ret = OMX_ErrorUndefined;