diff options
author | James Dong <jdong@google.com> | 2010-06-24 19:55:31 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-06-24 21:59:25 -0700 |
commit | d3d4e5069e1af0437c4f5a7b4ba344bda5b937af (patch) | |
tree | 596bf02fa9495c743c1069ecb99b5f134afac850 /include | |
parent | 47c778f4a5fa639b2082fcc74080d33ac847b232 (diff) | |
download | frameworks_av-d3d4e5069e1af0437c4f5a7b4ba344bda5b937af.zip frameworks_av-d3d4e5069e1af0437c4f5a7b4ba344bda5b937af.tar.gz frameworks_av-d3d4e5069e1af0437c4f5a7b4ba344bda5b937af.tar.bz2 |
Track maximum amplitude and fix getMaxAmplitude()
- only start to track the max amplitude after the first call to getMaxAmplitude()
Change-Id: I64d3d9ca0542202a8535a211425e8bccceca50fc
Diffstat (limited to 'include')
-rw-r--r-- | include/media/stagefright/AudioSource.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/media/stagefright/AudioSource.h b/include/media/stagefright/AudioSource.h index f2001e1..628200d 100644 --- a/include/media/stagefright/AudioSource.h +++ b/include/media/stagefright/AudioSource.h @@ -39,6 +39,9 @@ struct AudioSource : public MediaSource { virtual status_t stop(); virtual sp<MetaData> getFormat(); + // Returns the maximum amplitude since last call. + int16_t getMaxAmplitude(); + virtual status_t read( MediaBuffer **buffer, const ReadOptions *options = NULL); @@ -53,13 +56,17 @@ private: bool mStarted; bool mCollectStats; + bool mTrackMaxAmplitude; int64_t mTotalReadTimeUs; int64_t mTotalReadBytes; int64_t mTotalReads; int64_t mStartTimeUs; + int16_t mMaxAmplitude; MediaBufferGroup *mGroup; + void trackMaxAmplitude(int16_t *data, int nSamples); + AudioSource(const AudioSource &); AudioSource &operator=(const AudioSource &); }; |