summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
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
commit206bf9df4839395e52a6834f9a0a452d355bad36 (patch)
tree334b5e02cbcf2e23958de6deef6d1170cdd51744 /media/libstagefright
parent7fe6d3f13ae18a85c09bf38ea1f3281280a9fd48 (diff)
parenta5fe77d004091bd9521d087c2572f587191afbfc (diff)
downloadframeworks_base-206bf9df4839395e52a6834f9a0a452d355bad36.zip
frameworks_base-206bf9df4839395e52a6834f9a0a452d355bad36.tar.gz
frameworks_base-206bf9df4839395e52a6834f9a0a452d355bad36.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')
-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));