summaryrefslogtreecommitdiffstats
path: root/camera/OMXCameraAdapter
diff options
context:
space:
mode:
authorAndriy Chepurnyy <x0155536@ti.com>2012-09-25 15:01:33 +0300
committerDaniel Levin <dendy@ti.com>2012-10-10 18:55:50 +0300
commitc2671dfd2ff330bf4da6563a50a70b0bc5d57ee8 (patch)
treec4eda8efab90b46c63036923391556e3d096ed85 /camera/OMXCameraAdapter
parentf25f76de80ce7ff4f942d53867277815ef767f21 (diff)
downloadhardware_ti_omap4-c2671dfd2ff330bf4da6563a50a70b0bc5d57ee8.zip
hardware_ti_omap4-c2671dfd2ff330bf4da6563a50a70b0bc5d57ee8.tar.gz
hardware_ti_omap4-c2671dfd2ff330bf4da6563a50a70b0bc5d57ee8.tar.bz2
CameraHal: Configure preview port before set orientation
Rotation cannot be applyed on unconfigured preview port due to it has non nv12 default pixel format. Therefore - set orientation will return error and unexpected dimensions will be returned to frame allocator. Change-Id: I31c755c3da68ac65fd61daeaa69861ae18f01798 Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Diffstat (limited to 'camera/OMXCameraAdapter')
-rw-r--r--camera/OMXCameraAdapter/OMXAlgo.cpp9
-rw-r--r--camera/OMXCameraAdapter/OMXCameraAdapter.cpp2
2 files changed, 11 insertions, 0 deletions
diff --git a/camera/OMXCameraAdapter/OMXAlgo.cpp b/camera/OMXCameraAdapter/OMXAlgo.cpp
index 2c3c1e1..d163ef2 100644
--- a/camera/OMXCameraAdapter/OMXAlgo.cpp
+++ b/camera/OMXCameraAdapter/OMXAlgo.cpp
@@ -1112,6 +1112,15 @@ status_t OMXCameraAdapter::setSensorOrientation(unsigned int degree)
mPreviewData->mWidth = tmpWidth;
mPreviewData->mHeight = tmpHeight;
+ mPreviewPortInitialized = true;
+ }
+ else if (!mPreviewPortInitialized) {
+ ret = setFormat(OMX_CAMERA_PORT_VIDEO_OUT_PREVIEW, *mPreviewData);
+ if ( NO_ERROR != ret ) {
+ CAMHAL_LOGEB("Error while configuring format 0x%x", ret);
+ return ret;
+ }
+ mPreviewPortInitialized = true;
}
/* Now set Required Orientation*/
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
index 4f7122e..d4ec707 100644
--- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
+++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
@@ -4150,6 +4150,8 @@ OMXCameraAdapter::OMXCameraAdapter(size_t sensor_index)
#endif
+ mPreviewPortInitialized = false;
+
LOG_FUNCTION_NAME_EXIT;
}