summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-08-30 11:01:13 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-30 11:01:13 -0700
commit86b1961a8d61086ef8d5475182f2a3cf4392b42c (patch)
tree2d1de1410cae399dbcdd39cafdff2b0d7c66f912 /include
parent546436a4569ec76ddfba78783851440edf990fbc (diff)
parent082830f92373a1b9e512dbbfb940187ffa1c2c6f (diff)
downloadframeworks_av-86b1961a8d61086ef8d5475182f2a3cf4392b42c.zip
frameworks_av-86b1961a8d61086ef8d5475182f2a3cf4392b42c.tar.gz
frameworks_av-86b1961a8d61086ef8d5475182f2a3cf4392b42c.tar.bz2
Merge "Prepare for transmitting audio through AudioSource." into jb-mr1-dev
Diffstat (limited to 'include')
-rw-r--r--include/media/stagefright/AudioSource.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h
index f5466e8..de7edf3 100644
--- a/include/media/stagefright/AudioSource.h
+++ b/include/media/stagefright/AudioSource.h
@@ -31,11 +31,12 @@ namespace android {
class AudioRecord;
struct AudioSource : public MediaSource, public MediaBufferObserver {
- // Note that the "channels" parameter is _not_ the number of channels,
- // but a bitmask of audio_channels_t constants.
+ // Note that the "channels" parameter _is_ the number of channels,
+ // _not_ a bitmask of audio_channels_t constants.
AudioSource(
- audio_source_t inputSource, uint32_t sampleRate,
- uint32_t channels = AUDIO_CHANNEL_IN_MONO);
+ audio_source_t inputSource,
+ uint32_t sampleRate,
+ uint32_t channels = 1);
status_t initCheck() const;
@@ -49,9 +50,15 @@ struct AudioSource : public MediaSource, public MediaBufferObserver {
virtual status_t read(
MediaBuffer **buffer, const ReadOptions *options = NULL);
- status_t dataCallbackTimestamp(const AudioRecord::Buffer& buffer, int64_t timeUs);
+ status_t dataCallback(const AudioRecord::Buffer& buffer);
virtual void signalBufferReturned(MediaBuffer *buffer);
+ // If useLooperTime == true, buffers will carry absolute timestamps
+ // as returned by ALooper::GetNowUs(), otherwise systemTime() is used
+ // and buffers contain timestamps relative to start time.
+ // The default is to _not_ use looper time.
+ void setUseLooperTime(bool useLooperTime);
+
protected:
virtual ~AudioSource();
@@ -87,6 +94,8 @@ private:
List<MediaBuffer * > mBuffersReceived;
+ bool mUseLooperTime;
+
void trackMaxAmplitude(int16_t *data, int nSamples);
// This is used to raise the volume from mute to the