diff options
author | Andreas Huber <andih@google.com> | 2010-06-10 11:16:10 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-06-10 11:27:06 -0700 |
commit | 1c70247536457f7b7fa84daa3482bd3d3b44e225 (patch) | |
tree | cfdaa243502d4944bc96b5656a74a5531b934925 /cmds/stagefright/stagefright.cpp | |
parent | 98c7c319907f4ed3915461ca62b1027590d351e5 (diff) | |
download | frameworks_av-1c70247536457f7b7fa84daa3482bd3d3b44e225.zip frameworks_av-1c70247536457f7b7fa84daa3482bd3d3b44e225.tar.gz frameworks_av-1c70247536457f7b7fa84daa3482bd3d3b44e225.tar.bz2 |
Simplify the code in the stagefright commandline utility.
Change-Id: Ia222b25ef12af34f6434421fd96b67eca800d1ab
Diffstat (limited to 'cmds/stagefright/stagefright.cpp')
-rw-r--r-- | cmds/stagefright/stagefright.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 94086fa..e2ad9e6 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -26,12 +26,11 @@ #include <binder/ProcessState.h> #include <media/IMediaPlayerService.h> #include <media/stagefright/AudioPlayer.h> -#include <media/stagefright/CachingDataSource.h> -#include <media/stagefright/FileSource.h> -#include <media/stagefright/HTTPDataSource.h> +#include <media/stagefright/DataSource.h> #include <media/stagefright/JPEGSource.h> #include <media/stagefright/MediaDebug.h> #include <media/stagefright/MediaDefs.h> +#include <media/stagefright/MediaErrors.h> #include <media/stagefright/MediaExtractor.h> #include <media/stagefright/MediaSource.h> #include <media/stagefright/MetaData.h> @@ -482,17 +481,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) { const char *filename = argv[k]; - sp<DataSource> dataSource; - if (!strncasecmp("http://", filename, 7)) { - dataSource = new HTTPDataSource(filename); - if (((HTTPDataSource *)dataSource.get())->connect() != OK) { - fprintf(stderr, "failed to connect to HTTP server.\n"); - return -1; - } - dataSource = new CachingDataSource(dataSource, 32 * 1024, 20); - } else { - dataSource = new FileSource(filename); - } + sp<DataSource> dataSource = DataSource::CreateFromURI(filename); if (dataSource == NULL) { fprintf(stderr, "Unable to create data source.\n"); |