summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-03-08 07:58:34 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-08 07:58:34 -0800
commit9d4ff8b41cb6b58411b73cf38fe2303ca736518b (patch)
tree202c872b96c580f8e3627b6c26e1d336541f20d1 /libcamera
parent95b9168a7432700ecf34e39208d28e8befae3dfb (diff)
parent2d6a603741d29c692b46b4828a9a43b9af434bfe (diff)
downloaddevice_samsung_crespo-9d4ff8b41cb6b58411b73cf38fe2303ca736518b.zip
device_samsung_crespo-9d4ff8b41cb6b58411b73cf38fe2303ca736518b.tar.gz
device_samsung_crespo-9d4ff8b41cb6b58411b73cf38fe2303ca736518b.tar.bz2
am 2d6a6037: am 28e8633c: Merge "libcamera: Fix setParameters crash when opening front camera." into gingerbread
* commit '2d6a603741d29c692b46b4828a9a43b9af434bfe': libcamera: Fix setParameters crash when opening front camera.
Diffstat (limited to 'libcamera')
-rwxr-xr-xlibcamera/SecCamera.cpp50
-rw-r--r--libcamera/SecCamera.h1
-rw-r--r--libcamera/SecCameraHWInterface.cpp2
3 files changed, 16 insertions, 37 deletions
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp
index e17c878..4d0705a 100755
--- a/libcamera/SecCamera.cpp
+++ b/libcamera/SecCamera.cpp
@@ -736,6 +736,22 @@ int SecCamera::initCamera(int index)
m_camera_id = index;
+ switch (m_camera_id) {
+ case CAMERA_ID_FRONT:
+ m_preview_max_width = MAX_FRONT_CAMERA_PREVIEW_WIDTH;
+ m_preview_max_height = MAX_FRONT_CAMERA_PREVIEW_HEIGHT;
+ m_snapshot_max_width = MAX_FRONT_CAMERA_SNAPSHOT_WIDTH;
+ m_snapshot_max_height = MAX_FRONT_CAMERA_SNAPSHOT_HEIGHT;
+ break;
+
+ case CAMERA_ID_BACK:
+ m_preview_max_width = MAX_BACK_CAMERA_PREVIEW_WIDTH;
+ m_preview_max_height = MAX_BACK_CAMERA_PREVIEW_HEIGHT;
+ m_snapshot_max_width = MAX_BACK_CAMERA_SNAPSHOT_WIDTH;
+ m_snapshot_max_height = MAX_BACK_CAMERA_SNAPSHOT_HEIGHT;
+ break;
+ }
+
setExifFixedAttribute();
m_flag_init = 1;
@@ -1615,40 +1631,6 @@ int SecCamera::getSnapshotPixelFormat(void)
// ======================================================================
// Settings
-int SecCamera::setCameraId(int camera_id)
-{
- if ((camera_id != CAMERA_ID_FRONT) && (camera_id != CAMERA_ID_BACK)) {
- LOGE("ERR(%s)::Invalid camera id(%d)\n", __func__, camera_id);
- return -1;
- }
- if (m_camera_id == camera_id)
- return 0;
-
- LOGV("%s(camera_id(%d))", __func__, camera_id);
-
- switch (camera_id) {
- case CAMERA_ID_FRONT:
- m_preview_max_width = MAX_FRONT_CAMERA_PREVIEW_WIDTH;
- m_preview_max_height = MAX_FRONT_CAMERA_PREVIEW_HEIGHT;
- m_snapshot_max_width = MAX_FRONT_CAMERA_SNAPSHOT_WIDTH;
- m_snapshot_max_height = MAX_FRONT_CAMERA_SNAPSHOT_HEIGHT;
- break;
-
- case CAMERA_ID_BACK:
- m_preview_max_width = MAX_BACK_CAMERA_PREVIEW_WIDTH;
- m_preview_max_height = MAX_BACK_CAMERA_PREVIEW_HEIGHT;
- m_snapshot_max_width = MAX_BACK_CAMERA_SNAPSHOT_WIDTH;
- m_snapshot_max_height = MAX_BACK_CAMERA_SNAPSHOT_HEIGHT;
- break;
- }
-
- m_camera_id = camera_id;
-
- resetCamera();
-
- return 0;
-}
-
int SecCamera::getCameraId(void)
{
return m_camera_id;
diff --git a/libcamera/SecCamera.h b/libcamera/SecCamera.h
index f3a2166..c87a0f4 100644
--- a/libcamera/SecCamera.h
+++ b/libcamera/SecCamera.h
@@ -284,7 +284,6 @@ public:
int flagCreate(void) const;
- int setCameraId(int camera_id);
int getCameraId(void);
int startPreview(void);
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index fffe15b..5228e18 100644
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -156,8 +156,6 @@ void CameraHardwareSec::initDefaultParameters(int cameraId)
int snapshot_max_width = 0;
int snapshot_max_height = 0;
- /* set camera ID & reset camera */
- mSecCamera->setCameraId(cameraId);
if (cameraId == SecCamera::CAMERA_ID_BACK) {
p.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES,
"720x480,640x480,352x288,176x144");