diff options
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 85 | ||||
-rw-r--r-- | media/libstagefright/httplive/LiveSession.cpp | 12 | ||||
-rw-r--r-- | media/libstagefright/include/AwesomePlayer.h | 5 | ||||
-rw-r--r-- | media/libstagefright/mpeg2ts/ATSParser.cpp | 15 | ||||
-rw-r--r-- | media/libstagefright/mpeg2ts/ATSParser.h | 1 | ||||
-rw-r--r-- | media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp | 9 |
6 files changed, 2 insertions, 125 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index ec5e7a8..8866750 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -44,7 +44,6 @@ #include <media/stagefright/foundation/ALooper.h> #include <media/stagefright/foundation/AMessage.h> -#include "include/LiveSession.h" #define USE_SURFACE_ALLOC 1 #define FRAME_DROP_FREQ 7 @@ -233,17 +232,6 @@ status_t AwesomePlayer::setDataSource_l( mUri = uri; - if (!strncmp("http://", uri, 7)) { - // Hack to support http live. - - size_t len = strlen(uri); - if (!strcasecmp(&uri[len - 5], ".m3u8") - || strstr(&uri[7], "m3u8") != NULL) { - mUri = "httplive://"; - mUri.append(&uri[7]); - } - } - if (headers) { mUriHeaders = *headers; } @@ -448,11 +436,6 @@ void AwesomePlayer::reset_l() { mRTSPController.clear(); } - if (mLiveSession != NULL) { - mLiveSession->disconnect(); - mLiveSession.clear(); - } - if (mVideoSource != NULL) { mVideoSource->stop(); @@ -655,35 +638,6 @@ void AwesomePlayer::onBufferingUpdate() { postBufferingEvent_l(); } -void AwesomePlayer::partial_reset_l() { - // Only reset the video renderer and shut down the video decoder. - // Then instantiate a new video decoder and resume video playback. - - mVideoRenderer.clear(); - - if (mVideoBuffer) { - mVideoBuffer->release(); - mVideoBuffer = NULL; - } - - { - mVideoSource->stop(); - - // The following hack is necessary to ensure that the OMX - // component is completely released by the time we may try - // to instantiate it again. - wp<MediaSource> tmp = mVideoSource; - mVideoSource.clear(); - while (tmp.promote() != NULL) { - usleep(1000); - } - IPCThreadState::self()->flushCommands(); - } - - CHECK_EQ((status_t)OK, - initVideoDecoder(OMXCodec::kIgnoreCodecSpecificData)); -} - void AwesomePlayer::onStreamDone() { // Posted whenever any stream finishes playing. @@ -693,21 +647,7 @@ void AwesomePlayer::onStreamDone() { } mStreamDoneEventPending = false; - if (mStreamDoneStatus == INFO_DISCONTINUITY) { - // This special status is returned because an http live stream's - // video stream switched to a different bandwidth at this point - // and future data may have been encoded using different parameters. - // This requires us to shutdown the video decoder and reinstantiate - // a fresh one. - - LOGV("INFO_DISCONTINUITY"); - - CHECK(mVideoSource != NULL); - - partial_reset_l(); - postVideoEvent_l(); - return; - } else if (mStreamDoneStatus != ERROR_END_OF_STREAM) { + if (mStreamDoneStatus != ERROR_END_OF_STREAM) { LOGV("MEDIA_ERROR %d", mStreamDoneStatus); notifyListener_l( @@ -1593,29 +1533,6 @@ status_t AwesomePlayer::finishSetDataSource_l() { LOGI("Prepare cancelled while waiting for initial cache fill."); return UNKNOWN_ERROR; } - } else if (!strncasecmp(mUri.string(), "httplive://", 11)) { - String8 uri("http://"); - uri.append(mUri.string() + 11); - - if (mLooper == NULL) { - mLooper = new ALooper; - mLooper->setName("httplive"); - mLooper->start(); - } - - mLiveSession = new LiveSession; - mLooper->registerHandler(mLiveSession); - - mLiveSession->connect(uri.string()); - dataSource = mLiveSession->getDataSource(); - - sp<MediaExtractor> extractor = - MediaExtractor::Create(dataSource, MEDIA_MIMETYPE_CONTAINER_MPEG2TS); - - static_cast<MPEG2TSExtractor *>(extractor.get()) - ->setLiveSession(mLiveSession); - - return setDataSource_l(extractor); } else if (!strncasecmp("rtsp://", mUri.string(), 7)) { if (mLooper == NULL) { mLooper = new ALooper; diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp index 0bed3ca..f7a9085 100644 --- a/media/libstagefright/httplive/LiveSession.cpp +++ b/media/libstagefright/httplive/LiveSession.cpp @@ -168,18 +168,6 @@ void LiveSession::onConnect(const sp<AMessage> &msg) { CHECK_GT(mBandwidthItems.size(), 0u); mBandwidthItems.sort(SortByBandwidth); - - char value[PROPERTY_VALUE_MAX]; - if (property_get("media.httplive.disable-nuplayer", value, NULL) - && (!strcasecmp(value, "true") || !strcmp(value, "1"))) { - // The "legacy" player cannot deal with audio format changes, - // some streams use different audio encoding parameters for - // their lowest bandwidth stream. - if (mBandwidthItems.size() > 1) { - // XXX Remove the lowest bitrate stream for now... - mBandwidthItems.removeAt(0); - } - } } postMonitorQueue(); diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h index 98b8c05..1497732 100644 --- a/media/libstagefright/include/AwesomePlayer.h +++ b/media/libstagefright/include/AwesomePlayer.h @@ -43,8 +43,6 @@ struct ARTSPController; class DrmManagerClinet; class DecryptHandle; -struct LiveSession; - struct AwesomeRenderer : public RefBase { AwesomeRenderer() {} @@ -207,8 +205,6 @@ private: sp<ARTSPController> mRTSPController; sp<ARTSPController> mConnectingRTSPController; - sp<LiveSession> mLiveSession; - DrmManagerClient *mDrmManagerClient; DecryptHandle *mDecryptHandle; @@ -219,7 +215,6 @@ private: status_t setDataSource_l(const sp<DataSource> &dataSource); status_t setDataSource_l(const sp<MediaExtractor> &extractor); void reset_l(); - void partial_reset_l(); status_t seekTo_l(int64_t timeUs); status_t pause_l(bool at_eos = false); void initRenderer_l(); diff --git a/media/libstagefright/mpeg2ts/ATSParser.cpp b/media/libstagefright/mpeg2ts/ATSParser.cpp index 4335b99..6056739 100644 --- a/media/libstagefright/mpeg2ts/ATSParser.cpp +++ b/media/libstagefright/mpeg2ts/ATSParser.cpp @@ -371,21 +371,6 @@ void ATSParser::Stream::signalDiscontinuity(DiscontinuityType type) { mBuffer->setRange(0, 0); switch (type) { - case DISCONTINUITY_HTTPLIVE: - { - mQueue.clear(true); - - if (mStreamType == 0x1b) { - // Don't signal discontinuities on audio streams. - if (mSource != NULL) { - mSource->queueDiscontinuity(type); - } else { - deferDiscontinuity(type); - } - } - break; - } - case DISCONTINUITY_SEEK: case DISCONTINUITY_FORMATCHANGE: { diff --git a/media/libstagefright/mpeg2ts/ATSParser.h b/media/libstagefright/mpeg2ts/ATSParser.h index ec3be84..455f9d5 100644 --- a/media/libstagefright/mpeg2ts/ATSParser.h +++ b/media/libstagefright/mpeg2ts/ATSParser.h @@ -34,7 +34,6 @@ struct MediaSource; struct ATSParser : public RefBase { enum DiscontinuityType { DISCONTINUITY_NONE, - DISCONTINUITY_HTTPLIVE, DISCONTINUITY_SEEK, DISCONTINUITY_FORMATCHANGE }; diff --git a/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp b/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp index a1f0796..dfec47f 100644 --- a/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp +++ b/media/libstagefright/mpeg2ts/MPEG2TSExtractor.cpp @@ -202,20 +202,13 @@ void MPEG2TSExtractor::init() { LOGI("haveAudio=%d, haveVideo=%d", haveAudio, haveVideo); } -static bool isDiscontinuity(const uint8_t *data, ssize_t size) { - return size == 188 && data[0] == 0x00; -} - status_t MPEG2TSExtractor::feedMore() { Mutex::Autolock autoLock(mLock); uint8_t packet[kTSPacketSize]; ssize_t n = mDataSource->readAt(mOffset, packet, kTSPacketSize); - if (isDiscontinuity(packet, n)) { - LOGI("XXX discontinuity detected"); - mParser->signalDiscontinuity(ATSParser::DISCONTINUITY_HTTPLIVE); - } else if (n < (ssize_t)kTSPacketSize) { + if (n < (ssize_t)kTSPacketSize) { return (n < 0) ? (status_t)n : ERROR_END_OF_STREAM; } else { mParser->feedTSPacket(packet, kTSPacketSize); |