File: interface.py

package info (click to toggle)
rtsp-to-webrtc 0.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 240 kB
  • sloc: python: 1,126; makefile: 7; sh: 5
file content (28 lines) | stat: -rw-r--r-- 781 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Interface for client library for RTSPtoWeb / RTSPtoWebRTC server."""

from __future__ import annotations

from abc import ABC, abstractmethod
from typing import Any


class WebRTCClientInterface(ABC):
    """Client for RTSPtoWeb / RTSPtoWebRTC server."""

    @abstractmethod
    async def offer(self, offer_sdp: str, rtsp_url: str) -> str:
        """Send the WebRTC offer to the server."""

    @abstractmethod
    async def offer_stream_id(
        self,
        stream_id: str,
        offer_sdp: str,
        rtsp_url: str,
        channel_data: dict[str, Any] | None = None,
    ) -> str:
        """Send the WebRTC offer to the server."""

    @abstractmethod
    async def heartbeat(self) -> None:
        """Send a request to the server to determine if it is alive."""