summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/camera/CameraParameters.h104
-rw-r--r--include/media/AudioEffect.h11
-rw-r--r--include/media/AudioSystem.h9
3 files changed, 13 insertions, 111 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
diff --git a/include/media/AudioEffect.h b/include/media/AudioEffect.h
index f3024b7..01dcbb2 100644
--- a/include/media/AudioEffect.h
+++ b/include/media/AudioEffect.h
@@ -217,8 +217,9 @@ public:
* higher priorities, 0 being the normal priority.
* cbf: optional callback function (see effect_callback_t)
* user: pointer to context for use by the callback receiver.
- * sessionID: audio session this effect is associated to. If 0, the effect will be global to
- * the output mix. If not 0, the effect will be applied to all players
+ * sessionID: audio session this effect is associated to.
+ * If equal to AUDIO_SESSION_OUTPUT_MIX, the effect will be global to
+ * the output mix. Otherwise, the effect will be applied to all players
* (AudioTrack or MediaPLayer) within the same audio session.
* io: HAL audio output or input stream to which this effect must be attached. Leave at 0 for
* automatic output selection by AudioFlinger.
@@ -229,7 +230,7 @@ public:
int32_t priority = 0,
effect_callback_t cbf = NULL,
void* user = NULL,
- int sessionId = 0,
+ int sessionId = AUDIO_SESSION_OUTPUT_MIX,
audio_io_handle_t io = 0
);
@@ -241,7 +242,7 @@ public:
int32_t priority = 0,
effect_callback_t cbf = NULL,
void* user = NULL,
- int sessionId = 0,
+ int sessionId = AUDIO_SESSION_OUTPUT_MIX,
audio_io_handle_t io = 0
);
@@ -263,7 +264,7 @@ public:
int32_t priority = 0,
effect_callback_t cbf = NULL,
void* user = NULL,
- int sessionId = 0,
+ int sessionId = AUDIO_SESSION_OUTPUT_MIX,
audio_io_handle_t io = 0
);
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index a09967b..402b479 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -113,7 +113,6 @@ public:
// returns the audio output stream latency in ms. Corresponds to
// audio_stream_out->get_latency()
static status_t getLatency(audio_io_handle_t output,
- audio_stream_type_t stream,
uint32_t* latency);
static bool routedToA2dpOutput(audio_stream_type_t streamType);
@@ -139,7 +138,13 @@ public:
// return the number of input frames lost by HAL implementation, or 0 if the handle is invalid
static uint32_t getInputFramesLost(audio_io_handle_t ioHandle);
+ // Allocate a new audio session ID and return that new ID.
+ // If unable to contact AudioFlinger, returns AUDIO_SESSION_ALLOCATE instead.
+ // FIXME If AudioFlinger were to ever exhaust the session ID namespace,
+ // this method could fail by returning either AUDIO_SESSION_ALLOCATE
+ // or an unspecified existing session ID.
static int newAudioSessionId();
+
static void acquireAudioSessionId(int audioSession, pid_t pid);
static void releaseAudioSessionId(int audioSession, pid_t pid);
@@ -316,8 +321,6 @@ private:
static sp<IAudioPolicyService> gAudioPolicyService;
- // mapping between stream types and outputs
- static DefaultKeyedVector<audio_stream_type_t, audio_io_handle_t> gStreamOutputMap;
// list of output descriptors containing cached parameters
// (sampling rate, framecount, channel count...)
static DefaultKeyedVector<audio_io_handle_t, OutputDescriptor *> gOutputs;