summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/DataSource.cpp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2013-04-08 14:30:57 -0700
committerMarco Nelissen <marcone@google.com>2013-04-08 16:34:27 -0700
commitec77122351b4e78c1fe5b60a208f76baf8c67591 (patch)
tree98e93cfa582e1ebe7fa27dadacb2ce9d01f5d28c /media/libstagefright/DataSource.cpp
parentb3a95a56f0adaf2b60ff164275487d1870442734 (diff)
downloadframeworks_av-ec77122351b4e78c1fe5b60a208f76baf8c67591.zip
frameworks_av-ec77122351b4e78c1fe5b60a208f76baf8c67591.tar.gz
frameworks_av-ec77122351b4e78c1fe5b60a208f76baf8c67591.tar.bz2
Add support for common encryption
b/7465749 Change-Id: I5403b74a5ae428ad28b382863a09daafc400b137
Diffstat (limited to 'media/libstagefright/DataSource.cpp')
-rw-r--r--media/libstagefright/DataSource.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp
index 19b38ee..fc6fd9c 100644
--- a/media/libstagefright/DataSource.cpp
+++ b/media/libstagefright/DataSource.cpp
@@ -58,6 +58,19 @@ bool DataSource::getUInt16(off64_t offset, uint16_t *x) {
return true;
}
+bool DataSource::getUInt24(off64_t offset, uint32_t *x) {
+ *x = 0;
+
+ uint8_t byte[3];
+ if (readAt(offset, byte, 3) != 3) {
+ return false;
+ }
+
+ *x = (byte[0] << 16) | (byte[1] << 8) | byte[2];
+
+ return true;
+}
+
bool DataSource::getUInt32(off64_t offset, uint32_t *x) {
*x = 0;