Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Stream(Generic[T]):
- def __init__(self, source: StreamSource[T]):
- self._source = source
- async def get_length(self) -> float:
- return await self._source.get_length()
- def slice(self, start=0, end=float('inf')):
- self._source = SliceSource(self._source, start, end)
- class VideoStream(Stream[Frame]):
- def __init__(self, source: VideoSource):
- super().__init__(source)
- self._video_metadata_source = source
- async def get_resolution(self) -> Tuple[int, int]:
- return await self._video_metadata_source.get_resolution()
- def crop(self, x, y, w, h):
- self._source = self._video_metadata_source = CropSource(
- self._source,
- self._video_metadata_source,
- x, y, w, h,
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement