Rename create_stream to async_create_stream in Camera
Rename get_image to async_get_image in Stream
Rename get_image to async_get_image in KeyFrameConverter
* Add a camera specific logger to help diagnose stream errors
Add a camera specific logger to help users associate stream errors with a particular camera.
Issue #54659
* Apply code review feedback
* Update package name based on manual testing
* Mark camera unavailable when keepalive stream fails
Add a listener in stream that notifies camera when the stream state has changed, and
use that to inform the camera `available` property. Update the property to be set
only from the main loop where it is read to reduce thread safety races.
Issue #54659
* Fix pylint import related errors
* Address lint naming errors
* Apply suggestions from code review
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This refactoring was pulled out of https://github.com/home-assistant/core/pull/53676 as an
initial step towards reverting the addition of the SegmentBuffer class, which will be
unrolled back into a for loop.
The StreamState class holds the persistent state in stream that is used across stream worker
instantiations, e.g. state across a retry or url expiration, which primarily handles
discontinuities. By itself, this PR is not a large win until follow up PRs further simplify
the SegmentBuffer class.
* Fix EXT-X-PROGRAM-DATE-TIME in stream
* Update fragment duration comments in worker
* Update duration test in worker
* Augment test on low latency playlists
* Reset start_time on discontinuity
Add a test that reproduces the issue where resetting the iterator
drops the already read packets. Fix a bug in replace_underlying_iterator
because checking the self._next function turns out not to work since
it points to a bound method so the "is not" check fails.
* Use defaultdict for TimestampValidator._last_dts
* Combine filters
* Allow PeekIterator to be updated while preserving buffer
* Fix peek edge case
* Readd is_valid filter to video only iterator
* Reset dts validator when container is reset
* Reuse existing dts_validator when disabling audio stream
* Refactor peek logic at the start of a stream
Add a PeekingIterator to support rewinding an iterator so that the code
for adjusting audio streams and start pts can be inlined in the worker.
* Simplification and readability improvements
* Remove unnecessary verbiage from comments and pydoc
* Address pylint errors
* Remove rewind function and just mux the first packet separately
* More cleanup after removing rewind()
* Skip check to self._buffer on every iteration
* Refactor dts validation logic into a separate function
Create a decompression timestamp validation function to move the logic out of
the worker into a separate class. This also uses the python itertools.chain
to chain together the initial packets with the remaining packets in the
container iterator, removing additional inline if statements.
* Reset dts validator when container is reset
* Fix typo in a comment
* Reuse existing dts_validator when disabling audio stream
* Enable gzip encoding for playlist responses
* Add EXT-X-PROGRAM-DATE-TIME to playlist
* Add EXT-X-START to playlist
* Change EXT-X-VERSION from 7 to 6
* Move idle timer call to recv
* Refactor recv to remove cursor and return bool
* Rename STREAM_TIMEOUT to SOURCE_TIMEOUT
* Combine StreamBuffer into SegmentBuffer in stream
* Use new style type hint in comment
Remove unused member self._segment
* Change reset_av to static helper function
* Change make_new_av to only return OutputContainer