-
Notifications
You must be signed in to change notification settings - Fork 135
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
[media] Set the bounds of Sbplayer via video_painter.cc #4385
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f3c2698
to
36d51af
Compare
fba14f7
to
7402087
Compare
osagie98
reviewed
Nov 12, 2024
jasonzhangxx
approved these changes
Nov 14, 2024
001b361
to
bb12930
Compare
johnxwork
approved these changes
Nov 15, 2024
bb12930
to
7111333
Compare
kaidokert
approved these changes
Nov 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm from 3p / upstream modifications perspective
SbPlayer needs SbPlayerSetBounds to update the bounds. This PR updates the bounds in blink via video_painter.cc for SbPlayer. Unlike Cobalt, Chromium upupdates the bounds of video frequently, resulting in multiple calls per video session for SbPlayer. We should revisit it if SbPlayerSetBounds causes performance issues. b/376320224
7111333
to
b00e647
Compare
osagie98
approved these changes
Nov 15, 2024
borongc
added a commit
that referenced
this pull request
Feb 15, 2025
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
added a commit
to borongc/cobalt
that referenced
this pull request
Feb 18, 2025
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
borongc
added a commit
to borongc/cobalt
that referenced
this pull request
Feb 18, 2025
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
borongc
added a commit
to borongc/cobalt
that referenced
this pull request
Feb 18, 2025
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
borongc
added a commit
to borongc/cobalt
that referenced
this pull request
Feb 18, 2025
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
borongc
added a commit
to borongc/cobalt
that referenced
this pull request
Feb 19, 2025
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
borongc
added a commit
that referenced
this pull request
Feb 19, 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SbPlayer needs
SbPlayerSetBounds
to update the bounds. This PR updates the bounds in blink via video_painter.cc for SbPlayer.Unlike Cobalt, Chromium updates the bounds of video frequently, resulting in multiple calls of
SbPlayerSetBounds
per video session for SbPlayer. We should revisit it if the multiple calls ofSbPlayerSetBounds
cause performance issues.b/376320224