Skip to content

[Lib+CLI] On Demand Feature + New Class Structure #6

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

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft

Conversation

egeakman
Copy link
Owner

@egeakman egeakman commented Feb 13, 2024

Closes #5 #8 #12 #13

@egeakman egeakman added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 13, 2024
@egeakman egeakman self-assigned this Feb 13, 2024
@egeakman
Copy link
Owner Author

Classes are mostly done. Need to finish CLI and write some documentation (docstrings look like a must at this point).

@egeakman egeakman linked an issue Feb 25, 2024 that may be closed by this pull request
@egeakman egeakman changed the title [Lib+CLI] On Demand Feature [Lib+CLI] On Demand Feature + New Class Structure Feb 25, 2024
@egeakman egeakman removed the documentation Improvements or additions to documentation label Mar 10, 2024
@egeakman
Copy link
Owner Author

egeakman commented May 5, 2024

Now it's time to do the CLI yay

@egeakman
Copy link
Owner Author

egeakman commented May 8, 2024

#13 Comes back when using a bad camera

@egeakman
Copy link
Owner Author

egeakman commented May 8, 2024

Add on-demand options to CLI

@egeakman egeakman requested a review from Copilot March 26, 2025 20:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an on demand streaming feature along with a restructured class architecture for improved modularity and clarity. Key changes include the addition of the ManagedStream class with support for both fast and full on-demand modes, updates to the CLI to support the new structure, and refactoring of tests and server initialization routines.

Reviewed Changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_fast_od.py Added tests for fast on-demand streaming functionality.
tests/test_streambase.py Added tests for basic StreamBase functionality.
tests/test_stream.py Added tests for the Stream class with new behavior.
tests/test_full_od.py Added tests for full on-demand streaming functionality.
perf/usage-tests.md Updated performance usage documentation.
perf/py-spy-results.md Updated py-spy performance results documentation.
mjpeg_streamer/stream.py Refactored stream classes including ManagedStream and StreamBase.
mjpeg_streamer/server.py Refactored server initialization and stream routing.
mjpeg_streamer/cli.py Updated CLI to support the new ManagedStream class.
mjpeg_streamer/init.py Updated module exports to include new classes.
Files not reviewed (2)
  • .editorconfig: Language not supported
  • requirements-dev.txt: Language not supported

Comment on lines +247 to +251
def change_source(self, source: Union[int, str]) -> None:
self.source = source
self.__close_cap()
self.__open_cap()

Copy link
Preview

Copilot AI Mar 26, 2025

Choose a reason for hiding this comment

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

The synchronous 'change_source' method calls the async functions '__close_cap' and '__open_cap' without awaiting them. Consider converting 'change_source' into an async function and using 'await' when calling these functions to ensure proper execution.

Suggested change
def change_source(self, source: Union[int, str]) -> None:
self.source = source
self.__close_cap()
self.__open_cap()
async def change_source(self, source: Union[int, str]) -> None:
self.source = source
await self.__close_cap()
await self.__open_cap()

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant