summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-08-26 19:12:59 -0700
committerJames Dong <jdong@google.com>2010-08-27 13:59:26 -0700
commit824c9ff4a55e86faae4f8f158977329909cbfaf6 (patch)
tree945b5b767cce0533fe3bbf4f01b54de42ca1c305 /media/libstagefright/OMXCodec.cpp
parent352c4683820c31eaad63e52a47d0d442bfe2c193 (diff)
downloadframeworks_av-824c9ff4a55e86faae4f8f158977329909cbfaf6.zip
frameworks_av-824c9ff4a55e86faae4f8f158977329909cbfaf6.tar.gz
frameworks_av-824c9ff4a55e86faae4f8f158977329909cbfaf6.tar.bz2
Workaround for a QCOM issue where the output buffer size advertised by the AVC encoder
is occasionally too small. bug - 2882917 Change-Id: Id59d8529084c5689a26f272e0cd3b1e955fd8a30
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r--media/libstagefright/OMXCodec.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 4741b1d..165cec9 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -353,6 +353,15 @@ uint32_t OMXCodec::getComponentQuirks(const char *componentName) {
quirks |= kRequiresLoadedToIdleAfterAllocation;
quirks |= kRequiresAllocateBufferOnInputPorts;
quirks |= kRequiresAllocateBufferOnOutputPorts;
+ if (!strncmp(componentName, "OMX.qcom.video.encoder.avc", 26)) {
+
+ // The AVC encoder advertises the size of output buffers
+ // based on the input video resolution and assumes
+ // the worst/least compression ratio is 0.5. It is found that
+ // sometimes, the output buffer size is larger than
+ // size advertised by the encoder.
+ quirks |= kRequiresLargerEncoderOutputBuffer;
+ }
}
if (!strncmp(componentName, "OMX.qcom.7x30.video.encoder.", 28)) {
}
@@ -906,6 +915,10 @@ void OMXCodec::setVideoInputFormat(
video_def->nBitrate = bitRate; // Q16 format
video_def->eCompressionFormat = compressionFormat;
video_def->eColorFormat = OMX_COLOR_FormatUnused;
+ if (mQuirks & kRequiresLargerEncoderOutputBuffer) {
+ // Increases the output buffer size
+ def.nBufferSize = ((def.nBufferSize * 3) >> 1);
+ }
err = mOMX->setParameter(
mNode, OMX_IndexParamPortDefinition, &def, sizeof(def));