summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-11-01 16:25:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-01 16:25:08 -0700
commit678d25019bd951a6af083bee0282e5b907713849 (patch)
tree9350644e7f1017d871a8e906b94d28bbf7bec2bc /media
parent51ef3f681e275f6edc6886c7a2dd409e6734a0ee (diff)
parent67f4cae120b49fad8b53a83499db1545bfa41e38 (diff)
downloadframeworks_av-678d25019bd951a6af083bee0282e5b907713849.zip
frameworks_av-678d25019bd951a6af083bee0282e5b907713849.tar.gz
frameworks_av-678d25019bd951a6af083bee0282e5b907713849.tar.bz2
Merge "Notify surfaceflinger about (changes to) the crop rectangle output by the decoder."
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/OMXCodec.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 0d8abe2..ce48d1c 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -2109,6 +2109,17 @@ void OMXCodec::onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) {
CODEC_LOGV(
"output crop (%ld, %ld, %ld, %ld)",
rect.nLeft, rect.nTop, rect.nWidth, rect.nHeight);
+
+ if (mNativeWindow != NULL) {
+ android_native_rect_t crop;
+ crop.left = rect.nLeft;
+ crop.top = rect.nTop;
+ crop.right = crop.left + rect.nWidth - 1;
+ crop.bottom = crop.top + rect.nHeight - 1;
+
+ CHECK_EQ(0, native_window_set_crop(
+ mNativeWindow.get(), &crop));
+ }
} else {
CODEC_LOGE("getConfig(OMX_IndexConfigCommonOutputCrop) "
"returned error 0x%08x", err);