Commit 7449ab04 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/GenericDmabufVFMapper: Support to map ABGR and XBGR formats

This enable GenericDmabufVFMapper to map ABGR and XBGR formats.

Bug: 944822
Test: image_processor_test
Change-Id: I19f6556c16a13104322c022a0179ca249a5d11f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611065Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659401}
parent 90e2e300
...@@ -52,6 +52,12 @@ gfx::BufferFormat VideoPixelFormatToGfxBufferFormat( ...@@ -52,6 +52,12 @@ gfx::BufferFormat VideoPixelFormatToGfxBufferFormat(
case PIXEL_FORMAT_NV12: case PIXEL_FORMAT_NV12:
return gfx::BufferFormat::YUV_420_BIPLANAR; return gfx::BufferFormat::YUV_420_BIPLANAR;
case PIXEL_FORMAT_ABGR:
return gfx::BufferFormat::RGBA_8888;
case PIXEL_FORMAT_XBGR:
return gfx::BufferFormat::RGBX_8888;
default: default:
LOG(FATAL) << "Unsupported VideoPixelFormat: " << pixel_format; LOG(FATAL) << "Unsupported VideoPixelFormat: " << pixel_format;
return gfx::BufferFormat::BGRX_8888; return gfx::BufferFormat::BGRX_8888;
......
...@@ -81,7 +81,12 @@ scoped_refptr<VideoFrame> CreateMappedVideoFrame( ...@@ -81,7 +81,12 @@ scoped_refptr<VideoFrame> CreateMappedVideoFrame(
bool IsFormatSupported(VideoPixelFormat format) { bool IsFormatSupported(VideoPixelFormat format) {
constexpr VideoPixelFormat supported_formats[] = { constexpr VideoPixelFormat supported_formats[] = {
// RGB pixel formats.
PIXEL_FORMAT_ABGR,
PIXEL_FORMAT_ARGB, PIXEL_FORMAT_ARGB,
PIXEL_FORMAT_XBGR,
// YUV pixel formats.
PIXEL_FORMAT_I420, PIXEL_FORMAT_I420,
PIXEL_FORMAT_NV12, PIXEL_FORMAT_NV12,
PIXEL_FORMAT_YV12, PIXEL_FORMAT_YV12,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment