o
    2j                     @   s   d dl mZ d dlZd dlm  mZ eee Z	ej
dejejej  dejejej  defddZG dd	 d	eZejejG d
d dZej
defddZej
defddZe Zee  dS )    )FlagNiptroptrreturnc                 C   sD   | s|st dttt}| |_||_|r|j|_|S | j|_|S )Nz#needs input format or output format)
ValueErrorContainerFormat__new___cinit_bypass_sentinelr   r   name)r   r   format r   D/var/www/html/whisper/venv/lib/python3.10/site-packages/av/format.pybuild_container_format	   s   r   c                   @   s   e Zd ZU ejZejZded< ej	Z
ded< ejZded< ejZded< ejZd	ed
< ejZded< ejZded< ejZded< ejZded< ejZded< ejZded< ejZded< ejZ ded< ej!Z"ded< ej#Z$ded< dS ) FlagszNeeds '%d' in filename.need_numberzShow format stream IDs numbers.show_idszFormat wants global header.global_headerz+Format does not need / have any timestamps.no_timestampsz Use generic index building code.generic_indexz'Format allows timestamp discontinuities
ts_discontzFormat allows variable fps.variable_fpsz!Format does not need width/heightno_dimensionsz#Format does not require any streams
no_streamszFFormat does not allow to fall back on binary search via read_timestampno_bin_searchz4Format does not allow to fall back on generic searchno_gen_searchz&Format does not allow seeking by bytesno_byte_seekzYFormat does not require strictly increasing timestamps, but they must still be monotonic.ts_nonstrictz)Format allows muxing negative timestamps.ts_negativezSeeking is based on PTSseek_to_ptsN)%__name__
__module____qualname__libAVFMT_NOFILEno_fileAVFMT_NEEDNUMBERr   __annotations__AVFMT_SHOW_IDSr   AVFMT_GLOBALHEADERr   AVFMT_NOTIMESTAMPSr   AVFMT_GENERIC_INDEXr   AVFMT_TS_DISCONTr   AVFMT_VARIABLE_FPSr   AVFMT_NODIMENSIONSr   AVFMT_NOSTREAMSr   AVFMT_NOBINSEARCHr   AVFMT_NOGENSEARCHr   AVFMT_NO_BYTE_SEEKr   AVFMT_TS_NONSTRICTr   AVFMT_TS_NEGATIVEr   AVFMT_SEEK_TO_PTSr   r   r   r   r   r      s"   
 r   c                   @   s   e Zd ZdZdddZdd Zedd Zed	d
 Zedd Z	edd Z
edd Zedd Zedd Zedd ZdS )r   zDescriptor of a container format.

    :param str name: The name of the format.
    :param str mode: ``'r'`` or ``'w'`` for input and output formats; defaults
        to None which will grab either.

    Nc                 C   st   |t u rd S || _|d u s|dkrt|| _|d u s|dkr)t|tjtj| _| js6| js8t	d|d S d S )Nrwzno container format )
r	   r
   r"   av_find_input_formatr   av_guess_formatcythonNULLr   r   )selfr
   moder   r   r   	__cinit__;   s   zContainerFormat.__cinit__c                 C   s   d| j j d| jdS )Nz<av. >)	__class__r   r
   r;   r   r   r   __repr__M   s   zContainerFormat.__repr__c                 C   s.   | j tjkrdS | jtjkr| S t| j tjS )z"An input-only view of this format.N)r   r9   r:   r   r   rA   r   r   r   inputP   
   zContainerFormat.inputc                 C   s.   | j tjkrdS | jtjkr| S ttj| j S )z#An output-only view of this format.N)r   r9   r:   r   r   rA   r   r   r   outputZ   rD   zContainerFormat.outputc                 C      | j tjkS N)r   r9   r:   rA   r   r   r   is_inputd      zContainerFormat.is_inputc                 C   rF   rG   )r   r9   r:   rA   r   r   r   	is_outputh   rI   zContainerFormat.is_outputc                 C   s   | j r| j jS | jjS rG   )r   	long_namer   rA   r   r   r   rK   l   s   zContainerFormat.long_namec                 C   sN   t  }| jr| jjr|| jjd | jr%| jjr%|| jjd |S )N,)setr   
extensionsupdatesplitr   )r;   extsr   r   r   rN   r   s   zContainerFormat.extensionsc                 C   s&   | j r| j jnd| jr| jjB S dB S )zL
        Get the flags bitmask for the format.

        :rtype: int
        r   )r   flagsr   rA   r   r   r   rR   {   s
   zContainerFormat.flagsc                 C   s   t | jtj@ S rG   )boolrR   r"   r#   rA   r   r   r   r$      s   zContainerFormat.no_filerG   )r   r    r!   __doc__r=   rB   propertyrC   rE   rH   rJ   rK   rN   rR   r$   r   r   r   r   r   0   s(    

	
	





r   c                  C   8   t  } tj}	 tt|}|r| |j n	 | S qrG   )rM   r9   r:   r"   av_muxer_iterateaddressaddr
   namesopaqueptrr   r   r   get_output_format_names      r^   c                  C   rV   rG   )rM   r9   r:   r"   av_demuxer_iteraterX   rY   r
   rZ   r   r   r   get_input_format_names   r_   ra   )enumr   r9   cython.cimports.libavcimportslibavr"   declareobjectr	   cfuncpointerconstAVInputFormatAVOutputFormatr   r   r   finalcclassrM   r^   ra   formats_availablerO   r   r   r   r   <module>   s,    Y