diff options
author | Santhosh Behara <santhoshbehara@codeaurora.org> | 2015-11-26 15:27:50 +0530 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-03-08 22:37:02 -0800 |
commit | 97fc248733b43731e1e2d98de5dad47a490dbbc2 (patch) | |
tree | 543ba0678f0c75d4cbb9db1d24d1b0e3fc367081 /media/libstagefright/ACodec.cpp | |
parent | 41d4ad503757189ad401fa82d7572502de0712fa (diff) | |
download | frameworks_av-97fc248733b43731e1e2d98de5dad47a490dbbc2.zip frameworks_av-97fc248733b43731e1e2d98de5dad47a490dbbc2.tar.gz frameworks_av-97fc248733b43731e1e2d98de5dad47a490dbbc2.tar.bz2 |
ACodec: update the right size and crop in smooth streaming case
In smooth streaming enabled case, the max width and max height
sizes should be updated in native window. And the crop rectangle
should also be updated.
Change-Id: I4a15aa24a51b495141001dd43adec7005ab0c742
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 4807b65..7351d3e 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -925,10 +925,24 @@ status_t ACodec::setupNativeWindowSizeFormatAndUsage( #endif ALOGV("gralloc usage: %#x(OMX) => %#x(ACodec)", omxUsage, usage); + int32_t width = 0, height = 0; + int32_t isAdaptivePlayback = 0; + + if (mInputFormat->findInt32("adaptive-playback", &isAdaptivePlayback) + && isAdaptivePlayback + && mInputFormat->findInt32("max-width", &width) + && mInputFormat->findInt32("max-height", &height)) { + width = max(width, (int32_t)def.format.video.nFrameWidth); + height = max(height, (int32_t)def.format.video.nFrameHeight); + ALOGV("Adaptive playback width = %d, height = %d", width, height); + } else { + width = def.format.video.nFrameWidth; + height = def.format.video.nFrameHeight; + } err = setNativeWindowSizeFormatAndUsage( nativeWindow, - def.format.video.nFrameWidth, - def.format.video.nFrameHeight, + width, + height, #ifdef USE_SAMSUNG_COLORFORMAT eNativeColorFormat, #else |