Skip to content

core: Add NetStreamSource for better buffer management #20322

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Apr 30, 2025

Adding NetStreamSource makes it easier to reset buffer-related data. Instead of individually resetting fields, all appropriate fields are inside NetStreamSource, which can be replaced wholly.

Adding NetStreamSource makes it easier to reset buffer-related data.
Instead of individually resetting fields, all appropriate fields are
inside NetStreamSource, which can be replaced wholly.
@kjarosh kjarosh added A-core Area: Core player, where no other category fits T-refactor Type: Refactor / Cleanup labels Apr 30, 2025
@kjarosh kjarosh requested a review from moulins April 30, 2025 22:52
@kjarosh kjarosh added the waiting-on-review Waiting on review from a Ruffle team member label Apr 30, 2025
@danielhjacobs danielhjacobs requested a review from torokati44 May 1, 2025 00:34
@moulins
Copy link
Contributor

moulins commented May 3, 2025

I'd actually suggest removing all interior mutability from it and changing NetStreamData to hold a RefCell<NetStreamSource> directly, for two reasons:

  • unlike in Video, the source doesn't appear to be shareable between instances, so there's no need to add indirection;
  • most of the methods that access NetStreamSource already have to borrow one of the RefCell fields, so we don't gain much by having "fine-grained" interior mutability here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core player, where no other category fits T-refactor Type: Refactor / Cleanup waiting-on-review Waiting on review from a Ruffle team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants