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

Avoid redundant player bounds setting #4758

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasonzhangxx
Copy link
Contributor

  1. Only change player bounds when there's a change.
  2. Change Surface bounds from VideoRendererSink instead of hacking codde in SbPlayerSetBounds().

b/377754564

Comment on lines 352 to 355
int x_ = 0;
int y_ = 0;
int width_ = 0;
int height_ = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider initializing them to -1, so {0, 0, 0, 0} will lead to a setVideoSurfaceBounds() call instead being skipped.

@@ -326,7 +326,17 @@ class VideoDecoder::Sink : public VideoDecoder::VideoRendererSink {
render_cb_ = render_cb;
}

void SetBounds(int z_index, int x, int y, int width, int height) override {}
void SetBounds(int z_index, int x, int y, int width, int height) override {
if (x_ != x || y != y_ || width != width_ || height != height_) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider doing this above Starboard, otherwise the same has to be done for all 3P platforms.

@jasonzhangxx jasonzhangxx marked this pull request as draft January 28, 2025 22:24
1. Only change player bounds when there's a change.
2. Change Surface bounds from VideoRendererSink instead of hacking codde
   in SbPlayerSetBounds().

b/377754564
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.

2 participants