Skip to content
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

Refactors the flask server and other audio/video streaming infrastructure into a new module. #440

Merged
merged 5 commits into from
Dec 14, 2023

Conversation

xsdg
Copy link
Collaborator

@xsdg xsdg commented Dec 14, 2023

This required jumping through a lot of hoops because Flask is not
object-oriented, and is intended to be implemented at a module level, which
makes it completely un-testable. I opted for a static class implementation,
which still provides some encapsulation and can be tested with the addition of
a reset function.

That said, a better option would be to switch over to something like
https://github.com/pallets-eco/flask-classful , which provides a
properly-encapsulated Flask implementation. Ideally, this will behave more like
Java servlets, which are usually pretty straightforward to test.

Tested

On Debian Linux

# Played audio via pulseaudio with parec backend
$mkchromecast --debug

# Played audio via pulseaudio with ffmpeg backend
$mkchromecast --debug --encoder-backend ffmpeg

# Played video with ffmpeg backend
mkchromecast --video --debug -i <file.mkv>

This is part of #434

@xsdg xsdg merged commit f409415 into muammar:master Dec 14, 2023
@xsdg xsdg deleted the flask_mod branch December 14, 2023 22:09
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.

1 participant