-
Notifications
You must be signed in to change notification settings - Fork 12
[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
base: main
Are you sure you want to change the base?
Conversation
Classes are mostly done. Need to finish CLI and write some documentation (docstrings look like a must at this point). |
Now it's time to do the CLI yay |
#13 Comes back when using a bad camera |
Add on-demand options to CLI |
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.
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
def change_source(self, source: Union[int, str]) -> None: | ||
self.source = source | ||
self.__close_cap() | ||
self.__open_cap() | ||
|
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 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.
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.
Closes #5 #8 #12 #13