summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-06-24 19:55:31 -0700
committerJames Dong <jdong@google.com>2010-06-24 21:59:25 -0700
commitd3d4e5069e1af0437c4f5a7b4ba344bda5b937af (patch)
tree596bf02fa9495c743c1069ecb99b5f134afac850 /include
parent47c778f4a5fa639b2082fcc74080d33ac847b232 (diff)
downloadframeworks_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.h7
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 &);
};