Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reland "Add VideoGeometrySetter Service for Cobalt (#4810)" #4921

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

borongc
Copy link
Contributor

@borongc borongc commented Feb 18, 2025

This is a reland of 10d4851

This CL fixed DCHECK failed caused by the PR (#4810) and list the fixes below (b/397413189):

  • Removed DCHECK(content::RenderThread::IsMainThread()); in CobaltContentRendererClient due to CobaltContentRendererClient is not in Render Thread.
  • Moved the order of DCHECK(video_geometry_change_subcriber_remote_); after video_geometry_setter_service_->GetVideoGeometryChangeSubscriber in StarboardRenderer.
  • Changed gfx::ToNearestRect() to gfx::ToEnclosingRect() in StarboardRenderer.

Original change's description:

Add VideoGeometrySetter Service for Cobalt (#4810)

StarboardRender needs to be informed with the video geometry information
from the display compositor. VideoGeometrySetter provides the IPC
between the StarobardRenderer and the display compositor so the video
geometry information can reach StarboardRenderer.

This refers to
https://chromium-review.googlesource.com/c/chromium/src/+/1799692 with
the following modifications:

  • VideoGeometrySetterService is in Renderer thread, and it is exposed to
    ContentBrowserClient.
  • ContentBrowserClient binds VideoGeometrySetterService after receiving
    mojo::PendingRemote<cobalt::media::mojom::VideoGeometrySetter> from
    compositing thread (viz) to Renderer thread.
  • ContentRendererClient creates a custom StarboardRendererFactory, which
    allows to bind |overlay_plane_id| for each StarboardRenderer with
    VideoGeometrySetterService.

This CL also cleans up the old implementations for setting video bounds:
#4385, because it is unnecessary
with this PR.

b/391938746

@borongc borongc requested review from a team as code owners February 18, 2025 19:49
@borongc borongc requested a review from yell0wd0g February 18, 2025 19:49
@borongc borongc force-pushed the android_dcheck_v2 branch 2 times, most recently from 78a1e9d to d165e88 Compare February 18, 2025 20:53
Copy link
Contributor

@yell0wd0g yell0wd0g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra changes, in particular using DCHECK+ThreadChecker ISO asserting for Main thread, LGTM.

This is a reland of 10d4851

This CL fixed DCHECK failed caused by the PR (youtube#4810) and list the fixes below (b/397413189):
- Removed `DCHECK(content::RenderThread::IsMainThread());` in CobaltContentRendererClient due to CobaltContentRendererClient is not in Render Thread.
- Moved the order of `DCHECK(video_geometry_change_subcriber_remote_);` after `video_geometry_setter_service_->GetVideoGeometryChangeSubscriber` in StarboardRenderer.
- Changed `gfx::ToNearestRect()` to `gfx::ToEnclosingRect()` in StarboardRenderer.

Original change's description:
> Add VideoGeometrySetter Service for Cobalt (youtube#4810)
>
> StarboardRender needs to be informed with the video geometry information
> from the display compositor. VideoGeometrySetter provides the IPC
> between the StarobardRenderer and the display compositor so the video
> geometry information can reach StarboardRenderer.
>
> This refers to
> https://chromium-review.googlesource.com/c/chromium/src/+/1799692 with
> the following modifications:
> - VideoGeometrySetterService is in Renderer thread, and it is exposed to
> ContentBrowserClient.
> - ContentBrowserClient binds VideoGeometrySetterService after receiving
> mojo::PendingRemote\<cobalt::media::mojom::VideoGeometrySetter\> from
> compositing thread (viz) to Renderer thread.
> - ContentRendererClient creates a custom StarboardRendererFactory, which
> allows to bind |overlay_plane_id| for each StarboardRenderer with
> VideoGeometrySetterService.
>
> This CL also cleans up the old implementations for setting video bounds:
> youtube#4385, because it is unnecessary
> with this PR.
>
> b/391938746
@jasonzhangxx jasonzhangxx self-requested a review February 19, 2025 17:13
@borongc borongc merged commit f19998d into youtube:main Feb 19, 2025
135 checks passed
@borongc borongc deleted the android_dcheck_v2 branch February 19, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants