Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.stream.hls.HlsStreamOutput Class Reference
Inheritance diagram for homeassistant.components.stream.hls.HlsStreamOutput:
[legend]
Collaboration diagram for homeassistant.components.stream.hls.HlsStreamOutput:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass, IdleTimer idle_timer, StreamSettings stream_settings, DynamicStreamSettings dynamic_stream_settings)
 
None cleanup (self)
 
None discontinuity (self)
 
str name (self)
 
float target_duration (self)
 
- Public Member Functions inherited from homeassistant.components.stream.core.StreamOutput
None __init__ (self, HomeAssistant hass, IdleTimer idle_timer, StreamSettings stream_settings, DynamicStreamSettings dynamic_stream_settings, int|None deque_maxlen=None)
 
Segment|None get_segment (self, int sequence)
 
deque[Segmentget_segments (self)
 
bool idle (self)
 
Segment|None last_segment (self)
 
int last_sequence (self)
 
None part_put (self)
 
bool part_recv (self, float|None timeout=None)
 
None put (self, Segment segment)
 
bool recv (self)
 
list[int] sequences (self)
 

Private Member Functions

None _async_discontinuity (self)
 
None _async_put (self, Segment segment)
 

Private Attributes

 _target_duration
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.components.stream.core.StreamOutput
 dynamic_stream_settings
 
 idle_timer
 
 stream_settings
 

Detailed Description

Represents HLS Output formats.

Definition at line 48 of file hls.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.stream.hls.HlsStreamOutput.__init__ (   self,
HomeAssistant  hass,
IdleTimer  idle_timer,
StreamSettings  stream_settings,
DynamicStreamSettings  dynamic_stream_settings 
)
Initialize HLS output.

Definition at line 51 of file hls.py.

Member Function Documentation

◆ _async_discontinuity()

None homeassistant.components.stream.hls.HlsStreamOutput._async_discontinuity (   self)
private
Fix incomplete segment at end of deque in event loop.

Definition at line 102 of file hls.py.

◆ _async_put()

None homeassistant.components.stream.hls.HlsStreamOutput._async_put (   self,
Segment  segment 
)
private
Async put and also update the target duration.

The target duration is calculated as the max duration of any given segment.
Technically it should not change per the hls spec, but some cameras adjust
their GOPs periodically so we need to account for this change.

Reimplemented from homeassistant.components.stream.core.StreamOutput.

Definition at line 84 of file hls.py.

◆ cleanup()

None homeassistant.components.stream.hls.HlsStreamOutput.cleanup (   self)
Handle cleanup.

Reimplemented from homeassistant.components.stream.core.StreamOutput.

Definition at line 73 of file hls.py.

◆ discontinuity()

None homeassistant.components.stream.hls.HlsStreamOutput.discontinuity (   self)
Fix incomplete segment at end of deque.

Definition at line 97 of file hls.py.

◆ name()

str homeassistant.components.stream.hls.HlsStreamOutput.name (   self)
Return provider name.

Reimplemented from homeassistant.components.stream.core.StreamOutput.

Definition at line 69 of file hls.py.

◆ target_duration()

float homeassistant.components.stream.hls.HlsStreamOutput.target_duration (   self)
Return the target duration.

Definition at line 79 of file hls.py.

Member Data Documentation

◆ _target_duration

homeassistant.components.stream.hls.HlsStreamOutput._target_duration
private

Definition at line 66 of file hls.py.


The documentation for this class was generated from the following file: