summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/foundation
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-08-16 09:34:26 -0700
committerMarco Nelissen <marcone@google.com>2012-08-03 13:57:32 -0700
commit840667883fd09d44015716d79bc3ac4d60edc0f0 (patch)
treecb55492dbe3ca64b2ab9ba2f5a3bb6d0a0bcf650 /media/libstagefright/foundation
parent9cb20d4a41eb84bfab7f9f0d0829393f378583f4 (diff)
downloadframeworks_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 'media/libstagefright/foundation')
-rw-r--r--media/libstagefright/foundation/AMessage.cpp16
-rw-r--r--media/libstagefright/foundation/hexdump.cpp21
2 files changed, 33 insertions, 4 deletions
diff --git a/media/libstagefright/foundation/AMessage.cpp b/media/libstagefright/foundation/AMessage.cpp
index 8b01ac6..dc42f91 100644
--- a/media/libstagefright/foundation/AMessage.cpp
+++ b/media/libstagefright/foundation/AMessage.cpp
@@ -25,6 +25,7 @@
#include "AString.h"
#include <binder/Parcel.h>
+#include <media/stagefright/foundation/hexdump.h>
namespace android {
@@ -399,9 +400,20 @@ AString AMessage::debugString(int32_t indent) const {
"RefBase *%s = %p", item.mName, item.u.refValue);
break;
case kTypeBuffer:
- tmp = StringPrintf(
- "ABuffer *%s = %p", item.mName, item.u.refValue);
+ {
+ sp<ABuffer> buffer = static_cast<ABuffer *>(item.u.refValue);
+
+ if (buffer != NULL && buffer->size() <= 64) {
+ tmp = StringPrintf("Buffer %s = {\n", item.mName);
+ hexdump(buffer->data(), buffer->size(), indent + 4, &tmp);
+ appendIndent(&tmp, indent + 2);
+ tmp.append("}");
+ } else {
+ tmp = StringPrintf(
+ "Buffer *%s = %p", item.mName, buffer.get());
+ }
break;
+ }
case kTypeMessage:
tmp = StringPrintf(
"AMessage %s = %s",
diff --git a/media/libstagefright/foundation/hexdump.cpp b/media/libstagefright/foundation/hexdump.cpp
index 16c1ca5..a44d832 100644
--- a/media/libstagefright/foundation/hexdump.cpp
+++ b/media/libstagefright/foundation/hexdump.cpp
@@ -29,13 +29,25 @@
namespace android {
-void hexdump(const void *_data, size_t size) {
+static void appendIndent(AString *s, int32_t indent) {
+ static const char kWhitespace[] =
+ " "
+ " ";
+
+ CHECK_LT((size_t)indent, sizeof(kWhitespace));
+
+ s->append(kWhitespace, indent);
+}
+
+void hexdump(const void *_data, size_t size, size_t indent, AString *appendTo) {
const uint8_t *data = (const uint8_t *)_data;
size_t offset = 0;
while (offset < size) {
AString line;
+ appendIndent(&line, indent);
+
char tmp[32];
sprintf(tmp, "%08lx: ", (unsigned long)offset);
@@ -67,7 +79,12 @@ void hexdump(const void *_data, size_t size) {
}
}
- ALOGI("%s", line.c_str());
+ if (appendTo != NULL) {
+ appendTo->append(line);
+ appendTo->append("\n");
+ } else {
+ ALOGI("%s", line.c_str());
+ }
offset += 16;
}