From d0b9a2b8538c9e4538d92fd675cf6786644ccb85 Mon Sep 17 00:00:00 2001 From: Rachad Date: Fri, 12 Dec 2014 17:41:36 -0800 Subject: Tunneled video Playback/Max resolution: Call mOmx->prepareForAdaptivePlayback() to provide max resolution information to tunneled OMX component. bug: 17883772 Change-Id: I8f634824103e66483527828993bb24f65e68e419 --- media/libstagefright/ACodec.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'media') diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 208f0d5..e1b3b4d 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -1303,7 +1303,21 @@ status_t ACodec::configureCodec( return err; } - inputFormat->setInt32("adaptive-playback", true); + int32_t maxWidth = 0, maxHeight = 0; + if (msg->findInt32("max-width", &maxWidth) && + msg->findInt32("max-height", &maxHeight)) { + + err = mOMX->prepareForAdaptivePlayback( + mNode, kPortIndexOutput, OMX_TRUE, maxWidth, maxHeight); + if (err != OK) { + ALOGW("[%s] prepareForAdaptivePlayback failed w/ err %d", + mComponentName.c_str(), err); + } else { + inputFormat->setInt32("max-width", maxWidth); + inputFormat->setInt32("max-height", maxHeight); + inputFormat->setInt32("adaptive-playback", true); + } + } } else { ALOGV("Configuring CPU controlled video playback."); mTunneled = false; -- cgit v1.1