o
    i                     @   s   d dl mZmZmZ d dlZddlmZmZ ddlm	Z
 ddlmZ ddlmZ ddlmZmZmZ G d	d
 d
ZG dd deZG dd deZdS )    )ListOptionalcastN   )	FfiHandle	FfiClient)e2ee_pb2)ffi_pb2)	track_pb2)Track
LocalTrackRemoteTrackc                   @   s  e Zd ZdejfddZedee fddZ	ede
fddZede
fd	d
ZedejjfddZedejjfddZedefddZedefddZedefddZede
fddZedefddZedejjfddZedeejj fddZdS )TrackPublication
owned_infoc                 C   s    |j | _d | _t|jj| _d S N)info_info_trackr   handleid_ffi_handleselfr    r   _/var/www/html/livekit_bhavya/venv/lib/python3.10/site-packages/livekit/rtc/track_publication.py__init__   s   zTrackPublication.__init__returnc                 C      | j S r   )r   r   r   r   r   track      zTrackPublication.trackc                 C      | j jS r   )r   sidr   r   r   r   r"   #      zTrackPublication.sidc                 C   r!   r   )r   namer   r   r   r   r$   '   r#   zTrackPublication.namec                 C   r!   r   )r   kindr   r   r   r   r%   +   r#   zTrackPublication.kindc                 C   r!   r   )r   sourcer   r   r   r   r&   /   r#   zTrackPublication.sourcec                 C   r!   r   )r   simulcastedr   r   r   r   r'   3   r#   zTrackPublication.simulcastedc                 C   r!   r   )r   widthr   r   r   r   r(   7   r#   zTrackPublication.widthc                 C   r!   r   )r   heightr   r   r   r   r)   ;   r#   zTrackPublication.heightc                 C   r!   r   )r   	mime_typer   r   r   r   r*   ?   r#   zTrackPublication.mime_typec                 C   r!   r   )r   mutedr   r   r   r   r+   C   r#   zTrackPublication.mutedc                 C   r!   r   )r   encryption_typer   r   r   r   r,   G   r#   z TrackPublication.encryption_typec                 C   s   t | jjS r   )listr   audio_featuresr   r   r   r   r.   K   s   zTrackPublication.audio_featuresN)__name__
__module____qualname__proto_trackOwnedTrackPublicationr   propertyr   r   r   strr"   r$   	TrackKind	ValueTyper%   TrackSourcer&   boolr'   intr(   r)   r*   r+   
proto_e2eeEncryptionTyper,   r   AudioTrackFeaturer.   r   r   r   r   r      s4    r   c                       sR   e Zd Zdejf fddZedee fddZ	ddd	Z
defd
dZ  ZS )LocalTrackPublicationr   c                    s   t  | t | _d S r   )superr   asyncioFuture_first_subscriptionr   	__class__r   r   r   Q   s   zLocalTrackPublication.__init__r   c                 C      t tt | jS r   )r   r   r   r   r   r   r   r   r   U      zLocalTrackPublication.trackNc                    s   t | jI d H  d S r   )r@   shieldrB   r   r   r   r   wait_for_subscriptionY   s   z+LocalTrackPublication.wait_for_subscriptionc              	   C   &   d| j  d| j d| j d| j d	S )Nzrtc.LocalTrackPublication(sid=, name=, kind=	, source=)r"   r$   r%   r&   r   r   r   r   __repr__\      &zLocalTrackPublication.__repr__)r   N)r/   r0   r1   r2   r3   r   r4   r   r   r   rH   r5   rO   __classcell__r   r   rC   r   r>   P   s    
r>   c                       sh   e Zd Zdejf fddZedee fddZ	ede
fddZd	e
fd
dZdefddZ  ZS )RemoteTrackPublicationr   c                    s   t  | d| _d S )NF)r?   r   _subscribedr   rC   r   r   r   a   s   
zRemoteTrackPublication.__init__r   c                 C   rE   r   )r   r   r   r   r   r   r   r   r   e   rF   zRemoteTrackPublication.trackc                 C   r   r   )rS   r   r   r   r   
subscribedi   r    z!RemoteTrackPublication.subscribedrT   c                 C   s,   t  }||j_| jj|j_tj	| d S r   )
	proto_ffi
FfiRequestset_subscribed	subscriber   r   publication_handler   instancerequest)r   rT   reqr   r   r   rW   m   s   z%RemoteTrackPublication.set_subscribedc              	   C   rI   )Nzrtc.RemoteTrackPublication(sid=rJ   rK   rL   rM   rN   r   r   r   r   rO   s   rP   zRemoteTrackPublication.__repr__)r/   r0   r1   r2   r3   r   r4   r   r   r   r9   rT   rW   r5   rO   rQ   r   r   rC   r   rR   `   s    rR   )typingr   r   r   r@   _ffi_clientr   r   _protor   r;   r	   rU   r
   r2   r   r   r   r   r   r>   rR   r   r   r   r   <module>   s   7