Include pixel type in layout messages triggered by `OnDesktopDisplayChanged`. [chromium/src : main]

0 views
Skip to first unread message

Jamie Walch (Gerrit)

unread,
Apr 2, 2026, 2:33:34 PM (yesterday) Apr 2
to Lambros Lambrou, Yuwei Huang, AyeAye, chromotin...@chromium.org
Attention needed from Lambros Lambrou and Yuwei Huang

Jamie Walch added 2 comments

Patchset-level comments
File-level comment, Patchset 1:
Jamie Walch . resolved

This fixes the bug, and it seems like it was an omission not to copy the pixel type into the protobuf so I think it's safe, but I don't really understand this code. Why do we have a separate internal representation of the video layout? It opens us to more bugs of this sort in the future.

Also, there are other call-sites that construct a `VideoLayout` proto and don't set the pixel type (for example, `ClientVideoDispatcher::OnIncomingMessage`). Do they also need to be updated?

Yuwei Huang

Why do we have a separate internal representation of the video layout?

Maybe it was due to dependency or something. You have to ask Gary for the reason :)

`DesktopDisplayInfo` has a [GetVideoLayoutProto()](https://source.chromium.org/chromium/chromium/src/+/main:remoting/host/desktop_display_info.h;l=102;drc=cd4d28a2c2add65c76bb3252dc28370982577e33) method for the opposite conversion. Maybe it's a good idea to add a static `FromVideoLayoutProto` to make it more obvious that it needs to be changed whenever fields are added or removed.

Also, there are other call-sites that construct a VideoLayout proto and don't set the pixel type (for example, ClientVideoDispatcher::OnIncomingMessage). Do they also need to be updated?

Sounds like it should be updated, though looking at the age of that file, I suspect it is only used by chromotocol.

Jamie Walch

`DesktopDisplayInfo` has a [GetVideoLayoutProto()](https://source.chromium.org/chromium/chromium/src/+/main:remoting/host/desktop_display_info.h;l=102;drc=cd4d28a2c2add65c76bb3252dc28370982577e33) method for the opposite conversion. Maybe it's a good idea to add a static `FromVideoLayoutProto` to make it more obvious that it needs to be changed whenever fields are added or removed.

Done


> Also, there are other call-sites that construct a VideoLayout proto and don't set the pixel type (for example, ClientVideoDispatcher::OnIncomingMessage). Do they also need to be updated?

Sounds like it should be updated, though looking at the age of that file, I suspect it is only used by chromotocol.

The other call-sites are `ClientVideoDispatcher::OnIncomingMessage` and `ClientSession::OnVideoSizeChanged`. Based on your and Lambros's comments, the former is Chromotocol-only and the latter is single-stream-only, so I don't think either needs to be updated.

Commit Message
Line 7, Patchset 1:Include pixel type in layout messages triggered by `OnVideoSizeChanged`.
Lambros Lambrou . resolved

You updated `OnDesktopDisplayChanged` as well. I think that's the important one - the `OnVideoSizeChanged` handler is only used in single-stream mode IIRC.

Jamie Walch

I removed the OnVideoSizeChanged call-site and updated the CL description.

Open in Gerrit

Related details

Attention is currently required from:
  • Lambros Lambrou
  • Yuwei Huang
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: I173f18f7053129314db167f6eeddeb8a8dd23c32
Gerrit-Change-Number: 7722623
Gerrit-PatchSet: 3
Gerrit-Owner: Jamie Walch <jamie...@chromium.org>
Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
Gerrit-Comment-Date: Thu, 02 Apr 2026 18:33:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Lambros Lambrou <lambros...@chromium.org>
Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
Comment-In-Reply-To: Jamie Walch <jamie...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
Apr 2, 2026, 2:54:07 PM (yesterday) Apr 2
to Jamie Walch, Lambros Lambrou, AyeAye, chromotin...@chromium.org
Attention needed from Jamie Walch and Lambros Lambrou

Yuwei Huang voted and added 2 comments

Votes added by Yuwei Huang

Code-Review+1

2 comments

Patchset-level comments
File remoting/host/client_session.cc
Line 1353, Patchset 3 (Latest): // For single-stream clients, the first layout must be the current webrtc
Yuwei Huang . unresolved

Not for this CL, but are we going to remove the legacy message once single-stream is no longer supported? The discrepancy between the wire format and the actual layout is always causing headaches..

Open in Gerrit

Related details

Attention is currently required from:
  • Jamie Walch
  • Lambros Lambrou
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I173f18f7053129314db167f6eeddeb8a8dd23c32
    Gerrit-Change-Number: 7722623
    Gerrit-PatchSet: 3
    Gerrit-Owner: Jamie Walch <jamie...@chromium.org>
    Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
    Gerrit-Attention: Jamie Walch <jamie...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Apr 2026 18:53:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jamie Walch (Gerrit)

    unread,
    Apr 2, 2026, 6:33:02 PM (23 hours ago) Apr 2
    to Yuwei Huang, Lambros Lambrou, AyeAye, chromotin...@chromium.org
    Attention needed from Lambros Lambrou

    Jamie Walch added 1 comment

    File remoting/host/client_session.cc
    Line 1353, Patchset 3 (Latest): // For single-stream clients, the first layout must be the current webrtc
    Yuwei Huang . resolved

    Not for this CL, but are we going to remove the legacy message once single-stream is no longer supported? The discrepancy between the wire format and the actual layout is always causing headaches..

    Jamie Walch

    The legacy message can probably be removed, but I'm pretty sure the website ignores it as soon as it's seen an extended message. The legacy _fields_ at the start of the extended message are harder to remove, because the client strips them so we'd need some way of knowing that the host had already done so, and there's already more special-case code based on host versions in the client than I'd like.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lambros Lambrou
    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: I173f18f7053129314db167f6eeddeb8a8dd23c32
      Gerrit-Change-Number: 7722623
      Gerrit-PatchSet: 3
      Gerrit-Owner: Jamie Walch <jamie...@chromium.org>
      Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 22:32:50 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
      satisfied_requirement
      open
      diffy

      Jamie Walch (Gerrit)

      unread,
      Apr 2, 2026, 6:33:34 PM (23 hours ago) Apr 2
      to Yuwei Huang, Lambros Lambrou, AyeAye, chromotin...@chromium.org
      Attention needed from Lambros Lambrou

      Jamie Walch voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Lambros Lambrou
      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: I173f18f7053129314db167f6eeddeb8a8dd23c32
      Gerrit-Change-Number: 7722623
      Gerrit-PatchSet: 3
      Gerrit-Owner: Jamie Walch <jamie...@chromium.org>
      Gerrit-Reviewer: Jamie Walch <jamie...@chromium.org>
      Gerrit-Reviewer: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Attention: Lambros Lambrou <lambros...@chromium.org>
      Gerrit-Comment-Date: Thu, 02 Apr 2026 22:33:21 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Apr 2, 2026, 7:04:04 PM (22 hours ago) Apr 2
      to Jamie Walch, Yuwei Huang, Lambros Lambrou, AyeAye, chromotin...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      Include pixel type in layout messages triggered by `OnDesktopDisplayChanged`.

      This is triggered after capabilities are negotiated and results in a layout message being sent to the client with no pixel type set, which breaks the cursor scaling (and probably some other things) if resize-to-fit is disabled (if it's enabled, then the desktop is resized almost immediately, resulting in an updated layout message). This CL refactors the proto->`DesktopDisplayInfo` conversion and updates it to include the pixel type. It also resets the pixel type in `DesktopDisplayInfo::Reset`, which isn't required for the bug-fix, but seems like the right thing to do.

      BUG=481041921
      Change-Id: I173f18f7053129314db167f6eeddeb8a8dd23c32
      Reviewed-by: Yuwei Huang <yuw...@chromium.org>
      Commit-Queue: Jamie Walch <jamie...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1609544}
      Files:
      • M remoting/host/client_session.cc
      • M remoting/host/desktop_display_info.cc
      • M remoting/host/desktop_display_info.h
      Change size: S
      Delta: 3 files changed, 24 insertions(+), 3 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Yuwei Huang
      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: I173f18f7053129314db167f6eeddeb8a8dd23c32
      Gerrit-Change-Number: 7722623
      Gerrit-PatchSet: 4
      Gerrit-Owner: Jamie Walch <jamie...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages