From 3c0409bf981f7ae224b4843741770ad4ee341207 Mon Sep 17 00:00:00 2001 From: Simon Shields Date: Mon, 7 Dec 2015 17:40:13 +1100 Subject: libstagefright: squash exynos4 support commit e41cc838b6212f8711c550522e8cefc95f003a67 Author: rINanDO Date: Mon Aug 10 13:56:56 2015 +0200 stagefright: Exynos4 MPEG4 decoder should set native color format. Change-Id: I41bee77d48fc0b35691b94585de10269579ae789 commit a50263c53a1ecd0f75688f7042dd5e5d9badbc39 Author: Caio Schnepper Date: Wed Jun 10 22:26:07 2015 -0300 libstagefright: back off exynos4_enhancements HWC_HWOVERLAY usage The open source hwc doesn't support the GRALLOC_USAGE_HW_FIMC1 | GRALLOC_USAGE_HWC_HWOVERLAY combination. Removing HWC_HWOVERLAY allows FIMC1 to do decode/color conversion. Change-Id: Ibdfa9e5dd170e99e0d994540979e88e519931641 commit 63286a333bde1aa047de4e2fde8da1b59e42a16d Author: Ricardo Cerqueira Date: Sun Nov 3 02:45:19 2013 +0000 exynos4: libstragefright: add support for samsung colorformat/omx/mfc Source: http://git.insignal.co.kr/samsung/exynos/android/platform/frameworks/av/commit/?h=exynos-jb&id=1614612f7ca2a00473d202dbedcb135fadc608ad Conflicts: media/libstagefright/ACodec.cpp media/libstagefright/OMXCodec.cpp cherry pick from 906eba9f Change-Id: I1c174f8e9fa9bd3ed16a0399f070b6680f6a331c Change-Id: I47f5b09b37ea5376a45c80c9dd91a7fbd0c3361a --- .../colorconversion/SoftwareRenderer.cpp | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'media/libstagefright/colorconversion') diff --git a/media/libstagefright/colorconversion/SoftwareRenderer.cpp b/media/libstagefright/colorconversion/SoftwareRenderer.cpp index e92c192..3fa29a2 100644 --- a/media/libstagefright/colorconversion/SoftwareRenderer.cpp +++ b/media/libstagefright/colorconversion/SoftwareRenderer.cpp @@ -150,11 +150,20 @@ void SoftwareRenderer::resetFormatIfChanged(const sp &format) { CHECK(mCropHeight > 0); CHECK(mConverter == NULL || mConverter->isValid()); +#ifdef EXYNOS4_ENHANCEMENTS + CHECK_EQ(0, + native_window_set_usage( + mNativeWindow.get(), + GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN + | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP + | GRALLOC_USAGE_HW_FIMC1)); +#else CHECK_EQ(0, native_window_set_usage( mNativeWindow.get(), GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP)); +#endif CHECK_EQ(0, native_window_set_scaling_mode( @@ -282,13 +291,25 @@ std::list SoftwareRenderer::render( const uint8_t *src_uv = (const uint8_t *)data + mWidth * (mHeight - mCropTop / 2); - uint8_t *dst_y = (uint8_t *)dst; +#ifdef EXYNOS4_ENHANCEMENTS + void *pYUVBuf[3]; + + CHECK_EQ(0, mapper.unlock(buf->handle)); + CHECK_EQ(0, mapper.lock( + buf->handle, GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_YUV_ADDR, bounds, pYUVBuf)); + size_t dst_c_stride = buf->stride / 2; + uint8_t *dst_y = (uint8_t *)pYUVBuf[0]; + uint8_t *dst_v = (uint8_t *)pYUVBuf[1]; + uint8_t *dst_u = (uint8_t *)pYUVBuf[2]; +#else + uint8_t *dst_y = (uint8_t *)dst; size_t dst_y_size = buf->stride * buf->height; size_t dst_c_stride = ALIGN(buf->stride / 2, 16); size_t dst_c_size = dst_c_stride * buf->height / 2; uint8_t *dst_v = dst_y + dst_y_size; uint8_t *dst_u = dst_v + dst_c_size; +#endif for (int y = 0; y < mCropHeight; ++y) { memcpy(dst_y, src_y, mCropWidth); -- cgit v1.1