ó
    Ý/jv  ã                  óX   • S SK Jr  SSKJrJr  SSKJr  SSKJr	  SSK
Jr   " S S5      rg	)
é    )Úannotationsé   )Ú	FfiHandleÚ	FfiClient)Úffi_pb2)Úvideo_frame_pb2)Ú
VideoFramec                  óz   • \ rS rSrSS.SS jjrS\R                  R                  S.       SS jjrSS jr	S	r
g
)ÚVideoSourceé   F)Úis_screencastc               óØ  • [         R                  " 5       n[        R                  R                  UR
                  l        XR
                  R                  l        X$R
                  R                  l	        X4R
                  l
        [        R                  R                  U5      nUR
                  R                  U l        [!        U R                  R"                  R$                  5      U l        g)a6  
Create a new video source.

Args:
    width (int): Initial width of the video source.
    height (int): Initial height of the video source.
    is_screencast (bool, optional): Optimize the WebRTC pipeline for screen content.
        Defaults to False.

        When True, WebRTC will:

        - Maintain resolution under congestion by dropping frames instead of
          downscaling (keeps text crisp)
        - Disable quality scaling and denoising to preserve text/UI readability
        - Guarantee a minimum 1200 kbps bitrate floor
        - Enable zero-hertz mode, stopping frame transmission when the screen
          is static to save bandwidth
        - Set content type to screen, adjusting encoder configuration throughout
          the pipeline (VP9 inter-layer prediction, simulcast layer allocation, etc.)
N)Ú	proto_ffiÚ
FfiRequestÚproto_videoÚVideoSourceTypeÚVIDEO_SOURCE_NATIVEÚnew_video_sourceÚtypeÚ
resolutionÚwidthÚheightr   r   ÚinstanceÚrequestÚsourceÚ_infor   ÚhandleÚidÚ_ffi_handle)Úselfr   r   r   ÚreqÚresps         ÚI/app/agent/.venv/lib/python3.13/site-packages/livekit/rtc/video_source.pyÚ__init__ÚVideoSource.__init__   s¢   € ô* ×"Ò"Ó$ˆÜ$/×$?Ñ$?×$SÑ$Sˆ×ÑÔ!Ø05×Ñ×'Ñ'Ô-Ø17×Ñ×'Ñ'Ô.Ø-:×ÑÔ*ä×!Ñ!×)Ñ)¨#Ó.ˆØ×*Ñ*×1Ñ1ˆŒ
Ü$ T§Z¡Z×%6Ñ%6×%9Ñ%9Ó:ˆÕó    r   )Útimestamp_usÚrotationc               ó\  • [         R                  " 5       nU R                  R                  UR                  l        UR                  R                  R                  UR                  5       5        X4R                  l	        X$R                  l
        [        R                  R                  U5        g ©N)r   r   r   r   Úcapture_video_frameÚsource_handleÚbufferÚCopyFromÚ_proto_infor(   r'   r   r   r   )r    Úframer'   r(   r!   s        r#   Úcapture_frameÚVideoSource.capture_frame7   s{   € ô ×"Ò"Ó$ˆØ04×0@Ñ0@×0GÑ0Gˆ×ÑÔ-Ø×Ñ×&Ñ&×/Ñ/°×0AÑ0AÓ0CÔDØ+3×ÑÔ(Ø/;×ÑÔ,Ü×Ñ×"Ñ" 3Õ'r&   c              ƒ  ó@   #   • U R                   R                  5         g 7fr*   )r   Údispose)r    s    r#   ÚacloseÚVideoSource.acloseE   s   é € Ø×Ñ× Ñ Õ"ùs   ‚)r   r   N)r   Úintr   r7   r   ÚboolÚreturnÚNone)r0   r	   r'   r7   r(   z#proto_video.VideoRotation.ValueTyper9   r:   )r9   r:   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r$   r   ÚVideoRotationÚVIDEO_ROTATION_0r1   r5   Ú__static_attributes__© r&   r#   r   r      sO   † ØIN÷ ;ðF Ø8C×8QÑ8Q×8bÑ8bñ(àð(ð ð	(ð
 6ð(ð 
õ(÷#r&   r   N)Ú
__future__r   Ú_ffi_clientr   r   Ú_protor   r   r   r   Úvideo_framer	   r   rB   r&   r#   Ú<module>rG      s    ðõ #ç -Ý (Ý 2Ý #÷/#ò /#r&   