summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-08-27 18:10:01 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-27 18:10:01 -0700
commit9bdccaca6a7a09457670138bf6cdd9b3ba5e7087 (patch)
treef2ce07a2b7f235a3e6b895f461ebd1fb6a5de8c3 /media/libstagefright/OMXCodec.cpp
parentf00421ce0af03785a229552cb9738ac09b17a675 (diff)
parentb354e7916ee7b5fffb61c3ede30c3d3b0c26b475 (diff)
downloadframeworks_av-9bdccaca6a7a09457670138bf6cdd9b3ba5e7087.zip
frameworks_av-9bdccaca6a7a09457670138bf6cdd9b3ba5e7087.tar.gz
frameworks_av-9bdccaca6a7a09457670138bf6cdd9b3ba5e7087.tar.bz2
am a5fe77d0: am df8356ff: Merge "Workaround for a QCOM issue where the output buffer size advertised by the AVC encoder is occasionally too small." into gingerbread
Merge commit 'a5fe77d004091bd9521d087c2572f587191afbfc' * commit 'a5fe77d004091bd9521d087c2572f587191afbfc': Workaround for a QCOM issue where the output buffer size advertised by the AVC encoder
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 37def3b..9d45c80 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -368,6 +368,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)) {
}
@@ -925,6 +934,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));