Ë
    ÏÍ:j³
  ã                   óÌ   — U d dl mZmZ d dlmZ eee   ee   f   Zdededefd„Z	dededefd„Z
dededefd	„Zeeegef   Ze	e
ed
œZeeef   ed<   d„ Zdedededefd„ZdZy)é    )ÚCallableÚUnion)Ú
FrameBatchÚvaluesÚdesired_lenÚreturnc                 ó6   — | | d   g|t        | «      z
  z  z  } | S )Néÿÿÿÿ©Úlen©r   r   s     úp/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/torchcodec/samplers/_common.pyÚ_repeat_last_policyr      s'   € ð
 ˆv�b‰zˆl˜k¬C°«KÑ7Ñ8Ñ8€FØ€Mó    c                 ó0   — | |t        | «      z  dz   z  d | S )Né   r   r   s     r   Ú_wrap_policyr      s$   € ð
 �k¤S¨£[Ñ0°1Ñ4Ñ5°|¸ÐDÐDr   Úframes_indicesc                 ó   — t        d«      ‚)Nz«You set the 'error' policy, and the sampler tried to decode a frame that is beyond the number of frames in the video. Try to leave sampling_range_end to its default value?)Ú
ValueError)r   r   s     r   Ú_error_policyr      s   € ô ð	@óð r   )Úrepeat_lastÚwrapÚerrorÚ_POLICY_FUNCTIONSc                 óì   — t        | «      dk  rt        dt        | «      › d�«      ‚|dk  rt        d|› d�«      ‚|t        j                  «       vr$t        d|› dt        j                  «       › d	�«      ‚y )
Nr   z,Decoder must have at least one frame, found z frames.r   znum_frames_per_clip (z) must be strictly positivezInvalid policy (z). Supported values are ú.)r   r   r   Úkeys)ÚdecoderÚnum_frames_per_clipÚpolicys      r   Ú_validate_common_paramsr"   ,   s–   € Ü
ˆ7ƒ|�aÒÜØ:¼3¸w»<¸.ÈÐQó
ð 	
ð ˜aÒÜØ#Ð$7Ð#8Ð8SÐTó
ð 	
ð Ô&×+Ñ+Ó-Ñ-ÜØ˜v˜hÐ&>Ô?P×?UÑ?UÓ?WÐ>XÐXYÐZó
ð 	
ð .r   ÚframesÚ	num_clipsr    c                 óð   — | j                   j                  dd  }t         | j                   j                  ||g|¢­Ž | j                  j                  ||«      | j
                  j                  ||«      ¬«      S )Néýÿÿÿ)ÚdataÚpts_secondsÚduration_seconds)r'   Úshaper   Úviewr(   r)   )r#   r$   r    Úlast_3_dimss       r   Ú_reshape_4d_framebatch_into_5dr-   <   sq   € ð —+‘+×#Ñ# B CÐ(€KÜØˆV�[‰[×Ñ˜iÐ)<ÐK¸{ÒKØ×&Ñ&×+Ñ+¨IÐ7JÓKØ×0Ñ0×5Ñ5°iÐATÓUôð r   aý  
    Returns:
        FrameBatch:
            The sampled :term:`clips`, as a 5D :class:`~torchcodec.FrameBatch`.
            The shape of the ``data`` field is (``num_clips``,
            ``num_frames_per_clips``, ...) where ... is (H, W, C) or (C, H, W)
            depending on the ``dimension_order`` parameter of
            :class:`~torchcodec.decoders.VideoDecoder`. The shape of the
            ``pts_seconds`` and ``duration_seconds`` fields is (``num_clips``,
            ``num_frames_per_clips``).
N)Útypingr   r   Ú
torchcodecr   ÚlistÚintÚfloatÚ_LIST_OF_INT_OR_FLOATr   r   r   Ú_POLICY_FUNCTION_TYPEr   ÚdictÚstrÚ__annotations__r"   r-   Ú_FRAMEBATCH_RETURN_DOCS© r   r   ú<module>r:      s÷   ðß "Ð "å !à˜d 3™i¨¨e©Ð4Ñ5Ð ðØ!ðØ03ðàóðEØ!ðEØ03ðEàóEðØ)ðØ8;ðàóð !Ð"7¸Ð!=Ð?TÐ!TÑUÐ ð 'ØØñ7Ð �4˜Ð2Ð2Ñ3ó ò
ð àðð ðð ð	ð
 óð
Ñ r   