From 87eb285dca94b20dc5f0ff8e60a0d395a4ca3be9 Mon Sep 17 00:00:00 2001 From: Dima Zavin Date: Thu, 18 Jul 2013 11:43:39 -0700 Subject: stagefright: set scaling mode for blank frames in ACodec Analogous to 1d5ac80d0c6d3deabcc9e9b4abc9e3ef536aeb27 (by jgennis), this sets the scaling mode for the ANativeWindow to SCALE_TO_WINDOW prior to pushing the blank frames during decoder tear down. Without this, the window defaults to FREEZE and SF ignores the new frames. Bug: 9516405 Change-Id: I39ef30922d733034bf01100d7ff24ac9c0c33b7d Signed-off-by: Dima Zavin --- media/libstagefright/ACodec.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'media') diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 6bc7718..9b24d44 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -2630,6 +2630,14 @@ status_t ACodec::pushBlankBuffersToNativeWindow() { goto error; } + err = native_window_set_scaling_mode(mNativeWindow.get(), + NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW); + if (err != NO_ERROR) { + ALOGE("error pushing blank_frames: set_scaling_mode failed: %s (%d)", + strerror(-err), -err); + goto error; + } + err = native_window_set_usage(mNativeWindow.get(), GRALLOC_USAGE_SW_WRITE_OFTEN); if (err != NO_ERROR) { -- cgit v1.1