diff options
author | Koushik Dutta <koushd@gmail.com> | 2010-07-11 23:05:00 -0700 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2010-07-11 23:05:00 -0700 |
commit | 8e309093776b259a23077feb095aee082f68a2f8 (patch) | |
tree | f3972b034fa3868cbaac011cb855973f376e494a /libs/camera | |
parent | 39a5d188dd20bdebee7a1da4e1f57455739c016f (diff) | |
download | frameworks_base-8e309093776b259a23077feb095aee082f68a2f8.zip frameworks_base-8e309093776b259a23077feb095aee082f68a2f8.tar.gz frameworks_base-8e309093776b259a23077feb095aee082f68a2f8.tar.bz2 |
Remerge libui.so, libsurfaceflinger_client.so, and libcamera_client.so for older devices.
Change-Id: I6a1dbe519df3b07292d738ffa9f6be95b794875e
Diffstat (limited to 'libs/camera')
-rw-r--r-- | libs/camera/Android.mk | 12 | ||||
-rw-r--r-- | libs/camera/CameraParameters.cpp | 22 |
2 files changed, 32 insertions, 2 deletions
diff --git a/libs/camera/Android.mk b/libs/camera/Android.mk index 03ff229..3691bde 100644 --- a/libs/camera/Android.mk +++ b/libs/camera/Android.mk @@ -8,6 +8,10 @@ LOCAL_SRC_FILES:= \ ICameraClient.cpp \ ICameraService.cpp +LOCAL_MODULE:= libcamera_client + +ifneq ($(BOARD_USES_ECLAIR_LIBCAMERA),true) + LOCAL_SHARED_LIBRARIES := \ libcutils \ libutils \ @@ -16,10 +20,14 @@ LOCAL_SHARED_LIBRARIES := \ libsurfaceflinger_client \ libui -LOCAL_MODULE:= libcamera_client - ifeq ($(TARGET_SIMULATOR),true) LOCAL_LDLIBS += -lpthread endif include $(BUILD_SHARED_LIBRARY) + +else + +include $(BUILD_STATIC_LIBRARY) + +endif diff --git a/libs/camera/CameraParameters.cpp b/libs/camera/CameraParameters.cpp index 65fd7ac..7a87b5f 100644 --- a/libs/camera/CameraParameters.cpp +++ b/libs/camera/CameraParameters.cpp @@ -138,6 +138,11 @@ const char CameraParameters::FOCUS_MODE_MACRO[] = "macro"; const char CameraParameters::FOCUS_MODE_FIXED[] = "fixed"; const char CameraParameters::FOCUS_MODE_EDOF[] = "edof"; + + +static const char* portrait = "portrait"; +static const char* landscape = "landscape"; + CameraParameters::CameraParameters() : mMap() { @@ -315,6 +320,23 @@ void CameraParameters::setPreviewFormat(const char *format) set(KEY_PREVIEW_FORMAT, format); } +int CameraParameters::getOrientation() const +{ + const char* orientation = get("orientation"); + if (orientation && !strcmp(orientation, portrait)) + return CAMERA_ORIENTATION_PORTRAIT; + return CAMERA_ORIENTATION_LANDSCAPE; +} + +void CameraParameters::setOrientation(int orientation) +{ + if (orientation == CAMERA_ORIENTATION_PORTRAIT) { + set("orientation", portrait); + } else { + set("orientation", landscape); + } +} + const char *CameraParameters::getPreviewFormat() const { return get(KEY_PREVIEW_FORMAT); |