LOCAL_CFLAGS += -DUSE_ANB
endif
+ifeq ($(BOARD_USE_DMA_BUF), true)
+LOCAL_CFLAGS += -DUSE_DMA_BUF
+endif
+
include $(BUILD_STATIC_LIBRARY)
pYUVBuf[2] = (unsigned char *)pOutputBuf + imageSize + imageSize / 4;
csc_get_method(pVideoDec->csc_handle, &csc_method);
+#ifdef USE_DMA_BUF
if (csc_method == CSC_METHOD_HW) {
pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.fd[0];
pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.fd[1];
pSrcBuf[2] = dstOutputData->buffer.multiPlaneBuffer.fd[2];
}
+#endif
#ifdef USE_ANB
if (exynosOutputPort->bIsANBEnabled == OMX_TRUE) {
width = stride;
outputUseBuffer->dataLen = sizeof(void *);
- if (csc_method == CSC_METHOD_SW) {
- pYUVBuf[0] = (unsigned char *)planes[0].addr;
- pYUVBuf[1] = (unsigned char *)planes[1].addr;
- pYUVBuf[2] = (unsigned char *)planes[2].addr;
- } else {
+ pYUVBuf[0] = (unsigned char *)planes[0].addr;
+ pYUVBuf[1] = (unsigned char *)planes[1].addr;
+ pYUVBuf[2] = (unsigned char *)planes[2].addr;
+#ifdef USE_DMA_BUF
+ if (csc_method == CSC_METHOD_HW) {
pYUVBuf[0] = (unsigned char *)planes[0].fd;
pYUVBuf[1] = (unsigned char *)planes[1].fd;
pYUVBuf[2] = (unsigned char *)planes[2].fd;
}
+#endif
}
#endif
+#ifdef USE_DMA_BUF
if ((exynosOutputPort->bIsANBEnabled == OMX_FALSE) &&
(csc_method == CSC_METHOD_HW)) {
pYUVBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoDec->hSharedMemory, pOutputBuf);
pYUVBuf[1] = NULL;
pYUVBuf[2] = NULL;
}
+#endif
if (pVideoDec->csc_set_format == OMX_FALSE) {
csc_set_src_format(
if (nPlane == TWO_PLANE) {
/* Case of Shared Buffer, Only support two PlaneBuffer */
pData->buffer.multiPlaneBuffer.dataBuffer[0] = planes[0].addr;
- pData->buffer.multiPlaneBuffer.fd[0] = planes[0].fd;
pData->buffer.multiPlaneBuffer.dataBuffer[1] = planes[1].addr;
+#ifdef USE_DMA_BUF
+ pData->buffer.multiPlaneBuffer.fd[0] = planes[0].fd;
pData->buffer.multiPlaneBuffer.fd[1] = planes[1].fd;
+#endif
} else {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Can not support plane");
ret = OMX_ErrorNotImplemented;
LOCAL_CFLAGS += -DUSE_ANB
endif
+ifeq ($(BOARD_USE_DMA_BUF), true)
+LOCAL_CFLAGS += -DUSE_DMA_BUF
+endif
+
ifeq ($(BOARD_USE_S3D_SUPPORT), true)
LOCAL_CFLAGS += -DUSE_S3D_SUPPORT
endif
}
/* alloc context, open, querycap */
+#ifdef USE_DMA_BUF
pH264Dec->hMFCH264Handle.hMFCHandle = pH264Dec->hMFCH264Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
+#else
+ pH264Dec->hMFCH264Handle.hMFCHandle = pH264Dec->hMFCH264Handle.pDecOps->Init(V4L2_MEMORY_USERPTR);
+#endif
if (pH264Dec->hMFCH264Handle.hMFCHandle == NULL) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
ret = OMX_ErrorInsufficientResources;
LOCAL_CFLAGS += -DUSE_ANB
endif
+ifeq ($(BOARD_USE_DMA_BUF), true)
+LOCAL_CFLAGS += -DUSE_DMA_BUF
+endif
+
LOCAL_ARM_MODE := arm
LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basecomponent \
}
/* alloc context, open, querycap */
+#ifdef USE_DMA_BUF
pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
+#else
+ pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_USERPTR);
+#endif
if (pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle == NULL) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
ret = OMX_ErrorInsufficientResources;
LOCAL_CFLAGS += -DUSE_ANB
endif
+ifeq ($(BOARD_USE_DMA_BUF), true)
+LOCAL_CFLAGS += -DUSE_DMA_BUF
+endif
+
LOCAL_ARM_MODE := arm
LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basecomponent \
}
/* alloc context, open, querycap */
+#ifdef USE_DMA_BUF
pVp8Dec->hMFCVp8Handle.hMFCHandle = pVp8Dec->hMFCVp8Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
+#else
+ pVp8Dec->hMFCVp8Handle.hMFCHandle = pVp8Dec->hMFCVp8Handle.pDecOps->Init(V4L2_MEMORY_USERPTR);
+#endif
if (pVp8Dec->hMFCVp8Handle.hMFCHandle == NULL) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
ret = OMX_ErrorInsufficientResources;
LOCAL_CFLAGS += -DUSE_STOREMETADATA
endif
+ifeq ($(BOARD_USE_DMA_BUF), true)
+LOCAL_CFLAGS += -DUSE_DMA_BUF
+endif
+
LOCAL_SHARED_LIBRARIES := libcsc
include $(BUILD_STATIC_LIBRARY)
Exynos_OSAL_LockANBHandle((OMX_U32)ppBuf[0], nFrameWidth, nFrameHeight, OMX_COLOR_FormatAndroidOpaque, planes);
imageSize = nFrameWidth * nFrameHeight * 3; /* RGB888 */
+#ifdef USE_DMA_BUF
if (csc_method == CSC_METHOD_HW)
pSrcBuf[0] = (unsigned char *)planes[0].fd;
else
- pSrcBuf[0] = planes[0].addr;
+#endif
+ pSrcBuf[0] = planes[0].addr;
pSrcBuf[1] = NULL;
pSrcBuf[2] = NULL;
}
} else
#endif
{
+#ifdef USE_DMA_BUF
if (csc_method == CSC_METHOD_HW) {
pSrcBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoEnc->hSharedMemory, checkInputStream);
pSrcBuf[1] = NULL;
pSrcBuf[2] = NULL;
}
+#endif
switch (eColorFormat) {
case OMX_COLOR_FormatYUV420Planar:
} else {
/* kMetadataBufferTypeCameraSource */
Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)inputUseBuffer->bufferHeader->pBuffer, ppBuf);
+#ifdef USE_DMA_BUF
srcInputData->buffer.multiPlaneBuffer.fd[0] = ppBuf[0];
srcInputData->buffer.multiPlaneBuffer.fd[1] = ppBuf[1];
allocSize[0] = nFrameWidth * nFrameHeight;
/* input buffers are 2 plane. */
srcInputData->buffer.multiPlaneBuffer.dataBuffer[2] = NULL;
srcInputData->buffer.multiPlaneBuffer.fd[2] = -1;
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s:%d YAddr: 0x%x CbCrAddr: 0x%x", __FUNCTION__, __LINE__, (unsigned int)ppBuf[0], (unsigned int)ppBuf[0]);
+#else
+ for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) {
+ srcInputData->buffer.multiPlaneBuffer.dataBuffer[plane] = ppBuf[plane];
+ }
+ srcInputData->buffer.multiPlaneBuffer.dataBuffer[2] = NULL;
+#endif
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s:%d YAddr: 0x%x CbCrAddr: 0x%x", __FUNCTION__, __LINE__, (unsigned int)ppBuf[0], (unsigned int)ppBuf[1]);
}
}
#endif
LOCAL_CFLAGS += -DUSE_METADATABUFFERTYPE
endif
+ifeq ($(BOARD_USE_DMA_BUF), true)
+LOCAL_CFLAGS += -DUSE_DMA_BUF
+endif
+
LOCAL_ARM_MODE := arm
LOCAL_STATIC_LIBRARIES := libExynosOMX_Venc libExynosOMX_OSAL libExynosOMX_Basecomponent \
}
/* alloc context, open, querycap */
+#ifdef USE_DMA_BUF
pH264Enc->hMFCH264Handle.hMFCHandle = pH264Enc->hMFCH264Handle.pEncOps->Init(V4L2_MEMORY_DMABUF);
+#else
+ pH264Enc->hMFCH264Handle.hMFCHandle = pH264Enc->hMFCH264Handle.pEncOps->Init(V4L2_MEMORY_USERPTR);
+#endif
if (pH264Enc->hMFCH264Handle.hMFCHandle == NULL) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
ret = OMX_ErrorInsufficientResources;
LOCAL_CFLAGS += -DUSE_METADATABUFFERTYPE
endif
+ifeq ($(BOARD_USE_DMA_BUF), true)
+LOCAL_CFLAGS += -DUSE_DMA_BUF
+endif
+
LOCAL_ARM_MODE := arm
LOCAL_STATIC_LIBRARIES := libExynosOMX_Venc libExynosOMX_OSAL libExynosOMX_Basecomponent \
}
/* alloc context, open, querycap */
+#ifdef USE_DMA_BUF
pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.pEncOps->Init(V4L2_MEMORY_DMABUF);
+#else
+ pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.pEncOps->Init(V4L2_MEMORY_USERPTR);
+#endif
if (pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle == NULL) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
ret = OMX_ErrorInsufficientResources;
LOCAL_CFLAGS += -DUSE_ANB_OUTBUF_SHARE
endif
+ifeq ($(BOARD_USE_DMA_BUF), true)
+LOCAL_CFLAGS += -DUSE_DMA_BUF
+endif
+
LOCAL_STATIC_LIBRARIES := liblog libcutils libExynosVideoApi
LOCAL_C_INCLUDES := \
#include <hardware/hardware.h>
#include <media/hardware/OMXPluginBase.h>
#include <media/hardware/MetadataBufferType.h>
+#ifdef USE_DMA_BUF
#include <gralloc_priv.h>
+#endif
#include "Exynos_OSAL_Semaphore.h"
#include "Exynos_OMX_Baseport.h"
OMX_ERRORTYPE ret = OMX_ErrorNone;
GraphicBufferMapper &mapper = GraphicBufferMapper::get();
buffer_handle_t bufferHandle = (buffer_handle_t) handle;
+#ifdef USE_DMA_BUF
private_handle_t *priv_hnd = (private_handle_t *) bufferHandle;
+#endif
Rect bounds(width, height);
ExynosVideoPlane *vplanes = (ExynosVideoPlane *) planes;
void *vaddr[MAX_BUFFER_PLANE];
goto EXIT;
}
+#ifdef USE_DMA_BUF
vplanes[0].fd = priv_hnd->fd;
vplanes[0].offset = 0;
- vplanes[0].addr = vaddr[0];
vplanes[1].fd = priv_hnd->fd1;
vplanes[1].offset = 0;
- vplanes[1].addr = vaddr[1];
vplanes[2].fd = priv_hnd->fd2;
vplanes[2].offset = 0;
+#endif
+ vplanes[0].addr = vaddr[0];
+ vplanes[1].addr = vaddr[1];
vplanes[2].addr = vaddr[2];
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: buffer locked: 0x%x", __func__, *vaddr);
Exynos_OSAL_LockANB(temp_bufferHeader->pBuffer, width, height,
pExynosPort->portDefinition.format.video.eColorFormat,
&stride, planes);
+#ifdef USE_DMA_BUF
pExynosPort->extendBufferHeader[i].buf_fd[0] = planes[0].fd;
- pExynosPort->extendBufferHeader[i].pYUVBuf[0] = planes[0].addr;
pExynosPort->extendBufferHeader[i].buf_fd[1] = planes[1].fd;
- pExynosPort->extendBufferHeader[i].pYUVBuf[1] = planes[1].addr;
pExynosPort->extendBufferHeader[i].buf_fd[2] = planes[2].fd;
+#endif
+ pExynosPort->extendBufferHeader[i].pYUVBuf[0] = planes[0].addr;
+ pExynosPort->extendBufferHeader[i].pYUVBuf[1] = planes[1].addr;
pExynosPort->extendBufferHeader[i].pYUVBuf[2] = planes[2].addr;
Exynos_OSAL_UnlockANB(temp_bufferHeader->pBuffer);
- Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "useAndroidNativeBuffer: buf %d pYUVBuf[0]:0x%x (fd:%d), pYUVBuf[1]:0x%x (fd:%d)",
- i, pExynosPort->extendBufferHeader[i].pYUVBuf[0], planes[0].fd,
- pExynosPort->extendBufferHeader[i].pYUVBuf[1], planes[1].fd);
+ Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "useAndroidNativeBuffer: buf %d pYUVBuf[0]:0x%x , pYUVBuf[1]:0x%x ",
+ i, pExynosPort->extendBufferHeader[i].pYUVBuf[0],
+ pExynosPort->extendBufferHeader[i].pYUVBuf[1]);
pExynosPort->assignedBufferNum++;
if (pExynosPort->assignedBufferNum == pExynosPort->portDefinition.nBufferCountActual) {
return;
}
+#ifdef USE_DMA_BUF
OMX_PTR Exynos_OSAL_SharedMemory_Map(OMX_HANDLETYPE handle, OMX_U32 size, unsigned int ionfd)
{
EXYNOS_SHARED_MEMORY *pHandle = (EXYNOS_SHARED_MEMORY *)handle;
EXIT:
return;
}
+#endif
int Exynos_OSAL_SharedMemory_VirtToION(OMX_HANDLETYPE handle, OMX_PTR pBuffer)
{