diff options
author | Andreas Huber <andih@google.com> | 2010-05-07 10:35:13 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-05-07 12:01:45 -0700 |
commit | ee7ff20e69498ebd53dd9717a0f984188341a75e (patch) | |
tree | 2338621414d60b23ec50dd5f28fc413fb957a59e /media/libstagefright/Utils.cpp | |
parent | f9325834de1ae004212aec2fd03445b4eebfa766 (diff) | |
download | frameworks_av-ee7ff20e69498ebd53dd9717a0f984188341a75e.zip frameworks_av-ee7ff20e69498ebd53dd9717a0f984188341a75e.tar.gz frameworks_av-ee7ff20e69498ebd53dd9717a0f984188341a75e.tar.bz2 |
A new OggExtractor/VorbisDecoder combo to support approximate seeking.
Change-Id: Id5d0c1c8b1adc62896bb5ed951f7b5cfda811e95
related-to-bug: 2654400
Diffstat (limited to 'media/libstagefright/Utils.cpp')
-rw-r--r-- | media/libstagefright/Utils.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp index 2720f93..c563ce6 100644 --- a/media/libstagefright/Utils.cpp +++ b/media/libstagefright/Utils.cpp @@ -32,6 +32,18 @@ uint64_t U64_AT(const uint8_t *ptr) { return ((uint64_t)U32_AT(ptr)) << 32 | U32_AT(ptr + 4); } +uint16_t U16LE_AT(const uint8_t *ptr) { + return ptr[0] | (ptr[1] << 8); +} + +uint32_t U32LE_AT(const uint8_t *ptr) { + return ptr[3] << 24 | ptr[2] << 16 | ptr[1] << 8 | ptr[0]; +} + +uint64_t U64LE_AT(const uint8_t *ptr) { + return ((uint64_t)U32LE_AT(ptr + 4)) << 32 | U32LE_AT(ptr); +} + // XXX warning: these won't work on big-endian host. uint64_t ntoh64(uint64_t x) { return ((uint64_t)ntohl(x & 0xffffffff) << 32) | ntohl(x >> 32); |