mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Use dataclass for stream segment Part (#101128)
* Use data class for stream segement Part * use slots
This commit is contained in:
parent
1b05418647
commit
26ba10f4e4
@ -4,6 +4,7 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from collections.abc import Callable, Coroutine, Iterable
|
from collections.abc import Callable, Coroutine, Iterable
|
||||||
|
from dataclasses import dataclass
|
||||||
import datetime
|
import datetime
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
import logging
|
import logging
|
||||||
@ -70,14 +71,14 @@ STREAM_SETTINGS_NON_LL_HLS = StreamSettings(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@attr.s(slots=True)
|
@dataclass(slots=True)
|
||||||
class Part:
|
class Part:
|
||||||
"""Represent a segment part."""
|
"""Represent a segment part."""
|
||||||
|
|
||||||
duration: float = attr.ib()
|
duration: float
|
||||||
has_keyframe: bool = attr.ib()
|
has_keyframe: bool
|
||||||
# video data (moof+mdat)
|
# video data (moof+mdat)
|
||||||
data: bytes = attr.ib()
|
data: bytes
|
||||||
|
|
||||||
|
|
||||||
@attr.s(slots=True)
|
@attr.s(slots=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user