diff options
author | Mathias Agopian <mathias@google.com> | 2011-07-18 16:15:08 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-07-19 13:05:12 -0700 |
commit | ff86f37b95327538b97b6b8ef5d3c6ed0cd7f902 (patch) | |
tree | 59deccf2daa7d8c8167574cacf878a4ee279f149 /media | |
parent | 09d7ed7b395d66be97c6bcb052039f5c0dce646c (diff) | |
download | frameworks_base-ff86f37b95327538b97b6b8ef5d3c6ed0cd7f902.zip frameworks_base-ff86f37b95327538b97b6b8ef5d3c6ed0cd7f902.tar.gz frameworks_base-ff86f37b95327538b97b6b8ef5d3c6ed0cd7f902.tar.bz2 |
use SurfaceTexture new scaling mode in SF
SF now obeys SurfaceTexture's scaling mode instead
of inferring it from the buffer's size
Change-Id: I4d50e9851abedd7e64bfcfc8af9eefb9fb668529
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 7 | ||||
-rwxr-xr-x | media/libstagefright/OMXCodec.cpp | 7 | ||||
-rw-r--r-- | media/libstagefright/colorconversion/SoftwareRenderer.cpp | 5 |
3 files changed, 19 insertions, 0 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index d4d07b2..174ec92 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -445,6 +445,13 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() { return err; } + err = native_window_set_scaling_mode(mNativeWindow.get(), + NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW); + + if (err != OK) { + return err; + } + err = native_window_set_buffers_geometry( mNativeWindow.get(), def.format.video.nFrameWidth, diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 4f8336e..7bcbdcf 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1765,6 +1765,13 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { return err; } + err = native_window_set_scaling_mode(mNativeWindow.get(), + NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW); + + if (err != OK) { + return err; + } + err = native_window_set_buffers_geometry( mNativeWindow.get(), def.format.video.nFrameWidth, diff --git a/media/libstagefright/colorconversion/SoftwareRenderer.cpp b/media/libstagefright/colorconversion/SoftwareRenderer.cpp index a4ca32d..3246021 100644 --- a/media/libstagefright/colorconversion/SoftwareRenderer.cpp +++ b/media/libstagefright/colorconversion/SoftwareRenderer.cpp @@ -93,6 +93,11 @@ SoftwareRenderer::SoftwareRenderer( GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP)); + CHECK_EQ(0, + native_window_set_scaling_mode( + mNativeWindow.get(), + NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW)); + // Width must be multiple of 32??? CHECK_EQ(0, native_window_set_buffers_geometry( mNativeWindow.get(), |