
    djY              	          d dl mZmZ d dlZd dlmZ d dlmZm	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 d d
lmZ d dlmZ d dlmZ  ej        e e                      Zej        dej         ej!                 dej         ej"        ej#                          de$de%fd            Z& G d de          Z' G d de          Z( G d de          Z)ej*         G d d                      Z%dS )    )FlagIntEnumN)libav)
ByteSource
bytesource)Codec
wrap_codec)
Dictionary)	err_check)Packet)avrational_to_fractionto_avrational)EAGAIN)uint8_t)memcpyc_ctxc_codechwaccelreturnc                 d   | j         t          j        k    rddlm}  |t
                    }nl| j         t          j        k    rddlm}  |t
                    }n@| j         t          j	        k    rddl
m}  |t
                    }nt          t
                    }|                    | ||           |S )z8Build an bv.CodecContext for an existing AVCodecContext.r   )VideoCodecContext)AudioCodecContext)SubtitleCodecContext)
codec_typelibAVMEDIA_TYPE_VIDEOav.video.codeccontextr   _cinit_sentinelAVMEDIA_TYPE_AUDIOav.audio.codeccontextr   AVMEDIA_TYPE_SUBTITLEav.subtitles.codeccontextr   CodecContext_init)r   r   r   r   py_ctxr   r   s          K/home/agentuser/manim-venv/lib/python3.11/site-packages/av/codec/context.pywrap_codec_contextr'      s     3111;;;;;;""?33		S3	3	3;;;;;;""?33		S6	6	6BBBBBB%%o66o..
LL)))M    c                   l    e Zd ZU dZej        Zded<   ej        Z	ded<   ej        ej        z  Z
ded<   dS )	
ThreadTyper   z"Decode more than one frame at onceFRAMEz3Decode more than one part of a single frame at onceSLICEz*Decode using both FRAME and SLICE methods.AUTON)__name__
__module____qualname__NONEr   FF_THREAD_FRAMEr+   __annotations__FF_THREAD_SLICEr,   r-    r(   r&   r*   r*   /   sh         D252EE/EEECFCVE@VVVc11 	
6     r(   r*   c                   &   e Zd Zej        Zej        Zej        Z	ej
        Zej        Zej        Zej        Zej        Zej        Zej        Zej        Zej        Zej        Zej        Zej         Z!ej"        Z#ej$        Z%ej&        Z'ej(        Z)ej*        Z+dS )FlagsN),r.   r/   r0   r   AV_CODEC_FLAG_UNALIGNED	unalignedAV_CODEC_FLAG_QSCALEqscaleAV_CODEC_FLAG_4MVfour_mvAV_CODEC_FLAG_OUTPUT_CORRUPToutput_corruptAV_CODEC_FLAG_QPELqpelAV_CODEC_FLAG_RECON_FRAMErecon_frameAV_CODEC_FLAG_COPY_OPAQUEcopy_opaqueAV_CODEC_FLAG_FRAME_DURATIONframe_durationAV_CODEC_FLAG_PASS1pass1AV_CODEC_FLAG_PASS2pass2AV_CODEC_FLAG_LOOP_FILTERloop_filterAV_CODEC_FLAG_GRAYgrayAV_CODEC_FLAG_PSNRpsnrAV_CODEC_FLAG_INTERLACED_DCTinterlaced_dctAV_CODEC_FLAG_LOW_DELAY	low_delayAV_CODEC_FLAG_GLOBAL_HEADERglobal_headerAV_CODEC_FLAG_BITEXACTbitexactAV_CODEC_FLAG_AC_PREDac_predAV_CODEC_FLAG_INTERLACED_MEinterlaced_meAV_CODEC_FLAG_CLOSED_GOP
closed_gopr5   r(   r&   r7   r7   8   s        +I%F#G5N!D/K/K5N#E#E/K!D!D5N+I3M)H'G3M-JJJr(   r7   c                       e Zd Zej        Zej        Zej        Z	ej
        Zej        Zej        Zej        Zej        Zej        ZdS )Flags2N)r.   r/   r0   r   AV_CODEC_FLAG2_FASTfastAV_CODEC_FLAG2_NO_OUTPUT	no_outputAV_CODEC_FLAG2_LOCAL_HEADERlocal_headerAV_CODEC_FLAG2_CHUNKSchunksAV_CODEC_FLAG2_IGNORE_CROPignore_cropAV_CODEC_FLAG2_SHOW_ALLshow_allAV_CODEC_FLAG2_EXPORT_MVS
export_mvsAV_CODEC_FLAG2_SKIP_MANUALskip_manualAV_CODEC_FLAG2_RO_FLUSH_NOOPro_flush_noopr5   r(   r&   ra   ra   O   sV        "D,I2L&F0K*H.J0K4MMMr(   ra   c                      e Zd ZedBd            ZdCdZej        dej        e	j
                 dej        ej        e	j                          defd            Zed             Zej        d	ej        fd
            Zed             Zej        d             Zed             Zej        d             Zed             Zej        d	ej        fd            Zed             Zej        d             Zed             Zed             Zed             Zej        dDdej        fd            Zd Zd ZdCdZed             Z de!dz  fdZ"ej        de!dz  de#fd             Z$ej        de!fd!            Z%ej        d"             Z&ej        de!fd#            Z'ej        d$             Z(ej        de!fd%            Z)ej        dCde!dz  fd&            Z*dCde!dz  fd'Z+ej        d(e,fd)            Z-ej        dCd(e,dz  fd*            Z.ej        d+             Z/ej        de!d(e,dz  fd,            Z0ed-             Z1ed.             Z2ed/             Z3ed0             Z4e4j        d1             Z4ed2             Z5e5j        d3             Z5ed4             Z6e6j        d5             Z6ed6             Z7e7j        d	ej        fd7            Z7ed8             Z8ed9             Z9e9j        d	ej        fd:            Z9ed;             Z:e:j        d	ej        fd<            Z:ed=             Z;e;j        d>             Z;ed?             Z<e<j        d@             Z<edA             Z=dS )Er#   Nc                     t          | t                    r| nt          | |          }t          j        |j                  }t          ||j        |          S N)
isinstancer   r   avcodec_alloc_context3ptrr'   )codecmoder   cy_codecr   s        r&   createzCodecContext.create]   sQ    #-eU#;#;S%%udASAS474NL5
 5
 "%w???r(   c                 `    |t           urt          d          i | _        d| _        d| _        d S )NzCannot instantiate CodecContextF)r   RuntimeErroroptionsstream_indexis_open)selfsentinelargskwargss       r&   	__cinit__zCodecContext.__cinit__e   s6    ?**@AAAr(   ry   rz   r   c                    || _         | j         j        r!|r| j         j        |k    rt          d          t          |t          j        k    r|n| j         j                  | _        || _        d| j         _        d| j         _        d S )Nz,Wrapping CodecContext with mismatched codec.r      )	ry   rz   r   r	   cythonNULLr   thread_countthread_type)r   ry   rz   r   s       r&   r$   zCodecContext._initm   s     8> 	Oe 	O%(?(?MNNN&+)=)=48>RR
 !"#r(   c                     | j         j        S )zU
        Get and set the flags bitmask of CodecContext.

        :rtype: int
        ry   flagsr   s    r&   r   zCodecContext.flags~        x~r(   valuec                     || j         _        d S rv   r   r   r   s     r&   r   zCodecContext.flags   s    r(   c                 N    t          | j        j        t          j        z            S )z9
        Use fixed qscale.

        :rtype: bool
        )boolry   r   r   r:   r   s    r&   r;   zCodecContext.qscale   s     DHNS%==>>>r(   c                     |r!| j         xj        t          j        z  c_        d S | j         xj        t          j         z  c_        d S rv   )ry   r   r   r:   r   s     r&   r;   zCodecContext.qscale   s?     	8HNNc66NNNNHNNs777NNNNr(   c                 N    t          | j        j        t          j        z            S rv   )r   ry   r   r   rD   r   s    r&   rE   zCodecContext.copy_opaque   s    DHNS%BBCCCr(   c                     |r!| j         xj        t          j        z  c_        d S | j         xj        t          j         z  c_        d S rv   )ry   r   r   rD   r   s     r&   rE   zCodecContext.copy_opaque   s?     	=HNNc;;NNNNHNNs<<<NNNNr(   c                     | j         j        S )zV
        Get and set the flags2 bitmask of CodecContext.

        :rtype: int
        ry   flags2r   s    r&   r   zCodecContext.flags2   s     xr(   c                     || j         _        d S rv   r   r   s     r&   r   zCodecContext.flags2   s    r(   c                    | j         t          j        u rd S | j         j        dk    r^t          j        t
          t          j        t          j        t                   | j         j                  d | j         j                           S d S Nr   )	ry   r   r   extradata_sizecastbytespointerr   	extradatar   s    r&   r   zCodecContext.extradata   sq    8v{""48"Q&&;FN73TX5GHH-dh--   tr(   c                    |>t          j        t          j        | j        j                             d| j        _        d S t          |          }t          j        t          j	        t                   t          j        | j        j        |j        t           j        z                       | j        _        | j        j        st          d          t          | j        j        |j        |j                   |j        | j        _        d S )Nr   zCannot allocate extradata)r   av_freepr   addressry   r   r   r   r   r   r   
av_realloclengthAV_INPUT_BUFFER_PADDING_SIZEMemoryErrorr   )r   datasources      r&   r   zCodecContext.extradata   s    <L(:;;<<<&'DH###%%F!'w'H&8X(X " "DH 8% ?!"=>>>48%vz6=AAA&,mDH###r(   c                     | j         j        S rv   )ry   r   r   s    r&   r   zCodecContext.extradata_size   s    x&&r(   c                 h    | j         t          j        u rdS t          j        | j         j                  S NF)ry   r   r   r   av_codec_is_encoderrz   r   s    r&   
is_encoderzCodecContext.is_encoder   +    8v{""5&tx~666r(   c                 h    | j         t          j        u rdS t          j        | j         j                  S r   )ry   r   r   r   av_codec_is_decoderrz   r   s    r&   
is_decoderzCodecContext.is_decoder   r   r(   Tstrictc           	      0   | j         r|rt          d          d S t                      }|                    | j        pi            | j        j        j        s| j        r| j	        dk    rO| j        j
        j        pd| j        j        _        | j        j
        j        pt          j        | j        j        _        nd| j	        dk    r-d| j        j        _        | j        j        | j        j        _        n,d| j        j        _        t          j        | j        j        _        t          t          j        | j        | j        j        t%          j        |j                            d| j        j         d| j         d           d| _         t+          |          | _        d S )	NzCodecContext is already open.video   audiozavcodec_open2("z", )T)r   
ValueErrorr
   updater   ry   	time_basenumr   type	frameratedenr   AV_TIME_BASEsample_rater   avcodec_open2rz   r   r   namedict)r   r   r   s      r&   openzCodecContext.open   sc   < 	 B !@AAAF(llt|)r***x!% 		:$/ 		:yG##)-);)?)D1"&)-);)?)S3CS"&&g%%)*"&)-)="&&)*"&),)9"&dh
w{8S8STTAdjoAA$,AAA	
 	
 	
 G}}r(   c                    | j         r[t          j        t          j        | j         j                             t          j        t          j        | j                              | j        rt          j        | j                   d S d S rv   )	ry   r   r   r   r   r   avcodec_free_contextparserav_parser_closer   s    r&   __dealloc__zCodecContext.__dealloc__   su    8 	?L(:;;<<<$V^DH%=%=>>>; 	-,,,,,	- 	-r(   c           
      t    | j         pd}| j        pd}d| j        j         d| d| dt	          |           dd	S )	Nz<notype>z	<nocodec>z<av. /z at 0xx>)r   r   	__class__r.   id)r   _typer   s      r&   __repr__zCodecContext.__repr__  sQ    	'Zy'KQdn-QQQQQQBtHHQQQQQr(   c                    | j         sKt          j        | j        j        j                  | _         | j         st          d| j        j                   t          |d          }||j        nt          j
        }||j        nd}d}g }	 t          j        5  t          j        | j         | j        t          j        |          t          j        |          ||t          j        t          j        d	  	        }	ddd           n# 1 swxY w Y   t!          |	           |r?t#          |          }t%          |j        j        ||           |                    |           |sn||	z  }||	z  }|sn|S )ah  Split up a byte stream into list of :class:`.Packet`.

        This is only effectively splitting up a byte stream, and does no
        actual interpretation of the data.

        It will return all packets that are fully contained within the given
        input, and will buffer partial packets until they are complete.

        :param ByteSource raw_input: A chunk of a byte-stream to process.
            Anything that can be turned into a :class:`.ByteSource` is fine.
            ``None`` or empty inputs will flush the parser's buffers.

        :return: ``list`` of :class:`.Packet` newly available.

        zNo parser for T)
allow_noneNr   )r   r   av_parser_initrz   ry   r   r   r   r   r   r   r   nogilav_parser_parse2r   AV_NOPTS_VALUEr   r   r   r   append)
r   	raw_inputr   in_datain_sizepacketpacketsout_dataout_sizeconsumeds
             r&   parsezCodecContext.parse
  s   " { 	E,TZ^->??DK; E !C$*/!C!CDDD'	dCCC060B&**/5/Afmmq
 )	  /KHN8,,N8,,&&
 
               h '  ))vz(;;;v&&& xGxG S)	V s   AD  DDc                     | j         duS )zf
        Returns ``True`` if this codec context is hardware accelerated, ``False`` otherwise.
        N)hwaccel_ctxr   s    r&   
is_hwaccelzCodecContext.is_hwaccelX  s    
 t++r(   framec              #   0  K   t           j        5  t          j        | j        ||j        nt           j                  }d d d            n# 1 swxY w Y   t          |d           |                                 }|r|V  |                                 }|d S d S )Nzavcodec_send_frame())r   r   r   avcodec_send_framery   r   r   _recv_packetr   r   resr   s       r&   _send_frame_and_recvz!CodecContext._send_frame_and_recv_  s       \ 	 	(u'8%))fk C	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	#-...""$$ 	)LLL&&((F  	) 	) 	) 	) 	)s   .A		AAr   c                     |gS rv   r5   r   r   s     r&   _prepare_frames_for_encodez'CodecContext._prepare_frames_for_encodem  s	    wr(   c                      t          d          )Nz Base CodecContext cannot decode.)NotImplementedErrorr   s    r&   _alloc_next_framezCodecContext._alloc_next_frameq  s    !"DEEEr(   c                 v   | j         s|                                 | _         | j         }t          j        5  t	          j        | j        |j                  }d d d            n# 1 swxY w Y   |t           k    s|t          j        k    rd S t          |d           | 
                    |          }|s	d | _         |S d S )Nzavcodec_receive_frame())_next_framer   r   r   r   avcodec_receive_framery   r   AVERROR_EOFr   _transfer_hwframe)r   r   r   s      r&   _recv_framezCodecContext._recv_frameu  s    	8#5577D' \ 	A 	A+DHei@@C	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 6'>>SCO33F#0111&&u-- 	#DL	 	s    A  A$'A$c                     |S rv   r5   r   s     r&   r   zCodecContext._transfer_hwframe  s    r(   c                    t                      }t          j        5  t          j        | j        |j                  }d d d            n# 1 swxY w Y   |t           k    s|t          j        k    rd S t          |d           |s|S d S )Nzavcodec_receive_packet())	r   r   r   r   avcodec_receive_packetry   r   r   r   )r   r   r   s      r&   r   zCodecContext._recv_packet  s     \ 	C 	C,TXvzBBC	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 6'>>SCO33F#1222 	M	 	s    AAAc                    | j         j        t          j        t          j        fvrt          d          |                     d           |                     |          }|D ]#}||                    | j         j	                   $|S )Nz/Encoding is only supported for audio and video.Fr   )
ry   r   r   r   r   r   r   r   _rebase_timer   )r   r   framess      r&   *_prepare_and_time_rebase_frames_for_encodez7CodecContext._prepare_and_time_rebase_frames_for_encode  s    8s'=s?U&VVV%&WXXX			0077  	7 	7E ""48#5666r(   c                     g }|                      |          D ]D}|                     |          D ],}|                     |           |                    |           -E|S )zAEncode a list of :class:`.Packet` from the given :class:`.Frame`.)r  r   _setup_encoded_packetr   r   s       r&   encodezCodecContext.encode  sx     DDUKK 	# 	#E33E:: # #**6222

6""""# 
r(   c              #      K   |                      |          D ]3}|                     |          D ]}|                     |           |V  4d S rv   )r  r   r	  r   r   r   s      r&   encode_lazyzCodecContext.encode_lazy  sn      DDUKK 	 	E33E::  **6222	 	r(   r   c                 2    | j         j        |j         _        d S rv   )ry   r   )r   r   s     r&   r	  z"CodecContext._setup_encoded_packet  s      $x1
r(   c                    | j         j        st          d          |                     d           t          j        5  t          j        | j        ||j        nt          j                  }ddd           n# 1 swxY w Y   t          |d           g }| 
                                }|rA|                     ||           |                    |           | 
                                }|A|S )a%  Decode a list of :class:`.Frame` from the given :class:`.Packet`.

        If the packet is None, the buffers will be flushed. This is useful if
        you do not want the library to automatically re-order frames for you
        (if they are encoded with a codec that has B-frames).

        zcannot decode unknown codecFr  Nzavcodec_send_packet())rz   ry   r   r   r   r   r   avcodec_send_packetr   r   r   _setup_decoded_framer   )r   r   r   outr   s        r&   decodezCodecContext.decode  s3    z~ 	<:;;;			 \ 	 	)(:&** C	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	#.///  "" 	'%%eV444JJu$$&&E  	' 
s   .A88A<?A<c                     | j         r@t          j        5  t          j        | j                   ddd           dS # 1 swxY w Y   dS dS )zReset the internal codec state and discard all internal buffers.

        Should be called before you start decoding from a new position e.g.
        when seeking or when switching to a different stream.

        N)r   r   r   r   avcodec_flush_buffersry   r   s    r&   flush_bufferszCodecContext.flush_buffers  s     < 	4 4 4)$(3334 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4	4 	4s   ;??c                 0    ||j         j        |_        d S d S rv   )ry   r   
_time_baser  s      r&   r  z!CodecContext._setup_decoded_frame  s%     %z3E r(   c                     | j         j        S rv   )rz   r   r   s    r&   r   zCodecContext.name      zr(   c                     | j         j        S rv   )rz   r   r   s    r&   r   zCodecContext.type   r  r(   c                 P   g }| j         j        r| j        j        r| j        j        j        s|S | j        j        }d}|j        |         j        t
          j        k    rJ|                    |j        |         j                   |dz  }|j        |         j        t
          j        k    J|S )zX
        List the available profiles for this stream.

        :type: list[str]
        r   r   )	ry   rz   descprofilesprofiler   AV_PROFILE_UNKNOWNr   r   )r   retr  is       r&   r  zCodecContext.profiles  s     x~ 	TZ_ 	DJO<T 	J zmA&#*@@@JJt}Q',---FA mA&#*@@@ 
r(   c                 j   | j         j        r| j        j        r| j        j        j        sd S | j        j        }d}|j        |         j        t
          j        k    rY|j        |         j        | j         j        k    r|j        |         j        S |dz  }|j        |         j        t
          j        k    Wd S d S Nr   r   )ry   rz   r  r  r  r   r   r   )r   r  r"  s      r&   r  zCodecContext.profile  s    x~ 	TZ_ 	DJO<T 	F zmA&#*@@@}Q'48+;;;}Q',,FA mA&#*@@@@@@@r(   c                 d   | j         r| j         j        r| j         j        j        sd S | j         j        }d}|j        |         j        t          j        k    r[|j        |         j        |k    r|j        |         j        | j        _        d S |dz  }|j        |         j        t          j        k    Yd S d S r$  )rz   r  r  r  r   r   r   ry   )r   r   r  r"  s       r&   r  zCodecContext.profile'  s    z 	 	
8P 	F zmA&#*@@@}Q$--#'=#3#; FA	 mA&#*@@@@@@@r(   c                     | j         rt          d          t          t          j        | j        j                            S Nz&Cannot access 'time_base' as a decoder)r   r   r   r   r   ry   r   r   s    r&   r   zCodecContext.time_base6  s9    ? 	IGHHH%fnTX5G&H&HIIIr(   c                     | j         rt          d          t          |t          j        | j        j                             d S r'  )r   r   r   r   r   ry   r   r   s     r&   r   zCodecContext.time_base<  sA    ? 	IGHHHeV^DH,>??@@@@@r(   c                 n    | j         j                            ddd                              d          S )N   littleF	byteordersignedasciiencoding)ry   	codec_tagto_bytesr  r   s    r&   r2  zCodecContext.codec_tagB  s=    x!**1*OOVV W 
 
 	
r(   c                     t          |t                    rPt          |          dk    r=t                              |                    d          dd          | j        _        d S t          d          )Nr*  r/  r0  r+  Fr,  z)Codec tag should be a 4 character string.)	rw   strlenint
from_bytesr
  ry   r2  r   r   s     r&   r2  zCodecContext.codec_tagH  sl    eS!! 	Jc%jjAoo!$g..(5 "0 " "DH HIIIr(   c                 >    | j         j        dk    r| j         j        nd S r   ry   bit_rater   s    r&   r;  zCodecContext.bit_rateQ  s!    $(H$5$9$9tx  tCr(   c                     || j         _        d S rv   r:  r   s     r&   r;  zCodecContext.bit_rateU  s    !r(   c                 >    | j         j        dk    r| j         j        S d S r   )ry   rc_max_rater   s    r&   max_bit_ratezCodecContext.max_bit_rateY  s"    8!##8''4r(   c                     | j         j         d S rv   ry   bit_rate_tolerancer   s    r&   rB  zCodecContext.bit_rate_tolerance`  s    ####r(   c                     || j         _        d S rv   rA  r   s     r&   rB  zCodecContext.bit_rate_toleranced  s    &+###r(   c                     | j         j        S )zfHow many threads to use; 0 means auto.

        Wraps :ffmpeg:`AVCodecContext.thread_count`.

        )ry   r   r   s    r&   r   zCodecContext.thread_counth  s     x$$r(   c                 J    | j         rt          d          || j        _        d S )Nz/Cannot change thread_count after codec is open.)r   r   ry   r   r   s     r&   r   zCodecContext.thread_countq  s,    < 	RPQQQ %r(   c                 4    t          | j        j                  S )z[One of :class:`.ThreadType`.

        Wraps :ffmpeg:`AVCodecContext.thread_type`.

        )r*   ry   r   r   s    r&   r   zCodecContext.thread_typew  s     $(.///r(   c                    | j         rt          d          t          |          t          u r|| j        _        d S t          |          t          u rt          |         j        | j        _        d S |j        | j        _        d S )Nz.Cannot change thread_type after codec is open.)	r   r   r   r7  ry   r   r5  r*   r   r   s     r&   r   zCodecContext.thread_type  sx    < 	QOPPP;;##(DH   %[[C#-e#4#:DH   #(;DH   r(   c                    | j         j        }|t          j        k    rdS |t          j        k    rdS |t          j        k    rdS |t          j        k    rdS |t          j        k    rdS |t          j        k    rdS |t          j	        k    rdS | S )a  Returns one of the following str literals:

        "NONE" Discard nothing
        "DEFAULT" Discard useless packets like 0 size packets in AVI
        "NONREF" Discard all non reference
        "BIDIR" Discard all bidirectional frames
        "NONINTRA" Discard all non intra frames
        "NONKEY Discard all frames except keyframes
        "ALL" Discard all

        Wraps :ffmpeg:`AVCodecContext.skip_frame`.
        r1   DEFAULTNONREFBIDIRNONINTRANONKEYALL)
ry   
skip_framer   AVDISCARD_NONEAVDISCARD_DEFAULTAVDISCARD_NONREFAVDISCARD_BIDIRAVDISCARD_NONINTRAAVDISCARD_NONKEYAVDISCARD_ALLr   s     r&   rO  zCodecContext.skip_frame  s     #C&&&6C)))9C(((8C'''7C***:C(((8C%%%5zr(   c                    |dk    rt           j        | j        _        d S |dk    rt           j        | j        _        d S |dk    rt           j        | j        _        d S |dk    rt           j        | j        _        d S |dk    rt           j        | j        _        d S |dk    rt           j        | j        _        d S |dk    rt           j	        | j        _        d S t          d          )	Nr1   rI  rJ  rK  rL  rM  rN  zInvalid skip_frame type)r   rP  ry   rO  rQ  rR  rS  rT  rU  rV  r   r   s     r&   rO  zCodecContext.skip_frame  s    F??"%"4DHi"%"7DHh"%"6DHg"%"5DHj  "%"8DHh"%"6DHe^^"%"3DH6777r(   c                     | j         j        S )zECodec delay.

        Wraps :ffmpeg:`AVCodecContext.delay`.

        )ry   delayr   s    r&   rY  zCodecContext.delay  r   r(   )NNrv   )T)>r.   r/   r0   staticmethodr}   r   r   cfuncr   r   AVCodecContextconstAVCodecHWAccelr$   propertyr   setterr7  r;   rE   r   r   r   r   r   ccallbintr   r   r   r   r   Framer   listr   r   r   r   r   r  r
  r  r   r	  r  r  r  r   r   r  r  r   r2  r;  r?  rB  r   r   rO  rY  r5   r(   r&   r#   r#   [   sK       @ @ @ \@    \$^C./$ ~fl3;78$ 	$ $ $ \$    X \6:    \ ? ? X? ]8 8 ]8 D D XD = = =   X ] FJ       ]  
 
 X
 4 4 4" ' ' X' 7 7 X7
 7 7 X7
 \% %6; % % % \%6- - -R R R
L L L L\ , , X,)%$, ) ) ) ) \     \ \F5 F F F \F \  \( \u    \ \  \ \    \  \ EDL    \      \2F 2 2 2 \2 \ Vd]    \8 \	4 	4 \	4 \4% 4$ 4 4 4 \4   X   X   X(   X ^  ^ J J XJ
 A A A
 
 
 X

 J J J D D XD _"fj " " " _"   X $ $ X$ ,
 , , , , % % X% &&* & & & &
 0 0 X0 / / /   X< 8 8 8$   X  r(   r#   )+enumr   r   r   cython.cimportsr   r   cython.cimports.av.bufferr   r   cython.cimports.av.codec.codecr   r	   cython.cimports.av.dictionaryr
   cython.cimports.av.errorr   cython.cimports.av.packetr   cython.cimports.av.utilsr   r   cython.cimports.libc.errnor   cython.cimports.libc.stdintr   cython.cimports.libc.stringr   declareobjectr   r[  r   r\  r]  r^  r_  r#   r'   r*   r7   ra   cclassr5   r(   r&   <module>rt     s-            ( ( ( ( ( ( < < < < < < < < < < < < < < < < 4 4 4 4 4 4 . . . . . . , , , , , , J J J J J J J J - - - - - - / / / / / / . . . . . . &.22 >#,-^FL56  	   8       . . . . .G . . ..	5 	5 	5 	5 	5W 	5 	5 	5 h	 h	 h	 h	 h	 h	 h	 h	 h	 h	r(   