diff options
author | Emilian Peev <epeev@mm-sol.com> | 2012-06-07 17:27:18 +0300 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-07-25 08:56:43 -0500 |
commit | c4b947c5581d346dc469a7a465f645fd50cebff0 (patch) | |
tree | 8f1ed312db3141b198140527c59226eaef5dc2ac /camera/inc/CameraProperties.h | |
parent | e0c66b5eac95cf3acbc968833a69b6be76a0da66 (diff) | |
download | hardware_ti_omap4-c4b947c5581d346dc469a7a465f645fd50cebff0.zip hardware_ti_omap4-c4b947c5581d346dc469a7a465f645fd50cebff0.tar.gz hardware_ti_omap4-c4b947c5581d346dc469a7a465f645fd50cebff0.tar.bz2 |
CameraHal: Queries picture sizes dynamically
- Currently the picture sizes are static and
will not change with the capture mode. For
some use-cases this is not sufficient.
To overcome this the Properties class is
extended to support an operating mode, which
will switch the supported properties depending
on the current setting. Additionally the
Ducati capabilities are queried not only for
one capture mode alone but for all use-cases
in 2D and 3D. As a result once the camera
client switches the capture mode, the supported
picture sizes will change inside CameraParameters
retrieved through a subsequent "getParameters()"
call.
Related UI patch: http://review.omapzoom.org/#/c/21685
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
Change-Id: Ib9f02ede94ff76feb86b3422dc453dfd8782ee43
Diffstat (limited to 'camera/inc/CameraProperties.h')
-rw-r--r-- | camera/inc/CameraProperties.h | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/camera/inc/CameraProperties.h b/camera/inc/CameraProperties.h index 96d4789..cec0e3d 100644 --- a/camera/inc/CameraProperties.h +++ b/camera/inc/CameraProperties.h @@ -44,11 +44,17 @@ namespace android { #define MAX_PROP_NAME_LENGTH 50 #define MAX_PROP_VALUE_LENGTH 2048 -#define EXIF_MAKE_DEFAULT "default_make" -#define EXIF_MODEL_DEFAULT "default_model" - #define REMAINING_BYTES(buff) ((((int)sizeof(buff) - 1 - (int)strlen(buff)) < 0) ? 0 : (sizeof(buff) - 1 - strlen(buff))) +enum OperatingMode { + MODE_HIGH_SPEED = 0, + MODE_HIGH_QUALITY, + MODE_ZEROSHUTTERLAG, + MODE_VIDEO, + MODE_STEREO, + MODE_CPCAM, + MODE_MAX +}; // Class that handles the Camera Properties class CameraProperties @@ -189,33 +195,31 @@ public: class Properties { public: + Properties() { - mProperties = new DefaultKeyedVector<String8, String8>(String8(DEFAULT_VALUE)); - char property[PROPERTY_VALUE_MAX]; - property_get("ro.product.manufacturer", property, EXIF_MAKE_DEFAULT); - property[0] = toupper(property[0]); - set(EXIF_MAKE, property); - property_get("ro.product.model", property, EXIF_MODEL_DEFAULT); - property[0] = toupper(property[0]); - set(EXIF_MODEL, property); } + ~Properties() { - delete mProperties; } - ssize_t set(const char *prop, const char *value); - ssize_t set(const char *prop, int value); - const char* get(const char * prop); - int getInt(const char * prop); + + void set(const char *prop, const char *value); + void set(const char *prop, int value); + const char* get(const char * prop) const; + int getInt(const char * prop) const; + void setSensorIndex(int idx); + void setMode(OperatingMode mode); + OperatingMode getMode() const; void dump(); protected: - const char* keyAt(unsigned int); - const char* valueAt(unsigned int); + const char* keyAt(const unsigned int) const; + const char* valueAt(const unsigned int) const; private: - DefaultKeyedVector<String8, String8>* mProperties; + OperatingMode mCurrentMode; + DefaultKeyedVector<String8, String8> mProperties[MODE_MAX]; }; |