Skip to content

Conversation

@eliteprox
Copy link
Collaborator

@eliteprox eliteprox commented Nov 28, 2025

This change adds set_loading_overlay to the StreamProcessor to support toggling overlay without blocking the frame processor. This is an alternative to returning VideoProcessingResult.WITHHELD which involves blocking client frame processing.

  • Introduced set_loading_overlay method in StreamProcessor to enable or disable the loading overlay for the current client, enhancing user experience during loading scenarios.
  • Updated TrickleClient, allowing immediate overlay frame generation without blocking the processor.
  • Updated overlay_example.py to demonstrate non-blocking manual overlay activation

There are three ways to activate the overlay currently:

  • Automatic via StreamServer config
    overlay_config=OverlayConfig(
    mode=OverlayMode.PROGRESSBAR,
    message="Loading...",
    enabled=True,
    auto_timeout_seconds=1.0,
    ),
  • Manually via StreamProcessor.set_loading_overlay()
    def set_loading_overlay(self, active: bool) -> bool:
    """
    Manually enable or disable the loading overlay for the current client.
    When enabled, the client will render overlay frames locally and skip
    sending frames to the processor, preventing blockage during warmup/loading.
    Returns:
    True if the command was sent to an active client, False otherwise.
    """
    if self.server and self.server.current_client:
    self.server.current_client.loading_controller.set_manual_loading(active)
    return True
    return False
  • Manually returning VideoProcessingResult.WITHHELD (not recommended)

…g states

- Updated TrickleClient to utilize this method, allowing immediate overlay frame generation without blocking the processor.

- Introduced `set_loading_overlay` method in StreamProcessor to enable or disable the loading overlay for the current client, enhancing user experience during loading scenarios.
- Added a check in OverlayController to return false for overlay generation when passthrough mode is active, ensuring proper handling of manual loading states.
@eliteprox
Copy link
Collaborator Author

@JJassonn69 If you have time to review today, this would be a good change to have

… activation and refactor into cleaner subclass structure

- Changed the loading overlay from automatic to manual activation during processing delays, allowing for better resource management.
- Introduced a new `ModelLoadingOverlayProcessor` class to encapsulate the overlay functionality and streamline model loading and parameter updates.
- Enhanced logging for model loading and processing delays, providing clearer feedback during operation.
…oving unnecessary controller references

- Removed the `_current_loading_controller` method and associated controller logic, streamlining the manual overlay activation and deactivation process.
- Updated the `_activate_manual_overlay` and `_disable_overlay_after` methods to directly use `set_loading_overlay`, enhancing code clarity and maintainability.
Copy link
Contributor

@JJassonn69 JJassonn69 left a comment

Choose a reason for hiding this comment

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

Looks solid, with well tested for edge issues. Ran it locally aswell and works as expected. LGTM

@eliteprox eliteprox merged commit 4ea4eac into main Dec 9, 2025
4 checks passed
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