summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-09-03 16:11:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-03 16:11:23 -0700
commitf701ddad1a4f58c368e3b642530849dcb57bb22c (patch)
treef35277a5d4de1d7d48e74737bfcf5bd1e6d3f71e
parentfe582a379aa775b34b6aba387eea046b6c4632f1 (diff)
parenta071bf884605f7bb34b45ee9f21476c9757c6d5b (diff)
downloadframeworks_av-f701ddad1a4f58c368e3b642530849dcb57bb22c.zip
frameworks_av-f701ddad1a4f58c368e3b642530849dcb57bb22c.tar.gz
frameworks_av-f701ddad1a4f58c368e3b642530849dcb57bb22c.tar.bz2
am a071bf88: am 894d6be4: Add NBAIO_Source::onTimestamp()
* commit 'a071bf884605f7bb34b45ee9f21476c9757c6d5b': 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