diff options
author | Andreas Huber <andih@google.com> | 2011-07-13 09:36:11 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-07-13 09:47:09 -0700 |
commit | 67d464f47e842d5069e993408fd51ec122ad8019 (patch) | |
tree | f0881cc39a02c87b9d7efcf9068387dabdd0152e /media | |
parent | 9cba686366870b3a4c69bcec0eb4200352ce481d (diff) | |
download | frameworks_base-67d464f47e842d5069e993408fd51ec122ad8019.zip frameworks_base-67d464f47e842d5069e993408fd51ec122ad8019.tar.gz frameworks_base-67d464f47e842d5069e993408fd51ec122ad8019.tar.bz2 |
Enable signalling of a stream discontinuity involving a format-change
through IStreamListener.
Change-Id: Ic0409cdc4891ad26b61f2f98bdda3c7fb2e2de6a
related-to-bug: 5022434
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/IStreamSource.cpp | 3 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/StreamingSource.cpp | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/media/libmedia/IStreamSource.cpp b/media/libmedia/IStreamSource.cpp index c14ee82..b311f35 100644 --- a/media/libmedia/IStreamSource.cpp +++ b/media/libmedia/IStreamSource.cpp @@ -29,6 +29,9 @@ namespace android { // static const char *const IStreamListener::kKeyResumeAtPTS = "resume-at-PTS"; +// static +const char *const IStreamListener::kKeyFormatChange = "format-change"; + enum { // IStreamSource SET_LISTENER = IBinder::FIRST_CALL_TRANSACTION, diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp index bbc8a6e..a6a3a18 100644 --- a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp +++ b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp @@ -63,8 +63,17 @@ bool NuPlayer::StreamingSource::feedMoreTSData() { mEOS = true; break; } else if (n == INFO_DISCONTINUITY) { - mTSParser->signalDiscontinuity( - ATSParser::DISCONTINUITY_SEEK, extra); + ATSParser::DiscontinuityType type = ATSParser::DISCONTINUITY_SEEK; + + int32_t formatChange; + if (extra != NULL + && extra->findInt32( + IStreamListener::kKeyFormatChange, &formatChange) + && formatChange != 0) { + type = ATSParser::DISCONTINUITY_FORMATCHANGE; + } + + mTSParser->signalDiscontinuity(type, extra); } else if (n < 0) { CHECK_EQ(n, -EWOULDBLOCK); break; |