summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefanEkenberg <stefan.ekenberg@linaro.org>2011-12-11 23:41:56 +0100
committerBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2011-12-17 11:58:18 +0059
commit4b135a0f73d7693e78dde743207fb8372022caf0 (patch)
treea82a98b03801a8764cfae9ca7e6f563e7b791cf3
parent00293e70c7af4a0620967d5b171acbbd112a6bc4 (diff)
downloadbase-4b135a0f73d7693e78dde743207fb8372022caf0.tar.gz
Stagefright: Provide crop info to native window
Moves the execution of native_window_set_crop() to after the execution of native_window_set_buffers_geometry(). This is done since otherwise the cropping information will be cleared by the call to native_window_set_buffers_geometry() in when it arrives in SurfaceTextureClient::setBuffersDimension(). Change-Id: I0e9ac4d2d65f82f6138b9e8773b0740da1e951bd Signed-off-by: StefanEkenberg <stefan.ekenberg@linaro.org>
-rwxr-xr-xmedia/libstagefright/OMXCodec.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index b177e4629d64..5d21b98d9697 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1854,6 +1854,10 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
return err;
}
+ if (mNativeWindow != NULL) {
+ initNativeWindowCrop();
+ }
+
err = applyRotation();
if (err != OK) {
return err;
@@ -2081,6 +2085,8 @@ status_t OMXCodec::pushBlankBuffersToNativeWindow() {
goto error;
}
+ initNativeWindowCrop();
+
err = native_window_set_usage(mNativeWindow.get(),
GRALLOC_USAGE_SW_WRITE_OFTEN);
if (err != NO_ERROR) {
@@ -4599,10 +4605,6 @@ void OMXCodec::initOutputFormat(const sp<MetaData> &inputFormat) {
video_def->nFrameWidth - 1,
video_def->nFrameHeight - 1);
}
-
- if (mNativeWindow != NULL) {
- initNativeWindowCrop();
- }
}
break;
}