summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-11-14 08:44:39 -0800
committerGlenn Kasten <gkasten@google.com>2012-11-14 16:19:23 -0800
commit3b16c766d1ae2cfd8487e8ffb2b23936fc0a8e17 (patch)
tree56e1f373606202e5d5277f9645158d91b1a0a80c /include
parentb4a17e834b718eff1ba2eac4232de6e73a4bf9f5 (diff)
downloadframeworks_av-3b16c766d1ae2cfd8487e8ffb2b23936fc0a8e17.zip
frameworks_av-3b16c766d1ae2cfd8487e8ffb2b23936fc0a8e17.tar.gz
frameworks_av-3b16c766d1ae2cfd8487e8ffb2b23936fc0a8e17.tar.bz2
Use uint32_t for sample rate
Change-Id: Ie240b48fb54b08359f69ecd4e5f8bda3d15cbe80
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioSystem.h6
-rw-r--r--include/media/AudioTrack.h4
-rw-r--r--include/media/IAudioFlinger.h2
-rw-r--r--include/media/ToneGenerator.h2
4 files changed, 8 insertions, 6 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index d64ecd4..33078bb 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -87,7 +87,7 @@ public:
static float linearToLog(int volume);
static int logToLinear(float volume);
- static status_t getOutputSamplingRate(int* samplingRate,
+ static status_t getOutputSamplingRate(uint32_t* samplingRate,
audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
static status_t getOutputFrameCount(int* frameCount,
audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
@@ -95,7 +95,7 @@ public:
audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
static status_t getSamplingRate(audio_io_handle_t output,
audio_stream_type_t streamType,
- int* samplingRate);
+ uint32_t* samplingRate);
// returns the number of frames per audio HAL write buffer. Corresponds to
// audio_stream->get_buffer_size()/audio_stream_frame_size()
static status_t getFrameCount(audio_io_handle_t output,
@@ -237,7 +237,7 @@ public:
static const sp<IAudioPolicyService>& get_audio_policy_service();
// helpers for android.media.AudioManager.getProperty(), see description there for meaning
- static int32_t getPrimaryOutputSamplingRate();
+ static uint32_t getPrimaryOutputSamplingRate();
static int32_t getPrimaryOutputFrameCount();
// ----------------------------------------------------------------------------
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index b82f814..99d583d 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -282,7 +282,9 @@ public:
/* Set sample rate for this track in Hz, mostly used for games' sound effects
*/
- status_t setSampleRate(int sampleRate);
+ status_t setSampleRate(uint32_t sampleRate);
+
+ /* Return current sample rate in Hz, or 0 if unknown */
uint32_t getSampleRate() const;
/* Enables looping and sets the start and end points of looping.
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index 0aa48c6..5fd5044 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -192,7 +192,7 @@ public:
// helpers for android.media.AudioManager.getProperty(), see description there for meaning
// FIXME move these APIs to AudioPolicy to permit a more accurate implementation
// that looks on primary device for a stream with fast flag, primary flag, or first one.
- virtual int32_t getPrimaryOutputSamplingRate() = 0;
+ virtual uint32_t getPrimaryOutputSamplingRate() = 0;
virtual int32_t getPrimaryOutputFrameCount() = 0;
};
diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h
index 29c8fd9..0529bcd 100644
--- a/include/media/ToneGenerator.h
+++ b/include/media/ToneGenerator.h
@@ -263,7 +263,7 @@ private:
unsigned short mLoopCounter; // Current tone loopback count
- int mSamplingRate; // AudioFlinger Sampling rate
+ uint32_t mSamplingRate; // AudioFlinger Sampling rate
AudioTrack *mpAudioTrack; // Pointer to audio track used for playback
Mutex mLock; // Mutex to control concurent access to ToneGenerator object from audio callback and application API
Mutex mCbkCondLock; // Mutex associated to mWaitCbkCond