summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-12-03 16:12:25 -0800
committerAndreas Huber <andih@google.com>2010-12-06 08:28:36 -0800
commita44153c1a57202fb538659eb50706e60454d6273 (patch)
tree4ba43d350d44fb4bd052ce3c562c4a2ad6658270 /media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
parent16afe2fb439cab6125bb46a07a8078d4ce1c1ea5 (diff)
downloadframeworks_av-a44153c1a57202fb538659eb50706e60454d6273.zip
frameworks_av-a44153c1a57202fb538659eb50706e60454d6273.tar.gz
frameworks_av-a44153c1a57202fb538659eb50706e60454d6273.tar.bz2
Squashed commit of the following:
commit 9254c845d7c82976fd4b8be406ce4b17eeb0e119 Author: Andreas Huber <andih@google.com> Date: Fri Dec 3 15:26:12 2010 -0800 Remove obsolete code from the cached data source. Change-Id: I794b986ac8977cbc834dff189221a636ba564e36 commit 2ee33711064c58c53ba65ed9e63dd4b01ec2380e Author: Andreas Huber <andih@google.com> Date: Fri Dec 3 15:23:13 2010 -0800 LiveSource is dead, long live LiveSession. Change-Id: Ibcd0731ecf9c94f0b3e5db3d53d012d9da2a1c66 commit 9eabb2c3cd8571ab859bdeae0aa7f655c414d8fa Author: Andreas Huber <andih@google.com> Date: Fri Dec 3 12:49:31 2010 -0800 Respect explicitly signalled discontinuities. Change-Id: I3c0c16a2de7a99742d25db7d1b2ff0258de52271 commit 7f7f7b6b906b6ece6e4d43af7fd5f494e805c5e5 Author: Andreas Huber <andih@google.com> Date: Fri Dec 3 11:45:57 2010 -0800 Better protection against syncword emulation in AAC ADTS content. Change-Id: I867e80a4556dd46d24ab3e781177c248a5221719 commit fe765766582efcc350aed01135ea603576adccf6 Author: Andreas Huber <andih@google.com> Date: Fri Dec 3 09:15:59 2010 -0800 New implementation of http live driving code. Change-Id: I31ddf3d6a0d5929b121be704a2b9c3d6775f7737 Change-Id: Id8d1829c8fcb173756965013f848c1d426ef1048
Diffstat (limited to 'media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp')
-rw-r--r--media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp b/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
index 3176810..600116e 100644
--- a/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
+++ b/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp
@@ -19,7 +19,7 @@
#include <utils/Log.h>
#include "include/MPEG2TSExtractor.h"
-#include "include/LiveSource.h"
+#include "include/LiveSession.h"
#include "include/NuCachedSource2.h"
#include <media/stagefright/DataSource.h>
@@ -82,8 +82,8 @@ sp<MetaData> MPEG2TSSource::getFormat() {
sp<MetaData> meta = mImpl->getFormat();
int64_t durationUs;
- if (mExtractor->mLiveSource != NULL
- && mExtractor->mLiveSource->getDuration(&durationUs)) {
+ if (mExtractor->mLiveSession != NULL
+ && mExtractor->mLiveSession->getDuration(&durationUs) == OK) {
meta->setInt64(kKeyDuration, durationUs);
}
@@ -226,32 +226,20 @@ status_t MPEG2TSExtractor::feedMore() {
return OK;
}
-void MPEG2TSExtractor::setLiveSource(const sp<LiveSource> &liveSource) {
+void MPEG2TSExtractor::setLiveSession(const sp<LiveSession> &liveSession) {
Mutex::Autolock autoLock(mLock);
- mLiveSource = liveSource;
+ mLiveSession = liveSession;
}
void MPEG2TSExtractor::seekTo(int64_t seekTimeUs) {
Mutex::Autolock autoLock(mLock);
- if (mLiveSource == NULL) {
+ if (mLiveSession == NULL) {
return;
}
- if (mDataSource->flags() & DataSource::kIsCachingDataSource) {
- static_cast<NuCachedSource2 *>(mDataSource.get())->suspend();
- }
-
- if (mLiveSource->seekTo(seekTimeUs)) {
- mParser->signalDiscontinuity(true /* isSeek */);
- mOffset = 0;
- }
-
- if (mDataSource->flags() & DataSource::kIsCachingDataSource) {
- static_cast<NuCachedSource2 *>(mDataSource.get())
- ->clearCacheAndResume();
- }
+ mLiveSession->seekTo(seekTimeUs);
}
uint32_t MPEG2TSExtractor::flags() const {
@@ -259,7 +247,7 @@ uint32_t MPEG2TSExtractor::flags() const {
uint32_t flags = CAN_PAUSE;
- if (mLiveSource != NULL && mLiveSource->isSeekable()) {
+ if (mLiveSession != NULL && mLiveSession->isSeekable()) {
flags |= CAN_SEEK_FORWARD | CAN_SEEK_BACKWARD | CAN_SEEK;
}