Ë
    ÖÉ�jô  ã                   ó¤   — d dl Z d dlmZ d dlmZmZ d dlmZ ddlm	Z	  e j                  e«      Ze G d„ d«      «       Z G d	„ d
e«      ZddlmZ y)é    N)Ú	dataclass)ÚOptionalÚUnion)ÚAsyncIOEventEmitteré   )ÚInvalidStateErrorc                   ó’   — e Zd ZU dZdZeed<   	 dZee	   ed<   	 dZ
ee	   ed<   	 dZeed<   	 dZeed	<   	 d
Zeed<   	 dZee	   ed<   y)ÚRTCDataChannelParameterszy
    The :class:`RTCDataChannelParameters` dictionary describes the
    configuration of an :class:`RTCDataChannel`.
    Ú ÚlabelNÚmaxPacketLifeTimeÚmaxRetransmitsTÚorderedÚprotocolFÚ
negotiatedÚid)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚstrÚ__annotations__r   r   Úintr   r   Úboolr   r   r   © ó    úV/home/uftp/webrtc-recorder/.venv/lib/python3.12/site-packages/aiortc/rtcdatachannel.pyr
   r
      sv   … ñð
 €Eˆ3ƒOØ)à'+Ð�x ‘}Ó+ØPà$(€N�H˜S‘MÓ(Ø?à€GˆTÓØHà€HˆcÓØ)à€J�Óð3ð €Bˆ�‰Óðr   r
   c            	       óÌ  ‡ — e Zd ZdZ	 d"dddededdfˆ fd„Zedefd	„«       Z	edefd
„«       Z
e
j                  deddfd„«       Z
edefd„«       Zedee   fd„«       Zedefd„«       Zedefd„«       Zedee   fd„«       Zedee   fd„«       Zedefd„«       Zedefd„«       Zed#d„«       Zd$d„Zdeeef   ddfd„Zdeddfd„Zdeddfd„Zdeddfd„Zded eddfd!„Zˆ xZ S )%ÚRTCDataChannela  
    The :class:`RTCDataChannel` interface represents a network channel which
    can be used for bidirectional peer-to-peer transfers of arbitrary data.

    :param transport: An :class:`RTCSctpTransport`.
    :param parameters: An :class:`RTCDataChannelParameters`.
    Ú	transportÚRTCSctpTransportÚ
parametersÚ	send_openÚreturnNc                 óð  •— t         ‰| �  «        d| _        d| _        |j                  | _        || _        d| _        || _        || _	        | j                  j                  r5| j
                  �| j
                  dk  s| j
                  dkD  rt        d«      ‚| j                  j                  s0| j                  r#d| _	        | j                  j                  | «       y y | j                  j                  | «       y )Nr   Ú
connectingiþÿ  zEID must be in range 0-65534 if data channel is negotiated out-of-bandF)ÚsuperÚ__init__Ú_RTCDataChannel__bufferedAmountÚ+_RTCDataChannel__bufferedAmountLowThresholdr   Ú_RTCDataChannel__idÚ_RTCDataChannel__parametersÚ_RTCDataChannel__readyStateÚ_RTCDataChannel__transportÚ_RTCDataChannel__send_openr   Ú
ValueErrorÚ_data_channel_openÚ_data_channel_add_negotiated)Úselfr    r"   r#   Ú	__class__s       €r   r(   zRTCDataChannel.__init__8   sÚ   ø€ ô 	‰ÑÔØ !ˆÔØ,-ˆÔ)Ø—M‘MˆŒ	Ø&ˆÔØ(ˆÔØ$ˆÔØ$ˆÔà×Ñ×'Ò'Ø�I‰IÐ §¡¨Q¢°$·)±)¸eÒ2CäØWóð ð × Ñ ×+Ò+Ø×ÒØ#(�Ô Ø× Ñ ×3Ñ3°DÕ9ð  ð ×Ñ×9Ñ9¸$Õ?r   c                 ó   — | j                   S )z`
        The number of bytes of data currently queued to be sent over the data channel.
        )r)   ©r3   s    r   ÚbufferedAmountzRTCDataChannel.bufferedAmountU   s   € ð
 ×$Ñ$Ð$r   c                 ó   — | j                   S )zY
        The number of bytes of buffered outgoing data that is considered "low".
        )r*   r6   s    r   ÚbufferedAmountLowThresholdz)RTCDataChannel.bufferedAmountLowThreshold\   s   € ð
 ×0Ñ0Ð0r   Úvaluec                 ó<   — |dk  s|dkD  rt        d«      ‚|| _        y )Nr   l   ÿÿ z:bufferedAmountLowThreshold must be in range 0 - 4294967295)r0   r*   )r3   r:   s     r   r9   z)RTCDataChannel.bufferedAmountLowThresholdc   s*   € à�1Š9˜ 
Ò*ÜØLóð ð -2ˆÕ)r   c                 ó.   — | j                   j                  S )zB
        Whether data channel was negotiated out-of-band.
        )r,   r   r6   s    r   r   zRTCDataChannel.negotiatedk   s   € ð
 × Ñ ×+Ñ+Ð+r   c                 ó   — | j                   S )zJ
        An ID number which uniquely identifies the data channel.
        ©r+   r6   s    r   r   zRTCDataChannel.idr   s   € ð
 �y‰yÐr   c                 ó.   — | j                   j                  S )zj
        A name describing the data channel.

        These labels are not required to be unique.
        )r,   r   r6   s    r   r   zRTCDataChannel.labely   s   € ð × Ñ ×&Ñ&Ð&r   c                 ó.   — | j                   j                  S )zm
        Indicates whether or not the data channel guarantees in-order delivery of
        messages.
        )r,   r   r6   s    r   r   zRTCDataChannel.ordered‚   s   € ð × Ñ ×(Ñ(Ð(r   c                 ó.   — | j                   j                  S )z\
        The maximum time in milliseconds during which transmissions are attempted.
        )r,   r   r6   s    r   r   z RTCDataChannel.maxPacketLifeTimeŠ   s   € ð
 × Ñ ×2Ñ2Ð2r   c                 ó.   — | j                   j                  S )zL
        "The maximum number of retransmissions that are attempted.
        )r,   r   r6   s    r   r   zRTCDataChannel.maxRetransmits‘   s   € ð
 × Ñ ×/Ñ/Ð/r   c                 ó.   — | j                   j                  S )z5
        The name of the subprotocol in use.
        )r,   r   r6   s    r   r   zRTCDataChannel.protocol˜   s   € ð
 × Ñ ×)Ñ)Ð)r   c                 ó   — | j                   S )zY
        A string indicating the current state of the underlying data transport.
        )r-   r6   s    r   Ú
readyStatezRTCDataChannel.readyStateŸ   s   € ð
 × Ñ Ð r   c                 ó   — | j                   S )zO
        The :class:`RTCSctpTransport` over which data is transmitted.
        )r.   r6   s    r   r    zRTCDataChannel.transport¦   s   € ð
 ×ÑÐr   c                 ó:   — | j                   j                  | «       y)z)
        Close the data channel.
        N)r    Ú_data_channel_closer6   s    r   ÚclosezRTCDataChannel.close­   s   € ð 	�‰×*Ñ*¨4Õ0r   Údatac                 óÀ   — | j                   dk7  rt        ‚t        |t        t        f«      st        dt        |«      › �«      ‚| j                  j                  | |«       y)zI
        Send `data` across the data channel to the remote peer.
        Úopenz#Cannot send unsupported data type: N)	rE   r   Ú
isinstancer   Úbytesr0   Útyper    Ú_data_channel_send)r3   rJ   s     r   ÚsendzRTCDataChannel.send³   sO   € ð �?‰?˜fÒ$Ü#Ð#ä˜$¤¤e Ô-ÜÐBÄ4ÈÃ:À,ÐOÓPÐPà�‰×)Ñ)¨$°Õ5r   Úamountc                 óÄ   — | j                   | j                  kD  xr | j                   |z   | j                  k  }| xj                   |z  c_         |r| j                  d«       y y )NÚbufferedamountlow)r)   r9   Úemit)r3   rR   Úcrosses_thresholds      r   Ú_addBufferedAmountz!RTCDataChannel._addBufferedAmount¿   sb   € à×!Ñ! D×$CÑ$CÑCò RØ×%Ñ%¨Ñ.°$×2QÑ2QÑQð 	ð 	×Ò Ñ'ÕÙØ�I‰IÐ)Õ*ð r   r   c                 ó   — || _         y )Nr>   )r3   r   s     r   Ú_setIdzRTCDataChannel._setIdÈ   s	   € Øˆ�	r   Ústatec                 óè   — || j                   k7  rc| j                  d| j                   |«       || _         |dk(  r| j                  d«       y |dk(  r"| j                  d«       | j                  «        y y y )Nz
- %s -> %srL   ÚclosedrI   )r-   Ú_RTCDataChannel__log_debugrU   Úremove_all_listeners)r3   rZ   s     r   Ú_setReadyStatezRTCDataChannel._setReadyStateË   so   € Ø�D×%Ñ%Ò%Ø×Ñ˜\¨4×+<Ñ+<¸eÔDØ %ˆDÔà˜ŠØ—	‘	˜&Õ!Ø˜(Ò"Ø—	‘	˜'Ô"ð ×)Ñ)Õ+ð #ð &r   ÚmsgÚargsc                 óL   — t        j                  d|› �| j                  g|¢­Ž  y )NzRTCDataChannel(%s) )ÚloggerÚdebugr+   )r3   r`   ra   s      r   Ú__log_debugzRTCDataChannel.__log_debugÙ   s!   € Ü�‰Ð*¨3¨%Ð0°$·)±)ÐC¸dÔCr   )T)r$   r!   )r$   N)!r   r   r   r   r
   r   r(   Úpropertyr   r7   r9   Úsetterr   r   r   r   r   r   r   r   r   rE   r    rI   r   rN   rQ   rW   rY   r_   Úobjectr]   Ú__classcell__)r4   s   @r   r   r   /   s  ø„ ñð ñ	@à%ð@ð -ð@ð ð	@ð
 
õ@ð: ð% ò %ó ð%ð ð1¨Cò 1ó ð1ð  ×&Ñ&ð2°ð 2¸ò 2ó 'ð2ð ð,˜Dò ,ó ð,ð ð�H˜S‘Mò ó ðð ð'�sò 'ó ð'ð ð)˜ò )ó ð)ð ð3 8¨C¡=ò 3ó ð3ð ð0 ¨¡ò 0ó ð0ð ð*˜#ò *ó ð*ð ð!˜Cò !ó ð!ð ò ó ð ó1ð
6˜˜u c˜zÑ*ð 
6¨tó 
6ð+¨ð +°ó +ð˜ð  ó ð, Cð ,¨Dó ,ðD˜sð D¨6ð D°d÷ Dr   r   )r!   )ÚloggingÚdataclassesr   Útypingr   r   Úpyee.asyncior   Ú
exceptionsr   Ú	getLoggerr   rc   r
   r   Úrtcsctptransportr!   r   r   r   ú<module>rq      sW   ðÛ Ý !ß "å ,å )à	ˆ×	Ñ	˜8Ó	$€ð ÷ð ó ðôDkDÐ(ô kDö\ /r   