diff options
author | Andreas Huber <andih@google.com> | 2011-08-16 09:34:26 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2012-08-03 13:57:32 -0700 |
commit | 840667883fd09d44015716d79bc3ac4d60edc0f0 (patch) | |
tree | cb55492dbe3ca64b2ab9ba2f5a3bb6d0a0bcf650 /cmds | |
parent | 9cb20d4a41eb84bfab7f9f0d0829393f378583f4 (diff) | |
download | frameworks_av-840667883fd09d44015716d79bc3ac4d60edc0f0.zip frameworks_av-840667883fd09d44015716d79bc3ac4d60edc0f0.tar.gz frameworks_av-840667883fd09d44015716d79bc3ac4d60edc0f0.tar.bz2 |
experimental support for fragmented mp4 playback in nuplayer
cherry picked from change 170999
Change-Id: I407775f0290154ad4961134839a15c9f296424c0
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/stagefright/Android.mk | 2 | ||||
-rw-r--r-- | cmds/stagefright/stream.cpp | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/cmds/stagefright/Android.mk b/cmds/stagefright/Android.mk index 8687fab..1247588 100644 --- a/cmds/stagefright/Android.mk +++ b/cmds/stagefright/Android.mk @@ -104,7 +104,7 @@ LOCAL_SRC_FILES:= \ LOCAL_SHARED_LIBRARIES := \ libstagefright liblog libutils libbinder libgui \ - libstagefright_foundation libmedia libmedia_native + libstagefright_foundation libmedia libmedia_native libcutils LOCAL_C_INCLUDES:= \ frameworks/av/media/libstagefright \ diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp index a9f0ab2..8e7861e 100644 --- a/cmds/stagefright/stream.cpp +++ b/cmds/stagefright/stream.cpp @@ -19,6 +19,7 @@ #include "utils/Log.h" #include <binder/ProcessState.h> +#include <cutils/properties.h> // for property_get #include <media/IStreamSource.h> #include <media/mediaplayer.h> @@ -342,8 +343,13 @@ int main(int argc, char **argv) { sp<IStreamSource> source; + char prop[PROPERTY_VALUE_MAX]; + bool usemp4 = property_get("media.stagefright.use-mp4source", prop, NULL) && + (!strcmp(prop, "1") || !strcasecmp(prop, "true")); + size_t len = strlen(argv[1]); - if (len >= 3 && !strcasecmp(".ts", &argv[1][len - 3])) { + if ((!usemp4 && len >= 3 && !strcasecmp(".ts", &argv[1][len - 3])) || + (usemp4 && len >= 4 && !strcasecmp(".mp4", &argv[1][len - 4]))) { int fd = open(argv[1], O_RDONLY); if (fd < 0) { |