summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-09-03 16:08:26 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-03 16:08:26 -0700
commita071bf884605f7bb34b45ee9f21476c9757c6d5b (patch)
treeb9d110c32f90f7c722ce4669f11bee708c3f6b57
parent1a3a8078462e52b450dbad7443abaca1ca9cbfb8 (diff)
parent894d6be4f9b4721c77a01919ecf03b27cec90cc9 (diff)
downloadframeworks_av-a071bf884605f7bb34b45ee9f21476c9757c6d5b.zip
frameworks_av-a071bf884605f7bb34b45ee9f21476c9757c6d5b.tar.gz
frameworks_av-a071bf884605f7bb34b45ee9f21476c9757c6d5b.tar.bz2
am 894d6be4: Add NBAIO_Source::onTimestamp()
* commit '894d6be4f9b4721c77a01919ecf03b27cec90cc9': Add NBAIO_Source::onTimestamp()
-rw-r--r--include/media/nbaio/MonoPipeReader.h2
-rw-r--r--include/media/nbaio/NBAIO.h4
-rw-r--r--media/libnbaio/MonoPipeReader.cpp5
3 files changed, 11 insertions, 0 deletions
diff --git a/include/media/nbaio/MonoPipeReader.h b/include/media/nbaio/MonoPipeReader.h
index 0e1c992..78fe867 100644
--- a/include/media/nbaio/MonoPipeReader.h
+++ b/include/media/nbaio/MonoPipeReader.h
@@ -49,6 +49,8 @@ public:
virtual ssize_t read(void *buffer, size_t count, int64_t readPTS);
+ virtual void onTimestamp(const AudioTimestamp& timestamp);
+
// NBAIO_Source end
#if 0 // until necessary
diff --git a/include/media/nbaio/NBAIO.h b/include/media/nbaio/NBAIO.h
index cc5b3e6..1da0c73 100644
--- a/include/media/nbaio/NBAIO.h
+++ b/include/media/nbaio/NBAIO.h
@@ -306,6 +306,10 @@ public:
virtual ssize_t readVia(readVia_t via, size_t total, void *user,
int64_t readPTS, size_t block = 0);
+ // Invoked asynchronously by corresponding sink when a new timestamp is available.
+ // Default implementation ignores the timestamp.
+ virtual void onTimestamp(const AudioTimestamp& timestamp) { }
+
protected:
NBAIO_Source(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesRead(0) { }
virtual ~NBAIO_Source() { }
diff --git a/media/libnbaio/MonoPipeReader.cpp b/media/libnbaio/MonoPipeReader.cpp
index 394f6ac..851341a 100644
--- a/media/libnbaio/MonoPipeReader.cpp
+++ b/media/libnbaio/MonoPipeReader.cpp
@@ -86,4 +86,9 @@ ssize_t MonoPipeReader::read(void *buffer, size_t count, int64_t readPTS)
return red;
}
+void MonoPipeReader::onTimestamp(const AudioTimestamp& timestamp)
+{
+ mPipe->mTimestampMutator.push(timestamp);
+}
+
} // namespace android