summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp
diff options
context:
space:
mode:
authorRonghua Wu <ronghuawu@google.com>2014-09-12 11:57:27 -0700
committerRonghua Wu <ronghuawu@google.com>2014-09-23 13:52:19 -0700
commit1aa26f787afc525e0deae31d856dce74a4b28a0f (patch)
treeb1722cd0ced9a000aa50e1b9fd33ca124fa9afb6 /media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp
parent2973994af39d55b58728df3dca067594e826ea2a (diff)
downloadframeworks_av-1aa26f787afc525e0deae31d856dce74a4b28a0f.zip
frameworks_av-1aa26f787afc525e0deae31d856dce74a4b28a0f.tar.gz
frameworks_av-1aa26f787afc525e0deae31d856dce74a4b28a0f.tar.bz2
stagefright: add adaptive playback support to SoftHEVC decoder.
Bug: 17326758 Change-Id: I245e2bd1490e810094ca550fdddfa87075bc2056
Diffstat (limited to 'media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp')
-rw-r--r--media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp
index 1cb1859..5853469 100644
--- a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp
+++ b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp
@@ -133,8 +133,8 @@ void SoftVideoDecoderOMXComponent::updatePortDefinitions(bool updateCrop) {
def->nBufferSize = def->format.video.nFrameWidth * def->format.video.nFrameHeight * 3 / 2;
def = &editPortInfo(kOutputPortIndex)->mDef;
- def->format.video.nFrameWidth = mIsAdaptive ? mAdaptiveMaxWidth : mWidth;
- def->format.video.nFrameHeight = mIsAdaptive ? mAdaptiveMaxHeight : mHeight;
+ def->format.video.nFrameWidth = outputBufferWidth();
+ def->format.video.nFrameHeight = outputBufferHeight();
def->format.video.nStride = def->format.video.nFrameWidth;
def->format.video.nSliceHeight = def->format.video.nFrameHeight;
@@ -150,6 +150,15 @@ void SoftVideoDecoderOMXComponent::updatePortDefinitions(bool updateCrop) {
}
}
+
+uint32_t SoftVideoDecoderOMXComponent::outputBufferWidth() {
+ return mIsAdaptive ? mAdaptiveMaxWidth : mWidth;
+}
+
+uint32_t SoftVideoDecoderOMXComponent::outputBufferHeight() {
+ return mIsAdaptive ? mAdaptiveMaxHeight : mHeight;
+}
+
void SoftVideoDecoderOMXComponent::handlePortSettingsChange(
bool *portWillReset, uint32_t width, uint32_t height, bool cropChanged, bool fakeStride) {
*portWillReset = false;
@@ -199,9 +208,9 @@ void SoftVideoDecoderOMXComponent::handlePortSettingsChange(
void SoftVideoDecoderOMXComponent::copyYV12FrameToOutputBuffer(
uint8_t *dst, const uint8_t *srcY, const uint8_t *srcU, const uint8_t *srcV,
size_t srcYStride, size_t srcUStride, size_t srcVStride) {
- size_t dstYStride = mIsAdaptive ? mAdaptiveMaxWidth : mWidth;
+ size_t dstYStride = outputBufferWidth();
size_t dstUVStride = dstYStride / 2;
- size_t dstHeight = mIsAdaptive ? mAdaptiveMaxHeight : mHeight;
+ size_t dstHeight = outputBufferHeight();
uint8_t *dstStart = dst;
for (size_t i = 0; i < mHeight; ++i) {