diff options
author | Marco Nelissen <marcone@google.com> | 2013-02-13 09:27:28 -0800 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2013-02-15 10:03:04 -0800 |
commit | 05f625c46b992ab66b8d1527a366fe2746b4e3c7 (patch) | |
tree | d1279615e941531ec3a7d49f49469b32a836aae5 /media/libstagefright/DataSource.cpp | |
parent | 7deec82fbe9f73da5488a0ac4732122a505602cb (diff) | |
download | frameworks_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.cpp | 26 |
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; |