summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/mpeg2ts/AnotherPacketSource.cpp')
-rw-r--r--media/libstagefright/mpeg2ts/AnotherPacketSource.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
index 0878a1b..cabde32 100644
--- a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
+++ b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
@@ -394,6 +394,20 @@ bool AnotherPacketSource::hasDataBufferAvailable(status_t *finalResult) {
return false;
}
+size_t AnotherPacketSource::getAvailableBufferCount(status_t *finalResult) {
+ Mutex::Autolock autoLock(mLock);
+
+ *finalResult = OK;
+ if (!mEnabled) {
+ return 0;
+ }
+ if (!mBuffers.empty()) {
+ return mBuffers.size();
+ }
+ *finalResult = mEOSResult;
+ return 0;
+}
+
int64_t AnotherPacketSource::getBufferedDurationUs(status_t *finalResult) {
Mutex::Autolock autoLock(mLock);
*finalResult = mEOSResult;