summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/include
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-06-07 10:19:42 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-06-07 10:19:42 -0700
commit80c362fec14af5f22e6d3967fc4ea04b363084da (patch)
treefe282db5799ca31479a92451d5f297f80d9529d1 /media/libstagefright/include
parent8f270dc1ec91d3b34d62202463e0b03939900449 (diff)
parentb57b3967b1a42dd505dbe4fcf1e1d810e3ae3777 (diff)
downloadframeworks_av-80c362fec14af5f22e6d3967fc4ea04b363084da.zip
frameworks_av-80c362fec14af5f22e6d3967fc4ea04b363084da.tar.gz
frameworks_av-80c362fec14af5f22e6d3967fc4ea04b363084da.tar.bz2
Merge tag 'android-6.0.1_r46' into HEAD
Android 6.0.1 release 46 Change-Id: I4fcabf5775aebd2cb8dc0e352d1b1460d3214573
Diffstat (limited to 'media/libstagefright/include')
-rw-r--r--media/libstagefright/include/SampleTable.h4
-rw-r--r--media/libstagefright/include/SoftOMXComponent.h16
2 files changed, 19 insertions, 1 deletions
diff --git a/media/libstagefright/include/SampleTable.h b/media/libstagefright/include/SampleTable.h
index 460492b..465f37c 100644
--- a/media/libstagefright/include/SampleTable.h
+++ b/media/libstagefright/include/SampleTable.h
@@ -24,6 +24,7 @@
#include <media/stagefright/MediaErrors.h>
#include <utils/RefBase.h>
#include <utils/threads.h>
+#include <utils/Vector.h>
namespace android {
@@ -110,8 +111,9 @@ private:
uint32_t mDefaultSampleSize;
uint32_t mNumSampleSizes;
+ bool mHasTimeToSample;
uint32_t mTimeToSampleCount;
- uint32_t *mTimeToSample;
+ Vector<uint32_t> mTimeToSample;
struct SampleTimeEntry {
uint32_t mSampleIndex;
diff --git a/media/libstagefright/include/SoftOMXComponent.h b/media/libstagefright/include/SoftOMXComponent.h
index a808611..3ab6f88 100644
--- a/media/libstagefright/include/SoftOMXComponent.h
+++ b/media/libstagefright/include/SoftOMXComponent.h
@@ -168,6 +168,22 @@ private:
DISALLOW_EVIL_CONSTRUCTORS(SoftOMXComponent);
};
+template<typename T>
+bool isValidOMXParam(T *a) {
+ static_assert(offsetof(typeof(*a), nSize) == 0, "nSize not at offset 0");
+ static_assert(std::is_same< decltype(a->nSize), OMX_U32>::value, "nSize has wrong type");
+ static_assert(offsetof(typeof(*a), nVersion) == 4, "nVersion not at offset 4");
+ static_assert(std::is_same< decltype(a->nVersion), OMX_VERSIONTYPE>::value,
+ "nVersion has wrong type");
+
+ if (a->nSize < sizeof(*a)) {
+ ALOGE("b/27207275: need %zu, got %u", sizeof(*a), a->nSize);
+ android_errorWriteLog(0x534e4554, "27207275");
+ return false;
+ }
+ return true;
+}
+
} // namespace android
#endif // SOFT_OMX_COMPONENT_H_