diff options
author | Andreas Huber <andih@google.com> | 2010-11-15 09:03:03 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-11-15 09:03:03 -0800 |
commit | e332a9181cf6a3155ed1a0fd2afc212ccb1f2753 (patch) | |
tree | 71973a8c5dedf9c38180a30b21d90ffff4f92e22 /media/libstagefright/AwesomePlayer.cpp | |
parent | 2d71233de5450f1b128c8149fdbdf39b937f3cb8 (diff) | |
download | frameworks_av-e332a9181cf6a3155ed1a0fd2afc212ccb1f2753.zip frameworks_av-e332a9181cf6a3155ed1a0fd2afc212ccb1f2753.tar.gz frameworks_av-e332a9181cf6a3155ed1a0fd2afc212ccb1f2753.tar.bz2 |
More HTTP live support, AES encryption etc.
Change-Id: Ia5088042dd0a2181cb73cf8c7a2ff81e34b3064c
related-to-bug: 2368598
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index f084e28..41f5f30 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -49,6 +49,8 @@ #include <media/stagefright/foundation/ALooper.h> +#define USE_SURFACE_ALLOC 1 + namespace android { static int64_t kLowWaterMarkUs = 2000000ll; // 2secs @@ -294,6 +296,16 @@ 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")) { + mUri = "httplive://"; + mUri.append(&uri[7]); + } + } + if (headers) { mUriHeaders = *headers; } @@ -873,7 +885,7 @@ void AwesomePlayer::initRenderer_l() { IPCThreadState::self()->flushCommands(); if (mSurface != NULL) { - if (strncmp(component, "OMX.", 4) == 0) { + if (USE_SURFACE_ALLOC && strncmp(component, "OMX.", 4) == 0) { // Hardware decoders avoid the CPU color conversion by decoding // directly to ANativeBuffers, so we must use a renderer that // just pushes those buffers to the ANativeWindow. @@ -1143,7 +1155,7 @@ status_t AwesomePlayer::initVideoDecoder(uint32_t flags) { mClient.interface(), mVideoTrack->getFormat(), false, // createEncoder mVideoTrack, - NULL, flags, mSurface); + NULL, flags, USE_SURFACE_ALLOC ? mSurface : NULL); if (mVideoSource != NULL) { int64_t durationUs; |