diff options
author | Andreas Huber <andih@google.com> | 2011-02-16 09:05:38 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-02-16 09:19:40 -0800 |
commit | ed8d14f6a934072cd012992c4ef16990a54baa9a (patch) | |
tree | e38162fe54457b3b943eb7e049dfd122822aa3fe /media/libstagefright/AwesomePlayer.cpp | |
parent | d48a6044fddc910f17e67650f280e91e7aaf5e65 (diff) | |
download | frameworks_av-ed8d14f6a934072cd012992c4ef16990a54baa9a.zip frameworks_av-ed8d14f6a934072cd012992c4ef16990a54baa9a.tar.gz frameworks_av-ed8d14f6a934072cd012992c4ef16990a54baa9a.tar.bz2 |
Remove legacy, AwesomePlayer-based http live implementation.
Change-Id: I455d0faa5612dcd4d2bb6f2b3c7b64a1caaabf69
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 85 |
1 files changed, 1 insertions, 84 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; |