import typing

from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gst
from gi.repository import GstNet
from gi.repository import GstRtsp
from gi.repository import GstSdp
from typing_extensions import Self

T = typing.TypeVar("T")

RTSP_ADDRESS_POOL_ANY_IPV4: str = "0.0.0.0"
RTSP_ADDRESS_POOL_ANY_IPV6: str = "::"
RTSP_AUTH_CHECK_CONNECT: str = "auth.check.connect"
RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS: str = "auth.check.media.factory.access"
RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT: str = "auth.check.media.factory.construct"
RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS: str = "auth.check.transport.client-settings"
RTSP_AUTH_CHECK_URL: str = "auth.check.url"
RTSP_ONVIF_BACKCHANNEL_REQUIREMENT: str = "www.onvif.org/ver20/backchannel"
RTSP_ONVIF_REPLAY_REQUIREMENT: str = "onvif-replay"
RTSP_PERM_MEDIA_FACTORY_ACCESS: str = "media.factory.access"
RTSP_PERM_MEDIA_FACTORY_CONSTRUCT: str = "media.factory.construct"
RTSP_TOKEN_MEDIA_FACTORY_ROLE: str = "media.factory.role"
RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS: str = "transport.client-settings"

def rtsp_params_get(client: RTSPClient, ctx: RTSPContext) -> GstRtsp.RTSPResult: ...
def rtsp_params_set(client: RTSPClient, ctx: RTSPContext) -> GstRtsp.RTSPResult: ...
def rtsp_sdp_from_media(
    sdp: GstSdp.SDPMessage, info: SDPInfo, media: RTSPMedia
) -> bool: ...
def rtsp_sdp_from_stream(
    sdp: GstSdp.SDPMessage, info: SDPInfo, stream: RTSPStream
) -> bool: ...
def rtsp_sdp_make_media(
    sdp: GstSdp.SDPMessage,
    info: SDPInfo,
    stream: RTSPStream,
    caps: Gst.Caps,
    profile: GstRtsp.RTSPProfile,
) -> bool: ...

class RTSPAddress(GObject.GBoxed):
    """
    :Constructors:

    ::

        RTSPAddress()
    """

    pool: RTSPAddressPool = ...
    address: str = ...
    port: int = ...
    n_ports: int = ...
    ttl: int = ...
    priv: None = ...
    def copy(self) -> RTSPAddress: ...
    def free(self) -> None: ...

class RTSPAddressPool(GObject.Object):
    """
    :Constructors:

    ::

        RTSPAddressPool(**properties)
        new() -> GstRtspServer.RTSPAddressPool

    Object GstRTSPAddressPool

    Signals from GObject:
      notify (GParam)
    """

    parent: GObject.Object = ...
    priv: RTSPAddressPoolPrivate = ...
    def acquire_address(
        self, flags: RTSPAddressFlags, n_ports: int
    ) -> typing.Optional[RTSPAddress]: ...
    def add_range(
        self, min_address: str, max_address: str, min_port: int, max_port: int, ttl: int
    ) -> bool: ...
    def clear(self) -> None: ...
    def dump(self) -> None: ...
    def has_unicast_addresses(self) -> bool: ...
    @classmethod
    def new(cls) -> RTSPAddressPool: ...
    def reserve_address(
        self, ip_address: str, port: int, n_ports: int, ttl: int
    ) -> typing.Tuple[RTSPAddressPoolResult, RTSPAddress]: ...

class RTSPAddressPoolClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPAddressPoolClass()
    """

    parent_class: GObject.ObjectClass = ...

class RTSPAddressPoolPrivate(GObject.GPointer): ...

class RTSPAuth(GObject.Object):
    """
    :Constructors:

    ::

        RTSPAuth(**properties)
        new() -> GstRtspServer.RTSPAuth

    Object GstRTSPAuth

    Signals from GstRTSPAuth:
      accept-certificate (GTlsConnection, GTlsCertificate, GTlsCertificateFlags) -> gboolean

    Signals from GObject:
      notify (GParam)
    """

    parent: GObject.Object = ...
    priv: RTSPAuthPrivate = ...
    def add_basic(self, basic: str, token: RTSPToken) -> None: ...
    def add_digest(self, user: str, pass_: str, token: RTSPToken) -> None: ...
    @staticmethod
    def check(check: str) -> bool: ...
    def do_accept_certificate(
        self,
        connection: Gio.TlsConnection,
        peer_cert: Gio.TlsCertificate,
        errors: Gio.TlsCertificateFlags,
    ) -> bool: ...
    def do_authenticate(self, ctx: RTSPContext) -> bool: ...
    def do_check(self, ctx: RTSPContext, check: str) -> bool: ...
    def do_generate_authenticate_header(self, ctx: RTSPContext) -> None: ...
    def get_default_token(self) -> typing.Optional[RTSPToken]: ...
    def get_realm(self) -> typing.Optional[str]: ...
    def get_supported_methods(self) -> GstRtsp.RTSPAuthMethod: ...
    def get_tls_authentication_mode(self) -> Gio.TlsAuthenticationMode: ...
    def get_tls_certificate(self) -> typing.Optional[Gio.TlsCertificate]: ...
    def get_tls_database(self) -> typing.Optional[Gio.TlsDatabase]: ...
    @staticmethod
    def make_basic(user: str, pass_: str) -> str: ...
    @classmethod
    def new(cls) -> RTSPAuth: ...
    def parse_htdigest(self, path: str, token: RTSPToken) -> bool: ...
    def remove_basic(self, basic: str) -> None: ...
    def remove_digest(self, user: str) -> None: ...
    def set_default_token(self, token: typing.Optional[RTSPToken] = None) -> None: ...
    def set_realm(self, realm: typing.Optional[str] = None) -> None: ...
    def set_supported_methods(self, methods: GstRtsp.RTSPAuthMethod) -> None: ...
    def set_tls_authentication_mode(self, mode: Gio.TlsAuthenticationMode) -> None: ...
    def set_tls_certificate(
        self, cert: typing.Optional[Gio.TlsCertificate] = None
    ) -> None: ...
    def set_tls_database(
        self, database: typing.Optional[Gio.TlsDatabase] = None
    ) -> None: ...

class RTSPAuthClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPAuthClass()
    """

    parent_class: GObject.ObjectClass = ...
    authenticate: typing.Callable[[RTSPAuth, RTSPContext], bool] = ...
    check: typing.Callable[[RTSPAuth, RTSPContext, str], bool] = ...
    generate_authenticate_header: typing.Callable[[RTSPAuth, RTSPContext], None] = ...
    accept_certificate: typing.Callable[
        [RTSPAuth, Gio.TlsConnection, Gio.TlsCertificate, Gio.TlsCertificateFlags], bool
    ] = ...

class RTSPAuthPrivate(GObject.GPointer): ...

class RTSPClient(GObject.Object):
    """
    :Constructors:

    ::

        RTSPClient(**properties)
        new() -> GstRtspServer.RTSPClient

    Object GstRTSPClient

    Signals from GstRTSPClient:
      closed ()
      new-session (GstRTSPSession)
      pre-options-request (GstRTSPContext) -> GstRTSPStatusCode
      options-request (GstRTSPContext)
      pre-describe-request (GstRTSPContext) -> GstRTSPStatusCode
      describe-request (GstRTSPContext)
      pre-setup-request (GstRTSPContext) -> GstRTSPStatusCode
      setup-request (GstRTSPContext)
      pre-play-request (GstRTSPContext) -> GstRTSPStatusCode
      play-request (GstRTSPContext)
      pre-pause-request (GstRTSPContext) -> GstRTSPStatusCode
      pause-request (GstRTSPContext)
      pre-teardown-request (GstRTSPContext) -> GstRTSPStatusCode
      teardown-request (GstRTSPContext)
      pre-set-parameter-request (GstRTSPContext) -> GstRTSPStatusCode
      set-parameter-request (GstRTSPContext)
      pre-get-parameter-request (GstRTSPContext) -> GstRTSPStatusCode
      get-parameter-request (GstRTSPContext)
      handle-response (GstRTSPContext)
      send-message (GstRTSPContext, gpointer)
      pre-announce-request (GstRTSPContext) -> GstRTSPStatusCode
      announce-request (GstRTSPContext)
      pre-record-request (GstRTSPContext) -> GstRTSPStatusCode
      record-request (GstRTSPContext)
      check-requirements (GstRTSPContext, GStrv) -> gchararray

    Properties from GstRTSPClient:
      session-pool -> GstRTSPSessionPool: Session Pool
        The session pool to use for client session
      mount-points -> GstRTSPMountPoints: Mount Points
        The mount points to use for client session
      drop-backlog -> gboolean: Drop Backlog
        Drop data when the backlog queue is full
      post-session-timeout -> gint: Post Session Timeout
        An extra TCP connection timeout after session timeout

    Signals from GObject:
      notify (GParam)
    """
    class Props(GObject.Object.Props):
        drop_backlog: bool
        mount_points: typing.Optional[RTSPMountPoints]
        post_session_timeout: int
        session_pool: typing.Optional[RTSPSessionPool]

    props: Props = ...
    parent: GObject.Object = ...
    priv: RTSPClientPrivate = ...
    def __init__(
        self,
        *,
        drop_backlog: bool = ...,
        mount_points: typing.Optional[RTSPMountPoints] = ...,
        post_session_timeout: int = ...,
        session_pool: typing.Optional[RTSPSessionPool] = ...,
    ) -> None: ...
    def attach(self, context: typing.Optional[GLib.MainContext] = None) -> int: ...
    def close(self) -> None: ...
    def do_adjust_error_code(
        self, ctx: RTSPContext, code: GstRtsp.RTSPStatusCode
    ) -> GstRtsp.RTSPStatusCode: ...
    def do_adjust_play_mode(
        self,
        context: RTSPContext,
        range: GstRtsp.RTSPTimeRange,
        flags: Gst.SeekFlags,
        rate: float,
        trickmode_interval: int,
        enable_rate_control: bool,
    ) -> GstRtsp.RTSPStatusCode: ...
    def do_adjust_play_response(
        self, context: RTSPContext
    ) -> GstRtsp.RTSPStatusCode: ...
    def do_announce_request(self, ctx: RTSPContext) -> None: ...
    def do_check_requirements(self, ctx: RTSPContext, arr: str) -> str: ...
    def do_closed(self) -> None: ...
    def do_configure_client_media(
        self, media: RTSPMedia, stream: RTSPStream, ctx: RTSPContext
    ) -> bool: ...
    def do_configure_client_transport(
        self, ctx: RTSPContext, ct: GstRtsp.RTSPTransport
    ) -> bool: ...
    def do_create_sdp(self, media: RTSPMedia) -> GstSdp.SDPMessage: ...
    def do_describe_request(self, ctx: RTSPContext) -> None: ...
    def do_get_parameter_request(self, ctx: RTSPContext) -> None: ...
    def do_handle_response(self, ctx: RTSPContext) -> None: ...
    def do_handle_sdp(
        self, ctx: RTSPContext, media: RTSPMedia, sdp: GstSdp.SDPMessage
    ) -> bool: ...
    def do_make_path_from_uri(self, uri: GstRtsp.RTSPUrl) -> str: ...
    def do_new_session(self, session: RTSPSession) -> None: ...
    def do_options_request(self, ctx: RTSPContext) -> None: ...
    def do_params_get(self, ctx: RTSPContext) -> GstRtsp.RTSPResult: ...
    def do_params_set(self, ctx: RTSPContext) -> GstRtsp.RTSPResult: ...
    def do_pause_request(self, ctx: RTSPContext) -> None: ...
    def do_play_request(self, ctx: RTSPContext) -> None: ...
    def do_pre_announce_request(self, ctx: RTSPContext) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_describe_request(self, ctx: RTSPContext) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_get_parameter_request(
        self, ctx: RTSPContext
    ) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_options_request(self, ctx: RTSPContext) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_pause_request(self, ctx: RTSPContext) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_play_request(self, ctx: RTSPContext) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_record_request(self, ctx: RTSPContext) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_set_parameter_request(
        self, ctx: RTSPContext
    ) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_setup_request(self, ctx: RTSPContext) -> GstRtsp.RTSPStatusCode: ...
    def do_pre_teardown_request(self, ctx: RTSPContext) -> GstRtsp.RTSPStatusCode: ...
    def do_record_request(self, ctx: RTSPContext) -> None: ...
    def do_send_message(
        self, ctx: RTSPContext, response: GstRtsp.RTSPMessage
    ) -> None: ...
    def do_set_parameter_request(self, ctx: RTSPContext) -> None: ...
    def do_setup_request(self, ctx: RTSPContext) -> None: ...
    def do_teardown_request(self, ctx: RTSPContext) -> None: ...
    def do_tunnel_http_response(
        self, request: GstRtsp.RTSPMessage, response: GstRtsp.RTSPMessage
    ) -> None: ...
    def get_auth(self) -> typing.Optional[RTSPAuth]: ...
    def get_connection(self) -> typing.Optional[GstRtsp.RTSPConnection]: ...
    def get_content_length_limit(self) -> int: ...
    def get_mount_points(self) -> typing.Optional[RTSPMountPoints]: ...
    def get_session_pool(self) -> typing.Optional[RTSPSessionPool]: ...
    def get_stream_transport(
        self, channel: int
    ) -> typing.Optional[RTSPStreamTransport]: ...
    def get_thread_pool(self) -> typing.Optional[RTSPThreadPool]: ...
    def handle_message(self, message: GstRtsp.RTSPMessage) -> GstRtsp.RTSPResult: ...
    @classmethod
    def new(cls) -> RTSPClient: ...
    def send_message(
        self, session: typing.Optional[RTSPSession], message: GstRtsp.RTSPMessage
    ) -> GstRtsp.RTSPResult: ...
    def session_filter(
        self,
        func: typing.Optional[typing.Callable[..., RTSPFilterResult]] = None,
        *user_data: typing.Any,
    ) -> list[RTSPSession]: ...
    def set_auth(self, auth: typing.Optional[RTSPAuth] = None) -> None: ...
    def set_connection(self, conn: GstRtsp.RTSPConnection) -> bool: ...
    def set_content_length_limit(self, limit: int) -> None: ...
    def set_mount_points(
        self, mounts: typing.Optional[RTSPMountPoints] = None
    ) -> None: ...
    def set_send_func(
        self, func: typing.Callable[..., bool], *user_data: typing.Any
    ) -> None: ...
    def set_send_messages_func(
        self, func: typing.Callable[..., bool], *user_data: typing.Any
    ) -> None: ...
    def set_session_pool(
        self, pool: typing.Optional[RTSPSessionPool] = None
    ) -> None: ...
    def set_thread_pool(self, pool: typing.Optional[RTSPThreadPool] = None) -> None: ...

class RTSPClientClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPClientClass()
    """

    parent_class: GObject.ObjectClass = ...
    create_sdp: typing.Callable[[RTSPClient, RTSPMedia], GstSdp.SDPMessage] = ...
    configure_client_media: typing.Callable[
        [RTSPClient, RTSPMedia, RTSPStream, RTSPContext], bool
    ] = ...
    configure_client_transport: typing.Callable[
        [RTSPClient, RTSPContext, GstRtsp.RTSPTransport], bool
    ] = ...
    params_set: typing.Callable[[RTSPClient, RTSPContext], GstRtsp.RTSPResult] = ...
    params_get: typing.Callable[[RTSPClient, RTSPContext], GstRtsp.RTSPResult] = ...
    make_path_from_uri: typing.Callable[[RTSPClient, GstRtsp.RTSPUrl], str] = ...
    adjust_play_mode: typing.Callable[
        [
            RTSPClient,
            RTSPContext,
            GstRtsp.RTSPTimeRange,
            Gst.SeekFlags,
            float,
            int,
            bool,
        ],
        GstRtsp.RTSPStatusCode,
    ] = ...
    adjust_play_response: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    closed: typing.Callable[[RTSPClient], None] = ...
    new_session: typing.Callable[[RTSPClient, RTSPSession], None] = ...
    options_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    describe_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    setup_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    play_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    pause_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    teardown_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    set_parameter_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    get_parameter_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    handle_response: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    tunnel_http_response: typing.Callable[
        [RTSPClient, GstRtsp.RTSPMessage, GstRtsp.RTSPMessage], None
    ] = ...
    send_message: typing.Callable[
        [RTSPClient, RTSPContext, GstRtsp.RTSPMessage], None
    ] = ...
    handle_sdp: typing.Callable[
        [RTSPClient, RTSPContext, RTSPMedia, GstSdp.SDPMessage], bool
    ] = ...
    announce_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    record_request: typing.Callable[[RTSPClient, RTSPContext], None] = ...
    check_requirements: typing.Callable[[RTSPClient, RTSPContext, str], str] = ...
    pre_options_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_describe_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_setup_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_play_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_pause_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_teardown_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_set_parameter_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_get_parameter_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_announce_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    pre_record_request: typing.Callable[
        [RTSPClient, RTSPContext], GstRtsp.RTSPStatusCode
    ] = ...
    adjust_error_code: typing.Callable[
        [RTSPClient, RTSPContext, GstRtsp.RTSPStatusCode], GstRtsp.RTSPStatusCode
    ] = ...

class RTSPClientPrivate(GObject.GPointer): ...

class RTSPContext(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPContext()
    """

    server: RTSPServer = ...
    conn: GstRtsp.RTSPConnection = ...
    client: RTSPClient = ...
    request: GstRtsp.RTSPMessage = ...
    uri: GstRtsp.RTSPUrl = ...
    method: GstRtsp.RTSPMethod = ...
    auth: RTSPAuth = ...
    token: RTSPToken = ...
    session: RTSPSession = ...
    sessmedia: RTSPSessionMedia = ...
    factory: RTSPMediaFactory = ...
    media: RTSPMedia = ...
    stream: RTSPStream = ...
    response: GstRtsp.RTSPMessage = ...
    trans: RTSPStreamTransport = ...
    def pop_current(self) -> None: ...
    def push_current(self) -> None: ...
    def set_token(self, token: RTSPToken) -> None: ...

class RTSPMedia(GObject.Object):
    """
    :Constructors:

    ::

        RTSPMedia(**properties)
        new(element:Gst.Element) -> GstRtspServer.RTSPMedia

    Object GstRTSPMedia

    Signals from GstRTSPMedia:
      new-stream (GstRTSPStream)
      removed-stream (GstRTSPStream)
      prepared ()
      unprepared ()
      target-state (gint)
      new-state (gint)
      handle-message (GstMessage) -> gboolean

    Properties from GstRTSPMedia:
      shared -> gboolean: Shared
        If this media pipeline can be shared
      suspend-mode -> GstRTSPSuspendMode: Suspend Mode
        How to suspend the media in PAUSED
      reusable -> gboolean: Reusable
        If this media pipeline can be reused after an unprepare
      profiles -> GstRTSPProfile: Profiles
        Allowed transfer profiles
      protocols -> GstRTSPLowerTrans: Protocols
        Allowed lower transport protocols
      eos-shutdown -> gboolean: EOS Shutdown
        Send an EOS event to the pipeline before unpreparing
      buffer-size -> guint: Buffer Size
        The kernel UDP buffer size to use
      ensure-keyunit-on-start -> gboolean: Ensure keyunit on start
        Whether the stream will ensure a keyunit when a client connects.
      ensure-keyunit-on-start-timeout -> guint: Timeout for discarding old keyunit on start
        Timeout in milliseconds used to determine if a keyunit should be discarded when a client connects.
      element -> GstElement: The Element
        The GstBin to use for streaming the media
      time-provider -> gboolean: Time Provider
        Use a NetTimeProvider for clients
      latency -> guint: Latency
        Latency used for receiving media in milliseconds
      transport-mode -> GstRTSPTransportMode: Transport Mode
        If this media pipeline can be used for PLAY or RECORD
      stop-on-disconnect -> gboolean: Stop On Disconnect
        If this media pipeline should be stopped when a client disconnects without TEARDOWN
      clock -> GstClock: Clock
        Clock to be used by the media pipeline
      max-mcast-ttl -> guint: Maximum multicast ttl
        The maximum time-to-live value of outgoing multicast packets
      bind-mcast-address -> gboolean: Bind mcast address
        Whether the multicast sockets should be bound to multicast addresses or INADDR_ANY
      dscp-qos -> gint: DSCP QoS
        The IP DSCP field to use for each related stream

    Signals from GObject:
      notify (GParam)
    """
    class Props(GObject.Object.Props):
        bind_mcast_address: bool
        buffer_size: int
        clock: typing.Optional[Gst.Clock]
        dscp_qos: int
        element: Gst.Element
        ensure_keyunit_on_start: bool
        ensure_keyunit_on_start_timeout: int
        eos_shutdown: bool
        latency: int
        max_mcast_ttl: int
        profiles: GstRtsp.RTSPProfile
        protocols: GstRtsp.RTSPLowerTrans
        reusable: bool
        shared: bool
        stop_on_disconnect: bool
        suspend_mode: RTSPSuspendMode
        time_provider: typing.Optional[bool]
        transport_mode: RTSPTransportMode

    props: Props = ...
    parent: GObject.Object = ...
    priv: RTSPMediaPrivate = ...
    def __init__(
        self,
        *,
        bind_mcast_address: bool = ...,
        buffer_size: int = ...,
        clock: typing.Optional[Gst.Clock] = ...,
        dscp_qos: int = ...,
        element: Gst.Element = ...,
        ensure_keyunit_on_start: bool = ...,
        ensure_keyunit_on_start_timeout: int = ...,
        eos_shutdown: bool = ...,
        latency: int = ...,
        max_mcast_ttl: int = ...,
        profiles: GstRtsp.RTSPProfile = ...,
        protocols: GstRtsp.RTSPLowerTrans = ...,
        reusable: bool = ...,
        shared: bool = ...,
        stop_on_disconnect: bool = ...,
        suspend_mode: RTSPSuspendMode = ...,
        time_provider: bool = ...,
        transport_mode: RTSPTransportMode = ...,
    ) -> None: ...
    def can_be_shared(self) -> bool: ...
    def collect_streams(self) -> None: ...
    def complete_pipeline(
        self, transports: typing.Sequence[GstRtsp.RTSPTransport]
    ) -> bool: ...
    def create_stream(self, payloader: Gst.Element, pad: Gst.Pad) -> RTSPStream: ...
    def do_convert_range(
        self, range: GstRtsp.RTSPTimeRange, unit: GstRtsp.RTSPRangeUnit
    ) -> bool: ...
    def do_handle_message(self, message: Gst.Message) -> bool: ...
    def do_handle_sdp(self, sdp: GstSdp.SDPMessage) -> bool: ...
    def do_new_state(self, state: Gst.State) -> None: ...
    def do_new_stream(self, stream: RTSPStream) -> None: ...
    def do_prepare(self, thread: typing.Optional[RTSPThread] = None) -> bool: ...
    def do_prepared(self) -> None: ...
    def do_query_position(self, position: int) -> bool: ...
    def do_query_stop(self, stop: int) -> bool: ...
    def do_removed_stream(self, stream: RTSPStream) -> None: ...
    def do_setup_rtpbin(self, rtpbin: Gst.Element) -> bool: ...
    def do_setup_sdp(self, sdp: GstSdp.SDPMessage, info: SDPInfo) -> bool: ...
    def do_suspend(self) -> bool: ...
    def do_target_state(self, state: Gst.State) -> None: ...
    def do_unprepare(self) -> bool: ...
    def do_unprepared(self) -> None: ...
    def do_unsuspend(self) -> bool: ...
    def find_stream(self, control: str) -> typing.Optional[RTSPStream]: ...
    def get_address_pool(self) -> typing.Optional[RTSPAddressPool]: ...
    def get_base_time(self) -> int: ...
    def get_buffer_size(self) -> int: ...
    def get_clock(self) -> typing.Optional[Gst.Clock]: ...
    def get_do_retransmission(self) -> bool: ...
    def get_dscp_qos(self) -> int: ...
    def get_element(self) -> Gst.Element: ...
    def get_ensure_keyunit_on_start(self) -> bool: ...
    def get_ensure_keyunit_on_start_timeout(self) -> int: ...
    def get_latency(self) -> int: ...
    def get_max_mcast_ttl(self) -> int: ...
    def get_multicast_iface(self) -> typing.Optional[str]: ...
    def get_permissions(self) -> typing.Optional[RTSPPermissions]: ...
    def get_profiles(self) -> GstRtsp.RTSPProfile: ...
    def get_protocols(self) -> GstRtsp.RTSPLowerTrans: ...
    def get_publish_clock_mode(self) -> RTSPPublishClockMode: ...
    def get_range_string(
        self, play: bool, unit: GstRtsp.RTSPRangeUnit
    ) -> typing.Optional[str]: ...
    def get_rate_control(self) -> bool: ...
    def get_rates(self) -> typing.Tuple[bool, float, float]: ...
    def get_retransmission_time(self) -> int: ...
    def get_status(self) -> RTSPMediaStatus: ...
    def get_stream(self, idx: int) -> typing.Optional[RTSPStream]: ...
    def get_suspend_mode(self) -> RTSPSuspendMode: ...
    def get_time_provider(
        self, address: typing.Optional[str], port: int
    ) -> typing.Optional[GstNet.NetTimeProvider]: ...
    def get_transport_mode(self) -> RTSPTransportMode: ...
    def handle_sdp(self, sdp: GstSdp.SDPMessage) -> bool: ...
    def has_completed_sender(self) -> bool: ...
    def is_bind_mcast_address(self) -> bool: ...
    def is_eos_shutdown(self) -> bool: ...
    def is_receive_only(self) -> bool: ...
    def is_reusable(self) -> bool: ...
    def is_shared(self) -> bool: ...
    def is_stop_on_disconnect(self) -> bool: ...
    def is_time_provider(self) -> bool: ...
    def lock(self) -> None: ...
    def n_streams(self) -> int: ...
    @classmethod
    def new(cls, element: Gst.Element) -> RTSPMedia: ...
    def prepare(self, thread: typing.Optional[RTSPThread] = None) -> bool: ...
    def seek(self, range: GstRtsp.RTSPTimeRange) -> bool: ...
    def seek_full(self, range: GstRtsp.RTSPTimeRange, flags: Gst.SeekFlags) -> bool: ...
    def seek_trickmode(
        self,
        range: GstRtsp.RTSPTimeRange,
        flags: Gst.SeekFlags,
        rate: float,
        trickmode_interval: int,
    ) -> bool: ...
    def seekable(self) -> int: ...
    def set_address_pool(
        self, pool: typing.Optional[RTSPAddressPool] = None
    ) -> None: ...
    def set_bind_mcast_address(self, bind_mcast_addr: bool) -> None: ...
    def set_buffer_size(self, size: int) -> None: ...
    def set_clock(self, clock: typing.Optional[Gst.Clock] = None) -> None: ...
    def set_do_retransmission(self, do_retransmission: bool) -> None: ...
    def set_dscp_qos(self, dscp_qos: int) -> None: ...
    def set_ensure_keyunit_on_start(self, ensure_keyunit_on_start: bool) -> None: ...
    def set_ensure_keyunit_on_start_timeout(self, timeout: int) -> None: ...
    def set_eos_shutdown(self, eos_shutdown: bool) -> None: ...
    def set_latency(self, latency: int) -> None: ...
    def set_max_mcast_ttl(self, ttl: int) -> bool: ...
    def set_multicast_iface(
        self, multicast_iface: typing.Optional[str] = None
    ) -> None: ...
    def set_permissions(
        self, permissions: typing.Optional[RTSPPermissions] = None
    ) -> None: ...
    def set_pipeline_state(self, state: Gst.State) -> None: ...
    def set_profiles(self, profiles: GstRtsp.RTSPProfile) -> None: ...
    def set_protocols(self, protocols: GstRtsp.RTSPLowerTrans) -> None: ...
    def set_publish_clock_mode(self, mode: RTSPPublishClockMode) -> None: ...
    def set_rate_control(self, enabled: bool) -> None: ...
    def set_retransmission_time(self, time: int) -> None: ...
    def set_reusable(self, reusable: bool) -> None: ...
    def set_shared(self, shared: bool) -> None: ...
    def set_state(
        self, state: Gst.State, transports: typing.Sequence[RTSPStreamTransport]
    ) -> bool: ...
    def set_stop_on_disconnect(self, stop_on_disconnect: bool) -> None: ...
    def set_suspend_mode(self, mode: RTSPSuspendMode) -> None: ...
    def set_transport_mode(self, mode: RTSPTransportMode) -> None: ...
    def setup_sdp(self, sdp: GstSdp.SDPMessage, info: SDPInfo) -> bool: ...
    def suspend(self) -> bool: ...
    def take_pipeline(self, pipeline: Gst.Pipeline) -> None: ...
    def unlock(self) -> None: ...
    def unprepare(self) -> bool: ...
    def unsuspend(self) -> bool: ...
    def use_time_provider(self, time_provider: bool) -> None: ...

class RTSPMediaClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPMediaClass()
    """

    parent_class: GObject.ObjectClass = ...
    handle_message: typing.Callable[[RTSPMedia, Gst.Message], bool] = ...
    prepare: typing.Callable[[RTSPMedia, typing.Optional[RTSPThread]], bool] = ...
    unprepare: typing.Callable[[RTSPMedia], bool] = ...
    suspend: typing.Callable[[RTSPMedia], bool] = ...
    unsuspend: typing.Callable[[RTSPMedia], bool] = ...
    convert_range: typing.Callable[
        [RTSPMedia, GstRtsp.RTSPTimeRange, GstRtsp.RTSPRangeUnit], bool
    ] = ...
    query_position: typing.Callable[[RTSPMedia, int], bool] = ...
    query_stop: typing.Callable[[RTSPMedia, int], bool] = ...
    create_rtpbin: None = ...
    setup_rtpbin: typing.Callable[[RTSPMedia, Gst.Element], bool] = ...
    setup_sdp: typing.Callable[[RTSPMedia, GstSdp.SDPMessage, SDPInfo], bool] = ...
    new_stream: typing.Callable[[RTSPMedia, RTSPStream], None] = ...
    removed_stream: typing.Callable[[RTSPMedia, RTSPStream], None] = ...
    prepared: typing.Callable[[RTSPMedia], None] = ...
    unprepared: typing.Callable[[RTSPMedia], None] = ...
    target_state: typing.Callable[[RTSPMedia, Gst.State], None] = ...
    new_state: typing.Callable[[RTSPMedia, Gst.State], None] = ...
    handle_sdp: typing.Callable[[RTSPMedia, GstSdp.SDPMessage], bool] = ...

class RTSPMediaFactory(GObject.Object):
    """
    :Constructors:

    ::

        RTSPMediaFactory(**properties)
        new() -> GstRtspServer.RTSPMediaFactory

    Object GstRTSPMediaFactory

    Signals from GstRTSPMediaFactory:
      media-constructed (GstRTSPMedia)
      media-configure (GstRTSPMedia)

    Properties from GstRTSPMediaFactory:
      launch -> gchararray: Launch
        A launch description of the pipeline
      shared -> gboolean: Shared
        If media from this factory is shared
      suspend-mode -> GstRTSPSuspendMode: Suspend Mode
        Control how media will be suspended
      eos-shutdown -> gboolean: EOS Shutdown
        Send EOS down the pipeline before shutting down
      profiles -> GstRTSPProfile: Profiles
        Allowed transfer profiles
      protocols -> GstRTSPLowerTrans: Protocols
        Allowed lower transport protocols
      buffer-size -> guint: Buffer Size
        The kernel UDP buffer size to use
      ensure-keyunit-on-start -> gboolean: Ensure keyunit on start
        If media from this factory should ensure a key unit when a client connects.
      ensure-keyunit-on-start-timeout -> guint: Timeout for discarding old keyunit on start
        Timeout in milliseconds used to determine if a keyunit should be discarded when a client connects.
      latency -> guint: Latency
        Latency used for receiving media in milliseconds
      transport-mode -> GstRTSPTransportMode: Transport Mode
        If media from this factory is for PLAY or RECORD
      stop-on-disconnect -> gboolean: Stop On Disconnect
        If media from this factory should be stopped when a client disconnects without TEARDOWN
      clock -> GstClock: Clock
        Clock to be used by the pipelines created for all medias of this factory
      max-mcast-ttl -> guint: Maximum multicast ttl
        The maximum time-to-live value of outgoing multicast packets
      bind-mcast-address -> gboolean: Bind mcast address
        Whether the multicast sockets should be bound to multicast addresses or INADDR_ANY
      dscp-qos -> gint: DSCP QoS
        The IP DSCP field to use
      enable-rtcp -> gboolean: Enable RTCP
        Whether the created media should send and receive RTCP

    Signals from GObject:
      notify (GParam)
    """
    class Props(GObject.Object.Props):
        bind_mcast_address: bool
        buffer_size: int
        clock: typing.Optional[Gst.Clock]
        dscp_qos: int
        enable_rtcp: bool
        ensure_keyunit_on_start: bool
        ensure_keyunit_on_start_timeout: int
        eos_shutdown: bool
        latency: int
        launch: typing.Optional[str]
        max_mcast_ttl: int
        profiles: GstRtsp.RTSPProfile
        protocols: GstRtsp.RTSPLowerTrans
        shared: bool
        stop_on_disconnect: bool
        suspend_mode: RTSPSuspendMode
        transport_mode: RTSPTransportMode

    props: Props = ...
    parent: GObject.Object = ...
    priv: RTSPMediaFactoryPrivate = ...
    def __init__(
        self,
        *,
        bind_mcast_address: bool = ...,
        buffer_size: int = ...,
        clock: typing.Optional[Gst.Clock] = ...,
        dscp_qos: int = ...,
        enable_rtcp: bool = ...,
        ensure_keyunit_on_start: bool = ...,
        ensure_keyunit_on_start_timeout: int = ...,
        eos_shutdown: bool = ...,
        latency: int = ...,
        launch: str = ...,
        max_mcast_ttl: int = ...,
        profiles: GstRtsp.RTSPProfile = ...,
        protocols: GstRtsp.RTSPLowerTrans = ...,
        shared: bool = ...,
        stop_on_disconnect: bool = ...,
        suspend_mode: RTSPSuspendMode = ...,
        transport_mode: RTSPTransportMode = ...,
    ) -> None: ...
    def add_role_from_structure(self, structure: Gst.Structure) -> None: ...
    def construct(self, url: GstRtsp.RTSPUrl) -> typing.Optional[RTSPMedia]: ...
    def create_element(self, url: GstRtsp.RTSPUrl) -> typing.Optional[Gst.Element]: ...
    def do_configure(self, media: RTSPMedia) -> None: ...
    def do_construct(self, url: GstRtsp.RTSPUrl) -> typing.Optional[RTSPMedia]: ...
    def do_create_element(
        self, url: GstRtsp.RTSPUrl
    ) -> typing.Optional[Gst.Element]: ...
    def do_gen_key(self, url: GstRtsp.RTSPUrl) -> str: ...
    def do_media_configure(self, media: RTSPMedia) -> None: ...
    def do_media_constructed(self, media: RTSPMedia) -> None: ...
    def get_address_pool(self) -> typing.Optional[RTSPAddressPool]: ...
    def get_buffer_size(self) -> int: ...
    def get_clock(self) -> typing.Optional[Gst.Clock]: ...
    def get_do_retransmission(self) -> bool: ...
    def get_dscp_qos(self) -> int: ...
    def get_ensure_keyunit_on_start(self) -> bool: ...
    def get_ensure_keyunit_on_start_timeout(self) -> int: ...
    def get_latency(self) -> int: ...
    def get_launch(self) -> typing.Optional[str]: ...
    def get_max_mcast_ttl(self) -> int: ...
    def get_media_gtype(self) -> typing.Type[typing.Any]: ...
    def get_multicast_iface(self) -> typing.Optional[str]: ...
    def get_permissions(self) -> typing.Optional[RTSPPermissions]: ...
    def get_profiles(self) -> GstRtsp.RTSPProfile: ...
    def get_protocols(self) -> GstRtsp.RTSPLowerTrans: ...
    def get_publish_clock_mode(self) -> RTSPPublishClockMode: ...
    def get_retransmission_time(self) -> int: ...
    def get_suspend_mode(self) -> RTSPSuspendMode: ...
    def get_transport_mode(self) -> RTSPTransportMode: ...
    def is_bind_mcast_address(self) -> bool: ...
    def is_enable_rtcp(self) -> bool: ...
    def is_eos_shutdown(self) -> bool: ...
    def is_shared(self) -> bool: ...
    def is_stop_on_disonnect(self) -> bool: ...
    @classmethod
    def new(cls) -> RTSPMediaFactory: ...
    def set_address_pool(
        self, pool: typing.Optional[RTSPAddressPool] = None
    ) -> None: ...
    def set_bind_mcast_address(self, bind_mcast_addr: bool) -> None: ...
    def set_buffer_size(self, size: int) -> None: ...
    def set_clock(self, clock: typing.Optional[Gst.Clock] = None) -> None: ...
    def set_do_retransmission(self, do_retransmission: bool) -> None: ...
    def set_dscp_qos(self, dscp_qos: int) -> None: ...
    def set_enable_rtcp(self, enable: bool) -> None: ...
    def set_ensure_keyunit_on_start(self, ensure_keyunit_on_start: bool) -> None: ...
    def set_ensure_keyunit_on_start_timeout(self, timeout: int) -> None: ...
    def set_eos_shutdown(self, eos_shutdown: bool) -> None: ...
    def set_latency(self, latency: int) -> None: ...
    def set_launch(self, launch: str) -> None: ...
    def set_max_mcast_ttl(self, ttl: int) -> bool: ...
    def set_media_gtype(self, media_gtype: typing.Type[typing.Any]) -> None: ...
    def set_multicast_iface(
        self, multicast_iface: typing.Optional[str] = None
    ) -> None: ...
    def set_permissions(
        self, permissions: typing.Optional[RTSPPermissions] = None
    ) -> None: ...
    def set_profiles(self, profiles: GstRtsp.RTSPProfile) -> None: ...
    def set_protocols(self, protocols: GstRtsp.RTSPLowerTrans) -> None: ...
    def set_publish_clock_mode(self, mode: RTSPPublishClockMode) -> None: ...
    def set_retransmission_time(self, time: int) -> None: ...
    def set_shared(self, shared: bool) -> None: ...
    def set_stop_on_disconnect(self, stop_on_disconnect: bool) -> None: ...
    def set_suspend_mode(self, mode: RTSPSuspendMode) -> None: ...
    def set_transport_mode(self, mode: RTSPTransportMode) -> None: ...

class RTSPMediaFactoryClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPMediaFactoryClass()
    """

    parent_class: GObject.ObjectClass = ...
    gen_key: typing.Callable[[RTSPMediaFactory, GstRtsp.RTSPUrl], str] = ...
    create_element: typing.Callable[
        [RTSPMediaFactory, GstRtsp.RTSPUrl], typing.Optional[Gst.Element]
    ] = ...
    construct: typing.Callable[
        [RTSPMediaFactory, GstRtsp.RTSPUrl], typing.Optional[RTSPMedia]
    ] = ...
    create_pipeline: None = ...
    configure: typing.Callable[[RTSPMediaFactory, RTSPMedia], None] = ...
    media_constructed: typing.Callable[[RTSPMediaFactory, RTSPMedia], None] = ...
    media_configure: typing.Callable[[RTSPMediaFactory, RTSPMedia], None] = ...

class RTSPMediaFactoryPrivate(GObject.GPointer): ...

class RTSPMediaFactoryURI(RTSPMediaFactory):
    """
    :Constructors:

    ::

        RTSPMediaFactoryURI(**properties)
        new() -> GstRtspServer.RTSPMediaFactoryURI

    Object GstRTSPMediaFactoryURI

    Properties from GstRTSPMediaFactoryURI:
      uri -> gchararray: URI
        The URI of the resource to stream
      use-gstpay -> gboolean: Use gstpay
        Use the gstpay payloader to avoid decoding

    Signals from GstRTSPMediaFactory:
      media-constructed (GstRTSPMedia)
      media-configure (GstRTSPMedia)

    Properties from GstRTSPMediaFactory:
      launch -> gchararray: Launch
        A launch description of the pipeline
      shared -> gboolean: Shared
        If media from this factory is shared
      suspend-mode -> GstRTSPSuspendMode: Suspend Mode
        Control how media will be suspended
      eos-shutdown -> gboolean: EOS Shutdown
        Send EOS down the pipeline before shutting down
      profiles -> GstRTSPProfile: Profiles
        Allowed transfer profiles
      protocols -> GstRTSPLowerTrans: Protocols
        Allowed lower transport protocols
      buffer-size -> guint: Buffer Size
        The kernel UDP buffer size to use
      ensure-keyunit-on-start -> gboolean: Ensure keyunit on start
        If media from this factory should ensure a key unit when a client connects.
      ensure-keyunit-on-start-timeout -> guint: Timeout for discarding old keyunit on start
        Timeout in milliseconds used to determine if a keyunit should be discarded when a client connects.
      latency -> guint: Latency
        Latency used for receiving media in milliseconds
      transport-mode -> GstRTSPTransportMode: Transport Mode
        If media from this factory is for PLAY or RECORD
      stop-on-disconnect -> gboolean: Stop On Disconnect
        If media from this factory should be stopped when a client disconnects without TEARDOWN
      clock -> GstClock: Clock
        Clock to be used by the pipelines created for all medias of this factory
      max-mcast-ttl -> guint: Maximum multicast ttl
        The maximum time-to-live value of outgoing multicast packets
      bind-mcast-address -> gboolean: Bind mcast address
        Whether the multicast sockets should be bound to multicast addresses or INADDR_ANY
      dscp-qos -> gint: DSCP QoS
        The IP DSCP field to use
      enable-rtcp -> gboolean: Enable RTCP
        Whether the created media should send and receive RTCP

    Signals from GObject:
      notify (GParam)
    """
    class Props(RTSPMediaFactory.Props):
        uri: str
        use_gstpay: bool
        bind_mcast_address: bool
        buffer_size: int
        clock: typing.Optional[Gst.Clock]
        dscp_qos: int
        enable_rtcp: bool
        ensure_keyunit_on_start: bool
        ensure_keyunit_on_start_timeout: int
        eos_shutdown: bool
        latency: int
        launch: typing.Optional[str]
        max_mcast_ttl: int
        profiles: GstRtsp.RTSPProfile
        protocols: GstRtsp.RTSPLowerTrans
        shared: bool
        stop_on_disconnect: bool
        suspend_mode: RTSPSuspendMode
        transport_mode: RTSPTransportMode

    props: Props = ...
    parent: RTSPMediaFactory = ...
    priv: RTSPMediaFactoryURIPrivate = ...
    def __init__(
        self,
        *,
        uri: str = ...,
        use_gstpay: bool = ...,
        bind_mcast_address: bool = ...,
        buffer_size: int = ...,
        clock: typing.Optional[Gst.Clock] = ...,
        dscp_qos: int = ...,
        enable_rtcp: bool = ...,
        ensure_keyunit_on_start: bool = ...,
        ensure_keyunit_on_start_timeout: int = ...,
        eos_shutdown: bool = ...,
        latency: int = ...,
        launch: str = ...,
        max_mcast_ttl: int = ...,
        profiles: GstRtsp.RTSPProfile = ...,
        protocols: GstRtsp.RTSPLowerTrans = ...,
        shared: bool = ...,
        stop_on_disconnect: bool = ...,
        suspend_mode: RTSPSuspendMode = ...,
        transport_mode: RTSPTransportMode = ...,
    ) -> None: ...
    def get_uri(self) -> str: ...
    @classmethod
    def new(cls) -> RTSPMediaFactoryURI: ...
    def set_uri(self, uri: str) -> None: ...

class RTSPMediaFactoryURIClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPMediaFactoryURIClass()
    """

    parent_class: RTSPMediaFactoryClass = ...

class RTSPMediaFactoryURIPrivate(GObject.GPointer): ...
class RTSPMediaPrivate(GObject.GPointer): ...

class RTSPMountPoints(GObject.Object):
    """
    :Constructors:

    ::

        RTSPMountPoints(**properties)
        new() -> GstRtspServer.RTSPMountPoints

    Object GstRTSPMountPoints

    Signals from GObject:
      notify (GParam)
    """

    parent: GObject.Object = ...
    priv: RTSPMountPointsPrivate = ...
    def add_factory(self, path: str, factory: RTSPMediaFactory) -> None: ...
    def do_make_path(self, url: GstRtsp.RTSPUrl) -> typing.Optional[str]: ...
    def make_path(self, url: GstRtsp.RTSPUrl) -> typing.Optional[str]: ...
    def match(self, path: str) -> typing.Tuple[RTSPMediaFactory, int]: ...
    @classmethod
    def new(cls) -> RTSPMountPoints: ...
    def remove_factory(self, path: str) -> None: ...

class RTSPMountPointsClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPMountPointsClass()
    """

    parent_class: GObject.ObjectClass = ...
    make_path: typing.Callable[
        [RTSPMountPoints, GstRtsp.RTSPUrl], typing.Optional[str]
    ] = ...

class RTSPMountPointsPrivate(GObject.GPointer): ...

class RTSPOnvifClient(RTSPClient):
    """
    :Constructors:

    ::

        RTSPOnvifClient(**properties)
        new() -> GstRtspServer.RTSPClient

    Object GstRTSPOnvifClient

    Signals from GstRTSPClient:
      closed ()
      new-session (GstRTSPSession)
      pre-options-request (GstRTSPContext) -> GstRTSPStatusCode
      options-request (GstRTSPContext)
      pre-describe-request (GstRTSPContext) -> GstRTSPStatusCode
      describe-request (GstRTSPContext)
      pre-setup-request (GstRTSPContext) -> GstRTSPStatusCode
      setup-request (GstRTSPContext)
      pre-play-request (GstRTSPContext) -> GstRTSPStatusCode
      play-request (GstRTSPContext)
      pre-pause-request (GstRTSPContext) -> GstRTSPStatusCode
      pause-request (GstRTSPContext)
      pre-teardown-request (GstRTSPContext) -> GstRTSPStatusCode
      teardown-request (GstRTSPContext)
      pre-set-parameter-request (GstRTSPContext) -> GstRTSPStatusCode
      set-parameter-request (GstRTSPContext)
      pre-get-parameter-request (GstRTSPContext) -> GstRTSPStatusCode
      get-parameter-request (GstRTSPContext)
      handle-response (GstRTSPContext)
      send-message (GstRTSPContext, gpointer)
      pre-announce-request (GstRTSPContext) -> GstRTSPStatusCode
      announce-request (GstRTSPContext)
      pre-record-request (GstRTSPContext) -> GstRTSPStatusCode
      record-request (GstRTSPContext)
      check-requirements (GstRTSPContext, GStrv) -> gchararray

    Properties from GstRTSPClient:
      session-pool -> GstRTSPSessionPool: Session Pool
        The session pool to use for client session
      mount-points -> GstRTSPMountPoints: Mount Points
        The mount points to use for client session
      drop-backlog -> gboolean: Drop Backlog
        Drop data when the backlog queue is full
      post-session-timeout -> gint: Post Session Timeout
        An extra TCP connection timeout after session timeout

    Signals from GObject:
      notify (GParam)
    """
    class Props(RTSPClient.Props):
        drop_backlog: bool
        mount_points: typing.Optional[RTSPMountPoints]
        post_session_timeout: int
        session_pool: typing.Optional[RTSPSessionPool]

    props: Props = ...
    parent: RTSPClient = ...
    def __init__(
        self,
        *,
        drop_backlog: bool = ...,
        mount_points: typing.Optional[RTSPMountPoints] = ...,
        post_session_timeout: int = ...,
        session_pool: typing.Optional[RTSPSessionPool] = ...,
    ) -> None: ...
    @classmethod
    def new(cls) -> RTSPOnvifClient: ...

class RTSPOnvifClientClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPOnvifClientClass()
    """

    parent: RTSPClientClass = ...

class RTSPOnvifMedia(RTSPMedia):
    """
    :Constructors:

    ::

        RTSPOnvifMedia(**properties)

    Object GstRTSPOnvifMedia

    Signals from GstRTSPMedia:
      new-stream (GstRTSPStream)
      removed-stream (GstRTSPStream)
      prepared ()
      unprepared ()
      target-state (gint)
      new-state (gint)
      handle-message (GstMessage) -> gboolean

    Properties from GstRTSPMedia:
      shared -> gboolean: Shared
        If this media pipeline can be shared
      suspend-mode -> GstRTSPSuspendMode: Suspend Mode
        How to suspend the media in PAUSED
      reusable -> gboolean: Reusable
        If this media pipeline can be reused after an unprepare
      profiles -> GstRTSPProfile: Profiles
        Allowed transfer profiles
      protocols -> GstRTSPLowerTrans: Protocols
        Allowed lower transport protocols
      eos-shutdown -> gboolean: EOS Shutdown
        Send an EOS event to the pipeline before unpreparing
      buffer-size -> guint: Buffer Size
        The kernel UDP buffer size to use
      ensure-keyunit-on-start -> gboolean: Ensure keyunit on start
        Whether the stream will ensure a keyunit when a client connects.
      ensure-keyunit-on-start-timeout -> guint: Timeout for discarding old keyunit on start
        Timeout in milliseconds used to determine if a keyunit should be discarded when a client connects.
      element -> GstElement: The Element
        The GstBin to use for streaming the media
      time-provider -> gboolean: Time Provider
        Use a NetTimeProvider for clients
      latency -> guint: Latency
        Latency used for receiving media in milliseconds
      transport-mode -> GstRTSPTransportMode: Transport Mode
        If this media pipeline can be used for PLAY or RECORD
      stop-on-disconnect -> gboolean: Stop On Disconnect
        If this media pipeline should be stopped when a client disconnects without TEARDOWN
      clock -> GstClock: Clock
        Clock to be used by the media pipeline
      max-mcast-ttl -> guint: Maximum multicast ttl
        The maximum time-to-live value of outgoing multicast packets
      bind-mcast-address -> gboolean: Bind mcast address
        Whether the multicast sockets should be bound to multicast addresses or INADDR_ANY
      dscp-qos -> gint: DSCP QoS
        The IP DSCP field to use for each related stream

    Signals from GObject:
      notify (GParam)
    """
    class Props(RTSPMedia.Props):
        bind_mcast_address: bool
        buffer_size: int
        clock: typing.Optional[Gst.Clock]
        dscp_qos: int
        element: Gst.Element
        ensure_keyunit_on_start: bool
        ensure_keyunit_on_start_timeout: int
        eos_shutdown: bool
        latency: int
        max_mcast_ttl: int
        profiles: GstRtsp.RTSPProfile
        protocols: GstRtsp.RTSPLowerTrans
        reusable: bool
        shared: bool
        stop_on_disconnect: bool
        suspend_mode: RTSPSuspendMode
        time_provider: typing.Optional[bool]
        transport_mode: RTSPTransportMode

    props: Props = ...
    parent: RTSPMedia = ...
    priv: RTSPOnvifMediaPrivate = ...
    def __init__(
        self,
        *,
        bind_mcast_address: bool = ...,
        buffer_size: int = ...,
        clock: typing.Optional[Gst.Clock] = ...,
        dscp_qos: int = ...,
        element: Gst.Element = ...,
        ensure_keyunit_on_start: bool = ...,
        ensure_keyunit_on_start_timeout: int = ...,
        eos_shutdown: bool = ...,
        latency: int = ...,
        max_mcast_ttl: int = ...,
        profiles: GstRtsp.RTSPProfile = ...,
        protocols: GstRtsp.RTSPLowerTrans = ...,
        reusable: bool = ...,
        shared: bool = ...,
        stop_on_disconnect: bool = ...,
        suspend_mode: RTSPSuspendMode = ...,
        time_provider: bool = ...,
        transport_mode: RTSPTransportMode = ...,
    ) -> None: ...
    def collect_backchannel(self) -> bool: ...
    def get_backchannel_bandwidth(self) -> int: ...
    def set_backchannel_bandwidth(self, bandwidth: int) -> None: ...

class RTSPOnvifMediaClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPOnvifMediaClass()
    """

    parent: RTSPMediaClass = ...

class RTSPOnvifMediaFactory(RTSPMediaFactory):
    """
    :Constructors:

    ::

        RTSPOnvifMediaFactory(**properties)
        new() -> GstRtspServer.RTSPMediaFactory

    Object GstRTSPOnvifMediaFactory

    Signals from GstRTSPMediaFactory:
      media-constructed (GstRTSPMedia)
      media-configure (GstRTSPMedia)

    Properties from GstRTSPMediaFactory:
      launch -> gchararray: Launch
        A launch description of the pipeline
      shared -> gboolean: Shared
        If media from this factory is shared
      suspend-mode -> GstRTSPSuspendMode: Suspend Mode
        Control how media will be suspended
      eos-shutdown -> gboolean: EOS Shutdown
        Send EOS down the pipeline before shutting down
      profiles -> GstRTSPProfile: Profiles
        Allowed transfer profiles
      protocols -> GstRTSPLowerTrans: Protocols
        Allowed lower transport protocols
      buffer-size -> guint: Buffer Size
        The kernel UDP buffer size to use
      ensure-keyunit-on-start -> gboolean: Ensure keyunit on start
        If media from this factory should ensure a key unit when a client connects.
      ensure-keyunit-on-start-timeout -> guint: Timeout for discarding old keyunit on start
        Timeout in milliseconds used to determine if a keyunit should be discarded when a client connects.
      latency -> guint: Latency
        Latency used for receiving media in milliseconds
      transport-mode -> GstRTSPTransportMode: Transport Mode
        If media from this factory is for PLAY or RECORD
      stop-on-disconnect -> gboolean: Stop On Disconnect
        If media from this factory should be stopped when a client disconnects without TEARDOWN
      clock -> GstClock: Clock
        Clock to be used by the pipelines created for all medias of this factory
      max-mcast-ttl -> guint: Maximum multicast ttl
        The maximum time-to-live value of outgoing multicast packets
      bind-mcast-address -> gboolean: Bind mcast address
        Whether the multicast sockets should be bound to multicast addresses or INADDR_ANY
      dscp-qos -> gint: DSCP QoS
        The IP DSCP field to use
      enable-rtcp -> gboolean: Enable RTCP
        Whether the created media should send and receive RTCP

    Signals from GObject:
      notify (GParam)
    """
    class Props(RTSPMediaFactory.Props):
        bind_mcast_address: bool
        buffer_size: int
        clock: typing.Optional[Gst.Clock]
        dscp_qos: int
        enable_rtcp: bool
        ensure_keyunit_on_start: bool
        ensure_keyunit_on_start_timeout: int
        eos_shutdown: bool
        latency: int
        launch: typing.Optional[str]
        max_mcast_ttl: int
        profiles: GstRtsp.RTSPProfile
        protocols: GstRtsp.RTSPLowerTrans
        shared: bool
        stop_on_disconnect: bool
        suspend_mode: RTSPSuspendMode
        transport_mode: RTSPTransportMode

    props: Props = ...
    parent: RTSPMediaFactory = ...
    priv: RTSPOnvifMediaFactoryPrivate = ...
    def __init__(
        self,
        *,
        bind_mcast_address: bool = ...,
        buffer_size: int = ...,
        clock: typing.Optional[Gst.Clock] = ...,
        dscp_qos: int = ...,
        enable_rtcp: bool = ...,
        ensure_keyunit_on_start: bool = ...,
        ensure_keyunit_on_start_timeout: int = ...,
        eos_shutdown: bool = ...,
        latency: int = ...,
        launch: str = ...,
        max_mcast_ttl: int = ...,
        profiles: GstRtsp.RTSPProfile = ...,
        protocols: GstRtsp.RTSPLowerTrans = ...,
        shared: bool = ...,
        stop_on_disconnect: bool = ...,
        suspend_mode: RTSPSuspendMode = ...,
        transport_mode: RTSPTransportMode = ...,
    ) -> None: ...
    def do_create_backchannel_stream(
        self, media: RTSPOnvifMedia, ctx: RTSPContext
    ) -> bool: ...
    def do_has_backchannel_support(self) -> bool: ...
    def get_backchannel_bandwidth(self) -> int: ...
    def get_backchannel_launch(self) -> typing.Optional[str]: ...
    def has_backchannel_support(self) -> bool: ...
    def has_replay_support(self) -> bool: ...
    @classmethod
    def new(cls) -> RTSPOnvifMediaFactory: ...
    @staticmethod
    def requires_backchannel(factory: RTSPMediaFactory, ctx: RTSPContext) -> bool: ...
    def set_backchannel_bandwidth(self, bandwidth: int) -> None: ...
    def set_backchannel_launch(self, launch: typing.Optional[str] = None) -> None: ...
    def set_replay_support(self, has_replay_support: bool) -> None: ...

class RTSPOnvifMediaFactoryClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPOnvifMediaFactoryClass()
    """

    parent: RTSPMediaFactoryClass = ...
    has_backchannel_support: typing.Callable[[RTSPOnvifMediaFactory], bool] = ...
    create_backchannel_stream: typing.Callable[
        [RTSPOnvifMediaFactory, RTSPOnvifMedia, RTSPContext], bool
    ] = ...

class RTSPOnvifMediaFactoryPrivate(GObject.GPointer): ...
class RTSPOnvifMediaPrivate(GObject.GPointer): ...

class RTSPOnvifServer(RTSPServer):
    """
    :Constructors:

    ::

        RTSPOnvifServer(**properties)
        new() -> GstRtspServer.RTSPServer

    Object GstRTSPOnvifServer

    Signals from GstRTSPServer:
      client-connected (GstRTSPClient)

    Properties from GstRTSPServer:
      address -> gchararray: Address
        The address the server uses to listen on
      service -> gchararray: Service
        The service or port number the server uses to listen on
      bound-port -> gint: Bound port
        The port number the server is listening on
      backlog -> gint: Backlog
        The maximum length to which the queue of pending connections may grow
      session-pool -> GstRTSPSessionPool: Session Pool
        The session pool to use for client session
      mount-points -> GstRTSPMountPoints: Mount Points
        The mount points to use for client session
      content-length-limit -> guint: Limitation of Content-Length
        Limitation of Content-Length

    Signals from GObject:
      notify (GParam)
    """
    class Props(RTSPServer.Props):
        address: typing.Optional[str]
        backlog: int
        bound_port: int
        content_length_limit: int
        mount_points: typing.Optional[RTSPMountPoints]
        service: str
        session_pool: typing.Optional[RTSPSessionPool]

    props: Props = ...
    parent: RTSPServer = ...
    def __init__(
        self,
        *,
        address: str = ...,
        backlog: int = ...,
        content_length_limit: int = ...,
        mount_points: typing.Optional[RTSPMountPoints] = ...,
        service: str = ...,
        session_pool: typing.Optional[RTSPSessionPool] = ...,
    ) -> None: ...
    @classmethod
    def new(cls) -> RTSPOnvifServer: ...

class RTSPOnvifServerClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPOnvifServerClass()
    """

    parent: RTSPServerClass = ...

class RTSPPermissions(GObject.GBoxed):
    """
    :Constructors:

    ::

        RTSPPermissions()
        new() -> GstRtspServer.RTSPPermissions
    """

    mini_object: Gst.MiniObject = ...
    @staticmethod
    def __new__(cls: type[Self]) -> Self: ...
    def add_permission_for_role(
        self, role: str, permission: str, allowed: bool
    ) -> None: ...
    def add_role(self, role: str) -> None: ...
    def add_role_from_structure(self, structure: Gst.Structure) -> None: ...
    def get_role(self, role: str) -> Gst.Structure: ...
    def is_allowed(self, role: str, permission: str) -> bool: ...
    @classmethod
    def new(cls) -> RTSPPermissions: ...
    def remove_role(self, role: str) -> None: ...

class RTSPServer(GObject.Object):
    """
    :Constructors:

    ::

        RTSPServer(**properties)
        new() -> GstRtspServer.RTSPServer

    Object GstRTSPServer

    Signals from GstRTSPServer:
      client-connected (GstRTSPClient)

    Properties from GstRTSPServer:
      address -> gchararray: Address
        The address the server uses to listen on
      service -> gchararray: Service
        The service or port number the server uses to listen on
      bound-port -> gint: Bound port
        The port number the server is listening on
      backlog -> gint: Backlog
        The maximum length to which the queue of pending connections may grow
      session-pool -> GstRTSPSessionPool: Session Pool
        The session pool to use for client session
      mount-points -> GstRTSPMountPoints: Mount Points
        The mount points to use for client session
      content-length-limit -> guint: Limitation of Content-Length
        Limitation of Content-Length

    Signals from GObject:
      notify (GParam)
    """
    class Props(GObject.Object.Props):
        address: typing.Optional[str]
        backlog: int
        bound_port: int
        content_length_limit: int
        mount_points: typing.Optional[RTSPMountPoints]
        service: str
        session_pool: typing.Optional[RTSPSessionPool]

    props: Props = ...
    parent: GObject.Object = ...
    priv: RTSPServerPrivate = ...
    def __init__(
        self,
        *,
        address: str = ...,
        backlog: int = ...,
        content_length_limit: int = ...,
        mount_points: typing.Optional[RTSPMountPoints] = ...,
        service: str = ...,
        session_pool: typing.Optional[RTSPSessionPool] = ...,
    ) -> None: ...
    def attach(self, context: typing.Optional[GLib.MainContext] = None) -> int: ...
    def client_filter(
        self,
        func: typing.Optional[typing.Callable[..., RTSPFilterResult]] = None,
        *user_data: typing.Any,
    ) -> list[RTSPClient]: ...
    def create_socket(
        self, cancellable: typing.Optional[Gio.Cancellable] = None
    ) -> Gio.Socket: ...
    def create_source(
        self, cancellable: typing.Optional[Gio.Cancellable] = None
    ) -> GLib.Source: ...
    def do_client_connected(self, client: RTSPClient) -> None: ...
    def get_address(self) -> typing.Optional[str]: ...
    def get_auth(self) -> typing.Optional[RTSPAuth]: ...
    def get_backlog(self) -> int: ...
    def get_bound_port(self) -> int: ...
    def get_content_length_limit(self) -> int: ...
    def get_mount_points(self) -> typing.Optional[RTSPMountPoints]: ...
    def get_service(self) -> str: ...
    def get_session_pool(self) -> typing.Optional[RTSPSessionPool]: ...
    def get_thread_pool(self) -> typing.Optional[RTSPThreadPool]: ...
    @staticmethod
    def io_func(
        socket: Gio.Socket, condition: GLib.IOCondition, server: RTSPServer
    ) -> bool: ...
    @classmethod
    def new(cls) -> RTSPServer: ...
    def set_address(self, address: str) -> None: ...
    def set_auth(self, auth: typing.Optional[RTSPAuth] = None) -> None: ...
    def set_backlog(self, backlog: int) -> None: ...
    def set_content_length_limit(self, limit: int) -> None: ...
    def set_mount_points(
        self, mounts: typing.Optional[RTSPMountPoints] = None
    ) -> None: ...
    def set_service(self, service: str) -> None: ...
    def set_session_pool(
        self, pool: typing.Optional[RTSPSessionPool] = None
    ) -> None: ...
    def set_thread_pool(self, pool: typing.Optional[RTSPThreadPool] = None) -> None: ...
    def transfer_connection(
        self,
        socket: Gio.Socket,
        ip: str,
        port: int,
        initial_buffer: typing.Optional[str] = None,
    ) -> bool: ...

class RTSPServerClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPServerClass()
    """

    parent_class: GObject.ObjectClass = ...
    create_client: None = ...
    client_connected: typing.Callable[[RTSPServer, RTSPClient], None] = ...

class RTSPServerPrivate(GObject.GPointer): ...

class RTSPSession(GObject.Object):
    """
    :Constructors:

    ::

        RTSPSession(**properties)
        new(sessionid:str) -> GstRtspServer.RTSPSession

    Object GstRTSPSession

    Properties from GstRTSPSession:
      sessionid -> gchararray: Sessionid
        the session id
      timeout -> guint: timeout
        the timeout of the session (0 = never)
      timeout-always-visible -> gboolean: Timeout Always Visible
        timeout always visible in header
      extra-timeout -> guint: Add extra time to timeout
        Add extra time to timeout

    Signals from GObject:
      notify (GParam)
    """
    class Props(GObject.Object.Props):
        extra_timeout: int
        sessionid: typing.Optional[str]
        timeout: int
        timeout_always_visible: bool

    props: Props = ...
    parent: GObject.Object = ...
    priv: RTSPSessionPrivate = ...
    def __init__(
        self,
        *,
        extra_timeout: int = ...,
        sessionid: str = ...,
        timeout: int = ...,
        timeout_always_visible: bool = ...,
    ) -> None: ...
    def allow_expire(self) -> None: ...
    def dup_media(
        self, path: str
    ) -> typing.Tuple[typing.Optional[RTSPSessionMedia], int]: ...
    def filter(
        self,
        func: typing.Optional[typing.Callable[..., RTSPFilterResult]] = None,
        *user_data: typing.Any,
    ) -> list[RTSPSessionMedia]: ...
    def get_header(self) -> typing.Optional[str]: ...
    def get_media(
        self, path: str
    ) -> typing.Tuple[typing.Optional[RTSPSessionMedia], int]: ...
    def get_sessionid(self) -> typing.Optional[str]: ...
    def get_timeout(self) -> int: ...
    def is_expired(self, now: GLib.TimeVal) -> bool: ...
    def is_expired_usec(self, now: int) -> bool: ...
    def manage_media(self, path: str, media: RTSPMedia) -> RTSPSessionMedia: ...
    @classmethod
    def new(cls, sessionid: str) -> RTSPSession: ...
    def next_timeout(self, now: GLib.TimeVal) -> int: ...
    def next_timeout_usec(self, now: int) -> int: ...
    def prevent_expire(self) -> None: ...
    def release_media(self, media: RTSPSessionMedia) -> bool: ...
    def set_timeout(self, timeout: int) -> None: ...
    def touch(self) -> None: ...

class RTSPSessionClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPSessionClass()
    """

    parent_class: GObject.ObjectClass = ...

class RTSPSessionMedia(GObject.Object):
    """
    :Constructors:

    ::

        RTSPSessionMedia(**properties)
        new(path:str, media:GstRtspServer.RTSPMedia) -> GstRtspServer.RTSPSessionMedia

    Object GstRTSPSessionMedia

    Signals from GObject:
      notify (GParam)
    """

    parent: GObject.Object = ...
    priv: RTSPSessionMediaPrivate = ...
    def alloc_channels(self) -> typing.Tuple[bool, GstRtsp.RTSPRange]: ...
    def get_base_time(self) -> int: ...
    def get_media(self) -> typing.Optional[RTSPMedia]: ...
    def get_rtpinfo(self) -> typing.Optional[str]: ...
    def get_rtsp_state(self) -> GstRtsp.RTSPState: ...
    def get_transport(self, idx: int) -> typing.Optional[RTSPStreamTransport]: ...
    def get_transports(self) -> list[RTSPStreamTransport]: ...
    def matches(self, path: str) -> typing.Tuple[bool, int]: ...
    @classmethod
    def new(cls, path: str, media: RTSPMedia) -> RTSPSessionMedia: ...
    def set_rtsp_state(self, state: GstRtsp.RTSPState) -> None: ...
    def set_state(self, state: Gst.State) -> bool: ...
    def set_transport(
        self, stream: RTSPStream, tr: GstRtsp.RTSPTransport
    ) -> RTSPStreamTransport: ...

class RTSPSessionMediaClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPSessionMediaClass()
    """

    parent_class: GObject.ObjectClass = ...

class RTSPSessionMediaPrivate(GObject.GPointer): ...

class RTSPSessionPool(GObject.Object):
    """
    :Constructors:

    ::

        RTSPSessionPool(**properties)
        new() -> GstRtspServer.RTSPSessionPool

    Object GstRTSPSessionPool

    Signals from GstRTSPSessionPool:
      session-removed (GstRTSPSession)

    Properties from GstRTSPSessionPool:
      max-sessions -> guint: Max Sessions
        the maximum amount of sessions (0 = unlimited)

    Signals from GObject:
      notify (GParam)
    """
    class Props(GObject.Object.Props):
        max_sessions: int

    props: Props = ...
    parent: GObject.Object = ...
    priv: RTSPSessionPoolPrivate = ...
    def __init__(self, *, max_sessions: int = ...) -> None: ...
    def cleanup(self) -> int: ...
    def create(self) -> typing.Optional[RTSPSession]: ...
    def create_watch(self) -> GLib.Source: ...
    def do_create_session_id(self) -> str: ...
    def do_session_removed(self, session: RTSPSession) -> None: ...
    def filter(
        self,
        func: typing.Optional[typing.Callable[..., RTSPFilterResult]] = None,
        *user_data: typing.Any,
    ) -> list[RTSPSession]: ...
    def find(self, sessionid: str) -> typing.Optional[RTSPSession]: ...
    def get_max_sessions(self) -> int: ...
    def get_n_sessions(self) -> int: ...
    @classmethod
    def new(cls) -> RTSPSessionPool: ...
    def remove(self, sess: RTSPSession) -> bool: ...
    def set_max_sessions(self, max: int) -> None: ...

class RTSPSessionPoolClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPSessionPoolClass()
    """

    parent_class: GObject.ObjectClass = ...
    create_session_id: typing.Callable[[RTSPSessionPool], str] = ...
    create_session: None = ...
    session_removed: typing.Callable[[RTSPSessionPool, RTSPSession], None] = ...

class RTSPSessionPoolPrivate(GObject.GPointer): ...
class RTSPSessionPrivate(GObject.GPointer): ...

class RTSPStream(GObject.Object):
    """
    :Constructors:

    ::

        RTSPStream(**properties)
        new(idx:int, payloader:Gst.Element, pad:Gst.Pad) -> GstRtspServer.RTSPStream

    Object GstRTSPStream

    Signals from GstRTSPStream:
      new-rtp-encoder (GstElement)
      new-rtcp-encoder (GstElement)
      new-rtp-rtcp-decoder (GstElement)

    Properties from GstRTSPStream:
      control -> gchararray: Control
        The control string for this stream
      profiles -> GstRTSPProfile: Profiles
        Allowed transfer profiles
      protocols -> GstRTSPLowerTrans: Protocols
        Allowed lower transport protocols

    Signals from GObject:
      notify (GParam)
    """
    class Props(GObject.Object.Props):
        control: typing.Optional[str]
        profiles: GstRtsp.RTSPProfile
        protocols: GstRtsp.RTSPLowerTrans

    props: Props = ...
    parent: GObject.Object = ...
    priv: RTSPStreamPrivate = ...
    def __init__(
        self,
        *,
        control: typing.Optional[str] = ...,
        profiles: GstRtsp.RTSPProfile = ...,
        protocols: GstRtsp.RTSPLowerTrans = ...,
    ) -> None: ...
    def add_multicast_client_address(
        self, destination: str, rtp_port: int, rtcp_port: int, family: Gio.SocketFamily
    ) -> bool: ...
    def add_transport(self, trans: RTSPStreamTransport) -> bool: ...
    def allocate_udp_sockets(
        self,
        family: Gio.SocketFamily,
        transport: GstRtsp.RTSPTransport,
        use_client_settings: bool,
    ) -> bool: ...
    def complete_stream(self, transport: GstRtsp.RTSPTransport) -> bool: ...
    def get_address_pool(self) -> typing.Optional[RTSPAddressPool]: ...
    def get_buffer_size(self) -> int: ...
    def get_caps(self) -> typing.Optional[Gst.Caps]: ...
    def get_control(self) -> typing.Optional[str]: ...
    def get_current_seqnum(self) -> int: ...
    def get_dscp_qos(self) -> int: ...
    def get_index(self) -> int: ...
    def get_joined_bin(self) -> typing.Optional[Gst.Bin]: ...
    def get_max_mcast_ttl(self) -> int: ...
    def get_mtu(self) -> int: ...
    def get_multicast_address(
        self, family: Gio.SocketFamily
    ) -> typing.Optional[RTSPAddress]: ...
    def get_multicast_client_addresses(self) -> str: ...
    def get_multicast_iface(self) -> typing.Optional[str]: ...
    def get_profiles(self) -> GstRtsp.RTSPProfile: ...
    def get_protocols(self) -> GstRtsp.RTSPLowerTrans: ...
    def get_pt(self) -> int: ...
    def get_publish_clock_mode(self) -> RTSPPublishClockMode: ...
    def get_rate_control(self) -> bool: ...
    def get_rates(self) -> typing.Tuple[bool, float, float]: ...
    def get_retransmission_pt(self) -> int: ...
    def get_retransmission_time(self) -> int: ...
    def get_rtcp_multicast_socket(
        self, family: Gio.SocketFamily
    ) -> typing.Optional[Gio.Socket]: ...
    def get_rtcp_socket(
        self, family: Gio.SocketFamily
    ) -> typing.Optional[Gio.Socket]: ...
    def get_rtp_multicast_socket(
        self, family: Gio.SocketFamily
    ) -> typing.Optional[Gio.Socket]: ...
    def get_rtp_socket(
        self, family: Gio.SocketFamily
    ) -> typing.Optional[Gio.Socket]: ...
    def get_rtpinfo(self) -> typing.Tuple[bool, int, int, int, int]: ...
    def get_rtpsession(self) -> typing.Optional[GObject.Object]: ...
    def get_server_port(self, family: Gio.SocketFamily) -> GstRtsp.RTSPRange: ...
    def get_sinkpad(self) -> typing.Optional[Gst.Pad]: ...
    def get_srcpad(self) -> typing.Optional[Gst.Pad]: ...
    def get_srtp_encoder(self) -> typing.Optional[Gst.Element]: ...
    def get_ssrc(self) -> int: ...
    def get_ulpfec_enabled(self) -> bool: ...
    def get_ulpfec_percentage(self) -> int: ...
    def get_ulpfec_pt(self) -> int: ...
    def handle_keymgmt(self, keymgmt: str) -> bool: ...
    def has_control(self, control: typing.Optional[str] = None) -> bool: ...
    def is_bind_mcast_address(self) -> bool: ...
    def is_blocking(self) -> bool: ...
    def is_client_side(self) -> bool: ...
    def is_complete(self) -> bool: ...
    def is_receiver(self) -> bool: ...
    def is_sender(self) -> bool: ...
    def is_transport_supported(self, transport: GstRtsp.RTSPTransport) -> bool: ...
    def join_bin(self, bin: Gst.Bin, rtpbin: Gst.Element, state: Gst.State) -> bool: ...
    def leave_bin(self, bin: Gst.Bin, rtpbin: Gst.Element) -> bool: ...
    @classmethod
    def new(cls, idx: int, payloader: Gst.Element, pad: Gst.Pad) -> RTSPStream: ...
    def query_position(self) -> typing.Tuple[bool, int]: ...
    def query_stop(self) -> typing.Tuple[bool, int]: ...
    def recv_rtcp(self, buffer: Gst.Buffer) -> Gst.FlowReturn: ...
    def recv_rtp(self, buffer: Gst.Buffer) -> Gst.FlowReturn: ...
    def remove_transport(self, trans: RTSPStreamTransport) -> bool: ...
    def request_aux_receiver(self, sessid: int) -> typing.Optional[Gst.Element]: ...
    def request_aux_sender(self, sessid: int) -> typing.Optional[Gst.Element]: ...
    def request_ulpfec_decoder(
        self, rtpbin: Gst.Element, sessid: int
    ) -> typing.Optional[Gst.Element]: ...
    def request_ulpfec_encoder(self, sessid: int) -> typing.Optional[Gst.Element]: ...
    def reserve_address(
        self, address: str, port: int, n_ports: int, ttl: int
    ) -> typing.Optional[RTSPAddress]: ...
    def seekable(self) -> bool: ...
    def set_address_pool(
        self, pool: typing.Optional[RTSPAddressPool] = None
    ) -> None: ...
    def set_bind_mcast_address(self, bind_mcast_addr: bool) -> None: ...
    def set_blocked(self, blocked: bool) -> bool: ...
    def set_buffer_size(self, size: int) -> None: ...
    def set_client_side(self, client_side: bool) -> None: ...
    def set_control(self, control: typing.Optional[str] = None) -> None: ...
    def set_dscp_qos(self, dscp_qos: int) -> None: ...
    def set_max_mcast_ttl(self, ttl: int) -> bool: ...
    def set_mtu(self, mtu: int) -> None: ...
    def set_multicast_iface(
        self, multicast_iface: typing.Optional[str] = None
    ) -> None: ...
    def set_profiles(self, profiles: GstRtsp.RTSPProfile) -> None: ...
    def set_protocols(self, protocols: GstRtsp.RTSPLowerTrans) -> None: ...
    def set_pt_map(self, pt: int, caps: Gst.Caps) -> None: ...
    def set_publish_clock_mode(self, mode: RTSPPublishClockMode) -> None: ...
    def set_rate_control(self, enabled: bool) -> None: ...
    def set_retransmission_pt(self, rtx_pt: int) -> None: ...
    def set_retransmission_time(self, time: int) -> None: ...
    def set_seqnum_offset(self, seqnum: int) -> None: ...
    def set_ulpfec_percentage(self, percentage: int) -> None: ...
    def set_ulpfec_pt(self, pt: int) -> None: ...
    def transport_filter(
        self,
        func: typing.Optional[typing.Callable[..., RTSPFilterResult]] = None,
        *user_data: typing.Any,
    ) -> list[RTSPStreamTransport]: ...
    def unblock_linked(self) -> bool: ...
    def unblock_rtcp(self) -> None: ...
    def update_crypto(
        self, ssrc: int, crypto: typing.Optional[Gst.Caps] = None
    ) -> bool: ...
    def verify_mcast_ttl(self, ttl: int) -> bool: ...

class RTSPStreamClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPStreamClass()
    """

    parent_class: GObject.ObjectClass = ...

class RTSPStreamPrivate(GObject.GPointer): ...

class RTSPStreamTransport(GObject.Object):
    """
    :Constructors:

    ::

        RTSPStreamTransport(**properties)
        new(stream:GstRtspServer.RTSPStream, tr:GstRtsp.RTSPTransport) -> GstRtspServer.RTSPStreamTransport

    Object GstRTSPStreamTransport

    Signals from GObject:
      notify (GParam)
    """

    parent: GObject.Object = ...
    priv: RTSPStreamTransportPrivate = ...
    def get_rtpinfo(self, start_time: int) -> typing.Optional[str]: ...
    def get_stream(self) -> typing.Optional[RTSPStream]: ...
    def get_transport(self) -> typing.Optional[GstRtsp.RTSPTransport]: ...
    def get_url(self) -> typing.Optional[GstRtsp.RTSPUrl]: ...
    def is_timed_out(self) -> bool: ...
    def keep_alive(self) -> None: ...
    def message_sent(self) -> None: ...
    @classmethod
    def new(
        cls, stream: RTSPStream, tr: GstRtsp.RTSPTransport
    ) -> RTSPStreamTransport: ...
    def recv_data(self, channel: int, buffer: Gst.Buffer) -> Gst.FlowReturn: ...
    def send_rtcp(self, buffer: Gst.Buffer) -> bool: ...
    def send_rtcp_list(self, buffer_list: Gst.BufferList) -> bool: ...
    def send_rtp(self, buffer: Gst.Buffer) -> bool: ...
    def send_rtp_list(self, buffer_list: Gst.BufferList) -> bool: ...
    def set_active(self, active: bool) -> bool: ...
    def set_callbacks(
        self,
        send_rtp: typing.Callable[..., bool],
        send_rtcp: typing.Callable[..., bool],
        *user_data: typing.Any,
    ) -> None: ...
    def set_keepalive(
        self, keep_alive: typing.Callable[..., None], *user_data: typing.Any
    ) -> None: ...
    def set_list_callbacks(
        self,
        send_rtp_list: typing.Callable[..., bool],
        send_rtcp_list: typing.Callable[..., bool],
        *user_data: typing.Any,
    ) -> None: ...
    def set_message_sent(
        self, message_sent: typing.Callable[..., None], *user_data: typing.Any
    ) -> None: ...
    def set_message_sent_full(
        self, message_sent: typing.Callable[..., None], *user_data: typing.Any
    ) -> None: ...
    def set_timed_out(self, timedout: bool) -> None: ...
    def set_transport(self, tr: GstRtsp.RTSPTransport) -> None: ...
    def set_url(self, url: typing.Optional[GstRtsp.RTSPUrl] = None) -> None: ...

class RTSPStreamTransportClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPStreamTransportClass()
    """

    parent_class: GObject.ObjectClass = ...

class RTSPStreamTransportPrivate(GObject.GPointer): ...

class RTSPThread(GObject.GBoxed):
    """
    :Constructors:

    ::

        RTSPThread()
        new(type:GstRtspServer.RTSPThreadType) -> GstRtspServer.RTSPThread
    """

    mini_object: Gst.MiniObject = ...
    type: RTSPThreadType = ...
    context: GLib.MainContext = ...
    loop: GLib.MainLoop = ...
    @classmethod
    def new(cls, type: RTSPThreadType) -> RTSPThread: ...
    def reuse(self) -> bool: ...
    def stop(self) -> None: ...

class RTSPThreadPool(GObject.Object):
    """
    :Constructors:

    ::

        RTSPThreadPool(**properties)
        new() -> GstRtspServer.RTSPThreadPool

    Object GstRTSPThreadPool

    Properties from GstRTSPThreadPool:
      max-threads -> gint: Max Threads
        The maximum amount of threads to use for client connections (0 = only mainloop, -1 = unlimited)

    Signals from GObject:
      notify (GParam)
    """
    class Props(GObject.Object.Props):
        max_threads: int

    props: Props = ...
    parent: GObject.Object = ...
    priv: RTSPThreadPoolPrivate = ...
    def __init__(self, *, max_threads: int = ...) -> None: ...
    @staticmethod
    def cleanup() -> None: ...
    def do_configure_thread(self, thread: RTSPThread, ctx: RTSPContext) -> None: ...
    def do_get_thread(
        self, type: RTSPThreadType, ctx: RTSPContext
    ) -> typing.Optional[RTSPThread]: ...
    def do_thread_enter(self, thread: RTSPThread) -> None: ...
    def do_thread_leave(self, thread: RTSPThread) -> None: ...
    def get_max_threads(self) -> int: ...
    def get_thread(
        self, type: RTSPThreadType, ctx: RTSPContext
    ) -> typing.Optional[RTSPThread]: ...
    @classmethod
    def new(cls) -> RTSPThreadPool: ...
    def set_max_threads(self, max_threads: int) -> None: ...

class RTSPThreadPoolClass(GObject.GPointer):
    """
    :Constructors:

    ::

        RTSPThreadPoolClass()
    """

    parent_class: GObject.ObjectClass = ...
    pool: GLib.ThreadPool = ...
    get_thread: typing.Callable[
        [RTSPThreadPool, RTSPThreadType, RTSPContext], typing.Optional[RTSPThread]
    ] = ...
    configure_thread: typing.Callable[
        [RTSPThreadPool, RTSPThread, RTSPContext], None
    ] = ...
    thread_enter: typing.Callable[[RTSPThreadPool, RTSPThread], None] = ...
    thread_leave: typing.Callable[[RTSPThreadPool, RTSPThread], None] = ...

class RTSPThreadPoolPrivate(GObject.GPointer): ...

class RTSPToken(GObject.GBoxed):
    """
    :Constructors:

    ::

        RTSPToken()
        new() -> GstRtspServer.RTSPToken
    """

    mini_object: Gst.MiniObject = ...
    @staticmethod
    def __new__(cls: type[Self]) -> Self: ...
    def get_string(self, field: str) -> typing.Optional[str]: ...
    def get_structure(self) -> Gst.Structure: ...
    def is_allowed(self, field: str) -> bool: ...
    @classmethod
    def new(cls) -> RTSPToken: ...
    def set_bool(self, field: str, bool_value: bool) -> None: ...
    def set_string(self, field: str, string_value: str) -> None: ...
    def writable_structure(self) -> Gst.Structure: ...

class SDPInfo(GObject.GPointer):
    """
    :Constructors:

    ::

        SDPInfo()
    """

    is_ipv6: bool = ...
    server_ip: str = ...

class RTSPAddressFlags(GObject.GFlags):
    EVEN_PORT = 4
    IPV4 = 1
    IPV6 = 2
    MULTICAST = 8
    NONE = 0
    UNICAST = 16

class RTSPTransportMode(GObject.GFlags):
    PLAY = 1
    RECORD = 2

class RTSPAddressPoolResult(GObject.GEnum):
    EINVAL = -1
    ELAST = -4
    ERANGE = -3
    ERESERVED = -2
    OK = 0

class RTSPFilterResult(GObject.GEnum):
    KEEP = 1
    REF = 2
    REMOVE = 0

class RTSPMediaStatus(GObject.GEnum):
    ERROR = 5
    PREPARED = 3
    PREPARING = 2
    SUSPENDED = 4
    UNPREPARED = 0
    UNPREPARING = 1

class RTSPPublishClockMode(GObject.GEnum):
    CLOCK = 1
    CLOCK_AND_OFFSET = 2
    NONE = 0

class RTSPSuspendMode(GObject.GEnum):
    NONE = 0
    PAUSE = 1
    RESET = 2

class RTSPThreadType(GObject.GEnum):
    CLIENT = 0
    MEDIA = 1
