Commit 48e3f587 authored by Vikas Soni's avatar Vikas Soni Committed by Commit Bot

Update pixel format used to create video frames.

Update pixel format used to create video frames on android for both MCVD
and MediaPlayer path from PIXEL_FORMAT_ARGB to PIXEL_FORMAT_ABGR.

This is required because SkiaRenderer wants to ensure that format of the
resource used during promise texture creation must match the format of
resources used for creating fulfill images.

Bug: 1028746,991291
Change-Id: Ie46c7fc0d43531f38f3eef85c8e3842f1ddf4712
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1938032Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719525}
parent 281daa39
......@@ -63,9 +63,16 @@ void StreamTextureWrapperImpl::ReallocateVideoFrame() {
gpu::MailboxHolder(mailbox, texture_mailbox_sync_token,
GL_TEXTURE_EXTERNAL_OES)};
// The pixel format doesn't matter here as long as it's valid for texture
// frames. But SkiaRenderer wants to ensure that the format of the resource
// used here which will eventually create a promise image must match the
// format of the resource(SharedImageVideo) used to create fulfill image.
// crbug.com/1028746. Since we create all the textures/abstract textures as
// well as shared images for video to be of format RGBA, we need to use the
// pixel format as ABGR here(which corresponds to 32bpp RGBA).
scoped_refptr<media::VideoFrame> new_frame =
media::VideoFrame::WrapNativeTextures(
media::PIXEL_FORMAT_ARGB, holders,
media::PIXEL_FORMAT_ABGR, holders,
media::BindToCurrentLoop(
base::BindOnce(&OnReleaseVideoFrame, factory_, mailbox)),
natural_size_, gfx::Rect(natural_size_), natural_size_,
......
......@@ -147,8 +147,15 @@ void VideoFrameFactoryImpl::CreateVideoFrame(
gfx::Size coded_size = output_buffer->size();
gfx::Rect visible_rect(coded_size);
// The pixel format doesn't matter as long as it's valid for texture frames.
VideoPixelFormat pixel_format = PIXEL_FORMAT_ARGB;
// The pixel format doesn't matter here as long as it's valid for texture
// frames. But SkiaRenderer wants to ensure that the format of the resource
// used here which will eventually create a promise image must match the
// format of the resource(SharedImageVideo) used to create fulfill image.
// crbug.com/1028746. Since we create all the textures/abstract textures as
// well as shared images for video to be of format RGBA, we need to use the
// pixel format as ABGR here(which corresponds to 32bpp RGBA).
VideoPixelFormat pixel_format = PIXEL_FORMAT_ABGR;
// Check that we can create a VideoFrame for this config before trying to
// create the textures for it.
......
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