diff options
author | Santhosh Behara <santhoshbehara@codeaurora.org> | 2015-11-25 19:27:22 +0530 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-01-18 23:52:20 -0800 |
commit | 9dae27c03dd73ca23c6aa778ed1423e4e133eb48 (patch) | |
tree | 63c8068b9ef115363624b2e5c811f0cf097048c4 /media | |
parent | 617daafc1cf7580b7d80ead8a7e21bb5cbf525cf (diff) | |
download | frameworks_av-9dae27c03dd73ca23c6aa778ed1423e4e133eb48.zip frameworks_av-9dae27c03dd73ca23c6aa778ed1423e4e133eb48.tar.gz frameworks_av-9dae27c03dd73ca23c6aa778ed1423e4e133eb48.tar.bz2 |
ACodec: update native window crop rectangle
In setupNativeWindowSizeFormatAndUsage, set the crop rectangle
with the output port's crop value.
Change-Id: I415be069d02d88dcd6b7c2460dda6df191ee7434
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index ad4676f..3a08078 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -925,7 +925,7 @@ status_t ACodec::setupNativeWindowSizeFormatAndUsage( #endif ALOGV("gralloc usage: %#x(OMX) => %#x(ACodec)", omxUsage, usage); - return setNativeWindowSizeFormatAndUsage( + err = setNativeWindowSizeFormatAndUsage( nativeWindow, def.format.video.nFrameWidth, def.format.video.nFrameHeight, @@ -936,6 +936,24 @@ status_t ACodec::setupNativeWindowSizeFormatAndUsage( #endif mRotationDegrees, usage); + if (err == OK) { + OMX_CONFIG_RECTTYPE rect; + InitOMXParams(&rect); + rect.nPortIndex = kPortIndexOutput; + err = mOMX->getConfig( + mNode, OMX_IndexConfigCommonOutputCrop, &rect, sizeof(rect)); + if (err == OK) { + ALOGV("rect size = %d, %d, %d, %d", rect.nLeft, rect.nTop, rect.nWidth, rect.nHeight); + android_native_rect_t crop; + crop.left = rect.nLeft; + crop.top = rect.nTop; + crop.right = rect.nLeft + rect.nWidth - 1; + crop.bottom = rect.nTop + rect.nHeight - 1; + ALOGV("crop update (%d, %d), (%d, %d)", crop.left, crop.top, crop.right, crop.bottom); + err = native_window_set_crop(nativeWindow, &crop); + } + } + return err; } status_t ACodec::configureOutputBuffersFromNativeWindow( |