Commit 08684a50 authored by Vasiliy Telezhnikov's avatar Vasiliy Telezhnikov Committed by Commit Bot

Fixed RGB/BGR mapping in VideoResourceUpdater

This CL fixes inconsistency between GMB (and hence ShareImage) format
for video frame resources and TrasferableResource format.

Bug: 988120
Change-Id: I77305a8bb5bcf1cefd6a5696d6f4b5e41e5311e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768936Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690767}
parent a4fd65ec
......@@ -70,7 +70,13 @@ VideoFrameResourceType ExternalResourceTypeForHardwarePlanes(
case PIXEL_FORMAT_UYVY:
case PIXEL_FORMAT_ABGR:
DCHECK_EQ(num_textures, 1);
buffer_formats[0] = gfx::BufferFormat::RGBA_8888;
// This maps VideoPixelFormat back to GMB BufferFormat
// NOTE: ABGR == RGBA and ARGB == BGRA, they differ only byte order
// See: VideoFormat function in gpu_memory_buffer_video_frame_pool
// https://cs.chromium.org/chromium/src/media/video/gpu_memory_buffer_video_frame_pool.cc?type=cs&g=0&l=281
buffer_formats[0] = (format == PIXEL_FORMAT_ABGR)
? gfx::BufferFormat::RGBA_8888
: gfx::BufferFormat::BGRA_8888;
switch (target) {
case GL_TEXTURE_EXTERNAL_OES:
if (use_stream_video_draw_quad)
......
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