diff options
author | Ronghua Wu <ronghuawu@google.com> | 2014-09-05 14:25:39 -0700 |
---|---|---|
committer | Ronghua Wu <ronghuawu@google.com> | 2014-09-11 10:33:59 -0700 |
commit | a694dd0ce2caaf921f7bc894df87a5d52594b4eb (patch) | |
tree | 9ad4a1cbb711e3b2f81365e6163367c4cfb4b02b /media/libstagefright/omx | |
parent | 971873179cf202ad8aa1ddc4ec737795f1e03ce3 (diff) | |
download | frameworks_av-a694dd0ce2caaf921f7bc894df87a5d52594b4eb.zip frameworks_av-a694dd0ce2caaf921f7bc894df87a5d52594b4eb.tar.gz frameworks_av-a694dd0ce2caaf921f7bc894df87a5d52594b4eb.tar.bz2 |
stagefright: add adaptive playback support to SoftMPEG decoder.
This covers both MPEG4 and H263 adaptive playback.
Bug: 17326758
Change-Id: I80a67b7f3ceab05e792f0a459439a8274bd78e20
Diffstat (limited to 'media/libstagefright/omx')
-rw-r--r-- | media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp index e533fdd..741ac96 100644 --- a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp +++ b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp @@ -151,7 +151,7 @@ void SoftVideoDecoderOMXComponent::updatePortDefinitions(bool updateCrop) { } void SoftVideoDecoderOMXComponent::handlePortSettingsChange( - bool *portWillReset, uint32_t width, uint32_t height, bool cropChanged) { + bool *portWillReset, uint32_t width, uint32_t height, bool cropChanged, bool fakeStride) { *portWillReset = false; bool sizeChanged = (width != mWidth || height != mHeight); @@ -177,6 +177,19 @@ void SoftVideoDecoderOMXComponent::handlePortSettingsChange( *portWillReset = true; } else { updatePortDefinitions(updateCrop); + + if (fakeStride) { + // MAJOR HACK that is not pretty, it's just to fool the renderer to read the correct + // data. + // Some software decoders (e.g. SoftMPEG4) fill decoded frame directly to output + // buffer without considering the output buffer stride and slice height. So this is + // used to signal how the buffer is arranged. The alternative is to re-arrange the + // output buffer in SoftMPEG4, but that results in memcopies. + OMX_PARAM_PORTDEFINITIONTYPE *def = &editPortInfo(kOutputPortIndex)->mDef; + def->format.video.nStride = mWidth; + def->format.video.nSliceHeight = mHeight; + } + notify(OMX_EventPortSettingsChanged, kOutputPortIndex, OMX_IndexConfigCommonOutputCrop, NULL); } |