summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-12 15:01:24 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-12 15:01:24 +0100
commite15fd68c5dc4089690b5d3086776c3851e504bb7 (patch)
tree2c75274dee02b07463c9164efdf6888e1a9c75dc /media/libstagefright/OMXCodec.cpp
parent185e2110a53feb7720d91b6f8366ad27402f21cc (diff)
parent26c5fa31d17a638bf314de6e12e86bb8a86db44b (diff)
downloadframeworks_av-e15fd68c5dc4089690b5d3086776c3851e504bb7.zip
frameworks_av-e15fd68c5dc4089690b5d3086776c3851e504bb7.tar.gz
frameworks_av-e15fd68c5dc4089690b5d3086776c3851e504bb7.tar.bz2
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_frameworks_av into replicant-6.0
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r--media/libstagefright/OMXCodec.cpp56
1 files changed, 7 insertions, 49 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index abe19a0..de00ff2 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -355,21 +355,6 @@ sp<MediaSource> OMXCodec::Create(
ALOGV("Attempting to allocate OMX node '%s'", componentName);
- if (!createEncoder
- && (quirks & kOutputBuffersAreUnreadable)
- && (flags & kClientNeedsFramebuffer)) {
- if (strncmp(componentName, "OMX.SEC.", 8)) {
- // For OMX.SEC.* decoders we can enable a special mode that
- // gives the client access to the framebuffer contents.
-
- ALOGW("Component '%s' does not give the client access to "
- "the framebuffer contents. Skipping.",
- componentName);
-
- continue;
- }
- }
-
status_t err = omx->allocateNode(componentName, observer, &node);
if (err == OK) {
ALOGV("Successfully allocated OMX node '%s'", componentName);
@@ -399,7 +384,7 @@ status_t OMXCodec::parseHEVCCodecSpecificData(
const uint8_t *ptr = (const uint8_t *)data;
// verify minimum size and configurationVersion == 1.
- if (size < 7 || ptr[0] != 1) {
+ if (size < 23 || ptr[0] != 1) {
return ERROR_MALFORMED;
}
@@ -414,6 +399,9 @@ status_t OMXCodec::parseHEVCCodecSpecificData(
size -= 1;
size_t j = 0, i = 0;
for (i = 0; i < numofArrays; i++) {
+ if (size < 3) {
+ return ERROR_MALFORMED;
+ }
ptr += 1;
size -= 1;
@@ -678,35 +666,6 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
initOutputFormat(meta);
- if ((mFlags & kClientNeedsFramebuffer)
- && !strncmp(mComponentName, "OMX.SEC.", 8)) {
- // This appears to no longer be needed???
-
- OMX_INDEXTYPE index;
-
- status_t err =
- mOMX->getExtensionIndex(
- mNode,
- "OMX.SEC.index.ThumbnailMode",
- &index);
-
- if (err != OK) {
- return err;
- }
-
- OMX_BOOL enable = OMX_TRUE;
- err = mOMX->setConfig(mNode, index, &enable, sizeof(enable));
-
- if (err != OK) {
- CODEC_LOGE("setConfig('OMX.SEC.index.ThumbnailMode') "
- "returned error 0x%08x", err);
-
- return err;
- }
-
- mQuirks &= ~kOutputBuffersAreUnreadable;
- }
-
if (mNativeWindow != NULL
&& !mIsEncoder
&& !strncasecmp(mMIME, "video/", 6)
@@ -1678,7 +1637,9 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) {
for (OMX_U32 i = 0; i < def.nBufferCountActual; ++i) {
sp<IMemory> mem = mDealer[portIndex]->allocate(def.nBufferSize);
- CHECK(mem.get() != NULL);
+ if (mem == NULL || mem->pointer() == NULL) {
+ return NO_MEMORY;
+ }
BufferInfo info;
info.mData = NULL;
@@ -2399,9 +2360,6 @@ void OMXCodec::onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) {
#ifdef USE_S3D_SUPPORT
case (OMX_EVENTTYPE)OMX_EventS3DInformation:
{
- if (mFlags & kClientNeedsFramebuffer)
- break;
-
sp<IServiceManager> sm = defaultServiceManager();
sp<android::IExynosHWCService> hwc = interface_cast<android::IExynosHWCService>(
sm->getService(String16("Exynos.HWCService")));