summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/DataSource.cpp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2013-02-13 09:27:28 -0800
committerMarco Nelissen <marcone@google.com>2013-02-15 10:03:04 -0800
commit05f625c46b992ab66b8d1527a366fe2746b4e3c7 (patch)
treed1279615e941531ec3a7d49f49469b32a836aae5 /media/libstagefright/DataSource.cpp
parent7deec82fbe9f73da5488a0ac4732122a505602cb (diff)
downloadframeworks_av-05f625c46b992ab66b8d1527a366fe2746b4e3c7.zip
frameworks_av-05f625c46b992ab66b8d1527a366fe2746b4e3c7.tar.gz
frameworks_av-05f625c46b992ab66b8d1527a366fe2746b4e3c7.tar.bz2
Add support for fragmented mp4 to MPEG4Extractor
This makes FragmentedMP4Extractor obsolete. It will be removed in a separate change. Change-Id: Ida74c07ccf84983e20a1320ee24ffc7a5c083859
Diffstat (limited to 'media/libstagefright/DataSource.cpp')
-rw-r--r--media/libstagefright/DataSource.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp
index 9d0eea2..bcf333e 100644
--- a/media/libstagefright/DataSource.cpp
+++ b/media/libstagefright/DataSource.cpp
@@ -59,6 +59,32 @@ bool DataSource::getUInt16(off64_t offset, uint16_t *x) {
return true;
}
+bool DataSource::getUInt32(off64_t offset, uint32_t *x) {
+ *x = 0;
+
+ uint32_t tmp;
+ if (readAt(offset, &tmp, 4) != 4) {
+ return false;
+ }
+
+ *x = ntohl(tmp);
+
+ return true;
+}
+
+bool DataSource::getUInt64(off64_t offset, uint64_t *x) {
+ *x = 0;
+
+ uint64_t tmp;
+ if (readAt(offset, &tmp, 8) != 8) {
+ return false;
+ }
+
+ *x = ntoh64(tmp);
+
+ return true;
+}
+
status_t DataSource::getSize(off64_t *size) {
*size = 0;