diff options
author | Robert Shih <robertshih@google.com> | 2014-07-16 15:47:09 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-07-31 10:32:23 -0700 |
commit | 3423bbdb05f843a64356fa24e8657f03ecbb7d65 (patch) | |
tree | ebe2761d0abe5f284d2c743efd2dab996b7be5c4 /media/libstagefright/mpeg2ts | |
parent | 63c0ce7ab7bd99d51414dcb4f765bc6faabf367d (diff) | |
download | frameworks_av-3423bbdb05f843a64356fa24e8657f03ecbb7d65.zip frameworks_av-3423bbdb05f843a64356fa24e8657f03ecbb7d65.tar.gz frameworks_av-3423bbdb05f843a64356fa24e8657f03ecbb7d65.tar.bz2 |
GenericSource: support track (de)selection
Bug: 15153976
Change-Id: Idfce856b4ca5fa7853da857757490798bc3ffe1e
Diffstat (limited to 'media/libstagefright/mpeg2ts')
-rw-r--r-- | media/libstagefright/mpeg2ts/AnotherPacketSource.cpp | 12 | ||||
-rw-r--r-- | media/libstagefright/mpeg2ts/AnotherPacketSource.h | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp index a0319ab..72c9dae 100644 --- a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp +++ b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp @@ -34,6 +34,7 @@ const int64_t kNearEOSMarkUs = 2000000ll; // 2 secs AnotherPacketSource::AnotherPacketSource(const sp<MetaData> &meta) : mIsAudio(false), + mIsVideo(false), mFormat(NULL), mLastQueuedTimeUs(0), mEOSResult(OK), @@ -45,6 +46,7 @@ void AnotherPacketSource::setFormat(const sp<MetaData> &meta) { CHECK(mFormat == NULL); mIsAudio = false; + mIsVideo = false; if (meta == NULL) { return; @@ -56,8 +58,10 @@ void AnotherPacketSource::setFormat(const sp<MetaData> &meta) { if (!strncasecmp("audio/", mime, 6)) { mIsAudio = true; + } else if (!strncasecmp("video/", mime, 6)) { + mIsVideo = true; } else { - CHECK(!strncasecmp("video/", mime, 6)); + CHECK(!strncasecmp("text/", mime, 5)); } } @@ -175,7 +179,11 @@ bool AnotherPacketSource::wasFormatChange( return (discontinuityType & ATSParser::DISCONTINUITY_AUDIO_FORMAT) != 0; } - return (discontinuityType & ATSParser::DISCONTINUITY_VIDEO_FORMAT) != 0; + if (mIsVideo) { + return (discontinuityType & ATSParser::DISCONTINUITY_VIDEO_FORMAT) != 0; + } + + return false; } void AnotherPacketSource::queueAccessUnit(const sp<ABuffer> &buffer) { diff --git a/media/libstagefright/mpeg2ts/AnotherPacketSource.h b/media/libstagefright/mpeg2ts/AnotherPacketSource.h index 06c49bd..f38f9dc 100644 --- a/media/libstagefright/mpeg2ts/AnotherPacketSource.h +++ b/media/libstagefright/mpeg2ts/AnotherPacketSource.h @@ -74,6 +74,7 @@ private: Condition mCondition; bool mIsAudio; + bool mIsVideo; sp<MetaData> mFormat; int64_t mLastQueuedTimeUs; List<sp<ABuffer> > mBuffers; |