diff options
author | Glenn Kasten <gkasten@google.com> | 2012-04-01 13:49:17 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-04-01 13:49:17 -0700 |
commit | edf47a8cba2d1d8985b64bf4a4fac661ba34f35a (patch) | |
tree | b97857a666d64b1633ba6598db61158010de4cc8 | |
parent | a1472d9883e35edd280201c8be3191695007dfd4 (diff) | |
download | frameworks_av-edf47a8cba2d1d8985b64bf4a4fac661ba34f35a.zip frameworks_av-edf47a8cba2d1d8985b64bf4a4fac661ba34f35a.tar.gz frameworks_av-edf47a8cba2d1d8985b64bf4a4fac661ba34f35a.tar.bz2 |
Update AudioParameter
Use definitions for AUDIO_PARAMETER_STREAM_* from <hardware/audio.h>
instead of repeating these constants.
String constants are const char * const.
Change-Id: I1c9ebe0bc9c827d719d3181aea55251c6db28ec4
-rw-r--r-- | include/media/AudioParameter.h | 12 | ||||
-rw-r--r-- | media/libmedia/AudioParameter.cpp | 14 |
2 files changed, 14 insertions, 12 deletions
diff --git a/include/media/AudioParameter.h b/include/media/AudioParameter.h index 79d5d82..8cb2fa7 100644 --- a/include/media/AudioParameter.h +++ b/include/media/AudioParameter.h @@ -40,12 +40,12 @@ public: // keyFrameCount: to change audio output frame count, value is an int // keyInputSource: to change audio input source, value is an int in audio_source_t // (defined in media/mediarecorder.h) - static const char *keyRouting; - static const char *keySamplingRate; - static const char *keyFormat; - static const char *keyChannels; - static const char *keyFrameCount; - static const char *keyInputSource; + static const char * const keyRouting; + static const char * const keySamplingRate; + static const char * const keyFormat; + static const char * const keyChannels; + static const char * const keyFrameCount; + static const char * const keyInputSource; String8 toString(); diff --git a/media/libmedia/AudioParameter.cpp b/media/libmedia/AudioParameter.cpp index abc7b3f..9766ee6 100644 --- a/media/libmedia/AudioParameter.cpp +++ b/media/libmedia/AudioParameter.cpp @@ -19,16 +19,18 @@ #include <utils/Log.h> +#include <hardware/audio.h> #include <media/AudioParameter.h> namespace android { -const char *AudioParameter::keyRouting = "routing"; -const char *AudioParameter::keySamplingRate = "sampling_rate"; -const char *AudioParameter::keyFormat = "format"; -const char *AudioParameter::keyChannels = "channels"; -const char *AudioParameter::keyFrameCount = "frame_count"; -const char *AudioParameter::keyInputSource = "input_source"; +// static +const char * const AudioParameter::keyRouting = AUDIO_PARAMETER_STREAM_ROUTING; +const char * const AudioParameter::keySamplingRate = AUDIO_PARAMETER_STREAM_SAMPLING_RATE; +const char * const AudioParameter::keyFormat = AUDIO_PARAMETER_STREAM_FORMAT; +const char * const AudioParameter::keyChannels = AUDIO_PARAMETER_STREAM_CHANNELS; +const char * const AudioParameter::keyFrameCount = AUDIO_PARAMETER_STREAM_FRAME_COUNT; +const char * const AudioParameter::keyInputSource = AUDIO_PARAMETER_STREAM_INPUT_SOURCE; AudioParameter::AudioParameter(const String8& keyValuePairs) { |