summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
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