[media] Update NativePixmapFrameResource to handle ColorSpace changes. [chromium/src : main]

0 views
Skip to first unread message

Saifuddin Hitawala (Gerrit)

unread,
Jun 30, 2026, 1:04:01 PM (8 days ago) Jun 30
to Pilar Molina Lopez, Hirokazu Honda, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, oshima...@chromium.org
Attention needed from Hirokazu Honda, Pilar Molina Lopez and Vasiliy Telezhnikov

Saifuddin Hitawala added 3 comments

Patchset-level comments
File-level comment, Patchset 11 (Latest):
Saifuddin Hitawala . resolved

Updated to make some changes addressing feedback. Please take another look.

File media/gpu/v4l2/v4l2_video_encode_accelerator.cc
Line 589, Patchset 8: base::FeatureList::IsEnabled(kV4L2VEAUseCorrectColorSpace)
? input_color_space_
: gfx::ColorSpace(),
Hirokazu Honda . resolved

Do you see anything changed by this CL?

The existing code propagates the input color space.
https://source.chromium.org/chromium/chromium/src/+/main:media/gpu/chromeos/libyuv_image_processor_backend.cc;l=352;drc=9405179380f3b5222471aa3430a8683f8c88f137

Besides, V4L2VEA doesn't currently embed the color space information to the stream.

Saifuddin Hitawala

Sorry for the delay as I'm currently OOO. Yes, it propagates the invalid color space there, and since earlier we set a default color space on output frame's SharedImage in platform_video_frame_utils.cc, we see a mismatch triggered. With this CL we don't see a mismatch triggered as both the SharedImage created for output frame as well as on the input frame we have some defaults.

Besides, V4L2VEA doesn't currently embed the color space information to the stream.

That is something I hadn't considered. In that case it doesn't make sense to store `input_color_space_`. I can look into it once I'm back.

Saifuddin Hitawala

Updated to remove these changes from V4L2VEA.

Line 1034, Patchset 6: input_color_space_ = frame.ColorSpace();
Saifuddin Hitawala . resolved

Ideally, this should default here to Rec709 or SRGB if `frame.ColorSpace()` is invalid and also set this default ColorSpace on `frame`, to ensure SharedImage always has a valid ColorSpace on creation. I'm not doing that here now, and we can look into it later as part of later goal.

Hirokazu Honda

Do you have any plan to do this?

The current code is nothing is set in V4L2VEA::Initialize(), so input_color_space_ is invalid.
No IP reconfiguration happens if no frame color space is specified.

Saifuddin Hitawala

Yes, I could look into doing this as well setting the default color space on `frame`.

Saifuddin Hitawala

I've reverted these changes here on further thought and now am just passing a default color space so the behaviour is same as before we added defaults (so that the output frame's color space is not overridden to BT709 in platform utils) and now default setting is moved up the stack. This still helps us meet our current goal of ensuring that the color spaces always match between shared image and video frame.

I can look into setting a default color space for input/output frames for V4L2VEA at a later point while evaluating other creators of SharedImage for its feasibility.

Open in Gerrit

Related details

Attention is currently required from:
  • Hirokazu Honda
  • Pilar Molina Lopez
  • Vasiliy Telezhnikov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I13e7292ff0eb7af8bdf2b4141b4cf03f987217ba
Gerrit-Change-Number: 7830867
Gerrit-PatchSet: 11
Gerrit-Owner: Saifuddin Hitawala <hita...@chromium.org>
Gerrit-Reviewer: Hirokazu Honda <hi...@chromium.org>
Gerrit-Reviewer: Pilar Molina Lopez <pmolin...@chromium.org>
Gerrit-Reviewer: Saifuddin Hitawala <hita...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Attention: Pilar Molina Lopez <pmolin...@chromium.org>
Gerrit-Attention: Hirokazu Honda <hi...@chromium.org>
Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Tue, 30 Jun 2026 17:03:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Saifuddin Hitawala <hita...@chromium.org>
Comment-In-Reply-To: Hirokazu Honda <hi...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Saifuddin Hitawala (Gerrit)

unread,
Jul 7, 2026, 3:27:57 PM (22 hours ago) Jul 7
to Code Review Nudger, Pilar Molina Lopez, Hirokazu Honda, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, oshima...@chromium.org
Attention needed from Hirokazu Honda, Pilar Molina Lopez and Vasiliy Telezhnikov

Saifuddin Hitawala added 1 comment

Patchset-level comments
Saifuddin Hitawala . resolved

Gentle ping.

I've reverted changes to V4L2VEA and now just passing a default color space so the behaviour is same as before we added defaults. This still helps us meet our current goal of ensuring that the color spaces always match between shared image and video frame. This patch now moves the default up from platform utils to NativePixmapFrameResource which sets a default color space.

Please take another look.

Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-Attention: Pilar Molina Lopez <pmolin...@chromium.org>
Gerrit-Attention: Hirokazu Honda <hi...@chromium.org>
Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Tue, 07 Jul 2026 19:27:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Hirokazu Honda (Gerrit)

unread,
Jul 7, 2026, 4:55:10 PM (21 hours ago) Jul 7
to Saifuddin Hitawala, Code Review Nudger, Pilar Molina Lopez, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, oshima...@chromium.org
Attention needed from Pilar Molina Lopez, Saifuddin Hitawala and Vasiliy Telezhnikov

Hirokazu Honda voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Pilar Molina Lopez
  • Saifuddin Hitawala
  • Vasiliy Telezhnikov
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I13e7292ff0eb7af8bdf2b4141b4cf03f987217ba
    Gerrit-Change-Number: 7830867
    Gerrit-PatchSet: 11
    Gerrit-Owner: Saifuddin Hitawala <hita...@chromium.org>
    Gerrit-Reviewer: Hirokazu Honda <hi...@chromium.org>
    Gerrit-Reviewer: Pilar Molina Lopez <pmolin...@chromium.org>
    Gerrit-Reviewer: Saifuddin Hitawala <hita...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Pilar Molina Lopez <pmolin...@chromium.org>
    Gerrit-Attention: Saifuddin Hitawala <hita...@chromium.org>
    Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-Comment-Date: Tue, 07 Jul 2026 20:54:55 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Hirokazu Honda (Gerrit)

    unread,
    Jul 7, 2026, 4:55:23 PM (21 hours ago) Jul 7
    to Saifuddin Hitawala, Code Review Nudger, Pilar Molina Lopez, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, oshima...@chromium.org
    Attention needed from Pilar Molina Lopez, Saifuddin Hitawala and Vasiliy Telezhnikov

    Hirokazu Honda added 1 comment

    Patchset-level comments
    Hirokazu Honda . resolved

    Sorry for the late response. LGTM.

    Gerrit-Comment-Date: Tue, 07 Jul 2026 20:55:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Saifuddin Hitawala (Gerrit)

    unread,
    9:43 AM (4 hours ago) 9:43 AM
    to Hirokazu Honda, Code Review Nudger, Pilar Molina Lopez, Vasiliy Telezhnikov, Chromium LUCI CQ, chromium...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, oshima...@chromium.org
    Attention needed from Pilar Molina Lopez and Vasiliy Telezhnikov

    Saifuddin Hitawala voted and added 1 comment

    Votes added by Saifuddin Hitawala

    Commit-Queue+2

    1 comment

    Patchset-level comments
    Saifuddin Hitawala . resolved

    Thanks for reviews!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Pilar Molina Lopez
    • Vasiliy Telezhnikov
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I13e7292ff0eb7af8bdf2b4141b4cf03f987217ba
    Gerrit-Change-Number: 7830867
    Gerrit-PatchSet: 11
    Gerrit-Owner: Saifuddin Hitawala <hita...@chromium.org>
    Gerrit-Reviewer: Hirokazu Honda <hi...@chromium.org>
    Gerrit-Reviewer: Pilar Molina Lopez <pmolin...@chromium.org>
    Gerrit-Reviewer: Saifuddin Hitawala <hita...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-Attention: Pilar Molina Lopez <pmolin...@chromium.org>
    Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
    Gerrit-Comment-Date: Wed, 08 Jul 2026 13:43:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    11:42 AM (2 hours ago) 11:42 AM
    to Saifuddin Hitawala, Hirokazu Honda, Code Review Nudger, Pilar Molina Lopez, Vasiliy Telezhnikov, chromium...@chromium.org, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, oshima...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    [media] Update NativePixmapFrameResource to handle ColorSpace changes.

    This change updates platform VF utility methods -
    CreateVideoFrameFromGpuMemoryBufferHandle and
    CreateMappableSharedImageVideoFrame to take in ColorSpace and not
    pass any default ColorSpaces, and let the client calling these
    utilities pass the proper ColorSpace and default if needed. As part of
    this, NativePixmapFrameResource now passes a default ColorSpace
    in similar manner behind a killswitch. The other callsite is
    V4L2VideoEncodeAccelerator which passes the input frame's default
    color space.

    Note these defaults in platform VideoFrame utils were added by us as
    part of larger refactor to ensure that VideoFrames backed by
    SharedImages have the same ColorSpace for both SharedImage and
    VideoFrame, and creators of VideoFrame pass a valid color space.

    Also update various tests to pass in a proper color space.
    Bug: 491815851, 425634684
    Change-Id: I13e7292ff0eb7af8bdf2b4141b4cf03f987217ba
    Commit-Queue: Saifuddin Hitawala <hita...@chromium.org>
    Reviewed-by: Hirokazu Honda <hi...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1658796}
    Files:
    • M media/gpu/chromeos/image_processor_perf_test.cc
    • M media/gpu/chromeos/image_processor_test.cc
    • M media/gpu/chromeos/native_pixmap_frame_resource.cc
    • M media/gpu/chromeos/platform_video_frame_utils.cc
    • M media/gpu/chromeos/platform_video_frame_utils.h
    • M media/gpu/chromeos/platform_video_frame_utils_unittest.cc
    • M media/gpu/chromeos/vulkan_overlay_adaptor_test.cc
    • M media/gpu/test/video_frame_helpers.cc
    • M media/gpu/test/video_player/test_vda_video_decoder.cc
    • M media/gpu/v4l2/v4l2_video_encode_accelerator.cc
    Change size: M
    Delta: 10 files changed, 42 insertions(+), 29 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Hirokazu Honda
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I13e7292ff0eb7af8bdf2b4141b4cf03f987217ba
    Gerrit-Change-Number: 7830867
    Gerrit-PatchSet: 12
    Gerrit-Owner: Saifuddin Hitawala <hita...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Hirokazu Honda <hi...@chromium.org>
    Gerrit-Reviewer: Pilar Molina Lopez <pmolin...@chromium.org>
    Gerrit-Reviewer: Saifuddin Hitawala <hita...@chromium.org>
    Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages