From dd600c91fc1bc564ae62ef945d67436fe2fb0451 Mon Sep 17 00:00:00 2001 From: SeungBeom Kim Date: Tue, 19 Jul 2011 10:23:46 +0900 Subject: Change SEC_OMX for Video Editor 1. Support Google ExtensionIndex. 2. Decode Component - Decode component return real YUV output data. - Video decode component support two output port color format. They are OMX_COLOR_FormatYUV420SemiPlanar(NV12) and OMX_COLOR_FormatYUV420Planar. Choose one of them under negotiation. - output port default color format is OMX_COLOR_FormatYUV420SemiPlanar(NV12). - Turn off the gralloc/graphic buffer since gralloc/graphic buffer allocator is unavailable 3. Encode Component - Encode component support real YUV input data. - Video encode component support two input port color format. They are OMX_COLOR_FormatYUV420SemiPlanar(NV12) and OMX_COLOR_FormatYUV420Planar. Choose one of them under negotiation. - input port default color format is OMX_COLOR_FormatYUV420SemiPlanar(NV12). - gralloc buffer is not support yet. (store meta data mode use physical address.) 4. Camera hal - Support metadata buffer mode TODO: 1. enable grallco/graphic buffer once the allocator is available 2. add support for gralloc-based metadata buffer support in video encoder component Change-Id: Ic8ba4f0230d6de77ffde7ddf1e2c9a3a5aeb806f Signed-off-by: SeungBeom Kim --- libcamera/SecCameraHWInterface.cpp | 17 ++++++++++++++++- libcamera/SecCameraHWInterface.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'libcamera') diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp index d0ea6a3..2ca714b 100644 --- a/libcamera/SecCameraHWInterface.cpp +++ b/libcamera/SecCameraHWInterface.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #define VIDEO_COMMENT_MARKER_H 0xFFBE #define VIDEO_COMMENT_MARKER_L 0xFFBF @@ -58,6 +59,7 @@ namespace android { struct addrs { + uint32_t type; // make sure that this is 4 byte. unsigned int addr_y; unsigned int addr_cbcr; unsigned int buf_index; @@ -699,6 +701,7 @@ callbacks: addrs = (struct addrs *)mRecordHeap->data; + addrs[index].type = kMetadataBufferTypeCameraSource; addrs[index].addr_y = phyYAddr; addrs[index].addr_cbcr = phyCAddr; addrs[index].buf_index = index; @@ -2340,6 +2343,18 @@ void CameraHardwareSec::release() mSecCamera->DeinitCamera(); } +status_t CameraHardwareSec::storeMetaDataInBuffers(bool enable) +{ + // FIXME: + // metadata buffer mode can be turned on or off. + // Samsung needs to fix this. + if (!enable) { + LOGE("Non-metadata buffer mode is not supported!"); + return INVALID_OPERATION; + } + return OK; +} + static CameraInfo sCameraInfo[] = { { CAMERA_FACING_BACK, @@ -2495,7 +2510,7 @@ static int HAL_camera_device_preview_enabled(struct camera_device *dev) static int HAL_camera_device_store_meta_data_in_buffers(struct camera_device *dev, int enable) { LOGV("%s", __func__); - return INVALID_OPERATION;// obj(dev)->storeMetaDataInBuffers(enable); + return obj(dev)->storeMetaDataInBuffers(enable); } /** diff --git a/libcamera/SecCameraHWInterface.h b/libcamera/SecCameraHWInterface.h index a081090..3254b7b 100644 --- a/libcamera/SecCameraHWInterface.h +++ b/libcamera/SecCameraHWInterface.h @@ -59,6 +59,7 @@ public: virtual CameraParameters getParameters() const; virtual status_t sendCommand(int32_t command, int32_t arg1, int32_t arg2); virtual status_t setPreviewWindow(preview_stream_ops *w); + virtual status_t storeMetaDataInBuffers(bool enable); virtual void release(); inline int getCameraId() const; -- cgit v1.1