Raise errors automatically (#69)

* Add auto errors

* change code

---------

Co-authored-by: Freddy Boulton <freddyboulton@hf-freddy.local>
This commit is contained in:
Freddy Boulton
2025-02-24 20:21:25 -05:00
committed by GitHub
parent c36fb8da50
commit 5a4693ee0b
20 changed files with 297 additions and 344 deletions

View File

@@ -1,4 +1,4 @@
"""gr.WebRTC() component."""
"""WebRTC tracks."""
from __future__ import annotations
@@ -277,9 +277,7 @@ class StreamHandler(StreamHandlerBase):
pass
@abstractmethod
def emit(
self,
) -> EmitType:
def emit(self) -> EmitType:
pass
@abstractmethod
@@ -296,9 +294,7 @@ class AsyncStreamHandler(StreamHandlerBase):
pass
@abstractmethod
async def emit(
self,
) -> EmitType:
async def emit(self) -> EmitType:
pass
@abstractmethod
@@ -312,15 +308,13 @@ class AsyncStreamHandler(StreamHandlerBase):
StreamHandlerImpl = StreamHandler | AsyncStreamHandler
class AudioVideoStreamHandler(StreamHandlerBase):
class AudioVideoStreamHandler(StreamHandler):
@abstractmethod
def video_receive(self, frame: VideoFrame) -> None:
pass
@abstractmethod
def video_emit(
self,
) -> VideoEmitType:
def video_emit(self) -> VideoEmitType:
pass
@abstractmethod
@@ -328,15 +322,13 @@ class AudioVideoStreamHandler(StreamHandlerBase):
pass
class AsyncAudioVideoStreamHandler(StreamHandlerBase):
class AsyncAudioVideoStreamHandler(AsyncStreamHandler):
@abstractmethod
async def video_receive(self, frame: npt.NDArray[np.float32]) -> None:
pass
@abstractmethod
async def video_emit(
self,
) -> VideoEmitType:
async def video_emit(self) -> VideoEmitType:
pass
@abstractmethod