diff options
author | Andreas Huber <andih@google.com> | 2013-01-15 09:04:18 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2013-05-31 10:30:45 -0700 |
commit | 14f7672b5d450ed26a06fd3bb3ce045ea78b11b2 (patch) | |
tree | 1730ace584297a64946ed5dccc0ca596c2570d21 /cmds | |
parent | fbb70ce416b193655fbe5ff7f6c8676050bdf524 (diff) | |
download | frameworks_av-14f7672b5d450ed26a06fd3bb3ce045ea78b11b2.zip frameworks_av-14f7672b5d450ed26a06fd3bb3ce045ea78b11b2.tar.gz frameworks_av-14f7672b5d450ed26a06fd3bb3ce045ea78b11b2.tar.bz2 |
New HLS implementation supporting independent stream sources, audio-only streams
and more.
Change-Id: Icfc45a0100243b2f7a14a9e65696be45b67d6495
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/stagefright/stagefright.cpp | 52 |
1 files changed, 12 insertions, 40 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 115b07c..924cf6d 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -30,8 +30,6 @@ #include <binder/ProcessState.h> #include <media/IMediaPlayerService.h> #include <media/stagefright/foundation/ALooper.h> -#include <media/stagefright/foundation/AMessage.h> -#include "include/LiveSession.h" #include "include/NuCachedSource2.h" #include <media/stagefright/AudioPlayer.h> #include <media/stagefright/DataSource.h> @@ -678,7 +676,6 @@ int main(int argc, char **argv) { gDisplayHistogram = false; sp<ALooper> looper; - sp<LiveSession> liveSession; int res; while ((res = getopt(argc, argv, "han:lm:b:ptsrow:kxSTd:D:")) >= 0) { @@ -961,9 +958,7 @@ int main(int argc, char **argv) { sp<DataSource> dataSource = DataSource::CreateFromURI(filename); - if (strncasecmp(filename, "sine:", 5) - && strncasecmp(filename, "httplive://", 11) - && dataSource == NULL) { + if (strncasecmp(filename, "sine:", 5) && dataSource == NULL) { fprintf(stderr, "Unable to create data source.\n"); return 1; } @@ -995,44 +990,21 @@ int main(int argc, char **argv) { mediaSources.push(mediaSource); } } else { - sp<MediaExtractor> extractor; + sp<MediaExtractor> extractor = MediaExtractor::Create(dataSource); - if (!strncasecmp("httplive://", filename, 11)) { - String8 uri("http://"); - uri.append(filename + 11); - - if (looper == NULL) { - looper = new ALooper; - looper->start(); - } - liveSession = new LiveSession(NULL /* notify */); - looper->registerHandler(liveSession); - - liveSession->connect(uri.string()); - dataSource = liveSession->getDataSource(); - - extractor = - MediaExtractor::Create( - dataSource, MEDIA_MIMETYPE_CONTAINER_MPEG2TS); - - syncInfoPresent = false; - } else { - extractor = MediaExtractor::Create(dataSource); - - if (extractor == NULL) { - fprintf(stderr, "could not create extractor.\n"); - return -1; - } + if (extractor == NULL) { + fprintf(stderr, "could not create extractor.\n"); + return -1; + } - sp<MetaData> meta = extractor->getMetaData(); + sp<MetaData> meta = extractor->getMetaData(); - if (meta != NULL) { - const char *mime; - CHECK(meta->findCString(kKeyMIMEType, &mime)); + if (meta != NULL) { + const char *mime; + CHECK(meta->findCString(kKeyMIMEType, &mime)); - if (!strcasecmp(mime, MEDIA_MIMETYPE_CONTAINER_MPEG2TS)) { - syncInfoPresent = false; - } + if (!strcasecmp(mime, MEDIA_MIMETYPE_CONTAINER_MPEG2TS)) { + syncInfoPresent = false; } } |