diff options
author | Lajos Molnar <lajos@google.com> | 2014-09-24 13:57:35 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-12-10 18:04:14 -0800 |
commit | a0940a569f2bc24b00dc10ce0fa7658b1dc3a3a5 (patch) | |
tree | 913e39ed6eff31c956135701290e1a5af21fd0f8 /media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp | |
parent | 94a92c69af528edf6ec17d7978a0c3bb6ab51e63 (diff) | |
download | frameworks_av-a0940a569f2bc24b00dc10ce0fa7658b1dc3a3a5.zip frameworks_av-a0940a569f2bc24b00dc10ce0fa7658b1dc3a3a5.tar.gz frameworks_av-a0940a569f2bc24b00dc10ce0fa7658b1dc3a3a5.tar.bz2 |
stagefright: misc fixes to software video encoders (and decoders)
- move logic to set encoder parameters to common encoder class
(similarly to what was done for decoders)
- set compressed buffer size based on frame size and compression ratio,
and codec-specific minimum size
- set raw buffer size based on frame size and metadata mode
- do not set stride and slice height on compressed ports
- advertise only QCIF support for google H263 encoder
- set large-enough input size for video decoders to support adaptive
playback
- do not change input buffer size on output port reconfiguration, as
no input buffer reallocation takes place
- do not return empty buffers with EOS after EOS has been signaled
Bug: 18513091
Bug: 18639027
Change-Id: Ib13492ef66adf331aa4572c67d2b283ea020cb41
Diffstat (limited to 'media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp')
-rw-r--r-- | media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp index 246069b..ede645c 100644 --- a/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp +++ b/media/libstagefright/codecs/m4v_h263/dec/SoftMPEG4.cpp @@ -21,6 +21,7 @@ #include "SoftMPEG4.h" #include <media/stagefright/foundation/ADebug.h> +#include <media/stagefright/foundation/AUtils.h> #include <media/stagefright/MediaDefs.h> #include <media/stagefright/MediaErrors.h> #include <media/IOMX.h> @@ -70,7 +71,7 @@ SoftMPEG4::SoftMPEG4( mPvTime(0) { initPorts( kNumInputBuffers, - 8192 /* inputBufferSize */, + 352 * 288 * 3 / 2 /* minInputBufferSize */, kNumOutputBuffers, (mMode == MODE_MPEG4) ? MEDIA_MIMETYPE_VIDEO_MPEG4 : MEDIA_MIMETYPE_VIDEO_H263); @@ -353,14 +354,14 @@ void SoftMPEG4::onReset() { } } -void SoftMPEG4::updatePortDefinitions(bool updateCrop) { - SoftVideoDecoderOMXComponent::updatePortDefinitions(updateCrop); +void SoftMPEG4::updatePortDefinitions(bool updateCrop, bool updateInputSize) { + SoftVideoDecoderOMXComponent::updatePortDefinitions(updateCrop, updateInputSize); /* We have to align our width and height - this should affect stride! */ OMX_PARAM_PORTDEFINITIONTYPE *def = &editPortInfo(kOutputPortIndex)->mDef; - def->nBufferSize = - (((def->format.video.nFrameWidth + 15) & -16) - * ((def->format.video.nFrameHeight + 15) & -16) * 3) / 2; + def->format.video.nStride = align(def->format.video.nStride, 16); + def->format.video.nSliceHeight = align(def->format.video.nSliceHeight, 16); + def->nBufferSize = (def->format.video.nStride * def->format.video.nSliceHeight * 3) / 2; } } // namespace android |