From 1c70247536457f7b7fa84daa3482bd3d3b44e225 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Thu, 10 Jun 2010 11:16:10 -0700 Subject: Simplify the code in the stagefright commandline utility. Change-Id: Ia222b25ef12af34f6434421fd96b67eca800d1ab --- cmds/stagefright/Android.mk | 1 + cmds/stagefright/stagefright.cpp | 17 +++-------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/cmds/stagefright/Android.mk b/cmds/stagefright/Android.mk index 34648b5..80d0d2b 100644 --- a/cmds/stagefright/Android.mk +++ b/cmds/stagefright/Android.mk @@ -14,6 +14,7 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_C_INCLUDES:= \ $(JNI_H_INCLUDE) \ frameworks/base/media/libstagefright \ + frameworks/base/media/libstagefright/include \ $(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include LOCAL_CFLAGS += -Wno-multichar 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 #include #include -#include -#include -#include +#include #include #include #include +#include #include #include #include @@ -482,17 +481,7 @@ int main(int argc, char **argv) { for (int k = 0; k < argc; ++k) { const char *filename = argv[k]; - sp 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::CreateFromURI(filename); if (dataSource == NULL) { fprintf(stderr, "Unable to create data source.\n"); -- cgit v1.1