-
Notifications
You must be signed in to change notification settings - Fork 2
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
Editor client: Pause/Resume video on tab visibility change #1261
Conversation
c12432c
to
f310015
Compare
@@ -145,6 +145,11 @@ impl SizeDependentResources { | |||
} | |||
} | |||
|
|||
pub enum RenderSurfacePresentingStatus { | |||
Presenting, | |||
Paused, |
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.
Made an enum instead of a bool just so that we add more status when needed. If you think that's not needed I can revert that 👍
RenderSurfacePresentingStatus::Paused | ||
) { | ||
return; | ||
} |
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.
This really feels like a small hack. Is there any other way to prevent a render surface from "presenting" @jelmansouri @vduboisdendien-legion ?
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.
What are you trying to do?
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.
Basically prevent the presenters' "present" method from being called when the RenderSurface is paused 🙂
After discussing with @jelmansouri @smartel-legion @R3DP1XL this might be necessary or not in the future...
@@ -1,3 +1,5 @@ | |||
#![allow(clippy::use_self)] |
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.
Multiple open issues related to the use_self false positive bug (this one for instance)) but none actually fixed it. Plus, using #[allow(clippy::use_self)]
above the guilty line will not shut the warning
@@ -104,14 +128,23 @@ pub(crate) enum Input { | |||
KeyboardInput(KeyboardInput), | |||
} | |||
|
|||
#[derive(Debug, Deserialize)] | |||
#[serde(tag = "event")] | |||
pub(crate) enum ControlEventInfo { |
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.
The line in question, not sure why it triggers a use_self warning in Clippy
Waiting for some improvements by @smartel-legion , this pr might become obsolete or not, we'll see when the refactor window/render surface/presenter is more advanced 👍 |
f310015
to
8412db0
Compare
Probably a dirty workaround that we'll get rid of as soon as we switch from data channels to media streaming 👍 |
Closes #1250
Actually seems to fix the bug, but I'm really not confident about the fix itself 😕