summaryrefslogtreecommitdiffstats
path: root/include/camera
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2014-03-26 18:10:09 +0000
committerEino-Ville Talvala <etalvala@google.com>2014-03-26 18:33:45 +0000
commit1cebdb77323e4554a316b9c34bf36957b7dad5ae (patch)
treefb2657136544bb4cb32fa0d8adf0782b421884d9 /include/camera
parent551cec544652783e3342c18386f64cee22412b60 (diff)
downloadframeworks_av-1cebdb77323e4554a316b9c34bf36957b7dad5ae.zip
frameworks_av-1cebdb77323e4554a316b9c34bf36957b7dad5ae.tar.gz
frameworks_av-1cebdb77323e4554a316b9c34bf36957b7dad5ae.tar.bz2
Revert "camera: Fix setParameters for Preview FPS single/range values"
Causes a regression on some devices, so reverting until we're in a position to fix those devices. This reverts commit 9078a1b3b9f9c0c48046ade0e8e18b0d79a659db. Bug: 13563098 Change-Id: I7aedd01fde8b8fdee77e972ec395f0ecadbf8ccb
Diffstat (limited to 'include/camera')
-rw-r--r--include/camera/CameraParameters.h104
1 files changed, 1 insertions, 103 deletions
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index 833ba76..d521543 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -18,7 +18,6 @@
#define ANDROID_HARDWARE_CAMERA_PARAMETERS_H
#include <utils/KeyedVector.h>
-#include <utils/Vector.h>
#include <utils/String8.h>
namespace android {
@@ -51,26 +50,10 @@ public:
void set(const char *key, const char *value);
void set(const char *key, int value);
void setFloat(const char *key, float value);
- // Look up string value by key.
- // -- The string remains valid until the next set/remove of the same key,
- // or until the map gets cleared.
const char *get(const char *key) const;
int getInt(const char *key) const;
float getFloat(const char *key) const;
- // Compare the order that key1 was set vs the order that key2 was set.
- //
- // Sets the order parameter to an integer less than, equal to, or greater
- // than zero if key1's set order was respectively, to be less than, to
- // match, or to be greater than key2's set order.
- //
- // Error codes:
- // * NAME_NOT_FOUND - if either key has not been set previously
- // * BAD_VALUE - if any of the parameters are NULL
- status_t compareSetOrder(const char *key1, const char *key2,
- /*out*/
- int *order) const;
-
void remove(const char *key);
void setPreviewSize(int width, int height);
@@ -108,7 +91,6 @@ public:
void setPreviewFrameRate(int fps);
int getPreviewFrameRate() const;
void getPreviewFpsRange(int *min_fps, int *max_fps) const;
- void setPreviewFpsRange(int min_fps, int max_fps);
void setPreviewFormat(const char *format);
const char *getPreviewFormat() const;
void setPictureSize(int width, int height);
@@ -693,91 +675,7 @@ public:
static const char LIGHTFX_HDR[];
private:
-
- // Quick and dirty map that maintains insertion order
- template <typename KeyT, typename ValueT>
- struct OrderedKeyedVector {
-
- ssize_t add(const KeyT& key, const ValueT& value) {
- return mList.add(Pair(key, value));
- }
-
- size_t size() const {
- return mList.size();
- }
-
- const KeyT& keyAt(size_t idx) const {
- return mList[idx].mKey;
- }
-
- const ValueT& valueAt(size_t idx) const {
- return mList[idx].mValue;
- }
-
- const ValueT& valueFor(const KeyT& key) const {
- ssize_t i = indexOfKey(key);
- LOG_ALWAYS_FATAL_IF(i<0, "%s: key not found", __PRETTY_FUNCTION__);
-
- return valueAt(i);
- }
-
- ssize_t indexOfKey(const KeyT& key) const {
- size_t vectorIdx = 0;
- for (; vectorIdx < mList.size(); ++vectorIdx) {
- if (mList[vectorIdx].mKey == key) {
- return (ssize_t) vectorIdx;
- }
- }
-
- return NAME_NOT_FOUND;
- }
-
- ssize_t removeItem(const KeyT& key) {
- size_t vectorIdx = (size_t) indexOfKey(key);
-
- if (vectorIdx < 0) {
- return vectorIdx;
- }
-
- return mList.removeAt(vectorIdx);
- }
-
- void clear() {
- mList.clear();
- }
-
- // Same as removing and re-adding. The key's index changes to max.
- ssize_t replaceValueFor(const KeyT& key, const ValueT& value) {
- removeItem(key);
- return add(key, value);
- }
-
- private:
-
- struct Pair {
- Pair() : mKey(), mValue() {}
- Pair(const KeyT& key, const ValueT& value) :
- mKey(key),
- mValue(value) {}
- KeyT mKey;
- ValueT mValue;
- };
-
- Vector<Pair> mList;
- };
-
- /**
- * Order matters: Keys that are set() later are stored later in the map.
- *
- * If two keys have meaning that conflict, then the later-set key
- * wins.
- *
- * For example, preview FPS and preview FPS range conflict since only
- * we only want to use the FPS range if that's the last thing that was set.
- * So in that case, only use preview FPS range if it was set later than
- * the preview FPS.
- */
- OrderedKeyedVector<String8,String8> mMap;
+ DefaultKeyedVector<String8,String8> mMap;
};
}; // namespace android