From 2dc64d80e3c395ca3ff06ce45e08f5fceae92874 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 11 Sep 2009 12:58:53 -0700 Subject: [PATCH] Apparently I must not use OMX_UseBuffer on either input or output ports on any of the TI components... or else. --- media/libstagefright/OMXCodec.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index a964d17a1baf..d905619159aa 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -232,6 +232,16 @@ sp OMXCodec::Create( quirks |= kRequiresAllocateBufferOnOutputPorts; } + if (!strncmp(componentName, "OMX.TI.", 7)) { + // Apparently I must not use OMX_UseBuffer on either input or + // output ports on any of the TI components or quote: + // "(I) may have unexpected problem (sic) which can be timing related + // and hard to reproduce." + + quirks |= kRequiresAllocateBufferOnInputPorts; + quirks |= kRequiresAllocateBufferOnOutputPorts; + } + sp codec = new OMXCodec( omx, node, quirks, createEncoder, mime, componentName, source); @@ -840,8 +850,8 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { mNode, portIndex, mem, &buffer); } else if (portIndex == kPortIndexOutput && (mQuirks & kRequiresAllocateBufferOnOutputPorts)) { - err = mOMX->allocate_buffer( - mNode, portIndex, def.nBufferSize, &buffer); + err = mOMX->allocate_buffer_with_backup( + mNode, portIndex, mem, &buffer); } else { err = mOMX->use_buffer(mNode, portIndex, mem, &buffer); } -- 2.11.0