summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-08-20 15:35:39 -0700
committerAndreas Huber <andih@google.com>2009-08-20 15:35:39 -0700
commit2ea76ead54982376e32ab196093babded80e05e4 (patch)
tree60d107529a284e404b3e3691f436065658dfe9d5 /cmds
parent7530e9c708275c273c134c36c68179f511c1940e (diff)
downloadframeworks_av-2ea76ead54982376e32ab196093babded80e05e4.zip
frameworks_av-2ea76ead54982376e32ab196093babded80e05e4.tar.gz
frameworks_av-2ea76ead54982376e32ab196093babded80e05e4.tar.bz2
Enable specification of http:// urls in stagefright commandline tool.
Diffstat (limited to 'cmds')
-rw-r--r--cmds/stagefright/stagefright.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 185e6ac..6b2d8ad 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -23,6 +23,8 @@
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
#include <media/IMediaPlayerService.h>
+#include <media/stagefright/CachingDataSource.h>
+#include <media/stagefright/HTTPDataSource.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/MediaPlayerImpl.h>
#include <media/stagefright/MediaExtractor.h>
@@ -191,7 +193,13 @@ int main(int argc, char **argv) {
for (int k = 0; k < argc; ++k) {
const char *filename = argv[k];
- sp<MmapSource> dataSource = new MmapSource(filename);
+ sp<DataSource> dataSource;
+ if (!strncasecmp("http://", filename, 7)) {
+ dataSource = new HTTPDataSource(filename);
+ dataSource = new CachingDataSource(dataSource, 64 * 1024, 10);
+ } else {
+ dataSource = new MmapSource(filename);
+ }
bool isJPEG = false;