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
commitc869702b6aa0c4af48226c7385eee60a1642761c (patch)
treeb1923ee8cb01d81574c9c2ca074dd32e393c9772 /include
parent7a7cb483e0c6384d7a075962d77b79b2bbf46fb0 (diff)
parentbd381af4d618a4da78de99d05d44a10c0c37207b (diff)
downloadframeworks_av-c869702b6aa0c4af48226c7385eee60a1642761c.zip
frameworks_av-c869702b6aa0c4af48226c7385eee60a1642761c.tar.gz
frameworks_av-c869702b6aa0c4af48226c7385eee60a1642761c.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