/*---------------------------------------------------------------- // Copyright (C) 2025 Beijing All rights reserved. // // Author: huachangmiao // Create Date: 2025/04/11 // Module Describe: //----------------------------------------------------------------*/ using System; using System.Runtime.InteropServices; namespace LeviathanVideo.Abstractions { public static unsafe partial class leviathan { /// Allocate and initialize an AVIOContext for buffered I/O. It must be later freed with avio_context_free(). /// Memory block for input/output operations via AVIOContext. The buffer must be allocated with av_malloc() and friends. It may be freed and replaced with a new buffer by libavformat. AVIOContext.buffer holds the buffer currently in use, which must be later freed with av_free(). /// The buffer size is very important for performance. For protocols with fixed blocksize it should be set to this blocksize. For others a typical size is a cache page, e.g. 4kb. /// Set to 1 if the buffer should be writable, 0 otherwise. /// An opaque pointer to user-specific data. /// A function for refilling the buffer, may be NULL. For stream protocols, must never return 0 but rather a proper AVERROR code. /// A function for writing the buffer contents, may be NULL. The function may not change the input buffers content. /// A function for seeking to specified byte position, may be NULL. /// Allocated AVIOContext or NULL on failure. public static AVIOContext* avio_alloc_context(byte* @buffer, int @buffer_size, int @write_flag, void* @opaque, avio_alloc_context_read_packet_func @read_packet, avio_alloc_context_write_packet_func @write_packet, avio_alloc_context_seek_func @seek) => vectors.avio_alloc_context(@buffer, @buffer_size, @write_flag, @opaque, @read_packet, @write_packet, @seek); /// Allocate an AVFormatContext. avformat_free_context() can be used to free the context and everything allocated by the framework within it. public static AVFormatContext* avformat_alloc_context() => vectors.avformat_alloc_context(); /// Open an input stream and read the header. The codecs are not opened. The stream must be closed with avformat_close_input(). /// Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). May be a pointer to NULL, in which case an AVFormatContext is allocated by this function and written into ps. Note that a user-supplied AVFormatContext will be freed on failure. /// URL of the stream to open. /// If non-NULL, this parameter forces a specific input format. Otherwise the format is autodetected. /// A dictionary filled with AVFormatContext and demuxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. /// 0 on success, a negative AVERROR on failure. public static int avformat_open_input(AVFormatContext** @ps, string @url, AVInputFormat* @fmt, AVDictionary** @options) => vectors.avformat_open_input(@ps, @url, @fmt, @options); /// Read packets of a media file to get stream information. This is useful for file formats with no headers such as MPEG. This function also computes the real framerate in case of MPEG-2 repeat frame mode. The logical file position is not changed by this function; examined packets may be buffered for later processing. /// media file handle /// If non-NULL, an ic.nb_streams long array of pointers to dictionaries, where i-th member contains options for codec corresponding to i-th stream. On return each dictionary will be filled with options that were not found. /// >=0 if OK, AVERROR_xxx on error public static int avformat_find_stream_info(AVFormatContext* @ic, AVDictionary** @options) => vectors.avformat_find_stream_info(@ic, @options); /// Find the "best" stream in the file. The best stream is determined according to various heuristics as the most likely to be what the user expects. If the decoder parameter is non-NULL, av_find_best_stream will find the default decoder for the stream's codec; streams for which no decoder can be found are ignored. /// media file handle /// stream type: video, audio, subtitles, etc. /// user-requested stream number, or -1 for automatic selection /// try to find a stream related (eg. in the same program) to this one, or -1 if none /// if non-NULL, returns the decoder for the selected stream /// flags; none are currently defined /// the non-negative stream number in case of success, AVERROR_STREAM_NOT_FOUND if no stream with the requested type could be found, AVERROR_DECODER_NOT_FOUND if streams were found but no decoder public static int av_find_best_stream(AVFormatContext* @ic, AVMediaType @type, int @wanted_stream_nb, int @related_stream, AVCodec** @decoder_ret, int @flags) => vectors.av_find_best_stream(@ic, @type, @wanted_stream_nb, @related_stream, @decoder_ret, @flags); /// Allocate an AVCodecContext and set its fields to default values. The resulting struct should be freed with avcodec_free_context(). /// if non-NULL, allocate private data and initialize defaults for the given codec. It is illegal to then call avcodec_open2() with a different codec. If NULL, then the codec-specific defaults won't be initialized, which may result in suboptimal default settings (this is important mainly for encoders, e.g. libx264). /// An AVCodecContext filled with default values or NULL on failure. public static AVCodecContext* avcodec_alloc_context3(AVCodec* @codec) => vectors.avcodec_alloc_context3(@codec); /// Get the name of a codec. /// a static string identifying the codec; never NULL public static string avcodec_get_name(AVCodecID @id) => vectors.avcodec_get_name(@id); /// Initialize the AVCodecContext to use the given AVCodec. Prior to using this function the context has to be allocated with avcodec_alloc_context3(). /// The context to initialize. /// The codec to open this context for. If a non-NULL codec has been previously passed to avcodec_alloc_context3() or for this context, then this parameter MUST be either NULL or equal to the previously passed codec. /// A dictionary filled with AVCodecContext and codec-private options, which are set on top of the options already set in avctx, can be NULL. On return this object will be filled with options that were not found in the avctx codec context. /// zero on success, a negative value on error public static int avcodec_open2(AVCodecContext* @avctx, AVCodec* @codec, AVDictionary** @options) => vectors.avcodec_open2(@avctx, @codec, @options); /// Allocate an AVFrame and set its fields to default values. The resulting struct must be freed using av_frame_free(). /// An AVFrame filled with default values or NULL on failure. public static AVFrame* av_frame_alloc() => vectors.av_frame_alloc(); /// Allocate an AVPacket and set its fields to default values. The resulting struct must be freed using av_packet_free(). /// An AVPacket filled with default values or NULL on failure. public static AVPacket* av_packet_alloc() => vectors.av_packet_alloc(); /// Free the codec context and everything associated with it and write NULL to the provided pointer. public static void avcodec_free_context(AVCodecContext** @avctx) => vectors.avcodec_free_context(@avctx); /// Close an opened input AVFormatContext. Free it and all its contents and set *s to NULL. public static void avformat_close_input(AVFormatContext** @s) => vectors.avformat_close_input(@s); /// Free the frame and any dynamically allocated objects in it, e.g. extended_data. If the frame is reference counted, it will be unreferenced first. /// frame to be freed. The pointer will be set to NULL. public static void av_frame_free(AVFrame** @frame) => vectors.av_frame_free(@frame); /// Free the packet, if the packet is reference counted, it will be unreferenced first. /// packet to be freed. The pointer will be set to NULL. public static void av_packet_free(AVPacket** @pkt) => vectors.av_packet_free(@pkt); /// Free the supplied IO context and everything associated with it. /// Double pointer to the IO context. This function will write NULL into s. public static void avio_context_free(AVIOContext** @s) => vectors.avio_context_free(@s); /// Return the size in bytes of the amount of data required to store an image with the given parameters. /// the pixel format of the image /// the width of the image in pixels /// the height of the image in pixels /// the assumed linesize alignment /// the buffer size in bytes, a negative error code in case of failure public static int av_image_get_buffer_size(AVPixelFormat @pix_fmt, int @width, int @height, int @align) => vectors.av_image_get_buffer_size(@pix_fmt, @width, @height, @align); /// Return decoded output data from a decoder or encoder (when the AV_CODEC_FLAG_RECON_FRAME flag is used). /// codec context /// This will be set to a reference-counted video or audio frame (depending on the decoder type) allocated by the codec. Note that the function will always call av_frame_unref(frame) before doing anything else. public static int avcodec_receive_frame(AVCodecContext* @avctx, AVFrame* @frame) => vectors.avcodec_receive_frame(@avctx, @frame); /// Return the next frame of a stream. This function returns what is stored in the file, and does not validate that what is there are valid frames for the decoder. It will split what is stored in the file into frames and return one for each call. It will not omit invalid data between valid frames so as to give the decoder the maximum information possible for decoding. /// 0 if OK, < 0 on error or end of file. On error, pkt will be blank (as if it came from av_packet_alloc()). public static int av_read_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_read_frame(@s, @pkt); /// Supply raw packet data as input to a decoder. /// codec context /// The input AVPacket. Usually, this will be a single video frame, or several complete audio frames. Ownership of the packet remains with the caller, and the decoder will not write to the packet. The decoder may create a reference to the packet data (or copy it if the packet is not reference-counted). Unlike with older APIs, the packet is always fully consumed, and if it contains multiple frames (e.g. some audio codecs), will require you to call avcodec_receive_frame() multiple times afterwards before you can send a new packet. It can be NULL (or an AVPacket with data set to NULL and size set to 0); in this case, it is considered a flush packet, which signals the end of the stream. Sending the first flush packet will return success. Subsequent ones are unnecessary and will return AVERROR_EOF. If the decoder still has frames buffered, it will return them after sending a flush packet. public static int avcodec_send_packet(AVCodecContext* @avctx, AVPacket* @avpkt) => vectors.avcodec_send_packet(@avctx, @avpkt); /// Wipe the packet. /// The packet to be unreferenced. public static void av_packet_unref(AVPacket* @pkt) => vectors.av_packet_unref(@pkt); /// Seek to timestamp ts. Seeking will be done so that the point from which all active streams can be presented successfully will be closest to ts and within min/max_ts. Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. /// media file handle /// index of the stream which is used as time base reference /// smallest acceptable timestamp /// target timestamp /// largest acceptable timestamp /// flags /// >=0 on success, error code otherwise public static int avformat_seek_file(AVFormatContext* @s, int @stream_index, long @min_ts, long @ts, long @max_ts, int @flags) => vectors.avformat_seek_file(@s, @stream_index, @min_ts, @ts, @max_ts, @flags); /// Reset the internal codec state / flush internal buffers. Should be called e.g. when seeking or when switching to a different stream. public static void avcodec_flush_buffers(AVCodecContext* @avctx) => vectors.avcodec_flush_buffers(@avctx); /// Allocate a memory block with alignment suitable for all memory accesses (including vectors if available on the CPU). /// Size in bytes for the memory block to be allocated /// Pointer to the allocated block, or `NULL` if the block cannot be allocated public static void* av_malloc(ulong @size) => vectors.av_malloc(@size); /// Free a memory block which has been allocated with a function of av_malloc() or av_realloc() family. /// Pointer to the memory block which should be freed. public static void av_free(void* @ptr) => vectors.av_free(@ptr); #region unuse code /* /// Add an index entry into a sorted list. Update the entry if the list already contains it. /// timestamp in the time base of the given stream public static int av_add_index_entry(AVStream* @st, long @pos, long @timestamp, int @size, int @distance, int @flags) => vectors.av_add_index_entry(@st, @pos, @timestamp, @size, @distance, @flags); /// Add two rationals. /// First rational /// Second rational /// b+c public static AVRational av_add_q(AVRational @b, AVRational @c) => vectors.av_add_q(@b, @c); /// Add a value to a timestamp. /// Input timestamp time base /// Input timestamp /// Time base of `inc` /// Value to be added public static long av_add_stable(AVRational @ts_tb, long @ts, AVRational @inc_tb, long @inc) => vectors.av_add_stable(@ts_tb, @ts, @inc_tb, @inc); /// Read data and append it to the current content of the AVPacket. If pkt->size is 0 this is identical to av_get_packet. Note that this uses av_grow_packet and thus involves a realloc which is inefficient. Thus this function should only be used when there is no reasonable way to know (an upper bound of) the final size. /// associated IO context /// packet /// amount of data to read /// >0 (read size) if OK, AVERROR_xxx otherwise, previous data will not be lost even if an error occurs. public static int av_append_packet(AVIOContext* @s, AVPacket* @pkt, int @size) => vectors.av_append_packet(@s, @pkt, @size); /// Allocate an AVAudioFifo. /// sample format /// number of channels /// initial allocation size, in samples /// newly allocated AVAudioFifo, or NULL on error public static AVAudioFifo* av_audio_fifo_alloc(AVSampleFormat @sample_fmt, int @channels, int @nb_samples) => vectors.av_audio_fifo_alloc(@sample_fmt, @channels, @nb_samples); /// Drain data from an AVAudioFifo. /// AVAudioFifo to drain /// number of samples to drain /// 0 if OK, or negative AVERROR code on failure public static int av_audio_fifo_drain(AVAudioFifo* @af, int @nb_samples) => vectors.av_audio_fifo_drain(@af, @nb_samples); /// Free an AVAudioFifo. /// AVAudioFifo to free public static void av_audio_fifo_free(AVAudioFifo* @af) => vectors.av_audio_fifo_free(@af); /// Peek data from an AVAudioFifo. /// AVAudioFifo to read from /// audio data plane pointers /// number of samples to peek /// number of samples actually peek, or negative AVERROR code on failure. The number of samples actually peek will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. public static int av_audio_fifo_peek(AVAudioFifo* @af, void** @data, int @nb_samples) => vectors.av_audio_fifo_peek(@af, @data, @nb_samples); /// Peek data from an AVAudioFifo. /// AVAudioFifo to read from /// audio data plane pointers /// number of samples to peek /// offset from current read position /// number of samples actually peek, or negative AVERROR code on failure. The number of samples actually peek will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. public static int av_audio_fifo_peek_at(AVAudioFifo* @af, void** @data, int @nb_samples, int @offset) => vectors.av_audio_fifo_peek_at(@af, @data, @nb_samples, @offset); /// Read data from an AVAudioFifo. /// AVAudioFifo to read from /// audio data plane pointers /// number of samples to read /// number of samples actually read, or negative AVERROR code on failure. The number of samples actually read will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. public static int av_audio_fifo_read(AVAudioFifo* @af, void** @data, int @nb_samples) => vectors.av_audio_fifo_read(@af, @data, @nb_samples); /// Reallocate an AVAudioFifo. /// AVAudioFifo to reallocate /// new allocation size, in samples /// 0 if OK, or negative AVERROR code on failure public static int av_audio_fifo_realloc(AVAudioFifo* @af, int @nb_samples) => vectors.av_audio_fifo_realloc(@af, @nb_samples); /// Reset the AVAudioFifo buffer. /// AVAudioFifo to reset public static void av_audio_fifo_reset(AVAudioFifo* @af) => vectors.av_audio_fifo_reset(@af); /// Get the current number of samples in the AVAudioFifo available for reading. /// the AVAudioFifo to query /// number of samples available for reading public static int av_audio_fifo_size(AVAudioFifo* @af) => vectors.av_audio_fifo_size(@af); /// Get the current number of samples in the AVAudioFifo available for writing. /// the AVAudioFifo to query /// number of samples available for writing public static int av_audio_fifo_space(AVAudioFifo* @af) => vectors.av_audio_fifo_space(@af); /// Write data to an AVAudioFifo. /// AVAudioFifo to write to /// audio data plane pointers /// number of samples to write /// number of samples actually written, or negative AVERROR code on failure. If successful, the number of samples actually written will always be nb_samples. public static int av_audio_fifo_write(AVAudioFifo* @af, void** @data, int @nb_samples) => vectors.av_audio_fifo_write(@af, @data, @nb_samples); /// 0th order modified bessel function of the first kind. public static double av_bessel_i0(double @x) => vectors.av_bessel_i0(@x); /// Allocate a context for a given bitstream filter. The caller must fill in the context parameters as described in the documentation and then call av_bsf_init() before sending any data to the filter. /// the filter for which to allocate an instance. /// a pointer into which the pointer to the newly-allocated context will be written. It must be freed with av_bsf_free() after the filtering is done. /// 0 on success, a negative AVERROR code on failure public static int av_bsf_alloc(AVBitStreamFilter* @filter, AVBSFContext** @ctx) => vectors.av_bsf_alloc(@filter, @ctx); /// Reset the internal bitstream filter state. Should be called e.g. when seeking. public static void av_bsf_flush(AVBSFContext* @ctx) => vectors.av_bsf_flush(@ctx); /// Free a bitstream filter context and everything associated with it; write NULL into the supplied pointer. public static void av_bsf_free(AVBSFContext** @ctx) => vectors.av_bsf_free(@ctx); /// Returns a bitstream filter with the specified name or NULL if no such bitstream filter exists. /// a bitstream filter with the specified name or NULL if no such bitstream filter exists. public static AVBitStreamFilter* av_bsf_get_by_name(string @name) => vectors.av_bsf_get_by_name(@name); /// Get the AVClass for AVBSFContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. public static AVClass* av_bsf_get_class() => vectors.av_bsf_get_class(); /// Get null/pass-through bitstream filter. /// Pointer to be set to new instance of pass-through bitstream filter public static int av_bsf_get_null_filter(AVBSFContext** @bsf) => vectors.av_bsf_get_null_filter(@bsf); /// Prepare the filter for use, after all the parameters and options have been set. /// a AVBSFContext previously allocated with av_bsf_alloc() public static int av_bsf_init(AVBSFContext* @ctx) => vectors.av_bsf_init(@ctx); /// Iterate over all registered bitstream filters. /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. /// the next registered bitstream filter or NULL when the iteration is finished public static AVBitStreamFilter* av_bsf_iterate(void** @opaque) => vectors.av_bsf_iterate(@opaque); /// Allocate empty list of bitstream filters. The list must be later freed by av_bsf_list_free() or finalized by av_bsf_list_finalize(). /// Pointer to on success, NULL in case of failure public static AVBSFList* av_bsf_list_alloc() => vectors.av_bsf_list_alloc(); /// Append bitstream filter to the list of bitstream filters. /// List to append to /// Filter context to be appended /// >=0 on success, negative AVERROR in case of failure public static int av_bsf_list_append(AVBSFList* @lst, AVBSFContext* @bsf) => vectors.av_bsf_list_append(@lst, @bsf); /// Construct new bitstream filter context given it's name and options and append it to the list of bitstream filters. /// List to append to /// Name of the bitstream filter /// Options for the bitstream filter, can be set to NULL /// >=0 on success, negative AVERROR in case of failure public static int av_bsf_list_append2(AVBSFList* @lst, string @bsf_name, AVDictionary** @options) => vectors.av_bsf_list_append2(@lst, @bsf_name, @options); /// Finalize list of bitstream filters. /// Filter list structure to be transformed /// Pointer to be set to newly created structure representing the chain of bitstream filters /// >=0 on success, negative AVERROR in case of failure public static int av_bsf_list_finalize(AVBSFList** @lst, AVBSFContext** @bsf) => vectors.av_bsf_list_finalize(@lst, @bsf); /// Free list of bitstream filters. /// Pointer to pointer returned by av_bsf_list_alloc() public static void av_bsf_list_free(AVBSFList** @lst) => vectors.av_bsf_list_free(@lst); /// Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters. Resulting AVBSFContext can be treated as any other AVBSFContext freshly allocated by av_bsf_alloc(). /// String describing chain of bitstream filters in format `bsf1[=opt1=val1:opt2=val2][,bsf2]` /// Pointer to be set to newly created structure representing the chain of bitstream filters /// >=0 on success, negative AVERROR in case of failure public static int av_bsf_list_parse_str(string @str, AVBSFContext** @bsf) => vectors.av_bsf_list_parse_str(@str, @bsf); /// Retrieve a filtered packet. /// an initialized AVBSFContext /// this struct will be filled with the contents of the filtered packet. It is owned by the caller and must be freed using av_packet_unref() when it is no longer needed. This parameter should be "clean" (i.e. freshly allocated with av_packet_alloc() or unreffed with av_packet_unref()) when this function is called. If this function returns successfully, the contents of pkt will be completely overwritten by the returned data. On failure, pkt is not touched. /// - 0 on success. - AVERROR(EAGAIN) if more packets need to be sent to the filter (using av_bsf_send_packet()) to get more output. - AVERROR_EOF if there will be no further output from the filter. - Another negative AVERROR value if an error occurs. public static int av_bsf_receive_packet(AVBSFContext* @ctx, AVPacket* @pkt) => vectors.av_bsf_receive_packet(@ctx, @pkt); /// Submit a packet for filtering. /// an initialized AVBSFContext /// the packet to filter. The bitstream filter will take ownership of the packet and reset the contents of pkt. pkt is not touched if an error occurs. If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero), it signals the end of the stream (i.e. no more non-empty packets will be sent; sending more empty packets does nothing) and will cause the filter to output any packets it may have buffered internally. /// - 0 on success. - AVERROR(EAGAIN) if packets need to be retrieved from the filter (using av_bsf_receive_packet()) before new input can be consumed. - Another negative AVERROR value if an error occurs. public static int av_bsf_send_packet(AVBSFContext* @ctx, AVPacket* @pkt) => vectors.av_bsf_send_packet(@ctx, @pkt); /// Allocate an AVBuffer of the given size using av_malloc(). /// an AVBufferRef of given size or NULL when out of memory public static AVBufferRef* av_buffer_alloc(ulong @size) => vectors.av_buffer_alloc(@size); /// Same as av_buffer_alloc(), except the returned buffer will be initialized to zero. public static AVBufferRef* av_buffer_allocz(ulong @size) => vectors.av_buffer_allocz(@size); /// Create an AVBuffer from an existing array. /// data array /// size of data in bytes /// a callback for freeing this buffer's data /// parameter to be got for processing or passed to free /// a combination of AV_BUFFER_FLAG_* /// an AVBufferRef referring to data on success, NULL on failure. public static AVBufferRef* av_buffer_create(byte* @data, ulong @size, av_buffer_create_free_func @free, void* @opaque, int @flags) => vectors.av_buffer_create(@data, @size, @free, @opaque, @flags); /// Default free callback, which calls av_free() on the buffer data. This function is meant to be passed to av_buffer_create(), not called directly. public static void av_buffer_default_free(void* @opaque, byte* @data) => vectors.av_buffer_default_free(@opaque, @data); /// Returns the opaque parameter set by av_buffer_create. /// the opaque parameter set by av_buffer_create. public static void* av_buffer_get_opaque(AVBufferRef* @buf) => vectors.av_buffer_get_opaque(@buf); public static int av_buffer_get_ref_count(AVBufferRef* @buf) => vectors.av_buffer_get_ref_count(@buf); /// Returns 1 if the caller may write to the data referred to by buf (which is true if and only if buf is the only reference to the underlying AVBuffer). Return 0 otherwise. A positive answer is valid until av_buffer_ref() is called on buf. /// 1 if the caller may write to the data referred to by buf (which is true if and only if buf is the only reference to the underlying AVBuffer). Return 0 otherwise. A positive answer is valid until av_buffer_ref() is called on buf. public static int av_buffer_is_writable(AVBufferRef* @buf) => vectors.av_buffer_is_writable(@buf); /// Create a writable reference from a given buffer reference, avoiding data copy if possible. /// buffer reference to make writable. On success, buf is either left untouched, or it is unreferenced and a new writable AVBufferRef is written in its place. On failure, buf is left untouched. /// 0 on success, a negative AVERROR on failure. public static int av_buffer_make_writable(AVBufferRef** @buf) => vectors.av_buffer_make_writable(@buf); /// Query the original opaque parameter of an allocated buffer in the pool. /// a buffer reference to a buffer returned by av_buffer_pool_get. /// the opaque parameter set by the buffer allocator function of the buffer pool. public static void* av_buffer_pool_buffer_get_opaque(AVBufferRef* @ref) => vectors.av_buffer_pool_buffer_get_opaque(@ref); /// Allocate a new AVBuffer, reusing an old buffer from the pool when available. This function may be called simultaneously from multiple threads. /// a reference to the new buffer on success, NULL on error. public static AVBufferRef* av_buffer_pool_get(AVBufferPool* @pool) => vectors.av_buffer_pool_get(@pool); /// Allocate and initialize a buffer pool. /// size of each buffer in this pool /// a function that will be used to allocate new buffers when the pool is empty. May be NULL, then the default allocator will be used (av_buffer_alloc()). /// newly created buffer pool on success, NULL on error. public static AVBufferPool* av_buffer_pool_init(ulong @size, av_buffer_pool_init_alloc_func @alloc) => vectors.av_buffer_pool_init(@size, @alloc); /// Allocate and initialize a buffer pool with a more complex allocator. /// size of each buffer in this pool /// arbitrary user data used by the allocator /// a function that will be used to allocate new buffers when the pool is empty. May be NULL, then the default allocator will be used (av_buffer_alloc()). /// a function that will be called immediately before the pool is freed. I.e. after av_buffer_pool_uninit() is called by the caller and all the frames are returned to the pool and freed. It is intended to uninitialize the user opaque data. May be NULL. /// newly created buffer pool on success, NULL on error. public static AVBufferPool* av_buffer_pool_init2(ulong @size, void* @opaque, av_buffer_pool_init2_alloc_func @alloc, av_buffer_pool_init2_pool_free_func @pool_free) => vectors.av_buffer_pool_init2(@size, @opaque, @alloc, @pool_free); /// Mark the pool as being available for freeing. It will actually be freed only once all the allocated buffers associated with the pool are released. Thus it is safe to call this function while some of the allocated buffers are still in use. /// pointer to the pool to be freed. It will be set to NULL. public static void av_buffer_pool_uninit(AVBufferPool** @pool) => vectors.av_buffer_pool_uninit(@pool); /// Reallocate a given buffer. /// a buffer reference to reallocate. On success, buf will be unreferenced and a new reference with the required size will be written in its place. On failure buf will be left untouched. *buf may be NULL, then a new buffer is allocated. /// required new buffer size. /// 0 on success, a negative AVERROR on failure. public static int av_buffer_realloc(AVBufferRef** @buf, ulong @size) => vectors.av_buffer_realloc(@buf, @size); /// Create a new reference to an AVBuffer. /// a new AVBufferRef referring to the same AVBuffer as buf or NULL on failure. public static AVBufferRef* av_buffer_ref(AVBufferRef* @buf) => vectors.av_buffer_ref(@buf); /// Ensure dst refers to the same data as src. /// Pointer to either a valid buffer reference or NULL. On success, this will point to a buffer reference equivalent to src. On failure, dst will be left untouched. /// A buffer reference to replace dst with. May be NULL, then this function is equivalent to av_buffer_unref(dst). /// 0 on success AVERROR(ENOMEM) on memory allocation failure. public static int av_buffer_replace(AVBufferRef** @dst, AVBufferRef* @src) => vectors.av_buffer_replace(@dst, @src); /// Free a given reference and automatically free the buffer if there are no more references to it. /// the reference to be freed. The pointer is set to NULL on return. public static void av_buffer_unref(AVBufferRef** @buf) => vectors.av_buffer_unref(@buf); public static int av_buffersink_get_ch_layout(AVFilterContext* @ctx, AVChannelLayout* @ch_layout) => vectors.av_buffersink_get_ch_layout(@ctx, @ch_layout); public static int av_buffersink_get_channels(AVFilterContext* @ctx) => vectors.av_buffersink_get_channels(@ctx); public static AVColorRange av_buffersink_get_color_range(AVFilterContext* @ctx) => vectors.av_buffersink_get_color_range(@ctx); public static AVColorSpace av_buffersink_get_colorspace(AVFilterContext* @ctx) => vectors.av_buffersink_get_colorspace(@ctx); public static int av_buffersink_get_format(AVFilterContext* @ctx) => vectors.av_buffersink_get_format(@ctx); /// Get a frame with filtered data from sink and put it in frame. /// pointer to a context of a buffersink or abuffersink AVFilter. /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() /// - >= 0 if a frame was successfully returned. - AVERROR(EAGAIN) if no frames are available at this point; more input frames must be added to the filtergraph to get more output. - AVERROR_EOF if there will be no more output frames on this sink. - A different negative AVERROR code in other failure cases. public static int av_buffersink_get_frame(AVFilterContext* @ctx, AVFrame* @frame) => vectors.av_buffersink_get_frame(@ctx, @frame); /// Get a frame with filtered data from sink and put it in frame. /// pointer to a buffersink or abuffersink filter context. /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() /// a combination of AV_BUFFERSINK_FLAG_* flags /// >= 0 in for success, a negative AVERROR code for failure. public static int av_buffersink_get_frame_flags(AVFilterContext* @ctx, AVFrame* @frame, int @flags) => vectors.av_buffersink_get_frame_flags(@ctx, @frame, @flags); public static AVRational av_buffersink_get_frame_rate(AVFilterContext* @ctx) => vectors.av_buffersink_get_frame_rate(@ctx); public static int av_buffersink_get_h(AVFilterContext* @ctx) => vectors.av_buffersink_get_h(@ctx); public static AVBufferRef* av_buffersink_get_hw_frames_ctx(AVFilterContext* @ctx) => vectors.av_buffersink_get_hw_frames_ctx(@ctx); public static AVRational av_buffersink_get_sample_aspect_ratio(AVFilterContext* @ctx) => vectors.av_buffersink_get_sample_aspect_ratio(@ctx); public static int av_buffersink_get_sample_rate(AVFilterContext* @ctx) => vectors.av_buffersink_get_sample_rate(@ctx); /// Same as av_buffersink_get_frame(), but with the ability to specify the number of samples read. This function is less efficient than av_buffersink_get_frame(), because it copies the data around. /// pointer to a context of the abuffersink AVFilter. /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() frame will contain exactly nb_samples audio samples, except at the end of stream, when it can contain less than nb_samples. /// The return codes have the same meaning as for av_buffersink_get_frame(). public static int av_buffersink_get_samples(AVFilterContext* @ctx, AVFrame* @frame, int @nb_samples) => vectors.av_buffersink_get_samples(@ctx, @frame, @nb_samples); public static AVRational av_buffersink_get_time_base(AVFilterContext* @ctx) => vectors.av_buffersink_get_time_base(@ctx); /// Get the properties of the stream @{ public static AVMediaType av_buffersink_get_type(AVFilterContext* @ctx) => vectors.av_buffersink_get_type(@ctx); public static int av_buffersink_get_w(AVFilterContext* @ctx) => vectors.av_buffersink_get_w(@ctx); /// Set the frame size for an audio buffer sink. public static void av_buffersink_set_frame_size(AVFilterContext* @ctx, uint @frame_size) => vectors.av_buffersink_set_frame_size(@ctx, @frame_size); /// Add a frame to the buffer source. /// an instance of the buffersrc filter /// frame to be added. If the frame is reference counted, this function will take ownership of the reference(s) and reset the frame. Otherwise the frame data will be copied. If this function returns an error, the input frame is not touched. /// 0 on success, a negative AVERROR on error. public static int av_buffersrc_add_frame(AVFilterContext* @ctx, AVFrame* @frame) => vectors.av_buffersrc_add_frame(@ctx, @frame); /// Add a frame to the buffer source. /// pointer to a buffer source context /// a frame, or NULL to mark EOF /// a combination of AV_BUFFERSRC_FLAG_* /// >= 0 in case of success, a negative AVERROR code in case of failure public static int av_buffersrc_add_frame_flags(AVFilterContext* @buffer_src, AVFrame* @frame, int @flags) => vectors.av_buffersrc_add_frame_flags(@buffer_src, @frame, @flags); /// Close the buffer source after EOF. public static int av_buffersrc_close(AVFilterContext* @ctx, long @pts, uint @flags) => vectors.av_buffersrc_close(@ctx, @pts, @flags); /// Get the number of failed requests. public static uint av_buffersrc_get_nb_failed_requests(AVFilterContext* @buffer_src) => vectors.av_buffersrc_get_nb_failed_requests(@buffer_src); /// Allocate a new AVBufferSrcParameters instance. It should be freed by the caller with av_free(). public static AVBufferSrcParameters* av_buffersrc_parameters_alloc() => vectors.av_buffersrc_parameters_alloc(); /// Initialize the buffersrc or abuffersrc filter with the provided parameters. This function may be called multiple times, the later calls override the previous ones. Some of the parameters may also be set through AVOptions, then whatever method is used last takes precedence. /// an instance of the buffersrc or abuffersrc filter /// the stream parameters. The frames later passed to this filter must conform to those parameters. All the allocated fields in param remain owned by the caller, libavfilter will make internal copies or references when necessary. /// 0 on success, a negative AVERROR code on failure. public static int av_buffersrc_parameters_set(AVFilterContext* @ctx, AVBufferSrcParameters* @param) => vectors.av_buffersrc_parameters_set(@ctx, @param); /// Add a frame to the buffer source. /// an instance of the buffersrc filter /// frame to be added. If the frame is reference counted, this function will make a new reference to it. Otherwise the frame data will be copied. /// 0 on success, a negative AVERROR on error public static int av_buffersrc_write_frame(AVFilterContext* @ctx, AVFrame* @frame) => vectors.av_buffersrc_write_frame(@ctx, @frame); /// Allocate a memory block for an array with av_mallocz(). /// Number of elements /// Size of the single element /// Pointer to the allocated block, or `NULL` if the block cannot be allocated public static void* av_calloc(ulong @nmemb, ulong @size) => vectors.av_calloc(@nmemb, @size); /// Get a human readable string describing a given channel. /// pre-allocated buffer where to put the generated string /// size in bytes of the buffer. /// the AVChannel whose description to get /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. public static int av_channel_description(byte* @buf, ulong @buf_size, AVChannel @channel) => vectors.av_channel_description(@buf, @buf_size, @channel); /// bprint variant of av_channel_description(). public static void av_channel_description_bprint(AVBPrint* @bp, AVChannel @channel_id) => vectors.av_channel_description_bprint(@bp, @channel_id); /// This is the inverse function of av_channel_name(). /// the channel with the given name AV_CHAN_NONE when name does not identify a known channel public static AVChannel av_channel_from_string(string @name) => vectors.av_channel_from_string(@name); /// Get the channel with the given index in a channel layout. /// input channel layout /// index of the channel /// channel with the index idx in channel_layout on success or AV_CHAN_NONE on failure (if idx is not valid or the channel order is unspecified) public static AVChannel av_channel_layout_channel_from_index(AVChannelLayout* @channel_layout, uint @idx) => vectors.av_channel_layout_channel_from_index(@channel_layout, @idx); /// Get a channel described by the given string. /// input channel layout /// string describing the channel to obtain /// a channel described by the given string in channel_layout on success or AV_CHAN_NONE on failure (if the string is not valid or the channel order is unspecified) public static AVChannel av_channel_layout_channel_from_string(AVChannelLayout* @channel_layout, string @name) => vectors.av_channel_layout_channel_from_string(@channel_layout, @name); /// Check whether a channel layout is valid, i.e. can possibly describe audio data. /// input channel layout /// 1 if channel_layout is valid, 0 otherwise. public static int av_channel_layout_check(AVChannelLayout* @channel_layout) => vectors.av_channel_layout_check(@channel_layout); /// Check whether two channel layouts are semantically the same, i.e. the same channels are present on the same positions in both. /// input channel layout /// input channel layout /// 0 if chl and chl1 are equal, 1 if they are not equal. A negative AVERROR code if one or both are invalid. public static int av_channel_layout_compare(AVChannelLayout* @chl, AVChannelLayout* @chl1) => vectors.av_channel_layout_compare(@chl, @chl1); /// Make a copy of a channel layout. This differs from just assigning src to dst in that it allocates and copies the map for AV_CHANNEL_ORDER_CUSTOM. /// destination channel layout /// source channel layout /// 0 on success, a negative AVERROR on error. public static int av_channel_layout_copy(AVChannelLayout* @dst, AVChannelLayout* @src) => vectors.av_channel_layout_copy(@dst, @src); /// Initialize a custom channel layout with the specified number of channels. The channel map will be allocated and the designation of all channels will be set to AV_CHAN_UNKNOWN. /// the layout structure to be initialized /// the number of channels /// 0 on success AVERROR(EINVAL) if the number of channels < = 0 AVERROR(ENOMEM) if the channel map could not be allocated public static int av_channel_layout_custom_init(AVChannelLayout* @channel_layout, int @nb_channels) => vectors.av_channel_layout_custom_init(@channel_layout, @nb_channels); /// Get the default channel layout for a given number of channels. /// the layout structure to be initialized /// number of channels public static void av_channel_layout_default(AVChannelLayout* @ch_layout, int @nb_channels) => vectors.av_channel_layout_default(@ch_layout, @nb_channels); /// Get a human-readable string describing the channel layout properties. The string will be in the same format that is accepted by av_channel_layout_from_string(), allowing to rebuild the same channel layout, except for opaque pointers. /// channel layout to be described /// pre-allocated buffer where to put the generated string /// size in bytes of the buffer. /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. public static int av_channel_layout_describe(AVChannelLayout* @channel_layout, byte* @buf, ulong @buf_size) => vectors.av_channel_layout_describe(@channel_layout, @buf, @buf_size); /// bprint variant of av_channel_layout_describe(). /// 0 on success, or a negative AVERROR value on failure. public static int av_channel_layout_describe_bprint(AVChannelLayout* @channel_layout, AVBPrint* @bp) => vectors.av_channel_layout_describe_bprint(@channel_layout, @bp); /// Initialize a native channel layout from a bitmask indicating which channels are present. /// the layout structure to be initialized /// bitmask describing the channel layout /// 0 on success AVERROR(EINVAL) for invalid mask values public static int av_channel_layout_from_mask(AVChannelLayout* @channel_layout, ulong @mask) => vectors.av_channel_layout_from_mask(@channel_layout, @mask); /// Initialize a channel layout from a given string description. The input string can be represented by: - the formal channel layout name (returned by av_channel_layout_describe()) - single or multiple channel names (returned by av_channel_name(), eg. "FL", or concatenated with "+", each optionally containing a custom name after a "", eg. "FL+FR+LFE") - a decimal or hexadecimal value of a native channel layout (eg. "4" or "0x4") - the number of channels with default layout (eg. "4c") - the number of unordered channels (eg. "4C" or "4 channels") - the ambisonic order followed by optional non-diegetic channels (eg. "ambisonic 2+stereo") On error, the channel layout will remain uninitialized, but not necessarily untouched. /// uninitialized channel layout for the result /// string describing the channel layout /// 0 on success parsing the channel layout AVERROR(EINVAL) if an invalid channel layout string was provided AVERROR(ENOMEM) if there was not enough memory public static int av_channel_layout_from_string(AVChannelLayout* @channel_layout, string @str) => vectors.av_channel_layout_from_string(@channel_layout, @str); /// Get the index of a given channel in a channel layout. In case multiple channels are found, only the first match will be returned. /// input channel layout /// the channel whose index to obtain /// index of channel in channel_layout on success or a negative number if channel is not present in channel_layout. public static int av_channel_layout_index_from_channel(AVChannelLayout* @channel_layout, AVChannel @channel) => vectors.av_channel_layout_index_from_channel(@channel_layout, @channel); /// Get the index in a channel layout of a channel described by the given string. In case multiple channels are found, only the first match will be returned. /// input channel layout /// string describing the channel whose index to obtain /// a channel index described by the given string, or a negative AVERROR value. public static int av_channel_layout_index_from_string(AVChannelLayout* @channel_layout, string @name) => vectors.av_channel_layout_index_from_string(@channel_layout, @name); /// Change the AVChannelOrder of a channel layout. /// channel layout which will be changed /// the desired channel layout order /// a combination of AV_CHANNEL_LAYOUT_RETYPE_FLAG_* constants /// 0 if the conversion was successful and lossless or if the channel layout was already in the desired order >0 if the conversion was successful but lossy AVERROR(ENOSYS) if the conversion was not possible (or would be lossy and AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS was specified) AVERROR(EINVAL), AVERROR(ENOMEM) on error public static int av_channel_layout_retype(AVChannelLayout* @channel_layout, AVChannelOrder @order, int @flags) => vectors.av_channel_layout_retype(@channel_layout, @order, @flags); /// Iterate over all standard channel layouts. /// a pointer where libavutil will store the iteration state. Must point to NULL to start the iteration. /// the standard channel layout or NULL when the iteration is finished public static AVChannelLayout* av_channel_layout_standard(void** @opaque) => vectors.av_channel_layout_standard(@opaque); /// Find out what channels from a given set are present in a channel layout, without regard for their positions. /// input channel layout /// a combination of AV_CH_* representing a set of channels /// a bitfield representing all the channels from mask that are present in channel_layout public static ulong av_channel_layout_subset(AVChannelLayout* @channel_layout, ulong @mask) => vectors.av_channel_layout_subset(@channel_layout, @mask); /// Free any allocated data in the channel layout and reset the channel count to 0. /// the layout structure to be uninitialized public static void av_channel_layout_uninit(AVChannelLayout* @channel_layout) => vectors.av_channel_layout_uninit(@channel_layout); /// Get a human readable string in an abbreviated form describing a given channel. This is the inverse function of av_channel_from_string(). /// pre-allocated buffer where to put the generated string /// size in bytes of the buffer. /// the AVChannel whose name to get /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. public static int av_channel_name(byte* @buf, ulong @buf_size, AVChannel @channel) => vectors.av_channel_name(@buf, @buf_size, @channel); /// bprint variant of av_channel_name(). public static void av_channel_name_bprint(AVBPrint* @bp, AVChannel @channel_id) => vectors.av_channel_name_bprint(@bp, @channel_id); /// Converts AVChromaLocation to swscale x/y chroma position. /// horizontal chroma sample position /// vertical chroma sample position public static int av_chroma_location_enum_to_pos(int* @xpos, int* @ypos, AVChromaLocation @pos) => vectors.av_chroma_location_enum_to_pos(@xpos, @ypos, @pos); /// Returns the AVChromaLocation value for name or an AVError if not found. /// the AVChromaLocation value for name or an AVError if not found. public static int av_chroma_location_from_name(string @name) => vectors.av_chroma_location_from_name(@name); /// Returns the name for provided chroma location or NULL if unknown. /// the name for provided chroma location or NULL if unknown. public static string av_chroma_location_name(AVChromaLocation @location) => vectors.av_chroma_location_name(@location); /// Converts swscale x/y chroma position to AVChromaLocation. /// horizontal chroma sample position /// vertical chroma sample position public static AVChromaLocation av_chroma_location_pos_to_enum(int @xpos, int @ypos) => vectors.av_chroma_location_pos_to_enum(@xpos, @ypos); /// Get the AVCodecID for the given codec tag tag. If no codec id is found returns AV_CODEC_ID_NONE. /// list of supported codec_id-codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag /// codec tag to match to a codec ID public static AVCodecID av_codec_get_id(AVCodecTag** @tags, uint @tag) => vectors.av_codec_get_id(@tags, @tag); /// Get the codec tag for the given codec id id. If no codec tag is found returns 0. /// list of supported codec_id-codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag /// codec ID to match to a codec tag public static uint av_codec_get_tag(AVCodecTag** @tags, AVCodecID @id) => vectors.av_codec_get_tag(@tags, @id); /// Get the codec tag for the given codec id. /// list of supported codec_id - codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag /// codec id that should be searched for in the list /// A pointer to the found tag /// 0 if id was not found in tags, > 0 if it was found public static int av_codec_get_tag2(AVCodecTag** @tags, AVCodecID @id, uint* @tag) => vectors.av_codec_get_tag2(@tags, @id, @tag); /// Returns a non-zero number if codec is a decoder, zero otherwise /// a non-zero number if codec is a decoder, zero otherwise public static int av_codec_is_decoder(AVCodec* @codec) => vectors.av_codec_is_decoder(@codec); /// Returns a non-zero number if codec is an encoder, zero otherwise /// a non-zero number if codec is an encoder, zero otherwise public static int av_codec_is_encoder(AVCodec* @codec) => vectors.av_codec_is_encoder(@codec); /// Iterate over all registered codecs. /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. /// the next registered codec or NULL when the iteration is finished public static AVCodec* av_codec_iterate(void** @opaque) => vectors.av_codec_iterate(@opaque); /// Returns the AVColorPrimaries value for name or an AVError if not found. /// the AVColorPrimaries value for name or an AVError if not found. public static int av_color_primaries_from_name(string @name) => vectors.av_color_primaries_from_name(@name); /// Returns the name for provided color primaries or NULL if unknown. /// the name for provided color primaries or NULL if unknown. public static string av_color_primaries_name(AVColorPrimaries @primaries) => vectors.av_color_primaries_name(@primaries); /// Returns the AVColorRange value for name or an AVError if not found. /// the AVColorRange value for name or an AVError if not found. public static int av_color_range_from_name(string @name) => vectors.av_color_range_from_name(@name); /// Returns the name for provided color range or NULL if unknown. /// the name for provided color range or NULL if unknown. public static string av_color_range_name(AVColorRange @range) => vectors.av_color_range_name(@range); /// Returns the AVColorSpace value for name or an AVError if not found. /// the AVColorSpace value for name or an AVError if not found. public static int av_color_space_from_name(string @name) => vectors.av_color_space_from_name(@name); /// Returns the name for provided color space or NULL if unknown. /// the name for provided color space or NULL if unknown. public static string av_color_space_name(AVColorSpace @space) => vectors.av_color_space_name(@space); /// Returns the AVColorTransferCharacteristic value for name or an AVError if not found. /// the AVColorTransferCharacteristic value for name or an AVError if not found. public static int av_color_transfer_from_name(string @name) => vectors.av_color_transfer_from_name(@name); /// Returns the name for provided color transfer or NULL if unknown. /// the name for provided color transfer or NULL if unknown. public static string av_color_transfer_name(AVColorTransferCharacteristic @transfer) => vectors.av_color_transfer_name(@transfer); /// Compare the remainders of two integer operands divided by a common divisor. /// Operand /// Operand /// Divisor; must be a power of 2 /// - a negative value if `a % mod < b % mod` - a positive value if `a % mod > b % mod` - zero if `a % mod == b % mod` public static long av_compare_mod(ulong @a, ulong @b, ulong @mod) => vectors.av_compare_mod(@a, @b, @mod); /// Compare two timestamps each in its own time base. /// One of the following values: - -1 if `ts_a` is before `ts_b` - 1 if `ts_a` is after `ts_b` - 0 if they represent the same position public static int av_compare_ts(long @ts_a, AVRational @tb_a, long @ts_b, AVRational @tb_b) => vectors.av_compare_ts(@ts_a, @tb_a, @ts_b, @tb_b); /// Allocate an AVContentLightMetadata structure and set its fields to default values. The resulting struct can be freed using av_freep(). /// An AVContentLightMetadata filled with default values or NULL on failure. public static AVContentLightMetadata* av_content_light_metadata_alloc(ulong* @size) => vectors.av_content_light_metadata_alloc(@size); /// Allocate a complete AVContentLightMetadata and add it to the frame. /// The frame which side data is added to. /// The AVContentLightMetadata structure to be filled by caller. public static AVContentLightMetadata* av_content_light_metadata_create_side_data(AVFrame* @frame) => vectors.av_content_light_metadata_create_side_data(@frame); /// Allocate a CPB properties structure and initialize its fields to default values. /// if non-NULL, the size of the allocated struct will be written here. This is useful for embedding it in side data. /// the newly allocated struct or NULL on failure public static AVCPBProperties* av_cpb_properties_alloc(ulong* @size) => vectors.av_cpb_properties_alloc(@size); /// Returns the number of logical CPU cores present. /// the number of logical CPU cores present. public static int av_cpu_count() => vectors.av_cpu_count(); /// Overrides cpu count detection and forces the specified count. Count < 1 disables forcing of specific count. public static void av_cpu_force_count(int @count) => vectors.av_cpu_force_count(@count); /// Get the maximum data alignment that may be required by leviathan. public static ulong av_cpu_max_align() => vectors.av_cpu_max_align(); /// Convert a double precision floating point number to a rational. /// `double` to convert /// Maximum allowed numerator and denominator /// `d` in AVRational form public static AVRational av_d2q(double @d, int @max) => vectors.av_d2q(@d, @max); /// Allocate an AVD3D11VAContext. /// Newly-allocated AVD3D11VAContext or NULL on failure. public static AVD3D11VAContext* av_d3d11va_alloc_context() => vectors.av_d3d11va_alloc_context(); public static AVClassCategory av_default_get_category(void* @ptr) => vectors.av_default_get_category(@ptr); /// Return the context name /// The AVClass context /// The AVClass class_name public static string av_default_item_name(void* @ctx) => vectors.av_default_item_name(@ctx); /// Iterate over all registered demuxers. /// a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. /// the next registered demuxer or NULL when the iteration is finished public static AVInputFormat* av_demuxer_iterate(void** @opaque) => vectors.av_demuxer_iterate(@opaque); /// Copy entries from one AVDictionary struct into another. /// Pointer to a pointer to a AVDictionary struct to copy into. If *dst is NULL, this function will allocate a struct for you and put it in *dst /// Pointer to the source AVDictionary struct to copy items from. /// Flags to use when setting entries in *dst /// 0 on success, negative AVERROR code on failure. If dst was allocated by this function, callers should free the associated memory. public static int av_dict_copy(AVDictionary** @dst, AVDictionary* @src, int @flags) => vectors.av_dict_copy(@dst, @src, @flags); /// Get number of entries in dictionary. /// dictionary /// number of entries in dictionary public static int av_dict_count(AVDictionary* @m) => vectors.av_dict_count(@m); /// Free all the memory allocated for an AVDictionary struct and all keys and values. public static void av_dict_free(AVDictionary** @m) => vectors.av_dict_free(@m); /// Get a dictionary entry with matching key. /// Matching key /// Set to the previous matching element to find the next. If set to NULL the first matching element is returned. /// A collection of AV_DICT_* flags controlling how the entry is retrieved /// Found entry or NULL in case no matching entry was found in the dictionary public static AVDictionaryEntry* av_dict_get(AVDictionary* @m, string @key, AVDictionaryEntry* @prev, int @flags) => vectors.av_dict_get(@m, @key, @prev, @flags); /// Get dictionary entries as a string. /// The dictionary /// Pointer to buffer that will be allocated with string containg entries. Buffer must be freed by the caller when is no longer needed. /// Character used to separate key from value /// Character used to separate two pairs from each other /// >= 0 on success, negative on error public static int av_dict_get_string(AVDictionary* @m, byte** @buffer, byte @key_val_sep, byte @pairs_sep) => vectors.av_dict_get_string(@m, @buffer, @key_val_sep, @pairs_sep); /// Iterate over a dictionary /// The dictionary to iterate over /// Pointer to the previous AVDictionaryEntry, NULL initially public static AVDictionaryEntry* av_dict_iterate(AVDictionary* @m, AVDictionaryEntry* @prev) => vectors.av_dict_iterate(@m, @prev); /// Parse the key/value pairs list and add the parsed entries to a dictionary. /// A 0-terminated list of characters used to separate key from value /// A 0-terminated list of characters used to separate two pairs from each other /// Flags to use when adding to the dictionary. ::AV_DICT_DONT_STRDUP_KEY and ::AV_DICT_DONT_STRDUP_VAL are ignored since the key/value tokens will always be duplicated. /// 0 on success, negative AVERROR code on failure public static int av_dict_parse_string(AVDictionary** @pm, string @str, string @key_val_sep, string @pairs_sep, int @flags) => vectors.av_dict_parse_string(@pm, @str, @key_val_sep, @pairs_sep, @flags); /// Set the given entry in *pm, overwriting an existing entry. /// Pointer to a pointer to a dictionary struct. If *pm is NULL a dictionary struct is allocated and put in *pm. /// Entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) /// Entry value to add to *pm (will be av_strduped or added as a new key depending on flags). Passing a NULL value will cause an existing entry to be deleted. /// >= 0 on success otherwise an error code < 0 public static int av_dict_set(AVDictionary** @pm, string @key, string @value, int @flags) => vectors.av_dict_set(@pm, @key, @value, @flags); /// Convenience wrapper for av_dict_set() that converts the value to a string and stores it. public static int av_dict_set_int(AVDictionary** @pm, string @key, long @value, int @flags) => vectors.av_dict_set_int(@pm, @key, @value, @flags); /// Flip the input matrix horizontally and/or vertically. /// a transformation matrix /// whether the matrix should be flipped horizontally /// whether the matrix should be flipped vertically public static void av_display_matrix_flip(ref int9 @matrix, int @hflip, int @vflip) => vectors.av_display_matrix_flip(ref @matrix, @hflip, @vflip); /// Extract the rotation component of the transformation matrix. /// the transformation matrix /// the angle (in degrees) by which the transformation rotates the frame counterclockwise. The angle will be in range [-180.0, 180.0], or NaN if the matrix is singular. public static double av_display_rotation_get(in int9 @matrix) => vectors.av_display_rotation_get(@matrix); /// Initialize a transformation matrix describing a pure clockwise rotation by the specified angle (in degrees). /// a transformation matrix (will be fully overwritten by this function) /// rotation angle in degrees. public static void av_display_rotation_set(ref int9 @matrix, double @angle) => vectors.av_display_rotation_set(ref @matrix, @angle); /// Returns The AV_DISPOSITION_* flag corresponding to disp or a negative error code if disp does not correspond to a known stream disposition. /// The AV_DISPOSITION_* flag corresponding to disp or a negative error code if disp does not correspond to a known stream disposition. public static int av_disposition_from_string(string @disp) => vectors.av_disposition_from_string(@disp); /// Returns The string description corresponding to the lowest set bit in disposition. NULL when the lowest set bit does not correspond to a known disposition or when disposition is 0. /// a combination of AV_DISPOSITION_* values /// The string description corresponding to the lowest set bit in disposition. NULL when the lowest set bit does not correspond to a known disposition or when disposition is 0. public static string av_disposition_to_string(int @disposition) => vectors.av_disposition_to_string(@disposition); /// Divide one rational by another. /// First rational /// Second rational /// b/c public static AVRational av_div_q(AVRational @b, AVRational @c) => vectors.av_div_q(@b, @c); /// Print detailed information about the input or output format, such as duration, bitrate, streams, container, programs, metadata, side data, codec and time base. /// the context to analyze /// index of the stream to dump information about /// the URL to print, such as source or destination file /// Select whether the specified context is an input(0) or output(1) public static void av_dump_format(AVFormatContext* @ic, int @index, string @url, int @is_output) => vectors.av_dump_format(@ic, @index, @url, @is_output); /// Allocate an AVDynamicHDRPlus structure and set its fields to default values. The resulting struct can be freed using av_freep(). /// An AVDynamicHDRPlus filled with default values or NULL on failure. public static AVDynamicHDRPlus* av_dynamic_hdr_plus_alloc(ulong* @size) => vectors.av_dynamic_hdr_plus_alloc(@size); /// Allocate a complete AVDynamicHDRPlus and add it to the frame. /// The frame which side data is added to. /// The AVDynamicHDRPlus structure to be filled by caller or NULL on failure. public static AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data(AVFrame* @frame) => vectors.av_dynamic_hdr_plus_create_side_data(@frame); /// Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). The T.35 buffer must begin with the application mode, skipping the country code, terminal provider codes, and application identifier. /// A pointer containing the decoded AVDynamicHDRPlus structure. /// The byte array containing the raw ITU-T T.35 data. /// Size of the data array in bytes. /// >= 0 on success. Otherwise, returns the appropriate AVERROR. public static int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus* @s, byte* @data, ulong @size) => vectors.av_dynamic_hdr_plus_from_t35(@s, @data, @size); /// Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, excluding the first 48 bytes of the header, and beginning with the application mode. /// A pointer containing the decoded AVDynamicHDRPlus structure. /// A pointer to pointer to a byte buffer to be filled with the serialized metadata. If *data is NULL, a buffer be will be allocated and a pointer to it stored in its place. The caller assumes ownership of the buffer. May be NULL, in which case the function will only store the required buffer size in *size. /// A pointer to a size to be set to the returned buffer's size. If *data is not NULL, *size must contain the size of the input buffer. May be NULL only if *data is NULL. /// >= 0 on success. Otherwise, returns the appropriate AVERROR. public static int av_dynamic_hdr_plus_to_t35(AVDynamicHDRPlus* @s, byte** @data, ulong* @size) => vectors.av_dynamic_hdr_plus_to_t35(@s, @data, @size); /// Add the pointer to an element to a dynamic array. /// Pointer to the array to grow /// Pointer to the number of elements in the array /// Element to add public static void av_dynarray_add(void* @tab_ptr, int* @nb_ptr, void* @elem) => vectors.av_dynarray_add(@tab_ptr, @nb_ptr, @elem); /// Add an element to a dynamic array. /// >=0 on success, negative otherwise public static int av_dynarray_add_nofree(void* @tab_ptr, int* @nb_ptr, void* @elem) => vectors.av_dynarray_add_nofree(@tab_ptr, @nb_ptr, @elem); /// Add an element of size `elem_size` to a dynamic array. /// Pointer to the array to grow /// Pointer to the number of elements in the array /// Size in bytes of an element in the array /// Pointer to the data of the element to add. If `NULL`, the space of the newly added element is allocated but left uninitialized. /// Pointer to the data of the element to copy in the newly allocated space public static void* av_dynarray2_add(void** @tab_ptr, int* @nb_ptr, ulong @elem_size, byte* @elem_data) => vectors.av_dynarray2_add(@tab_ptr, @nb_ptr, @elem_size, @elem_data); /// Allocate a buffer, reusing the given one if large enough. /// Pointer to pointer to an already allocated buffer. `*ptr` will be overwritten with pointer to new buffer on success or `NULL` on failure /// Pointer to the size of buffer `*ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. /// Desired minimal size of buffer `*ptr` public static void av_fast_malloc(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_malloc(@ptr, @size, @min_size); /// Allocate and clear a buffer, reusing the given one if large enough. /// Pointer to pointer to an already allocated buffer. `*ptr` will be overwritten with pointer to new buffer on success or `NULL` on failure /// Pointer to the size of buffer `*ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. /// Desired minimal size of buffer `*ptr` public static void av_fast_mallocz(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_mallocz(@ptr, @size, @min_size); /// Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0. public static void av_fast_padded_malloc(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_padded_malloc(@ptr, @size, @min_size); /// Same behaviour av_fast_padded_malloc except that buffer will always be 0-initialized after call. public static void av_fast_padded_mallocz(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_padded_mallocz(@ptr, @size, @min_size); /// Reallocate the given buffer if it is not large enough, otherwise do nothing. /// Already allocated buffer, or `NULL` /// Pointer to the size of buffer `ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. /// Desired minimal size of buffer `ptr` /// `ptr` if the buffer is large enough, a pointer to newly reallocated buffer if the buffer was not large enough, or `NULL` in case of error public static void* av_fast_realloc(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_realloc(@ptr, @size, @min_size); /// Read the file with name filename, and put its content in a newly allocated buffer or map it with mmap() when available. In case of success set *bufptr to the read or mmapped buffer, and *size to the size in bytes of the buffer in *bufptr. Unlike mmap this function succeeds with zero sized files, in this case *bufptr will be set to NULL and *size will be set to 0. The returned buffer must be released with av_file_unmap(). /// path to the file /// pointee is set to the mapped or allocated buffer /// pointee is set to the size in bytes of the buffer /// loglevel offset used for logging /// context used for logging /// a non negative number in case of success, a negative value corresponding to an AVERROR error code in case of failure public static int av_file_map(string @filename, byte** @bufptr, ulong* @size, int @log_offset, void* @log_ctx) => vectors.av_file_map(@filename, @bufptr, @size, @log_offset, @log_ctx); /// Unmap or free the buffer bufptr created by av_file_map(). /// the buffer previously created with av_file_map() /// size in bytes of bufptr, must be the same as returned by av_file_map() public static void av_file_unmap(byte* @bufptr, ulong @size) => vectors.av_file_unmap(@bufptr, @size); /// Check whether filename actually is a numbered sequence generator. /// possible numbered sequence string /// 1 if a valid numbered sequence string, 0 otherwise public static int av_filename_number_test(string @filename) => vectors.av_filename_number_test(@filename); /// Iterate over all registered filters. /// a pointer where libavfilter will store the iteration state. Must point to NULL to start the iteration. /// the next registered filter or NULL when the iteration is finished public static AVFilter* av_filter_iterate(void** @opaque) => vectors.av_filter_iterate(@opaque); /// Compute what kind of losses will occur when converting from one specific pixel format to another. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. av_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another. /// source pixel format /// Whether the source pixel format alpha channel is used. /// Combination of flags informing you what kind of losses will occur (maximum loss for an invalid dst_pix_fmt). public static AVPixelFormat av_find_best_pix_fmt_of_2(AVPixelFormat @dst_pix_fmt1, AVPixelFormat @dst_pix_fmt2, AVPixelFormat @src_pix_fmt, int @has_alpha, int* @loss_ptr) => vectors.av_find_best_pix_fmt_of_2(@dst_pix_fmt1, @dst_pix_fmt2, @src_pix_fmt, @has_alpha, @loss_ptr); public static int av_find_default_stream_index(AVFormatContext* @s) => vectors.av_find_default_stream_index(@s); /// Find AVInputFormat based on the short name of the input format. public static AVInputFormat* av_find_input_format(string @short_name) => vectors.av_find_input_format(@short_name); /// Find the value in a list of rationals nearest a given reference rational. /// Reference rational /// Array of rationals terminated by `{0, 0}` /// Index of the nearest value found in the array public static int av_find_nearest_q_idx(AVRational @q, AVRational* @q_list) => vectors.av_find_nearest_q_idx(@q, @q_list); /// Find the programs which belong to a given stream. /// media file handle /// the last found program, the search will start after this program, or from the beginning if it is NULL /// stream index /// the next program which belongs to s, NULL if no program is found or the last program is not among the programs of ic. public static AVProgram* av_find_program_from_stream(AVFormatContext* @ic, AVProgram* @last, int @s) => vectors.av_find_program_from_stream(@ic, @last, @s); /// Returns the method used to set ctx->duration. /// AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. [Obsolete("duration_estimation_method is public and can be read directly.")] public static AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(AVFormatContext* @ctx) => vectors.av_fmt_ctx_get_duration_estimation_method(@ctx); /// Disables cpu detection and forces the specified flags. -1 is a special case that disables forcing of specific flags. public static void av_force_cpu_flags(int @flags) => vectors.av_force_cpu_flags(@flags); /// This function will cause global side data to be injected in the next packet of each stream as well as after any subsequent seek. public static void av_format_inject_global_side_data(AVFormatContext* @s) => vectors.av_format_inject_global_side_data(@s); /// Fill the provided buffer with a string containing a FourCC (four-character code) representation. /// a buffer with size in bytes of at least AV_FOURCC_MAX_STRING_SIZE /// the fourcc to represent /// the buffer in input public static byte* av_fourcc_make_string(byte* @buf, uint @fourcc) => vectors.av_fourcc_make_string(@buf, @fourcc); /// Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ crop_bottom fields. If cropping is successful, the function will adjust the data pointers and the width/height fields, and set the crop fields to 0. /// the frame which should be cropped /// Some combination of AV_FRAME_CROP_* flags, or 0. /// >= 0 on success, a negative AVERROR on error. If the cropping fields were invalid, AVERROR(ERANGE) is returned, and nothing is changed. public static int av_frame_apply_cropping(AVFrame* @frame, int @flags) => vectors.av_frame_apply_cropping(@frame, @flags); /// Create a new frame that references the same data as src. /// newly created AVFrame on success, NULL on error. public static AVFrame* av_frame_clone(AVFrame* @src) => vectors.av_frame_clone(@src); /// Copy the frame data from src to dst. /// >= 0 on success, a negative AVERROR on error. public static int av_frame_copy(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_copy(@dst, @src); /// Copy only "metadata" fields from src to dst. public static int av_frame_copy_props(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_copy_props(@dst, @src); /// Allocate new buffer(s) for audio or video data. /// frame in which to store the new buffers. /// Required buffer size alignment. If equal to 0, alignment will be chosen automatically for the current CPU. It is highly recommended to pass 0 here unless you know what you are doing. /// 0 on success, a negative AVERROR on error. public static int av_frame_get_buffer(AVFrame* @frame, int @align) => vectors.av_frame_get_buffer(@frame, @align); /// Get the buffer reference a given data plane is stored in. /// the frame to get the plane's buffer from /// index of the data plane of interest in frame->extended_data. /// the buffer reference that contains the plane or NULL if the input frame is not valid. public static AVBufferRef* av_frame_get_plane_buffer(AVFrame* @frame, int @plane) => vectors.av_frame_get_plane_buffer(@frame, @plane); /// Returns a pointer to the side data of a given type on success, NULL if there is no side data with such type in this frame. /// a pointer to the side data of a given type on success, NULL if there is no side data with such type in this frame. public static AVFrameSideData* av_frame_get_side_data(AVFrame* @frame, AVFrameSideDataType @type) => vectors.av_frame_get_side_data(@frame, @type); /// Check if the frame data is writable. /// A positive value if the frame data is writable (which is true if and only if each of the underlying buffers has only one reference, namely the one stored in this frame). Return 0 otherwise. public static int av_frame_is_writable(AVFrame* @frame) => vectors.av_frame_is_writable(@frame); /// Ensure that the frame data is writable, avoiding data copy if possible. /// 0 on success, a negative AVERROR on error. public static int av_frame_make_writable(AVFrame* @frame) => vectors.av_frame_make_writable(@frame); /// Move everything contained in src to dst and reset src. public static void av_frame_move_ref(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_move_ref(@dst, @src); /// Add a new side data to a frame. /// a frame to which the side data should be added /// type of the added side data /// size of the side data /// newly added side data on success, NULL on error public static AVFrameSideData* av_frame_new_side_data(AVFrame* @frame, AVFrameSideDataType @type, ulong @size) => vectors.av_frame_new_side_data(@frame, @type, @size); /// Add a new side data to a frame from an existing AVBufferRef /// a frame to which the side data should be added /// the type of the added side data /// an AVBufferRef to add as side data. The ownership of the reference is transferred to the frame. /// newly added side data on success, NULL on error. On failure the frame is unchanged and the AVBufferRef remains owned by the caller. public static AVFrameSideData* av_frame_new_side_data_from_buf(AVFrame* @frame, AVFrameSideDataType @type, AVBufferRef* @buf) => vectors.av_frame_new_side_data_from_buf(@frame, @type, @buf); /// Set up a new reference to the data described by the source frame. /// 0 on success, a negative AVERROR on error public static int av_frame_ref(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_ref(@dst, @src); /// Remove and free all side data instances of the given type. public static void av_frame_remove_side_data(AVFrame* @frame, AVFrameSideDataType @type) => vectors.av_frame_remove_side_data(@frame, @type); /// Ensure the destination frame refers to the same data described by the source frame, either by creating a new reference for each AVBufferRef from src if they differ from those in dst, by allocating new buffers and copying data if src is not reference counted, or by unrefencing it if src is empty. /// 0 on success, a negative AVERROR on error. On error, dst is unreferenced. public static int av_frame_replace(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_replace(@dst, @src); /// Add a new side data entry to an array based on existing side data, taking a reference towards the contained AVBufferRef. /// pointer to array of side data to which to add another entry, or to NULL in order to start a new array. /// pointer to an integer containing the number of entries in the array. /// side data to be cloned, with a new reference utilized for the buffer. /// Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. /// negative error code on failure, >=0 on success. In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of matching AVFrameSideDataType will be removed before the addition is attempted. public static int av_frame_side_data_clone(AVFrameSideData*** @sd, int* @nb_sd, AVFrameSideData* @src, uint @flags) => vectors.av_frame_side_data_clone(@sd, @nb_sd, @src, @flags); /// Free all side data entries and their contents, then zeroes out the values which the pointers are pointing to. /// pointer to array of side data to free. Will be set to NULL upon return. /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. public static void av_frame_side_data_free(AVFrameSideData*** @sd, int* @nb_sd) => vectors.av_frame_side_data_free(@sd, @nb_sd); /// Get a side data entry of a specific type from an array. /// array of side data. /// integer containing the number of entries in the array. /// type of side data to be queried /// a pointer to the side data of a given type on success, NULL if there is no side data with such type in this set. public static AVFrameSideData* av_frame_side_data_get_c(AVFrameSideData** @sd, int @nb_sd, AVFrameSideDataType @type) => vectors.av_frame_side_data_get_c(@sd, @nb_sd, @type); /// Returns a string identifying the side data type /// a string identifying the side data type public static string av_frame_side_data_name(AVFrameSideDataType @type) => vectors.av_frame_side_data_name(@type); /// Add new side data entry to an array. /// pointer to array of side data to which to add another entry, or to NULL in order to start a new array. /// pointer to an integer containing the number of entries in the array. /// type of the added side data /// size of the side data /// Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. /// newly added side data on success, NULL on error. In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of matching AVFrameSideDataType will be removed before the addition is attempted. public static AVFrameSideData* av_frame_side_data_new(AVFrameSideData*** @sd, int* @nb_sd, AVFrameSideDataType @type, ulong @size, uint @flags) => vectors.av_frame_side_data_new(@sd, @nb_sd, @type, @size, @flags); /// Unreference all the buffers referenced by frame and reset the frame fields. public static void av_frame_unref(AVFrame* @frame) => vectors.av_frame_unref(@frame); /// Free a memory block which has been allocated with a function of av_malloc() or av_realloc() family, and set the pointer pointing to it to `NULL`. /// Pointer to the pointer to the memory block which should be freed public static void av_freep(void* @ptr) => vectors.av_freep(@ptr); /// Compute the greatest common divisor of two integer operands. /// Operand /// Operand /// GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; if a == 0 and b == 0, returns 0. public static long av_gcd(long @a, long @b) => vectors.av_gcd(@a, @b); /// Return the best rational so that a and b are multiple of it. If the resulting denominator is larger than max_den, return def. public static AVRational av_gcd_q(AVRational @a, AVRational @b, int @max_den, AVRational @def) => vectors.av_gcd_q(@a, @b, @max_den, @def); /// Return the planar<->packed alternative form of the given sample format, or AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the requested planar/packed format, the format returned is the same as the input. public static AVSampleFormat av_get_alt_sample_fmt(AVSampleFormat @sample_fmt, int @planar) => vectors.av_get_alt_sample_fmt(@sample_fmt, @planar); /// Return audio frame duration. /// codec context /// size of the frame, or 0 if unknown /// frame duration, in samples, if known. 0 if not able to determine. public static int av_get_audio_frame_duration(AVCodecContext* @avctx, int @frame_bytes) => vectors.av_get_audio_frame_duration(@avctx, @frame_bytes); /// This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters instead of an AVCodecContext. public static int av_get_audio_frame_duration2(AVCodecParameters* @par, int @frame_bytes) => vectors.av_get_audio_frame_duration2(@par, @frame_bytes); /// Return the number of bits per pixel used by the pixel format described by pixdesc. Note that this is not the same as the number of bits per sample. public static int av_get_bits_per_pixel(AVPixFmtDescriptor* @pixdesc) => vectors.av_get_bits_per_pixel(@pixdesc); /// Return codec bits per sample. /// the codec /// Number of bits per sample or zero if unknown for the given codec. public static int av_get_bits_per_sample(AVCodecID @codec_id) => vectors.av_get_bits_per_sample(@codec_id); /// Return number of bytes per sample. /// the sample format /// number of bytes per sample or zero if unknown for the given sample format public static int av_get_bytes_per_sample(AVSampleFormat @sample_fmt) => vectors.av_get_bytes_per_sample(@sample_fmt); /// Return the flags which specify extensions supported by the CPU. The returned value is affected by av_force_cpu_flags() if that was used before. So av_get_cpu_flags() can easily be used in an application to detect the enabled cpu flags. public static int av_get_cpu_flags() => vectors.av_get_cpu_flags(); /// Return codec bits per sample. Only return non-zero if the bits per sample is exactly correct, not an approximation. /// the codec /// Number of bits per sample or zero if unknown for the given codec. public static int av_get_exact_bits_per_sample(AVCodecID @codec_id) => vectors.av_get_exact_bits_per_sample(@codec_id); public static int av_get_frame_filename(byte* @buf, int @buf_size, string @path, int @number) => vectors.av_get_frame_filename(@buf, @buf_size, @path, @number); /// Return in 'buf' the path with '%d' replaced by a number. /// destination buffer /// destination buffer size /// numbered sequence string /// frame number /// AV_FRAME_FILENAME_FLAGS_* /// 0 if OK, -1 on format error public static int av_get_frame_filename2(byte* @buf, int @buf_size, string @path, int @number, int @flags) => vectors.av_get_frame_filename2(@buf, @buf_size, @path, @number, @flags); /// Return a string describing the media_type enum, NULL if media_type is unknown. public static string av_get_media_type_string(AVMediaType @media_type) => vectors.av_get_media_type_string(@media_type); /// Get timing information for the data currently output. The exact meaning of "currently output" depends on the format. It is mostly relevant for devices that have an internal buffer and/or work in real time. /// media file handle /// stream in the media file /// DTS of the last packet output for the stream, in stream time_base units /// absolute time when that packet whas output, in microsecond public static int av_get_output_timestamp(AVFormatContext* @s, int @stream, long* @dts, long* @wall) => vectors.av_get_output_timestamp(@s, @stream, @dts, @wall); /// Get the packed alternative form of the given sample format. /// the packed alternative form of the given sample format or AV_SAMPLE_FMT_NONE on error. public static AVSampleFormat av_get_packed_sample_fmt(AVSampleFormat @sample_fmt) => vectors.av_get_packed_sample_fmt(@sample_fmt); /// Allocate and read the payload of a packet and initialize its fields with default values. /// associated IO context /// packet /// desired payload size /// >0 (read size) if OK, AVERROR_xxx otherwise public static int av_get_packet(AVIOContext* @s, AVPacket* @pkt, int @size) => vectors.av_get_packet(@s, @pkt, @size); /// Return the number of bits per pixel for the pixel format described by pixdesc, including any padding or unused bits. public static int av_get_padded_bits_per_pixel(AVPixFmtDescriptor* @pixdesc) => vectors.av_get_padded_bits_per_pixel(@pixdesc); /// Return the PCM codec associated with a sample format. /// endianness, 0 for little, 1 for big, -1 (or anything else) for native /// AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE public static AVCodecID av_get_pcm_codec(AVSampleFormat @fmt, int @be) => vectors.av_get_pcm_codec(@fmt, @be); /// Return a single letter to describe the given picture type pict_type. /// the picture type /// a single character representing the picture type, '?' if pict_type is unknown public static byte av_get_picture_type_char(AVPictureType @pict_type) => vectors.av_get_picture_type_char(@pict_type); /// Return the pixel format corresponding to name. public static AVPixelFormat av_get_pix_fmt(string @name) => vectors.av_get_pix_fmt(@name); /// Compute what kind of losses will occur when converting from one specific pixel format to another. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. av_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another. /// destination pixel format /// source pixel format /// Whether the source pixel format alpha channel is used. /// Combination of flags informing you what kind of losses will occur (maximum loss for an invalid dst_pix_fmt). public static int av_get_pix_fmt_loss(AVPixelFormat @dst_pix_fmt, AVPixelFormat @src_pix_fmt, int @has_alpha) => vectors.av_get_pix_fmt_loss(@dst_pix_fmt, @src_pix_fmt, @has_alpha); /// Return the short name for a pixel format, NULL in case pix_fmt is unknown. public static string av_get_pix_fmt_name(AVPixelFormat @pix_fmt) => vectors.av_get_pix_fmt_name(@pix_fmt); /// Print in buf the string corresponding to the pixel format with number pix_fmt, or a header if pix_fmt is negative. /// the buffer where to write the string /// the size of buf /// the number of the pixel format to print the corresponding info string, or a negative value to print the corresponding header. public static byte* av_get_pix_fmt_string(byte* @buf, int @buf_size, AVPixelFormat @pix_fmt) => vectors.av_get_pix_fmt_string(@buf, @buf_size, @pix_fmt); /// Get the planar alternative form of the given sample format. /// the planar alternative form of the given sample format or AV_SAMPLE_FMT_NONE on error. public static AVSampleFormat av_get_planar_sample_fmt(AVSampleFormat @sample_fmt) => vectors.av_get_planar_sample_fmt(@sample_fmt); /// Return a name for the specified profile, if available. /// the codec that is searched for the given profile /// the profile value for which a name is requested /// A name for the profile if found, NULL otherwise. public static string av_get_profile_name(AVCodec* @codec, int @profile) => vectors.av_get_profile_name(@codec, @profile); /// Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error. public static AVSampleFormat av_get_sample_fmt(string @name) => vectors.av_get_sample_fmt(@name); /// Return the name of sample_fmt, or NULL if sample_fmt is not recognized. public static string av_get_sample_fmt_name(AVSampleFormat @sample_fmt) => vectors.av_get_sample_fmt_name(@sample_fmt); /// Generate a string corresponding to the sample format with sample_fmt, or a header if sample_fmt is negative. /// the buffer where to write the string /// the size of buf /// the number of the sample format to print the corresponding info string, or a negative value to print the corresponding header. /// the pointer to the filled buffer or NULL if sample_fmt is unknown or in case of other errors public static byte* av_get_sample_fmt_string(byte* @buf, int @buf_size, AVSampleFormat @sample_fmt) => vectors.av_get_sample_fmt_string(@buf, @buf_size, @sample_fmt); /// Return the fractional representation of the internal time base. public static AVRational av_get_time_base_q() => vectors.av_get_time_base_q(); /// Get the current time in microseconds. public static long av_gettime() => vectors.av_gettime(); /// Get the current time in microseconds since some unspecified starting point. On platforms that support it, the time comes from a monotonic clock This property makes this time source ideal for measuring relative time. The returned values may not be monotonic on platforms where a monotonic clock is not available. public static long av_gettime_relative() => vectors.av_gettime_relative(); /// Indicates with a boolean result if the av_gettime_relative() time source is monotonic. public static int av_gettime_relative_is_monotonic() => vectors.av_gettime_relative_is_monotonic(); /// Increase packet size, correctly zeroing padding /// packet /// number of bytes by which to increase the size of the packet public static int av_grow_packet(AVPacket* @pkt, int @grow_by) => vectors.av_grow_packet(@pkt, @grow_by); /// Guess the codec ID based upon muxer and filename. public static AVCodecID av_guess_codec(AVOutputFormat* @fmt, string @short_name, string @filename, string @mime_type, AVMediaType @type) => vectors.av_guess_codec(@fmt, @short_name, @filename, @mime_type, @type); /// Return the output format in the list of registered output formats which best matches the provided parameters, or return NULL if there is no match. /// if non-NULL checks if short_name matches with the names of the registered formats /// if non-NULL checks if filename terminates with the extensions of the registered formats /// if non-NULL checks if mime_type matches with the MIME type of the registered formats public static AVOutputFormat* av_guess_format(string @short_name, string @filename, string @mime_type) => vectors.av_guess_format(@short_name, @filename, @mime_type); /// Guess the frame rate, based on both the container and codec information. /// the format context which the stream is part of /// the stream which the frame is part of /// the frame for which the frame rate should be determined, may be NULL /// the guessed (valid) frame rate, 0/1 if no idea public static AVRational av_guess_frame_rate(AVFormatContext* @ctx, AVStream* @stream, AVFrame* @frame) => vectors.av_guess_frame_rate(@ctx, @stream, @frame); /// Guess the sample aspect ratio of a frame, based on both the stream and the frame aspect ratio. /// the format context which the stream is part of /// the stream which the frame is part of /// the frame with the aspect ratio to be determined /// the guessed (valid) sample_aspect_ratio, 0/1 if no idea public static AVRational av_guess_sample_aspect_ratio(AVFormatContext* @format, AVStream* @stream, AVFrame* @frame) => vectors.av_guess_sample_aspect_ratio(@format, @stream, @frame); /// Send a nice hexadecimal dump of a buffer to the specified file stream. /// The file stream pointer where the dump should be sent to. /// buffer /// buffer size public static void av_hex_dump(_iobuf* @f, byte* @buf, int @size) => vectors.av_hex_dump(@f, @buf, @size); /// Send a nice hexadecimal dump of a buffer to the log. /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. /// The importance level of the message, lower values signifying higher importance. /// buffer /// buffer size public static void av_hex_dump_log(void* @avcl, int @level, byte* @buf, int @size) => vectors.av_hex_dump_log(@avcl, @level, @buf, @size); /// Allocate an AVHWDeviceContext for a given hardware type. /// the type of the hardware device to allocate. /// a reference to the newly created AVHWDeviceContext on success or NULL on failure. public static AVBufferRef* av_hwdevice_ctx_alloc(AVHWDeviceType @type) => vectors.av_hwdevice_ctx_alloc(@type); /// Open a device of the specified type and create an AVHWDeviceContext for it. /// On success, a reference to the newly-created device context will be written here. The reference is owned by the caller and must be released with av_buffer_unref() when no longer needed. On failure, NULL will be written to this pointer. /// The type of the device to create. /// A type-specific string identifying the device to open. /// A dictionary of additional (type-specific) options to use in opening the device. The dictionary remains owned by the caller. /// currently unused /// 0 on success, a negative AVERROR code on failure. public static int av_hwdevice_ctx_create(AVBufferRef** @device_ctx, AVHWDeviceType @type, string @device, AVDictionary* @opts, int @flags) => vectors.av_hwdevice_ctx_create(@device_ctx, @type, @device, @opts, @flags); /// Create a new device of the specified type from an existing device. /// On success, a reference to the newly-created AVHWDeviceContext. /// The type of the new device to create. /// A reference to an existing AVHWDeviceContext which will be used to create the new device. /// Currently unused; should be set to zero. /// Zero on success, a negative AVERROR code on failure. public static int av_hwdevice_ctx_create_derived(AVBufferRef** @dst_ctx, AVHWDeviceType @type, AVBufferRef* @src_ctx, int @flags) => vectors.av_hwdevice_ctx_create_derived(@dst_ctx, @type, @src_ctx, @flags); /// Create a new device of the specified type from an existing device. /// On success, a reference to the newly-created AVHWDeviceContext. /// The type of the new device to create. /// A reference to an existing AVHWDeviceContext which will be used to create the new device. /// Options for the new device to create, same format as in av_hwdevice_ctx_create. /// Currently unused; should be set to zero. /// Zero on success, a negative AVERROR code on failure. public static int av_hwdevice_ctx_create_derived_opts(AVBufferRef** @dst_ctx, AVHWDeviceType @type, AVBufferRef* @src_ctx, AVDictionary* @options, int @flags) => vectors.av_hwdevice_ctx_create_derived_opts(@dst_ctx, @type, @src_ctx, @options, @flags); /// Finalize the device context before use. This function must be called after the context is filled with all the required information and before it is used in any way. /// a reference to the AVHWDeviceContext /// 0 on success, a negative AVERROR code on failure public static int av_hwdevice_ctx_init(AVBufferRef* @ref) => vectors.av_hwdevice_ctx_init(@ref); /// Look up an AVHWDeviceType by name. /// String name of the device type (case-insensitive). /// The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if not found. public static AVHWDeviceType av_hwdevice_find_type_by_name(string @name) => vectors.av_hwdevice_find_type_by_name(@name); /// Get the constraints on HW frames given a device and the HW-specific configuration to be used with that device. If no HW-specific configuration is provided, returns the maximum possible capabilities of the device. /// a reference to the associated AVHWDeviceContext. /// a filled HW-specific configuration structure, or NULL to return the maximum possible capabilities of the device. /// AVHWFramesConstraints structure describing the constraints on the device, or NULL if not available. public static AVHWFramesConstraints* av_hwdevice_get_hwframe_constraints(AVBufferRef* @ref, void* @hwconfig) => vectors.av_hwdevice_get_hwframe_constraints(@ref, @hwconfig); /// Get the string name of an AVHWDeviceType. /// Type from enum AVHWDeviceType. /// Pointer to a static string containing the name, or NULL if the type is not valid. public static string av_hwdevice_get_type_name(AVHWDeviceType @type) => vectors.av_hwdevice_get_type_name(@type); /// Allocate a HW-specific configuration structure for a given HW device. After use, the user must free all members as required by the specific hardware structure being used, then free the structure itself with av_free(). /// a reference to the associated AVHWDeviceContext. /// The newly created HW-specific configuration structure on success or NULL on failure. public static void* av_hwdevice_hwconfig_alloc(AVBufferRef* @device_ctx) => vectors.av_hwdevice_hwconfig_alloc(@device_ctx); /// Iterate over supported device types. /// AV_HWDEVICE_TYPE_NONE initially, then the previous type returned by this function in subsequent iterations. /// The next usable device type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if there are no more. public static AVHWDeviceType av_hwdevice_iterate_types(AVHWDeviceType @prev) => vectors.av_hwdevice_iterate_types(@prev); /// Free an AVHWFrameConstraints structure. /// The (filled or unfilled) AVHWFrameConstraints structure. public static void av_hwframe_constraints_free(AVHWFramesConstraints** @constraints) => vectors.av_hwframe_constraints_free(@constraints); /// Allocate an AVHWFramesContext tied to a given device context. /// a reference to a AVHWDeviceContext. This function will make a new reference for internal use, the one passed to the function remains owned by the caller. /// a reference to the newly created AVHWFramesContext on success or NULL on failure. public static AVBufferRef* av_hwframe_ctx_alloc(AVBufferRef* @device_ctx) => vectors.av_hwframe_ctx_alloc(@device_ctx); /// Create and initialise an AVHWFramesContext as a mapping of another existing AVHWFramesContext on a different device. /// On success, a reference to the newly created AVHWFramesContext. /// The AVPixelFormat for the derived context. /// A reference to the device to create the new AVHWFramesContext on. /// A reference to an existing AVHWFramesContext which will be mapped to the derived context. /// Some combination of AV_HWFRAME_MAP_* flags, defining the mapping parameters to apply to frames which are allocated in the derived device. /// Zero on success, negative AVERROR code on failure. public static int av_hwframe_ctx_create_derived(AVBufferRef** @derived_frame_ctx, AVPixelFormat @format, AVBufferRef* @derived_device_ctx, AVBufferRef* @source_frame_ctx, int @flags) => vectors.av_hwframe_ctx_create_derived(@derived_frame_ctx, @format, @derived_device_ctx, @source_frame_ctx, @flags); /// Finalize the context before use. This function must be called after the context is filled with all the required information and before it is attached to any frames. /// a reference to the AVHWFramesContext /// 0 on success, a negative AVERROR code on failure public static int av_hwframe_ctx_init(AVBufferRef* @ref) => vectors.av_hwframe_ctx_init(@ref); /// Allocate a new frame attached to the given AVHWFramesContext. /// a reference to an AVHWFramesContext /// an empty (freshly allocated or unreffed) frame to be filled with newly allocated buffers. /// currently unused, should be set to zero /// 0 on success, a negative AVERROR code on failure public static int av_hwframe_get_buffer(AVBufferRef* @hwframe_ctx, AVFrame* @frame, int @flags) => vectors.av_hwframe_get_buffer(@hwframe_ctx, @frame, @flags); /// Map a hardware frame. /// Destination frame, to contain the mapping. /// Source frame, to be mapped. /// Some combination of AV_HWFRAME_MAP_* flags. /// Zero on success, negative AVERROR code on failure. public static int av_hwframe_map(AVFrame* @dst, AVFrame* @src, int @flags) => vectors.av_hwframe_map(@dst, @src, @flags); /// Copy data to or from a hw surface. At least one of dst/src must have an AVHWFramesContext attached. /// the destination frame. dst is not touched on failure. /// the source frame. /// currently unused, should be set to zero /// 0 on success, a negative AVERROR error code on failure. public static int av_hwframe_transfer_data(AVFrame* @dst, AVFrame* @src, int @flags) => vectors.av_hwframe_transfer_data(@dst, @src, @flags); /// Get a list of possible source or target formats usable in av_hwframe_transfer_data(). /// the frame context to obtain the information for /// the direction of the transfer /// the pointer to the output format list will be written here. The list is terminated with AV_PIX_FMT_NONE and must be freed by the caller when no longer needed using av_free(). If this function returns successfully, the format list will have at least one item (not counting the terminator). On failure, the contents of this pointer are unspecified. /// currently unused, should be set to zero /// 0 on success, a negative AVERROR code on failure. public static int av_hwframe_transfer_get_formats(AVBufferRef* @hwframe_ctx, AVHWFrameTransferDirection @dir, AVPixelFormat** @formats, int @flags) => vectors.av_hwframe_transfer_get_formats(@hwframe_ctx, @dir, @formats, @flags); /// Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordingly. The allocated image buffer has to be freed by using av_freep(&pointers[0]). /// array to be filled with the pointer for each image plane /// the array filled with the linesize for each plane /// width of the image in pixels /// height of the image in pixels /// the AVPixelFormat of the image /// the value to use for buffer size alignment /// the size in bytes required for the image buffer, a negative error code in case of failure public static int av_image_alloc(ref byte_ptr4 @pointers, ref int4 @linesizes, int @w, int @h, AVPixelFormat @pix_fmt, int @align) => vectors.av_image_alloc(ref @pointers, ref @linesizes, @w, @h, @pix_fmt, @align); /// Check if the given sample aspect ratio of an image is valid. /// width of the image /// height of the image /// sample aspect ratio of the image /// 0 if valid, a negative AVERROR code otherwise public static int av_image_check_sar(uint @w, uint @h, AVRational @sar) => vectors.av_image_check_sar(@w, @h, @sar); /// Check if the given dimension of an image is valid, meaning that all bytes of the image can be addressed with a signed int. /// the width of the picture /// the height of the picture /// the offset to sum to the log level for logging with log_ctx /// the parent logging context, it may be NULL /// >= 0 if valid, a negative error code otherwise public static int av_image_check_size(uint @w, uint @h, int @log_offset, void* @log_ctx) => vectors.av_image_check_size(@w, @h, @log_offset, @log_ctx); /// Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with the specified pix_fmt can be addressed with a signed int. /// the width of the picture /// the height of the picture /// the maximum number of pixels the user wants to accept /// the pixel format, can be AV_PIX_FMT_NONE if unknown. /// the offset to sum to the log level for logging with log_ctx /// the parent logging context, it may be NULL /// >= 0 if valid, a negative error code otherwise public static int av_image_check_size2(uint @w, uint @h, long @max_pixels, AVPixelFormat @pix_fmt, int @log_offset, void* @log_ctx) => vectors.av_image_check_size2(@w, @h, @max_pixels, @pix_fmt, @log_offset, @log_ctx); /// Copy image in src_data to dst_data. /// destination image data buffer to copy to /// linesizes for the image in dst_data /// source image data buffer to copy from /// linesizes for the image in src_data /// the AVPixelFormat of the image /// width of the image in pixels /// height of the image in pixels public static void av_image_copy(ref byte_ptr4 @dst_data, in int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => vectors.av_image_copy(ref @dst_data, @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); /// Copy image plane from src to dst. That is, copy "height" number of lines of "bytewidth" bytes each. The first byte of each successive line is separated by *_linesize bytes. /// destination plane to copy to /// linesize for the image plane in dst /// source plane to copy from /// linesize for the image plane in src /// height (number of lines) of the plane public static void av_image_copy_plane(byte* @dst, int @dst_linesize, byte* @src, int @src_linesize, int @bytewidth, int @height) => vectors.av_image_copy_plane(@dst, @dst_linesize, @src, @src_linesize, @bytewidth, @height); /// Copy image data located in uncacheable (e.g. GPU mapped) memory. Where available, this function will use special functionality for reading from such memory, which may result in greatly improved performance compared to plain av_image_copy_plane(). public static void av_image_copy_plane_uc_from(byte* @dst, long @dst_linesize, byte* @src, long @src_linesize, long @bytewidth, int @height) => vectors.av_image_copy_plane_uc_from(@dst, @dst_linesize, @src, @src_linesize, @bytewidth, @height); /// Copy image data from an image into a buffer. /// a buffer into which picture data will be copied /// the size in bytes of dst /// pointers containing the source image data /// linesizes for the image in src_data /// the pixel format of the source image /// the width of the source image in pixels /// the height of the source image in pixels /// the assumed linesize alignment for dst /// the number of bytes written to dst, or a negative value (error code) on error public static int av_image_copy_to_buffer(byte* @dst, int @dst_size, in byte_ptr4 @src_data, in int4 @src_linesize, AVPixelFormat @pix_fmt, int @width, int @height, int @align) => vectors.av_image_copy_to_buffer(@dst, @dst_size, @src_data, @src_linesize, @pix_fmt, @width, @height, @align); /// Copy image data located in uncacheable (e.g. GPU mapped) memory. Where available, this function will use special functionality for reading from such memory, which may result in greatly improved performance compared to plain av_image_copy(). public static void av_image_copy_uc_from(ref byte_ptr4 @dst_data, in long4 @dst_linesizes, in byte_ptr4 @src_data, in long4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => vectors.av_image_copy_uc_from(ref @dst_data, @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); /// Setup the data pointers and linesizes based on the specified image parameters and the provided array. /// data pointers to be filled in /// linesizes for the image in dst_data to be filled in /// buffer which will contain or contains the actual image data, can be NULL /// the pixel format of the image /// the width of the image in pixels /// the height of the image in pixels /// the value used in src for linesize alignment /// the size in bytes required for src, a negative error code in case of failure public static int av_image_fill_arrays(ref byte_ptr4 @dst_data, ref int4 @dst_linesize, byte* @src, AVPixelFormat @pix_fmt, int @width, int @height, int @align) => vectors.av_image_fill_arrays(ref @dst_data, ref @dst_linesize, @src, @pix_fmt, @width, @height, @align); /// Overwrite the image data with black. This is suitable for filling a sub-rectangle of an image, meaning the padding between the right most pixel and the left most pixel on the next line will not be overwritten. For some formats, the image size might be rounded up due to inherent alignment. /// data pointers to destination image /// linesizes for the destination image /// the pixel format of the image /// the color range of the image (important for colorspaces such as YUV) /// the width of the image in pixels /// the height of the image in pixels /// 0 if the image data was cleared, a negative AVERROR code otherwise public static int av_image_fill_black(ref byte_ptr4 @dst_data, in long4 @dst_linesize, AVPixelFormat @pix_fmt, AVColorRange @range, int @width, int @height) => vectors.av_image_fill_black(ref @dst_data, @dst_linesize, @pix_fmt, @range, @width, @height); /// Overwrite the image data with a color. This is suitable for filling a sub-rectangle of an image, meaning the padding between the right most pixel and the left most pixel on the next line will not be overwritten. For some formats, the image size might be rounded up due to inherent alignment. /// data pointers to destination image /// linesizes for the destination image /// the pixel format of the image /// the color components to be used for the fill /// the width of the image in pixels /// the height of the image in pixels /// currently unused /// 0 if the image data was filled, a negative AVERROR code otherwise public static int av_image_fill_color(ref byte_ptr4 @dst_data, in long4 @dst_linesize, AVPixelFormat @pix_fmt, in uint4 @color, int @width, int @height, int @flags) => vectors.av_image_fill_color(ref @dst_data, @dst_linesize, @pix_fmt, @color, @width, @height, @flags); /// Fill plane linesizes for an image with pixel format pix_fmt and width width. /// array to be filled with the linesize for each plane /// the AVPixelFormat of the image /// width of the image in pixels /// >= 0 in case of success, a negative error code otherwise public static int av_image_fill_linesizes(ref int4 @linesizes, AVPixelFormat @pix_fmt, int @width) => vectors.av_image_fill_linesizes(ref @linesizes, @pix_fmt, @width); /// Compute the max pixel step for each plane of an image with a format described by pixdesc. /// an array which is filled with the max pixel step for each plane. Since a plane may contain different pixel components, the computed max_pixsteps[plane] is relative to the component in the plane with the max pixel step. /// an array which is filled with the component for each plane which has the max pixel step. May be NULL. /// the AVPixFmtDescriptor for the image, describing its format public static void av_image_fill_max_pixsteps(ref int4 @max_pixsteps, ref int4 @max_pixstep_comps, AVPixFmtDescriptor* @pixdesc) => vectors.av_image_fill_max_pixsteps(ref @max_pixsteps, ref @max_pixstep_comps, @pixdesc); /// Fill plane sizes for an image with pixel format pix_fmt and height height. /// the array to be filled with the size of each image plane /// the AVPixelFormat of the image /// height of the image in pixels /// the array containing the linesize for each plane, should be filled by av_image_fill_linesizes() /// >= 0 in case of success, a negative error code otherwise public static int av_image_fill_plane_sizes(ref ulong4 @size, AVPixelFormat @pix_fmt, int @height, in long4 @linesizes) => vectors.av_image_fill_plane_sizes(ref @size, @pix_fmt, @height, @linesizes); /// Fill plane data pointers for an image with pixel format pix_fmt and height height. /// pointers array to be filled with the pointer for each image plane /// the AVPixelFormat of the image /// height of the image in pixels /// the pointer to a buffer which will contain the image /// the array containing the linesize for each plane, should be filled by av_image_fill_linesizes() /// the size in bytes required for the image buffer, a negative error code in case of failure public static int av_image_fill_pointers(ref byte_ptr4 @data, AVPixelFormat @pix_fmt, int @height, byte* @ptr, in int4 @linesizes) => vectors.av_image_fill_pointers(ref @data, @pix_fmt, @height, @ptr, @linesizes); /// Compute the size of an image line with format pix_fmt and width width for the plane plane. /// the computed size in bytes public static int av_image_get_linesize(AVPixelFormat @pix_fmt, int @width, int @plane) => vectors.av_image_get_linesize(@pix_fmt, @width, @plane); /// Get the index for a specific timestamp. /// stream that the timestamp belongs to /// timestamp to retrieve the index for /// if AVSEEK_FLAG_BACKWARD then the returned index will correspond to the timestamp which is < = the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise /// < 0 if no such timestamp could be found public static int av_index_search_timestamp(AVStream* @st, long @timestamp, int @flags) => vectors.av_index_search_timestamp(@st, @timestamp, @flags); /// Initialize optional fields of a packet with default values. /// packet [Obsolete("This function is deprecated. Once it's removed, sizeof(AVPacket) will not be a part of the ABI anymore.")] public static void av_init_packet(AVPacket* @pkt) => vectors.av_init_packet(@pkt); /// Audio input devices iterator. public static AVInputFormat* av_input_audio_device_next(AVInputFormat* @d) => vectors.av_input_audio_device_next(@d); /// Video input devices iterator. public static AVInputFormat* av_input_video_device_next(AVInputFormat* @d) => vectors.av_input_video_device_next(@d); /// Compute the length of an integer list. /// size in bytes of each list element (only 1, 2, 4 or 8) /// pointer to the list /// list terminator (usually 0 or -1) /// length of the list, in elements, not counting the terminator public static uint av_int_list_length_for_size(uint @elsize, void* @list, ulong @term) => vectors.av_int_list_length_for_size(@elsize, @list, @term); /// Write a packet to an output media file ensuring correct interleaving. /// media file handle /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. /// 0 on success, a negative AVERROR on error. public static int av_interleaved_write_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_interleaved_write_frame(@s, @pkt); /// Write an uncoded frame to an output media file. /// >=0 for success, a negative code on error public static int av_interleaved_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame) => vectors.av_interleaved_write_uncoded_frame(@s, @stream_index, @frame); /// Send the specified message to the log if the level is less than or equal to the current av_log_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct or NULL if general log. /// The importance level of the message expressed using a "Logging Constant". /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. public static void av_log(void* @avcl, int @level, string @fmt) => vectors.av_log(@avcl, @level, @fmt); /// Default logging callback /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. /// The importance level of the message expressed using a "Logging Constant". /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. /// The arguments referenced by the format string. public static void av_log_default_callback(void* @avcl, int @level, string @fmt, byte* @vl) => vectors.av_log_default_callback(@avcl, @level, @fmt, @vl); /// Format a line of log the same way as the default callback. /// buffer to receive the formatted line /// size of the buffer /// used to store whether the prefix must be printed; must point to a persistent integer initially set to 1 public static void av_log_format_line(void* @ptr, int @level, string @fmt, byte* @vl, byte* @line, int @line_size, int* @print_prefix) => vectors.av_log_format_line(@ptr, @level, @fmt, @vl, @line, @line_size, @print_prefix); /// Format a line of log the same way as the default callback. /// buffer to receive the formatted line; may be NULL if line_size is 0 /// size of the buffer; at most line_size-1 characters will be written to the buffer, plus one null terminator /// used to store whether the prefix must be printed; must point to a persistent integer initially set to 1 /// Returns a negative value if an error occurred, otherwise returns the number of characters that would have been written for a sufficiently large buffer, not including the terminating null character. If the return value is not less than line_size, it means that the log message was truncated to fit the buffer. public static int av_log_format_line2(void* @ptr, int @level, string @fmt, byte* @vl, byte* @line, int @line_size, int* @print_prefix) => vectors.av_log_format_line2(@ptr, @level, @fmt, @vl, @line, @line_size, @print_prefix); public static int av_log_get_flags() => vectors.av_log_get_flags(); /// Get the current log level /// Current log level public static int av_log_get_level() => vectors.av_log_get_level(); /// Send the specified message to the log once with the initial_level and then with the subsequent_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct or NULL if general log. /// importance level of the message expressed using a "Logging Constant" for the first occurance. /// importance level of the message expressed using a "Logging Constant" after the first occurance. /// a variable to keep trak of if a message has already been printed this must be initialized to 0 before the first use. The same state must not be accessed by 2 Threads simultaneously. /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. public static void av_log_once(void* @avcl, int @initial_level, int @subsequent_level, int* @state, string @fmt) => vectors.av_log_once(@avcl, @initial_level, @subsequent_level, @state, @fmt); /// Set the logging callback /// A logging function with a compatible signature. public static void av_log_set_callback(av_log_set_callback_callback_func @callback) => vectors.av_log_set_callback(@callback); public static void av_log_set_flags(int @arg) => vectors.av_log_set_flags(@arg); /// Set the log level /// Logging level public static void av_log_set_level(int @level) => vectors.av_log_set_level(@level); public static int av_log2(uint @v) => vectors.av_log2(@v); public static int av_log2_16bit(uint @v) => vectors.av_log2_16bit(@v); /// Allocate a memory block for an array with av_malloc(). /// Number of element /// Size of a single element /// Pointer to the allocated block, or `NULL` if the block cannot be allocated public static void* av_malloc_array(ulong @nmemb, ulong @size) => vectors.av_malloc_array(@nmemb, @size); /// Allocate a memory block with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block. /// Size in bytes for the memory block to be allocated /// Pointer to the allocated block, or `NULL` if it cannot be allocated public static void* av_mallocz(ulong @size) => vectors.av_mallocz(@size); /// Allocate an AVMasteringDisplayMetadata structure and set its fields to default values. The resulting struct can be freed using av_freep(). /// An AVMasteringDisplayMetadata filled with default values or NULL on failure. public static AVMasteringDisplayMetadata* av_mastering_display_metadata_alloc() => vectors.av_mastering_display_metadata_alloc(); /// Allocate a complete AVMasteringDisplayMetadata and add it to the frame. /// The frame which side data is added to. /// The AVMasteringDisplayMetadata structure to be filled by caller. public static AVMasteringDisplayMetadata* av_mastering_display_metadata_create_side_data(AVFrame* @frame) => vectors.av_mastering_display_metadata_create_side_data(@frame); /// Return a positive value if the given filename has one of the given extensions, 0 otherwise. /// file name to check against the given extensions /// a comma-separated list of filename extensions public static int av_match_ext(string @filename, string @extensions) => vectors.av_match_ext(@filename, @extensions); /// Set the maximum size that may be allocated in one block. /// Value to be set as the new maximum size public static void av_max_alloc(ulong @max) => vectors.av_max_alloc(@max); /// Overlapping memcpy() implementation. /// Destination buffer /// Number of bytes back to start copying (i.e. the initial size of the overlapping window); must be > 0 /// Number of bytes to copy; must be >= 0 public static void av_memcpy_backptr(byte* @dst, int @back, int @cnt) => vectors.av_memcpy_backptr(@dst, @back, @cnt); /// Duplicate a buffer with av_malloc(). /// Buffer to be duplicated /// Size in bytes of the buffer copied /// Pointer to a newly allocated buffer containing a copy of `p` or `NULL` if the buffer cannot be allocated public static void* av_memdup(void* @p, ulong @size) => vectors.av_memdup(@p, @size); /// Multiply two rationals. /// First rational /// Second rational /// b*c public static AVRational av_mul_q(AVRational @b, AVRational @c) => vectors.av_mul_q(@b, @c); /// Iterate over all registered muxers. /// a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. /// the next registered muxer or NULL when the iteration is finished public static AVOutputFormat* av_muxer_iterate(void** @opaque) => vectors.av_muxer_iterate(@opaque); /// Find which of the two rationals is closer to another rational. /// Rational to be compared against /// Rational to be tested /// Rational to be tested /// One of the following values: - 1 if `q1` is nearer to `q` than `q2` - -1 if `q2` is nearer to `q` than `q1` - 0 if they have the same distance public static int av_nearer_q(AVRational @q, AVRational @q1, AVRational @q2) => vectors.av_nearer_q(@q, @q1, @q2); /// Allocate the payload of a packet and initialize its fields with default values. /// packet /// wanted payload size /// 0 if OK, AVERROR_xxx otherwise public static int av_new_packet(AVPacket* @pkt, int @size) => vectors.av_new_packet(@pkt, @size); public static AVProgram* av_new_program(AVFormatContext* @s, int @id) => vectors.av_new_program(@s, @id); /// Iterate over potential AVOptions-enabled children of parent. /// a pointer where iteration state is stored. /// AVClass corresponding to next potential child or NULL public static AVClass* av_opt_child_class_iterate(AVClass* @parent, void** @iter) => vectors.av_opt_child_class_iterate(@parent, @iter); /// Iterate over AVOptions-enabled children of obj. /// result of a previous call to this function or NULL /// next AVOptions-enabled child or NULL public static void* av_opt_child_next(void* @obj, void* @prev) => vectors.av_opt_child_next(@obj, @prev); /// Copy options from src object into dest object. /// Object to copy from /// Object to copy into /// 0 on success, negative on error public static int av_opt_copy(void* @dest, void* @src) => vectors.av_opt_copy(@dest, @src); public static int av_opt_eval_double(void* @obj, AVOption* @o, string @val, double* @double_out) => vectors.av_opt_eval_double(@obj, @o, @val, @double_out); /// @{ This group of functions can be used to evaluate option strings and get numbers out of them. They do the same thing as av_opt_set(), except the result is written into the caller-supplied pointer. /// a struct whose first element is a pointer to AVClass. /// an option for which the string is to be evaluated. /// string to be evaluated. /// 0 on success, a negative number on failure. public static int av_opt_eval_flags(void* @obj, AVOption* @o, string @val, int* @flags_out) => vectors.av_opt_eval_flags(@obj, @o, @val, @flags_out); public static int av_opt_eval_float(void* @obj, AVOption* @o, string @val, float* @float_out) => vectors.av_opt_eval_float(@obj, @o, @val, @float_out); public static int av_opt_eval_int(void* @obj, AVOption* @o, string @val, int* @int_out) => vectors.av_opt_eval_int(@obj, @o, @val, @int_out); public static int av_opt_eval_int64(void* @obj, AVOption* @o, string @val, long* @int64_out) => vectors.av_opt_eval_int64(@obj, @o, @val, @int64_out); public static int av_opt_eval_q(void* @obj, AVOption* @o, string @val, AVRational* @q_out) => vectors.av_opt_eval_q(@obj, @o, @val, @q_out); /// Look for an option in an object. Consider only options which have all the specified flags set. /// A pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set. /// The name of the option to look for. /// When searching for named constants, name of the unit it belongs to. /// Find only options with all the specified flags set (AV_OPT_FLAG). /// A combination of AV_OPT_SEARCH_*. /// A pointer to the option found, or NULL if no option was found. public static AVOption* av_opt_find(void* @obj, string @name, string @unit, int @opt_flags, int @search_flags) => vectors.av_opt_find(@obj, @name, @unit, @opt_flags, @search_flags); /// Look for an option in an object. Consider only options which have all the specified flags set. /// A pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set. /// The name of the option to look for. /// When searching for named constants, name of the unit it belongs to. /// Find only options with all the specified flags set (AV_OPT_FLAG). /// A combination of AV_OPT_SEARCH_*. /// if non-NULL, an object to which the option belongs will be written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present in search_flags. This parameter is ignored if search_flags contain AV_OPT_SEARCH_FAKE_OBJ. /// A pointer to the option found, or NULL if no option was found. public static AVOption* av_opt_find2(void* @obj, string @name, string @unit, int @opt_flags, int @search_flags, void** @target_obj) => vectors.av_opt_find2(@obj, @name, @unit, @opt_flags, @search_flags, @target_obj); /// Check whether a particular flag is set in a flags field. /// the name of the flag field option /// the name of the flag to check /// non-zero if the flag is set, zero if the flag isn't set, isn't of the right type, or the flags field doesn't exist. public static int av_opt_flag_is_set(void* @obj, string @field_name, string @flag_name) => vectors.av_opt_flag_is_set(@obj, @field_name, @flag_name); /// Free all allocated objects in obj. public static void av_opt_free(void* @obj) => vectors.av_opt_free(@obj); /// Free an AVOptionRanges struct and set it to NULL. public static void av_opt_freep_ranges(AVOptionRanges** @ranges) => vectors.av_opt_freep_ranges(@ranges); /// @{ Those functions get a value of the option with the given name from an object. /// a struct whose first element is a pointer to an AVClass. /// name of the option to get. /// flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be found in a child of obj. /// value of the option will be written here /// >=0 on success, a negative error code otherwise public static int av_opt_get(void* @obj, string @name, int @search_flags, byte** @out_val) => vectors.av_opt_get(@obj, @name, @search_flags, @out_val); public static int av_opt_get_chlayout(void* @obj, string @name, int @search_flags, AVChannelLayout* @layout) => vectors.av_opt_get_chlayout(@obj, @name, @search_flags, @layout); /// The returned dictionary is a copy of the actual value and must be freed with av_dict_free() by the caller public static int av_opt_get_dict_val(void* @obj, string @name, int @search_flags, AVDictionary** @out_val) => vectors.av_opt_get_dict_val(@obj, @name, @search_flags, @out_val); public static int av_opt_get_double(void* @obj, string @name, int @search_flags, double* @out_val) => vectors.av_opt_get_double(@obj, @name, @search_flags, @out_val); public static int av_opt_get_image_size(void* @obj, string @name, int @search_flags, int* @w_out, int* @h_out) => vectors.av_opt_get_image_size(@obj, @name, @search_flags, @w_out, @h_out); public static int av_opt_get_int(void* @obj, string @name, int @search_flags, long* @out_val) => vectors.av_opt_get_int(@obj, @name, @search_flags, @out_val); /// Extract a key-value pair from the beginning of a string. /// pointer to the options string, will be updated to point to the rest of the string (one of the pairs_sep or the final NUL) /// a 0-terminated list of characters used to separate key from value, for example '=' /// a 0-terminated list of characters used to separate two pairs from each other, for example ':' or ',' /// flags; see the AV_OPT_FLAG_* values below /// parsed key; must be freed using av_free() /// parsed value; must be freed using av_free() /// >=0 for success, or a negative value corresponding to an AVERROR code in case of error; in particular: AVERROR(EINVAL) if no key is present public static int av_opt_get_key_value(byte** @ropts, string @key_val_sep, string @pairs_sep, uint @flags, byte** @rkey, byte** @rval) => vectors.av_opt_get_key_value(@ropts, @key_val_sep, @pairs_sep, @flags, @rkey, @rval); public static int av_opt_get_pixel_fmt(void* @obj, string @name, int @search_flags, AVPixelFormat* @out_fmt) => vectors.av_opt_get_pixel_fmt(@obj, @name, @search_flags, @out_fmt); public static int av_opt_get_q(void* @obj, string @name, int @search_flags, AVRational* @out_val) => vectors.av_opt_get_q(@obj, @name, @search_flags, @out_val); public static int av_opt_get_sample_fmt(void* @obj, string @name, int @search_flags, AVSampleFormat* @out_fmt) => vectors.av_opt_get_sample_fmt(@obj, @name, @search_flags, @out_fmt); public static int av_opt_get_video_rate(void* @obj, string @name, int @search_flags, AVRational* @out_val) => vectors.av_opt_get_video_rate(@obj, @name, @search_flags, @out_val); /// Check if given option is set to its default value. /// AVClass object to check option on /// option to be checked /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error public static int av_opt_is_set_to_default(void* @obj, AVOption* @o) => vectors.av_opt_is_set_to_default(@obj, @o); /// Check if given option is set to its default value. /// AVClass object to check option on /// option name /// combination of AV_OPT_SEARCH_* /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error public static int av_opt_is_set_to_default_by_name(void* @obj, string @name, int @search_flags) => vectors.av_opt_is_set_to_default_by_name(@obj, @name, @search_flags); /// Iterate over all AVOptions belonging to obj. /// an AVOptions-enabled struct or a double pointer to an AVClass describing it. /// result of the previous call to av_opt_next() on this object or NULL /// next AVOption or NULL public static AVOption* av_opt_next(void* @obj, AVOption* @prev) => vectors.av_opt_next(@obj, @prev); /// Gets a pointer to the requested field in a struct. This function allows accessing a struct even when its fields are moved or renamed since the application making the access has been compiled, public static void* av_opt_ptr(AVClass* @avclass, void* @obj, string @name) => vectors.av_opt_ptr(@avclass, @obj, @name); /// Get a list of allowed ranges for the given option. /// is a bitmask of flags, undefined flags should not be set and should be ignored AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, /// number of compontents returned on success, a negative errro code otherwise public static int av_opt_query_ranges(AVOptionRanges** @p0, void* @obj, string @key, int @flags) => vectors.av_opt_query_ranges(@p0, @obj, @key, @flags); /// Get a default list of allowed ranges for the given option. /// is a bitmask of flags, undefined flags should not be set and should be ignored AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, /// number of compontents returned on success, a negative errro code otherwise public static int av_opt_query_ranges_default(AVOptionRanges** @p0, void* @obj, string @key, int @flags) => vectors.av_opt_query_ranges_default(@p0, @obj, @key, @flags); /// Serialize object's options. /// AVClass object to serialize /// serialize options with all the specified flags set (AV_OPT_FLAG) /// combination of AV_OPT_SERIALIZE_* flags /// Pointer to buffer that will be allocated with string containg serialized options. Buffer must be freed by the caller when is no longer needed. /// character used to separate key from value /// character used to separate two pairs from each other /// >= 0 on success, negative on error public static int av_opt_serialize(void* @obj, int @opt_flags, int @flags, byte** @buffer, byte @key_val_sep, byte @pairs_sep) => vectors.av_opt_serialize(@obj, @opt_flags, @flags, @buffer, @key_val_sep, @pairs_sep); /// @{ Those functions set the field of obj with the given name to value. /// A struct whose first element is a pointer to an AVClass. /// the name of the field to set /// The value to set. In case of av_opt_set() if the field is not of a string type, then the given string is parsed. SI postfixes and some named scalars are supported. If the field is of a numeric type, it has to be a numeric or named scalar. Behavior with more than one scalar and +- infix operators is undefined. If the field is of a flags type, it has to be a sequence of numeric scalars or named flags separated by '+' or '-'. Prefixing a flag with '+' causes it to be set without affecting the other flags; similarly, '-' unsets a flag. If the field is of a dictionary type, it has to be a ':' separated list of key=value parameters. Values containing ':' special characters must be escaped. /// flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be set on a child of obj. /// 0 if the value has been set, or an AVERROR code in case of error: AVERROR_OPTION_NOT_FOUND if no matching option exists AVERROR(ERANGE) if the value is out of range AVERROR(EINVAL) if the value is not valid public static int av_opt_set(void* @obj, string @name, string @val, int @search_flags) => vectors.av_opt_set(@obj, @name, @val, @search_flags); public static int av_opt_set_bin(void* @obj, string @name, byte* @val, int @size, int @search_flags) => vectors.av_opt_set_bin(@obj, @name, @val, @size, @search_flags); public static int av_opt_set_chlayout(void* @obj, string @name, AVChannelLayout* @layout, int @search_flags) => vectors.av_opt_set_chlayout(@obj, @name, @layout, @search_flags); /// Set the values of all AVOption fields to their default values. /// an AVOption-enabled struct (its first member must be a pointer to AVClass) public static void av_opt_set_defaults(void* @s) => vectors.av_opt_set_defaults(@s); /// Set the values of all AVOption fields to their default values. Only these AVOption fields for which (opt->flags & mask) == flags will have their default applied to s. /// an AVOption-enabled struct (its first member must be a pointer to AVClass) /// combination of AV_OPT_FLAG_* /// combination of AV_OPT_FLAG_* public static void av_opt_set_defaults2(void* @s, int @mask, int @flags) => vectors.av_opt_set_defaults2(@s, @mask, @flags); /// Set all the options from a given dictionary on an object. /// a struct whose first element is a pointer to AVClass /// options to process. This dictionary will be freed and replaced by a new one containing all options not found in obj. Of course this new dictionary needs to be freed by caller with av_dict_free(). /// 0 on success, a negative AVERROR if some option was found in obj, but could not be set. public static int av_opt_set_dict(void* @obj, AVDictionary** @options) => vectors.av_opt_set_dict(@obj, @options); public static int av_opt_set_dict_val(void* @obj, string @name, AVDictionary* @val, int @search_flags) => vectors.av_opt_set_dict_val(@obj, @name, @val, @search_flags); /// Set all the options from a given dictionary on an object. /// a struct whose first element is a pointer to AVClass /// options to process. This dictionary will be freed and replaced by a new one containing all options not found in obj. Of course this new dictionary needs to be freed by caller with av_dict_free(). /// A combination of AV_OPT_SEARCH_*. /// 0 on success, a negative AVERROR if some option was found in obj, but could not be set. public static int av_opt_set_dict2(void* @obj, AVDictionary** @options, int @search_flags) => vectors.av_opt_set_dict2(@obj, @options, @search_flags); public static int av_opt_set_double(void* @obj, string @name, double @val, int @search_flags) => vectors.av_opt_set_double(@obj, @name, @val, @search_flags); /// Parse the key-value pairs list in opts. For each key=value pair found, set the value of the corresponding option in ctx. /// the AVClass object to set options on /// the options string, key-value pairs separated by a delimiter /// a NULL-terminated array of options names for shorthand notation: if the first field in opts has no key part, the key is taken from the first element of shorthand; then again for the second, etc., until either opts is finished, shorthand is finished or a named option is found; after that, all options must be named /// a 0-terminated list of characters used to separate key from value, for example '=' /// a 0-terminated list of characters used to separate two pairs from each other, for example ':' or ',' /// the number of successfully set key=value pairs, or a negative value corresponding to an AVERROR code in case of error: AVERROR(EINVAL) if opts cannot be parsed, the error code issued by av_set_string3() if a key/value pair cannot be set public static int av_opt_set_from_string(void* @ctx, string @opts, byte** @shorthand, string @key_val_sep, string @pairs_sep) => vectors.av_opt_set_from_string(@ctx, @opts, @shorthand, @key_val_sep, @pairs_sep); public static int av_opt_set_image_size(void* @obj, string @name, int @w, int @h, int @search_flags) => vectors.av_opt_set_image_size(@obj, @name, @w, @h, @search_flags); public static int av_opt_set_int(void* @obj, string @name, long @val, int @search_flags) => vectors.av_opt_set_int(@obj, @name, @val, @search_flags); public static int av_opt_set_pixel_fmt(void* @obj, string @name, AVPixelFormat @fmt, int @search_flags) => vectors.av_opt_set_pixel_fmt(@obj, @name, @fmt, @search_flags); public static int av_opt_set_q(void* @obj, string @name, AVRational @val, int @search_flags) => vectors.av_opt_set_q(@obj, @name, @val, @search_flags); public static int av_opt_set_sample_fmt(void* @obj, string @name, AVSampleFormat @fmt, int @search_flags) => vectors.av_opt_set_sample_fmt(@obj, @name, @fmt, @search_flags); public static int av_opt_set_video_rate(void* @obj, string @name, AVRational @val, int @search_flags) => vectors.av_opt_set_video_rate(@obj, @name, @val, @search_flags); /// Show the obj options. /// log context to use for showing the options /// requested flags for the options to show. Show only the options for which it is opt->flags & req_flags. /// rejected flags for the options to show. Show only the options for which it is !(opt->flags & req_flags). public static int av_opt_show2(void* @obj, void* @av_log_obj, int @req_flags, int @rej_flags) => vectors.av_opt_show2(@obj, @av_log_obj, @req_flags, @rej_flags); /// Audio output devices iterator. public static AVOutputFormat* av_output_audio_device_next(AVOutputFormat* @d) => vectors.av_output_audio_device_next(@d); /// Video output devices iterator. public static AVOutputFormat* av_output_video_device_next(AVOutputFormat* @d) => vectors.av_output_video_device_next(@d); /// Wrap an existing array as a packet side data. /// packet /// side information type /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to pkt. /// side information size /// a non-negative number on success, a negative AVERROR code on failure. On failure, the packet is unchanged and the data remains owned by the caller. public static int av_packet_add_side_data(AVPacket* @pkt, AVPacketSideDataType @type, byte* @data, ulong @size) => vectors.av_packet_add_side_data(@pkt, @type, @data, @size); /// Create a new packet that references the same data as src. /// newly created AVPacket on success, NULL on error. public static AVPacket* av_packet_clone(AVPacket* @src) => vectors.av_packet_clone(@src); /// Copy only "properties" fields from src to dst. /// Destination packet /// Source packet /// 0 on success AVERROR on failure. public static int av_packet_copy_props(AVPacket* @dst, AVPacket* @src) => vectors.av_packet_copy_props(@dst, @src); /// Convenience function to free all the side data stored. All the other fields stay untouched. /// packet public static void av_packet_free_side_data(AVPacket* @pkt) => vectors.av_packet_free_side_data(@pkt); /// Initialize a reference-counted packet from av_malloc()ed data. /// packet to be initialized. This function will set the data, size, and buf fields, all others are left untouched. /// Data allocated by av_malloc() to be used as packet data. If this function returns successfully, the data is owned by the underlying AVBuffer. The caller may not access the data through other means. /// size of data in bytes, without the padding. I.e. the full buffer size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. /// 0 on success, a negative AVERROR on error public static int av_packet_from_data(AVPacket* @pkt, byte* @data, int @size) => vectors.av_packet_from_data(@pkt, @data, @size); /// Get side information from packet. /// packet /// desired side information type /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. /// pointer to data if present or NULL otherwise public static byte* av_packet_get_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong* @size) => vectors.av_packet_get_side_data(@pkt, @type, @size); /// Ensure the data described by a given packet is reference counted. /// packet whose data should be made reference counted. /// 0 on success, a negative AVERROR on error. On failure, the packet is unchanged. public static int av_packet_make_refcounted(AVPacket* @pkt) => vectors.av_packet_make_refcounted(@pkt); /// Create a writable reference for the data described by a given packet, avoiding data copy if possible. /// Packet whose data should be made writable. /// 0 on success, a negative AVERROR on failure. On failure, the packet is unchanged. public static int av_packet_make_writable(AVPacket* @pkt) => vectors.av_packet_make_writable(@pkt); /// Move every field in src to dst and reset src. /// Destination packet /// Source packet, will be reset public static void av_packet_move_ref(AVPacket* @dst, AVPacket* @src) => vectors.av_packet_move_ref(@dst, @src); /// Allocate new information of a packet. /// packet /// side information type /// side information size /// pointer to fresh allocated data or NULL otherwise public static byte* av_packet_new_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size) => vectors.av_packet_new_side_data(@pkt, @type, @size); /// Pack a dictionary for use in side_data. /// The dictionary to pack. /// pointer to store the size of the returned data /// pointer to data if successful, NULL otherwise public static byte* av_packet_pack_dictionary(AVDictionary* @dict, ulong* @size) => vectors.av_packet_pack_dictionary(@dict, @size); /// Setup a new reference to the data described by a given packet /// Destination packet. Will be completely overwritten. /// Source packet /// 0 on success, a negative AVERROR on error. On error, dst will be blank (as if returned by av_packet_alloc()). public static int av_packet_ref(AVPacket* @dst, AVPacket* @src) => vectors.av_packet_ref(@dst, @src); /// Convert valid timing fields (timestamps / durations) in a packet from one timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be ignored. /// packet on which the conversion will be performed /// source timebase, in which the timing fields in pkt are expressed /// destination timebase, to which the timing fields will be converted public static void av_packet_rescale_ts(AVPacket* @pkt, AVRational @tb_src, AVRational @tb_dst) => vectors.av_packet_rescale_ts(@pkt, @tb_src, @tb_dst); /// Shrink the already allocated side data buffer /// packet /// side information type /// new side information size /// 0 on success, < 0 on failure public static int av_packet_shrink_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size) => vectors.av_packet_shrink_side_data(@pkt, @type, @size); /// Wrap existing data as packet side data. /// pointer to an array of side data to which the side data should be added. *sd may be NULL, in which case the array will be initialized /// pointer to an integer containing the number of entries in the array. The integer value will be increased by 1 on success. /// side data type /// a data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to the side data array on success /// size of the data array /// currently unused. Must be zero /// pointer to freshly allocated side data on success, or NULL otherwise On failure, the side data array is unchanged and the data remains owned by the caller. public static AVPacketSideData* av_packet_side_data_add(AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags) => vectors.av_packet_side_data_add(@sd, @nb_sd, @type, @data, @size, @flags); /// Convenience function to free all the side data stored in an array, and the array itself. /// pointer to array of side data to free. Will be set to NULL upon return. /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. public static void av_packet_side_data_free(AVPacketSideData** @sd, int* @nb_sd) => vectors.av_packet_side_data_free(@sd, @nb_sd); /// Get side information from a side data array. /// the array from which the side data should be fetched /// value containing the number of entries in the array. /// desired side information type /// pointer to side data if present or NULL otherwise public static AVPacketSideData* av_packet_side_data_get(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type) => vectors.av_packet_side_data_get(@sd, @nb_sd, @type); public static string av_packet_side_data_name(AVPacketSideDataType @type) => vectors.av_packet_side_data_name(@type); /// Allocate a new packet side data. /// side data type /// desired side data size /// currently unused. Must be zero /// pointer to freshly allocated side data on success, or NULL otherwise. public static AVPacketSideData* av_packet_side_data_new(AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags) => vectors.av_packet_side_data_new(@psd, @pnb_sd, @type, @size, @flags); /// Remove side data of the given type from a side data array. /// the array from which the side data should be removed /// pointer to an integer containing the number of entries in the array. Will be reduced by the amount of entries removed upon return /// side information type public static void av_packet_side_data_remove(AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type) => vectors.av_packet_side_data_remove(@sd, @nb_sd, @type); /// Unpack a dictionary from side_data. /// data from side_data /// size of the data /// the metadata storage dictionary /// 0 on success, < 0 on failure public static int av_packet_unpack_dictionary(byte* @data, ulong @size, AVDictionary** @dict) => vectors.av_packet_unpack_dictionary(@data, @size, @dict); /// Parse CPU caps from a string and update the given AV_CPU_* flags based on that. /// negative on error. public static int av_parse_cpu_caps(uint* @flags, string @s) => vectors.av_parse_cpu_caps(@flags, @s); public static void av_parser_close(AVCodecParserContext* @s) => vectors.av_parser_close(@s); public static AVCodecParserContext* av_parser_init(int @codec_id) => vectors.av_parser_init(@codec_id); /// Iterate over all registered codec parsers. /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. /// the next registered codec parser or NULL when the iteration is finished public static AVCodecParser* av_parser_iterate(void** @opaque) => vectors.av_parser_iterate(@opaque); /// Parse a packet. /// parser context. /// codec context. /// set to pointer to parsed buffer or NULL if not yet finished. /// set to size of parsed buffer or zero if not yet finished. /// input buffer. /// buffer size in bytes without the padding. I.e. the full buffer size is assumed to be buf_size + AV_INPUT_BUFFER_PADDING_SIZE. To signal EOF, this should be 0 (so that the last frame can be output). /// input presentation timestamp. /// input decoding timestamp. /// input byte position in stream. /// the number of bytes of the input bitstream used. public static int av_parser_parse2(AVCodecParserContext* @s, AVCodecContext* @avctx, byte** @poutbuf, int* @poutbuf_size, byte* @buf, int @buf_size, long @pts, long @dts, long @pos) => vectors.av_parser_parse2(@s, @avctx, @poutbuf, @poutbuf_size, @buf, @buf_size, @pts, @dts, @pos); /// Returns number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a valid pixel format. /// number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a valid pixel format. public static int av_pix_fmt_count_planes(AVPixelFormat @pix_fmt) => vectors.av_pix_fmt_count_planes(@pix_fmt); /// Returns a pixel format descriptor for provided pixel format or NULL if this pixel format is unknown. /// a pixel format descriptor for provided pixel format or NULL if this pixel format is unknown. public static AVPixFmtDescriptor* av_pix_fmt_desc_get(AVPixelFormat @pix_fmt) => vectors.av_pix_fmt_desc_get(@pix_fmt); /// Returns an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc is not a valid pointer to a pixel format descriptor. /// an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc is not a valid pointer to a pixel format descriptor. public static AVPixelFormat av_pix_fmt_desc_get_id(AVPixFmtDescriptor* @desc) => vectors.av_pix_fmt_desc_get_id(@desc); /// Iterate over all pixel format descriptors known to libavutil. /// previous descriptor. NULL to get the first descriptor. /// next descriptor or NULL after the last descriptor public static AVPixFmtDescriptor* av_pix_fmt_desc_next(AVPixFmtDescriptor* @prev) => vectors.av_pix_fmt_desc_next(@prev); /// Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor. /// the pixel format /// store log2_chroma_w (horizontal/width shift) /// store log2_chroma_h (vertical/height shift) /// 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format public static int av_pix_fmt_get_chroma_sub_sample(AVPixelFormat @pix_fmt, int* @h_shift, int* @v_shift) => vectors.av_pix_fmt_get_chroma_sub_sample(@pix_fmt, @h_shift, @v_shift); /// Utility function to swap the endianness of a pixel format. /// the pixel format /// pixel format with swapped endianness if it exists, otherwise AV_PIX_FMT_NONE public static AVPixelFormat av_pix_fmt_swap_endianness(AVPixelFormat @pix_fmt) => vectors.av_pix_fmt_swap_endianness(@pix_fmt); /// Send a nice dump of a packet to the log. /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. /// The importance level of the message, lower values signifying higher importance. /// packet to dump /// True if the payload must be displayed, too. /// AVStream that the packet belongs to public static void av_pkt_dump_log2(void* @avcl, int @level, AVPacket* @pkt, int @dump_payload, AVStream* @st) => vectors.av_pkt_dump_log2(@avcl, @level, @pkt, @dump_payload, @st); /// Send a nice dump of a packet to the specified file stream. /// The file stream pointer where the dump should be sent to. /// packet to dump /// True if the payload must be displayed, too. /// AVStream that the packet belongs to public static void av_pkt_dump2(_iobuf* @f, AVPacket* @pkt, int @dump_payload, AVStream* @st) => vectors.av_pkt_dump2(@f, @pkt, @dump_payload, @st); /// Like av_probe_input_buffer2() but returns 0 on success public static int av_probe_input_buffer(AVIOContext* @pb, AVInputFormat** @fmt, string @url, void* @logctx, uint @offset, uint @max_probe_size) => vectors.av_probe_input_buffer(@pb, @fmt, @url, @logctx, @offset, @max_probe_size); /// Probe a bytestream to determine the input format. Each time a probe returns with a score that is too low, the probe buffer size is increased and another attempt is made. When the maximum probe size is reached, the input format with the highest score is returned. /// the bytestream to probe /// the input format is put here /// the url of the stream /// the log context /// the offset within the bytestream to probe from /// the maximum probe buffer size (zero for default) /// the score in case of success, a negative value corresponding to an the maximal score is AVPROBE_SCORE_MAX AVERROR code otherwise public static int av_probe_input_buffer2(AVIOContext* @pb, AVInputFormat** @fmt, string @url, void* @logctx, uint @offset, uint @max_probe_size) => vectors.av_probe_input_buffer2(@pb, @fmt, @url, @logctx, @offset, @max_probe_size); /// Guess the file format. /// data to be probed /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. public static AVInputFormat* av_probe_input_format(AVProbeData* @pd, int @is_opened) => vectors.av_probe_input_format(@pd, @is_opened); /// Guess the file format. /// data to be probed /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. /// A probe score larger that this is required to accept a detection, the variable is set to the actual detection score afterwards. If the score is < = AVPROBE_SCORE_MAX / 4 it is recommended to retry with a larger probe buffer. public static AVInputFormat* av_probe_input_format2(AVProbeData* @pd, int @is_opened, int* @score_max) => vectors.av_probe_input_format2(@pd, @is_opened, @score_max); /// Guess the file format. /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. /// The score of the best detection. public static AVInputFormat* av_probe_input_format3(AVProbeData* @pd, int @is_opened, int* @score_ret) => vectors.av_probe_input_format3(@pd, @is_opened, @score_ret); public static void av_program_add_stream_index(AVFormatContext* @ac, int @progid, uint @idx) => vectors.av_program_add_stream_index(@ac, @progid, @idx); /// Convert an AVRational to a IEEE 32-bit `float` expressed in fixed-point format. /// Rational to be converted /// Equivalent floating-point value, expressed as an unsigned 32-bit integer. public static uint av_q2intfloat(AVRational @q) => vectors.av_q2intfloat(@q); public static void av_read_image_line(ushort* @dst, in byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @read_pal_component) => vectors.av_read_image_line(@dst, @data, @linesize, @desc, @x, @y, @c, @w, @read_pal_component); /// Read a line from an image, and write the values of the pixel format component c to dst. /// the array containing the pointers to the planes of the image /// the array containing the linesizes of the image /// the pixel format descriptor for the image /// the horizontal coordinate of the first pixel to read /// the vertical coordinate of the first pixel to read /// the width of the line to read, that is the number of values to write to dst /// if not zero and the format is a paletted format writes the values corresponding to the palette component c in data[1] to dst, rather than the palette indexes in data[0]. The behavior is undefined if the format is not paletted. /// size of elements in dst array (2 or 4 byte) public static void av_read_image_line2(void* @dst, in byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @read_pal_component, int @dst_element_size) => vectors.av_read_image_line2(@dst, @data, @linesize, @desc, @x, @y, @c, @w, @read_pal_component, @dst_element_size); /// Pause a network-based stream (e.g. RTSP stream). public static int av_read_pause(AVFormatContext* @s) => vectors.av_read_pause(@s); /// Start playing a network-based stream (e.g. RTSP stream) at the current position. public static int av_read_play(AVFormatContext* @s) => vectors.av_read_play(@s); /// Allocate, reallocate, or free a block of memory. /// Pointer to a memory block already allocated with av_realloc() or `NULL` /// Size in bytes of the memory block to be allocated or reallocated /// Pointer to a newly-reallocated block or `NULL` if the block cannot be reallocated public static void* av_realloc(void* @ptr, ulong @size) => vectors.av_realloc(@ptr, @size); /// Allocate, reallocate, or free an array. /// Pointer to a memory block already allocated with av_realloc() or `NULL` /// Number of elements in the array /// Size of the single element of the array /// Pointer to a newly-reallocated block or NULL if the block cannot be reallocated public static void* av_realloc_array(void* @ptr, ulong @nmemb, ulong @size) => vectors.av_realloc_array(@ptr, @nmemb, @size); /// Allocate, reallocate, or free a block of memory. public static void* av_realloc_f(void* @ptr, ulong @nelem, ulong @elsize) => vectors.av_realloc_f(@ptr, @nelem, @elsize); /// Allocate, reallocate, or free a block of memory through a pointer to a pointer. /// Pointer to a pointer to a memory block already allocated with av_realloc(), or a pointer to `NULL`. The pointer is updated on success, or freed on failure. /// Size in bytes for the memory block to be allocated or reallocated /// Zero on success, an AVERROR error code on failure public static int av_reallocp(void* @ptr, ulong @size) => vectors.av_reallocp(@ptr, @size); /// Allocate, reallocate an array through a pointer to a pointer. /// Pointer to a pointer to a memory block already allocated with av_realloc(), or a pointer to `NULL`. The pointer is updated on success, or freed on failure. /// Number of elements /// Size of the single element /// Zero on success, an AVERROR error code on failure public static int av_reallocp_array(void* @ptr, ulong @nmemb, ulong @size) => vectors.av_reallocp_array(@ptr, @nmemb, @size); /// Reduce a fraction. /// Destination numerator /// Destination denominator /// Source numerator /// Source denominator /// Maximum allowed values for `dst_num` & `dst_den` /// 1 if the operation is exact, 0 otherwise public static int av_reduce(int* @dst_num, int* @dst_den, long @num, long @den, long @max) => vectors.av_reduce(@dst_num, @dst_den, @num, @den, @max); /// Rescale a 64-bit integer with rounding to nearest. public static long av_rescale(long @a, long @b, long @c) => vectors.av_rescale(@a, @b, @c); /// Rescale a timestamp while preserving known durations. /// Input time base /// Input timestamp /// Duration time base; typically this is finer-grained (greater) than `in_tb` and `out_tb` /// Duration till the next call to this function (i.e. duration of the current packet/frame) /// Pointer to a timestamp expressed in terms of `fs_tb`, acting as a state variable /// Output timebase /// Timestamp expressed in terms of `out_tb` public static long av_rescale_delta(AVRational @in_tb, long @in_ts, AVRational @fs_tb, int @duration, long* @last, AVRational @out_tb) => vectors.av_rescale_delta(@in_tb, @in_ts, @fs_tb, @duration, @last, @out_tb); /// Rescale a 64-bit integer by 2 rational numbers. public static long av_rescale_q(long @a, AVRational @bq, AVRational @cq) => vectors.av_rescale_q(@a, @bq, @cq); /// Rescale a 64-bit integer by 2 rational numbers with specified rounding. public static long av_rescale_q_rnd(long @a, AVRational @bq, AVRational @cq, AVRounding @rnd) => vectors.av_rescale_q_rnd(@a, @bq, @cq, @rnd); /// Rescale a 64-bit integer with specified rounding. public static long av_rescale_rnd(long @a, long @b, long @c, AVRounding @rnd) => vectors.av_rescale_rnd(@a, @b, @c, @rnd); /// Check if the sample format is planar. /// the sample format to inspect /// 1 if the sample format is planar, 0 if it is interleaved public static int av_sample_fmt_is_planar(AVSampleFormat @sample_fmt) => vectors.av_sample_fmt_is_planar(@sample_fmt); /// Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly. The allocated samples buffer can be freed by using av_freep(&audio_data[0]) Allocated data will be initialized to silence. /// array to be filled with the pointer for each channel /// aligned size for audio buffer(s), may be NULL /// number of audio channels /// number of samples per channel /// the sample format /// buffer size alignment (0 = default, 1 = no alignment) /// >=0 on success or a negative error code on failure public static int av_samples_alloc(byte** @audio_data, int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align) => vectors.av_samples_alloc(@audio_data, @linesize, @nb_channels, @nb_samples, @sample_fmt, @align); /// Allocate a data pointers array, samples buffer for nb_samples samples, and fill data pointers and linesize accordingly. public static int av_samples_alloc_array_and_samples(byte*** @audio_data, int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align) => vectors.av_samples_alloc_array_and_samples(@audio_data, @linesize, @nb_channels, @nb_samples, @sample_fmt, @align); /// Copy samples from src to dst. /// destination array of pointers to data planes /// source array of pointers to data planes /// offset in samples at which the data will be written to dst /// offset in samples at which the data will be read from src /// number of samples to be copied /// number of audio channels /// audio sample format public static int av_samples_copy(byte** @dst, byte** @src, int @dst_offset, int @src_offset, int @nb_samples, int @nb_channels, AVSampleFormat @sample_fmt) => vectors.av_samples_copy(@dst, @src, @dst_offset, @src_offset, @nb_samples, @nb_channels, @sample_fmt); /// Fill plane data pointers and linesize for samples with sample format sample_fmt. /// array to be filled with the pointer for each channel /// calculated linesize, may be NULL /// the pointer to a buffer containing the samples /// the number of channels /// the number of samples in a single channel /// the sample format /// buffer size alignment (0 = default, 1 = no alignment) /// minimum size in bytes required for the buffer on success, or a negative error code on failure public static int av_samples_fill_arrays(byte** @audio_data, int* @linesize, byte* @buf, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align) => vectors.av_samples_fill_arrays(@audio_data, @linesize, @buf, @nb_channels, @nb_samples, @sample_fmt, @align); /// Get the required buffer size for the given audio parameters. /// calculated linesize, may be NULL /// the number of channels /// the number of samples in a single channel /// the sample format /// buffer size alignment (0 = default, 1 = no alignment) /// required buffer size, or negative error code on failure public static int av_samples_get_buffer_size(int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align) => vectors.av_samples_get_buffer_size(@linesize, @nb_channels, @nb_samples, @sample_fmt, @align); /// Fill an audio buffer with silence. /// array of pointers to data planes /// offset in samples at which to start filling /// number of samples to fill /// number of audio channels /// audio sample format public static int av_samples_set_silence(byte** @audio_data, int @offset, int @nb_samples, int @nb_channels, AVSampleFormat @sample_fmt) => vectors.av_samples_set_silence(@audio_data, @offset, @nb_samples, @nb_channels, @sample_fmt); /// Generate an SDP for an RTP session. /// array of AVFormatContexts describing the RTP streams. If the array is composed by only one context, such context can contain multiple AVStreams (one AVStream per RTP stream). Otherwise, all the contexts in the array (an AVCodecContext per RTP stream) must contain only one AVStream. /// number of AVCodecContexts contained in ac /// buffer where the SDP will be stored (must be allocated by the caller) /// the size of the buffer /// 0 if OK, AVERROR_xxx on error public static int av_sdp_create(AVFormatContext** @ac, int @n_files, byte* @buf, int @size) => vectors.av_sdp_create(@ac, @n_files, @buf, @size); /// Seek to the keyframe at timestamp. 'timestamp' in 'stream_index'. /// media file handle /// If stream_index is (-1), a default stream is selected, and timestamp is automatically converted from AV_TIME_BASE units to the stream specific time_base. /// Timestamp in AVStream.time_base units or, if no stream is specified, in AV_TIME_BASE units. /// flags which select direction and seeking mode /// >= 0 on success public static int av_seek_frame(AVFormatContext* @s, int @stream_index, long @timestamp, int @flags) => vectors.av_seek_frame(@s, @stream_index, @timestamp, @flags); /// Parse the key/value pairs list in opts. For each key/value pair found, stores the value in the field in ctx that is named like the key. ctx must be an AVClass context, storing is done using AVOptions. /// options string to parse, may be NULL /// a 0-terminated list of characters used to separate key from value /// a 0-terminated list of characters used to separate two pairs from each other /// the number of successfully set key/value pairs, or a negative value corresponding to an AVERROR code in case of error: AVERROR(EINVAL) if opts cannot be parsed, the error code issued by av_opt_set() if a key/value pair cannot be set public static int av_set_options_string(void* @ctx, string @opts, string @key_val_sep, string @pairs_sep) => vectors.av_set_options_string(@ctx, @opts, @key_val_sep, @pairs_sep); /// Reduce packet size, correctly zeroing padding /// packet /// new size public static void av_shrink_packet(AVPacket* @pkt, int @size) => vectors.av_shrink_packet(@pkt, @size); /// Multiply two `size_t` values checking for overflow. /// Operand of multiplication /// Operand of multiplication /// Pointer to the result of the operation /// 0 on success, AVERROR(EINVAL) on overflow public static int av_size_mult(ulong @a, ulong @b, ulong* @r) => vectors.av_size_mult(@a, @b, @r); /// Duplicate a string. /// String to be duplicated /// Pointer to a newly-allocated string containing a copy of `s` or `NULL` if the string cannot be allocated public static byte* av_strdup(string @s) => vectors.av_strdup(@s); /// Wrap an existing array as stream side data. /// stream /// side information type /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to st. /// side information size /// zero on success, a negative AVERROR code on failure. On failure, the stream is unchanged and the data remains owned by the caller. [Obsolete("use av_packet_side_data_add() with the stream's \"codecpar side data\"")] public static int av_stream_add_side_data(AVStream* @st, AVPacketSideDataType @type, byte* @data, ulong @size) => vectors.av_stream_add_side_data(@st, @type, @data, @size); /// Get the AVClass for AVStream. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. public static AVClass* av_stream_get_class() => vectors.av_stream_get_class(); /// Get the internal codec timebase from a stream. /// input stream to extract the timebase from public static AVRational av_stream_get_codec_timebase(AVStream* @st) => vectors.av_stream_get_codec_timebase(@st); public static AVCodecParserContext* av_stream_get_parser(AVStream* @s) => vectors.av_stream_get_parser(@s); /// Get side information from stream. /// stream /// desired side information type /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. /// pointer to data if present or NULL otherwise [Obsolete("use av_packet_side_data_get() with the stream's \"codecpar side data\"")] public static byte* av_stream_get_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong* @size) => vectors.av_stream_get_side_data(@stream, @type, @size); /// Get the AVClass for AVStreamGroup. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. public static AVClass* av_stream_group_get_class() => vectors.av_stream_group_get_class(); /// Allocate new information from stream. /// stream /// desired side information type /// side information size /// pointer to fresh allocated data or NULL otherwise [Obsolete("use av_packet_side_data_new() with the stream's \"codecpar side data\"")] public static byte* av_stream_new_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong @size) => vectors.av_stream_new_side_data(@stream, @type, @size); /// Put a description of the AVERROR code errnum in errbuf. In case of failure the global variable errno is set to indicate the error. Even in case of failure av_strerror() will print a generic error message indicating the errnum provided to errbuf. /// error code to describe /// buffer to which description is written /// the size in bytes of errbuf /// 0 on success, a negative value if a description for errnum cannot be found public static int av_strerror(int @errnum, byte* @errbuf, ulong @errbuf_size) => vectors.av_strerror(@errnum, @errbuf, @errbuf_size); /// Duplicate a substring of a string. /// String to be duplicated /// Maximum length of the resulting string (not counting the terminating byte) /// Pointer to a newly-allocated string containing a substring of `s` or `NULL` if the string cannot be allocated public static byte* av_strndup(string @s, ulong @len) => vectors.av_strndup(@s, @len); /// Subtract one rational from another. /// First rational /// Second rational /// b-c public static AVRational av_sub_q(AVRational @b, AVRational @c) => vectors.av_sub_q(@b, @c); /// Adjust frame number for NTSC drop frame time code. /// frame number to adjust /// frame per second, multiples of 30 /// adjusted frame number public static int av_timecode_adjust_ntsc_framenum2(int @framenum, int @fps) => vectors.av_timecode_adjust_ntsc_framenum2(@framenum, @fps); /// Check if the timecode feature is available for the given frame rate /// 0 if supported, < 0 otherwise public static int av_timecode_check_frame_rate(AVRational @rate) => vectors.av_timecode_check_frame_rate(@rate); /// Convert sei info to SMPTE 12M binary representation. /// frame rate in rational form /// drop flag /// hour /// minute /// second /// frame number /// the SMPTE binary representation public static uint av_timecode_get_smpte(AVRational @rate, int @drop, int @hh, int @mm, int @ss, int @ff) => vectors.av_timecode_get_smpte(@rate, @drop, @hh, @mm, @ss, @ff); /// Convert frame number to SMPTE 12M binary representation. /// timecode data correctly initialized /// frame number /// the SMPTE binary representation public static uint av_timecode_get_smpte_from_framenum(AVTimecode* @tc, int @framenum) => vectors.av_timecode_get_smpte_from_framenum(@tc, @framenum); /// Init a timecode struct with the passed parameters. /// pointer to an allocated AVTimecode /// frame rate in rational form /// miscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag) /// the first frame number /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) /// 0 on success, AVERROR otherwise public static int av_timecode_init(AVTimecode* @tc, AVRational @rate, int @flags, int @frame_start, void* @log_ctx) => vectors.av_timecode_init(@tc, @rate, @flags, @frame_start, @log_ctx); /// Init a timecode struct from the passed timecode components. /// pointer to an allocated AVTimecode /// frame rate in rational form /// miscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag) /// hours /// minutes /// seconds /// frames /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) /// 0 on success, AVERROR otherwise public static int av_timecode_init_from_components(AVTimecode* @tc, AVRational @rate, int @flags, int @hh, int @mm, int @ss, int @ff, void* @log_ctx) => vectors.av_timecode_init_from_components(@tc, @rate, @flags, @hh, @mm, @ss, @ff, @log_ctx); /// Parse timecode representation (hh:mm:ss[:;.]ff). /// pointer to an allocated AVTimecode /// frame rate in rational form /// timecode string which will determine the frame start /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log). /// 0 on success, AVERROR otherwise public static int av_timecode_init_from_string(AVTimecode* @tc, AVRational @rate, string @str, void* @log_ctx) => vectors.av_timecode_init_from_string(@tc, @rate, @str, @log_ctx); /// Get the timecode string from the 25-bit timecode format (MPEG GOP format). /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long /// the 25-bits timecode /// the buf parameter public static byte* av_timecode_make_mpeg_tc_string(byte* @buf, uint @tc25bit) => vectors.av_timecode_make_mpeg_tc_string(@buf, @tc25bit); /// Get the timecode string from the SMPTE timecode format. /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long /// the 32-bit SMPTE timecode /// prevent the use of a drop flag when it is known the DF bit is arbitrary /// the buf parameter public static byte* av_timecode_make_smpte_tc_string(byte* @buf, uint @tcsmpte, int @prevent_df) => vectors.av_timecode_make_smpte_tc_string(@buf, @tcsmpte, @prevent_df); /// Get the timecode string from the SMPTE timecode format. /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long /// frame rate of the timecode /// the 32-bit SMPTE timecode /// prevent the use of a drop flag when it is known the DF bit is arbitrary /// prevent the use of a field flag when it is known the field bit is arbitrary (e.g. because it is used as PC flag) /// the buf parameter public static byte* av_timecode_make_smpte_tc_string2(byte* @buf, AVRational @rate, uint @tcsmpte, int @prevent_df, int @skip_field) => vectors.av_timecode_make_smpte_tc_string2(@buf, @rate, @tcsmpte, @prevent_df, @skip_field); /// Load timecode string in buf. /// timecode data correctly initialized /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long /// frame number /// the buf parameter public static byte* av_timecode_make_string(AVTimecode* @tc, byte* @buf, int @framenum) => vectors.av_timecode_make_string(@tc, @buf, @framenum); public static void av_tree_destroy(AVTreeNode* @t) => vectors.av_tree_destroy(@t); /// Apply enu(opaque, &elem) to all the elements in the tree in a given range. /// a comparison function that returns < 0 for an element below the range, > 0 for an element above the range and == 0 for an element inside the range public static void av_tree_enumerate(AVTreeNode* @t, void* @opaque, av_tree_enumerate_cmp_func @cmp, av_tree_enumerate_enu_func @enu) => vectors.av_tree_enumerate(@t, @opaque, @cmp, @enu); /// Find an element. /// a pointer to the root node of the tree /// compare function used to compare elements in the tree, API identical to that of Standard C's qsort It is guaranteed that the first and only the first argument to cmp() will be the key parameter to av_tree_find(), thus it could if the user wants, be a different type (like an opaque context). /// If next is not NULL, then next[0] will contain the previous element and next[1] the next element. If either does not exist, then the corresponding entry in next is unchanged. /// An element with cmp(key, elem) == 0 or NULL if no such element exists in the tree. public static void* av_tree_find(AVTreeNode* @root, void* @key, av_tree_find_cmp_func @cmp, ref void_ptr2 @next) => vectors.av_tree_find(@root, @key, @cmp, ref @next); /// Insert or remove an element. /// A pointer to a pointer to the root node of the tree; note that the root node can change during insertions, this is required to keep the tree balanced. /// pointer to the element key to insert in the tree /// compare function used to compare elements in the tree, API identical to that of Standard C's qsort /// Used to allocate and free AVTreeNodes. For insertion the user must set it to an allocated and zeroed object of at least av_tree_node_size bytes size. av_tree_insert() will set it to NULL if it has been consumed. For deleting elements *next is set to NULL by the user and av_tree_insert() will set it to the AVTreeNode which was used for the removed element. This allows the use of flat arrays, which have lower overhead compared to many malloced elements. You might want to define a function like: /// If no insertion happened, the found element; if an insertion or removal happened, then either key or NULL will be returned. Which one it is depends on the tree state and the implementation. You should make no assumptions that it's one or the other in the code. public static void* av_tree_insert(AVTreeNode** @rootp, void* @key, av_tree_insert_cmp_func @cmp, AVTreeNode** @next) => vectors.av_tree_insert(@rootp, @key, @cmp, @next); /// Allocate an AVTreeNode. public static AVTreeNode* av_tree_node_alloc() => vectors.av_tree_node_alloc(); /// Split a URL string into components. /// the buffer for the protocol /// the size of the proto buffer /// the buffer for the authorization /// the size of the authorization buffer /// the buffer for the host name /// the size of the hostname buffer /// a pointer to store the port number in /// the buffer for the path /// the size of the path buffer /// the URL to split public static void av_url_split(byte* @proto, int @proto_size, byte* @authorization, int @authorization_size, byte* @hostname, int @hostname_size, int* @port_ptr, byte* @path, int @path_size, string @url) => vectors.av_url_split(@proto, @proto_size, @authorization, @authorization_size, @hostname, @hostname_size, @port_ptr, @path, @path_size, @url); /// Sleep for a period of time. Although the duration is expressed in microseconds, the actual delay may be rounded to the precision of the system timer. /// Number of microseconds to sleep. /// zero on success or (negative) error code. public static int av_usleep(uint @usec) => vectors.av_usleep(@usec); /// Return an informative version string. This usually is the actual release version number or a git commit description. This string has no fixed format and can change any time. It should never be parsed by code. public static string av_version_info() => vectors.av_version_info(); /// Send the specified message to the log if the level is less than or equal to the current av_log_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. /// The importance level of the message expressed using a "Logging Constant". /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. /// The arguments referenced by the format string. public static void av_vlog(void* @avcl, int @level, string @fmt, byte* @vl) => vectors.av_vlog(@avcl, @level, @fmt, @vl); /// Write a packet to an output media file. /// media file handle /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. /// < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush public static int av_write_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_write_frame(@s, @pkt); public static void av_write_image_line(ushort* @src, ref byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w) => vectors.av_write_image_line(@src, ref @data, @linesize, @desc, @x, @y, @c, @w); /// Write the values from src to the pixel format component c of an image line. /// array containing the values to write /// the array containing the pointers to the planes of the image to write into. It is supposed to be zeroed. /// the array containing the linesizes of the image /// the pixel format descriptor for the image /// the horizontal coordinate of the first pixel to write /// the vertical coordinate of the first pixel to write /// the width of the line to write, that is the number of values to write to the image line /// size of elements in src array (2 or 4 byte) public static void av_write_image_line2(void* @src, ref byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @src_element_size) => vectors.av_write_image_line2(@src, ref @data, @linesize, @desc, @x, @y, @c, @w, @src_element_size); /// Write the stream trailer to an output media file and free the file private data. /// media file handle /// 0 if OK, AVERROR_xxx on error public static int av_write_trailer(AVFormatContext* @s) => vectors.av_write_trailer(@s); /// Write an uncoded frame to an output media file. public static int av_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame) => vectors.av_write_uncoded_frame(@s, @stream_index, @frame); /// Test whether a muxer supports uncoded frame. /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not public static int av_write_uncoded_frame_query(AVFormatContext* @s, int @stream_index) => vectors.av_write_uncoded_frame_query(@s, @stream_index); /// Encode extradata length to a buffer. Used by xiph codecs. /// buffer to write to; must be at least (v/255+1) bytes long /// size of extradata in bytes /// number of bytes written to the buffer. public static uint av_xiphlacing(byte* @s, uint @v) => vectors.av_xiphlacing(@s, @v); /// Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you do not use any horizontal padding. public static void avcodec_align_dimensions(AVCodecContext* @s, int* @width, int* @height) => vectors.avcodec_align_dimensions(@s, @width, @height); /// Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you also ensure that all line sizes are a multiple of the respective linesize_align[i]. public static void avcodec_align_dimensions2(AVCodecContext* @s, int* @width, int* @height, ref int8 @linesize_align) => vectors.avcodec_align_dimensions2(@s, @width, @height, ref @linesize_align); /// Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext itself). [Obsolete("Do not use this function. Use avcodec_free_context() to destroy a codec context (either open or closed). Opening and closing a codec context multiple times is not supported anymore -- use multiple codec contexts instead.")] public static int avcodec_close(AVCodecContext* @avctx) => vectors.avcodec_close(@avctx); /// Return the libavcodec build-time configuration. public static string avcodec_configuration() => vectors.avcodec_configuration(); /// Decode a subtitle message. Return a negative value on error, otherwise return the number of bytes used. If no subtitle could be decompressed, got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for simplicity, because the performance difference is expected to be negligible and reusing a get_buffer written for video codecs would probably perform badly due to a potentially very different allocation pattern. /// the codec context /// The preallocated AVSubtitle in which the decoded subtitle will be stored, must be freed with avsubtitle_free if *got_sub_ptr is set. /// Zero if no subtitle could be decompressed, otherwise, it is nonzero. /// The input AVPacket containing the input buffer. public static int avcodec_decode_subtitle2(AVCodecContext* @avctx, AVSubtitle* @sub, int* @got_sub_ptr, AVPacket* @avpkt) => vectors.avcodec_decode_subtitle2(@avctx, @sub, @got_sub_ptr, @avpkt); public static int avcodec_default_execute(AVCodecContext* @c, avcodec_default_execute_func_func @func, void* @arg, int* @ret, int @count, int @size) => vectors.avcodec_default_execute(@c, @func, @arg, @ret, @count, @size); public static int avcodec_default_execute2(AVCodecContext* @c, avcodec_default_execute2_func_func @func, void* @arg, int* @ret, int @count) => vectors.avcodec_default_execute2(@c, @func, @arg, @ret, @count); /// The default callback for AVCodecContext.get_buffer2(). It is made public so it can be called by custom get_buffer2() implementations for decoders without AV_CODEC_CAP_DR1 set. public static int avcodec_default_get_buffer2(AVCodecContext* @s, AVFrame* @frame, int @flags) => vectors.avcodec_default_get_buffer2(@s, @frame, @flags); /// The default callback for AVCodecContext.get_encode_buffer(). It is made public so it can be called by custom get_encode_buffer() implementations for encoders without AV_CODEC_CAP_DR1 set. public static int avcodec_default_get_encode_buffer(AVCodecContext* @s, AVPacket* @pkt, int @flags) => vectors.avcodec_default_get_encode_buffer(@s, @pkt, @flags); public static AVPixelFormat avcodec_default_get_format(AVCodecContext* @s, AVPixelFormat* @fmt) => vectors.avcodec_default_get_format(@s, @fmt); /// Returns descriptor for given codec ID or NULL if no descriptor exists. /// descriptor for given codec ID or NULL if no descriptor exists. public static AVCodecDescriptor* avcodec_descriptor_get(AVCodecID @id) => vectors.avcodec_descriptor_get(@id); /// Returns codec descriptor with the given name or NULL if no such descriptor exists. /// codec descriptor with the given name or NULL if no such descriptor exists. public static AVCodecDescriptor* avcodec_descriptor_get_by_name(string @name) => vectors.avcodec_descriptor_get_by_name(@name); /// Iterate over all codec descriptors known to libavcodec. /// previous descriptor. NULL to get the first descriptor. /// next descriptor or NULL after the last descriptor public static AVCodecDescriptor* avcodec_descriptor_next(AVCodecDescriptor* @prev) => vectors.avcodec_descriptor_next(@prev); /// @{ public static int avcodec_encode_subtitle(AVCodecContext* @avctx, byte* @buf, int @buf_size, AVSubtitle* @sub) => vectors.avcodec_encode_subtitle(@avctx, @buf, @buf_size, @sub); /// Fill AVFrame audio data and linesize pointers. /// the AVFrame frame->nb_samples must be set prior to calling the function. This function fills in frame->data, frame->extended_data, frame->linesize[0]. /// channel count /// sample format /// buffer to use for frame data /// size of buffer /// plane size sample alignment (0 = default) /// >=0 on success, negative error code on failure public static int avcodec_fill_audio_frame(AVFrame* @frame, int @nb_channels, AVSampleFormat @sample_fmt, byte* @buf, int @buf_size, int @align) => vectors.avcodec_fill_audio_frame(@frame, @nb_channels, @sample_fmt, @buf, @buf_size, @align); /// Find the best pixel format to convert to given a certain source pixel format. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of the given pixel formats should be used to suffer the least amount of loss. The pixel formats from which it chooses one, are determined by the pix_fmt_list parameter. /// AV_PIX_FMT_NONE terminated array of pixel formats to choose from /// source pixel format /// Whether the source pixel format alpha channel is used. /// Combination of flags informing you what kind of losses will occur. /// The best pixel format to convert to or -1 if none was found. public static AVPixelFormat avcodec_find_best_pix_fmt_of_list(AVPixelFormat* @pix_fmt_list, AVPixelFormat @src_pix_fmt, int @has_alpha, int* @loss_ptr) => vectors.avcodec_find_best_pix_fmt_of_list(@pix_fmt_list, @src_pix_fmt, @has_alpha, @loss_ptr); /// Find a registered decoder with a matching codec ID. /// AVCodecID of the requested decoder /// A decoder if one was found, NULL otherwise. public static AVCodec* avcodec_find_decoder(AVCodecID @id) => vectors.avcodec_find_decoder(@id); /// Find a registered decoder with the specified name. /// name of the requested decoder /// A decoder if one was found, NULL otherwise. public static AVCodec* avcodec_find_decoder_by_name(string @name) => vectors.avcodec_find_decoder_by_name(@name); /// Find a registered encoder with a matching codec ID. /// AVCodecID of the requested encoder /// An encoder if one was found, NULL otherwise. public static AVCodec* avcodec_find_encoder(AVCodecID @id) => vectors.avcodec_find_encoder(@id); /// Find a registered encoder with the specified name. /// name of the requested encoder /// An encoder if one was found, NULL otherwise. public static AVCodec* avcodec_find_encoder_by_name(string @name) => vectors.avcodec_find_encoder_by_name(@name); /// Get the AVClass for AVCodecContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. public static AVClass* avcodec_get_class() => vectors.avcodec_get_class(); /// Retrieve supported hardware configurations for a codec. public static AVCodecHWConfig* avcodec_get_hw_config(AVCodec* @codec, int @index) => vectors.avcodec_get_hw_config(@codec, @index); /// Create and return a AVHWFramesContext with values adequate for hardware decoding. This is meant to get called from the get_format callback, and is a helper for preparing a AVHWFramesContext for AVCodecContext.hw_frames_ctx. This API is for decoding with certain hardware acceleration modes/APIs only. /// The context which is currently calling get_format, and which implicitly contains all state needed for filling the returned AVHWFramesContext properly. /// A reference to the AVHWDeviceContext describing the device which will be used by the hardware decoder. /// The hwaccel format you are going to return from get_format. /// On success, set to a reference to an _uninitialized_ AVHWFramesContext, created from the given device_ref. Fields will be set to values required for decoding. Not changed if an error is returned. /// zero on success, a negative value on error. The following error codes have special semantics: AVERROR(ENOENT): the decoder does not support this functionality. Setup is always manual, or it is a decoder which does not support setting AVCodecContext.hw_frames_ctx at all, or it is a software format. AVERROR(EINVAL): it is known that hardware decoding is not supported for this configuration, or the device_ref is not supported for the hwaccel referenced by hw_pix_fmt. public static int avcodec_get_hw_frames_parameters(AVCodecContext* @avctx, AVBufferRef* @device_ref, AVPixelFormat @hw_pix_fmt, AVBufferRef** @out_frames_ref) => vectors.avcodec_get_hw_frames_parameters(@avctx, @device_ref, @hw_pix_fmt, @out_frames_ref); /// Get the AVClass for AVSubtitleRect. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. public static AVClass* avcodec_get_subtitle_rect_class() => vectors.avcodec_get_subtitle_rect_class(); /// Get the type of the given codec. public static AVMediaType avcodec_get_type(AVCodecID @codec_id) => vectors.avcodec_get_type(@codec_id); /// Returns a positive value if s is open (i.e. avcodec_open2() was called on it with no corresponding avcodec_close()), 0 otherwise. /// a positive value if s is open (i.e. avcodec_open2() was called on it with no corresponding avcodec_close()), 0 otherwise. public static int avcodec_is_open(AVCodecContext* @s) => vectors.avcodec_is_open(@s); /// Return the libavcodec license. public static string avcodec_license() => vectors.avcodec_license(); /// Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0). The returned struct must be freed with avcodec_parameters_free(). public static AVCodecParameters* avcodec_parameters_alloc() => vectors.avcodec_parameters_alloc(); /// Copy the contents of src to dst. Any allocated fields in dst are freed and replaced with newly allocated duplicates of the corresponding fields in src. /// >= 0 on success, a negative AVERROR code on failure. public static int avcodec_parameters_copy(AVCodecParameters* @dst, AVCodecParameters* @src) => vectors.avcodec_parameters_copy(@dst, @src); /// Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied pointer. public static void avcodec_parameters_free(AVCodecParameters** @par) => vectors.avcodec_parameters_free(@par); /// Fill the parameters struct based on the values from the supplied codec context. Any allocated fields in par are freed and replaced with duplicates of the corresponding fields in codec. /// >= 0 on success, a negative AVERROR code on failure public static int avcodec_parameters_from_context(AVCodecParameters* @par, AVCodecContext* @codec) => vectors.avcodec_parameters_from_context(@par, @codec); /// Fill the codec context based on the values from the supplied codec parameters. Any allocated fields in codec that have a corresponding field in par are freed and replaced with duplicates of the corresponding field in par. Fields in codec that do not have a counterpart in par are not touched. /// >= 0 on success, a negative AVERROR code on failure. public static int avcodec_parameters_to_context(AVCodecContext* @codec, AVCodecParameters* @par) => vectors.avcodec_parameters_to_context(@codec, @par); /// Return a value representing the fourCC code associated to the pixel format pix_fmt, or 0 if no associated fourCC code can be found. public static uint avcodec_pix_fmt_to_codec_tag(AVPixelFormat @pix_fmt) => vectors.avcodec_pix_fmt_to_codec_tag(@pix_fmt); /// Return a name for the specified profile, if available. /// the ID of the codec to which the requested profile belongs /// the profile value for which a name is requested /// A name for the profile if found, NULL otherwise. public static string avcodec_profile_name(AVCodecID @codec_id, int @profile) => vectors.avcodec_profile_name(@codec_id, @profile); /// Read encoded data from the encoder. /// codec context /// This will be set to a reference-counted packet allocated by the encoder. Note that the function will always call av_packet_unref(avpkt) before doing anything else. public static int avcodec_receive_packet(AVCodecContext* @avctx, AVPacket* @avpkt) => vectors.avcodec_receive_packet(@avctx, @avpkt); /// Supply a raw video or audio frame to the encoder. Use avcodec_receive_packet() to retrieve buffered output packets. /// codec context /// AVFrame containing the raw audio or video frame to be encoded. Ownership of the frame remains with the caller, and the encoder will not write to the frame. The encoder may create a reference to the frame data (or copy it if the frame is not reference-counted). It can be NULL, in which case it is considered a flush packet. This signals the end of the stream. If the encoder still has packets buffered, it will return them after this call. Once flushing mode has been entered, additional flush packets are ignored, and sending frames will return AVERROR_EOF. public static int avcodec_send_frame(AVCodecContext* @avctx, AVFrame* @frame) => vectors.avcodec_send_frame(@avctx, @frame); /// @} public static void avcodec_string(byte* @buf, int @buf_size, AVCodecContext* @enc, int @encode) => vectors.avcodec_string(@buf, @buf_size, @enc, @encode); /// Return the LIBAVCODEC_VERSION_INT constant. public static uint avcodec_version() => vectors.avcodec_version(); /// Send control message from application to device. /// device context. /// message type. /// message data. Exact type depends on message type. /// size of message data. /// >= 0 on success, negative on error. AVERROR(ENOSYS) when device doesn't implement handler of the message. public static int avdevice_app_to_dev_control_message(AVFormatContext* @s, AVAppToDevMessageType @type, void* @data, ulong @data_size) => vectors.avdevice_app_to_dev_control_message(@s, @type, @data, @data_size); /// Return the libavdevice build-time configuration. public static string avdevice_configuration() => vectors.avdevice_configuration(); /// Send control message from device to application. /// device context. /// message type. /// message data. Can be NULL. /// size of message data. /// >= 0 on success, negative on error. AVERROR(ENOSYS) when application doesn't implement handler of the message. public static int avdevice_dev_to_app_control_message(AVFormatContext* @s, AVDevToAppMessageType @type, void* @data, ulong @data_size) => vectors.avdevice_dev_to_app_control_message(@s, @type, @data, @data_size); /// Convenient function to free result of avdevice_list_devices(). /// device list to be freed. public static void avdevice_free_list_devices(AVDeviceInfoList** @device_list) => vectors.avdevice_free_list_devices(@device_list); /// Return the libavdevice license. public static string avdevice_license() => vectors.avdevice_license(); /// List devices. /// device context. /// list of autodetected devices. /// count of autodetected devices, negative on error. public static int avdevice_list_devices(AVFormatContext* @s, AVDeviceInfoList** @device_list) => vectors.avdevice_list_devices(@s, @device_list); /// List devices. /// device format. May be NULL if device name is set. /// device name. May be NULL if device format is set. /// An AVDictionary filled with device-private options. May be NULL. The same options must be passed later to avformat_write_header() for output devices or avformat_open_input() for input devices, or at any other place that affects device-private options. /// list of autodetected devices /// count of autodetected devices, negative on error. public static int avdevice_list_input_sources(AVInputFormat* @device, string @device_name, AVDictionary* @device_options, AVDeviceInfoList** @device_list) => vectors.avdevice_list_input_sources(@device, @device_name, @device_options, @device_list); public static int avdevice_list_output_sinks(AVOutputFormat* @device, string @device_name, AVDictionary* @device_options, AVDeviceInfoList** @device_list) => vectors.avdevice_list_output_sinks(@device, @device_name, @device_options, @device_list); /// Initialize libavdevice and register all the input and output devices. public static void avdevice_register_all() => vectors.avdevice_register_all(); /// Return the LIBAVDEVICE_VERSION_INT constant. public static uint avdevice_version() => vectors.avdevice_version(); [Obsolete("this function should never be called by users")] public static int avfilter_config_links(AVFilterContext* @filter) => vectors.avfilter_config_links(@filter); /// Return the libavfilter build-time configuration. public static string avfilter_configuration() => vectors.avfilter_configuration(); /// Get the number of elements in an AVFilter's inputs or outputs array. public static uint avfilter_filter_pad_count(AVFilter* @filter, int @is_output) => vectors.avfilter_filter_pad_count(@filter, @is_output); /// Free a filter context. This will also remove the filter from its filtergraph's list of filters. /// the filter to free public static void avfilter_free(AVFilterContext* @filter) => vectors.avfilter_free(@filter); /// Get a filter definition matching the given name. /// the filter name to find /// the filter definition, if any matching one is registered. NULL if none found. public static AVFilter* avfilter_get_by_name(string @name) => vectors.avfilter_get_by_name(@name); /// Returns AVClass for AVFilterContext. /// AVClass for AVFilterContext. public static AVClass* avfilter_get_class() => vectors.avfilter_get_class(); /// Allocate a filter graph. /// the allocated filter graph on success or NULL. public static AVFilterGraph* avfilter_graph_alloc() => vectors.avfilter_graph_alloc(); /// Create a new filter instance in a filter graph. /// graph in which the new filter will be used /// the filter to create an instance of /// Name to give to the new instance (will be copied to AVFilterContext.name). This may be used by the caller to identify different filters, libavfilter itself assigns no semantics to this parameter. May be NULL. /// the context of the newly created filter instance (note that it is also retrievable directly through AVFilterGraph.filters or with avfilter_graph_get_filter()) on success or NULL on failure. public static AVFilterContext* avfilter_graph_alloc_filter(AVFilterGraph* @graph, AVFilter* @filter, string @name) => vectors.avfilter_graph_alloc_filter(@graph, @filter, @name); /// Check validity and configure all the links and formats in the graph. /// the filter graph /// context used for logging /// >= 0 in case of success, a negative AVERROR code otherwise public static int avfilter_graph_config(AVFilterGraph* @graphctx, void* @log_ctx) => vectors.avfilter_graph_config(@graphctx, @log_ctx); /// Create and add a filter instance into an existing graph. The filter instance is created from the filter filt and inited with the parameter args. opaque is currently ignored. /// the instance name to give to the created filter instance /// the filter graph /// a negative AVERROR error code in case of failure, a non negative value otherwise public static int avfilter_graph_create_filter(AVFilterContext** @filt_ctx, AVFilter* @filt, string @name, string @args, void* @opaque, AVFilterGraph* @graph_ctx) => vectors.avfilter_graph_create_filter(@filt_ctx, @filt, @name, @args, @opaque, @graph_ctx); /// Dump a graph into a human-readable string representation. /// the graph to dump /// formatting options; currently ignored /// a string, or NULL in case of memory allocation failure; the string must be freed using av_free public static byte* avfilter_graph_dump(AVFilterGraph* @graph, string @options) => vectors.avfilter_graph_dump(@graph, @options); /// Free a graph, destroy its links, and set *graph to NULL. If *graph is NULL, do nothing. public static void avfilter_graph_free(AVFilterGraph** @graph) => vectors.avfilter_graph_free(@graph); /// Get a filter instance identified by instance name from graph. /// filter graph to search through. /// filter instance name (should be unique in the graph). /// the pointer to the found filter instance or NULL if it cannot be found. public static AVFilterContext* avfilter_graph_get_filter(AVFilterGraph* @graph, string @name) => vectors.avfilter_graph_get_filter(@graph, @name); /// Add a graph described by a string to a graph. /// the filter graph where to link the parsed graph context /// string to be parsed /// linked list to the inputs of the graph /// linked list to the outputs of the graph /// zero on success, a negative AVERROR code on error public static int avfilter_graph_parse(AVFilterGraph* @graph, string @filters, AVFilterInOut* @inputs, AVFilterInOut* @outputs, void* @log_ctx) => vectors.avfilter_graph_parse(@graph, @filters, @inputs, @outputs, @log_ctx); /// Add a graph described by a string to a graph. /// the filter graph where to link the parsed graph context /// string to be parsed /// pointer to a linked list to the inputs of the graph, may be NULL. If non-NULL, *inputs is updated to contain the list of open inputs after the parsing, should be freed with avfilter_inout_free(). /// pointer to a linked list to the outputs of the graph, may be NULL. If non-NULL, *outputs is updated to contain the list of open outputs after the parsing, should be freed with avfilter_inout_free(). /// non negative on success, a negative AVERROR code on error public static int avfilter_graph_parse_ptr(AVFilterGraph* @graph, string @filters, AVFilterInOut** @inputs, AVFilterInOut** @outputs, void* @log_ctx) => vectors.avfilter_graph_parse_ptr(@graph, @filters, @inputs, @outputs, @log_ctx); /// Add a graph described by a string to a graph. /// the filter graph where to link the parsed graph context /// string to be parsed /// a linked list of all free (unlinked) inputs of the parsed graph will be returned here. It is to be freed by the caller using avfilter_inout_free(). /// a linked list of all free (unlinked) outputs of the parsed graph will be returned here. It is to be freed by the caller using avfilter_inout_free(). /// zero on success, a negative AVERROR code on error public static int avfilter_graph_parse2(AVFilterGraph* @graph, string @filters, AVFilterInOut** @inputs, AVFilterInOut** @outputs) => vectors.avfilter_graph_parse2(@graph, @filters, @inputs, @outputs); /// Queue a command for one or more filter instances. /// the filter graph /// the filter(s) to which the command should be sent "all" sends to all filters otherwise it can be a filter or filter instance name which will send the command to all matching filters. /// the command to sent, for handling simplicity all commands must be alphanumeric only /// the argument for the command /// time at which the command should be sent to the filter public static int avfilter_graph_queue_command(AVFilterGraph* @graph, string @target, string @cmd, string @arg, int @flags, double @ts) => vectors.avfilter_graph_queue_command(@graph, @target, @cmd, @arg, @flags, @ts); /// Request a frame on the oldest sink link. /// the return value of ff_request_frame(), or AVERROR_EOF if all links returned AVERROR_EOF public static int avfilter_graph_request_oldest(AVFilterGraph* @graph) => vectors.avfilter_graph_request_oldest(@graph); /// Apply all filter/link descriptions from a graph segment to the associated filtergraph. /// the filtergraph segment to process /// reserved for future use, caller must set to 0 for now /// passed to avfilter_graph_segment_link() /// passed to avfilter_graph_segment_link() public static int avfilter_graph_segment_apply(AVFilterGraphSegment* @seg, int @flags, AVFilterInOut** @inputs, AVFilterInOut** @outputs) => vectors.avfilter_graph_segment_apply(@seg, @flags, @inputs, @outputs); /// Apply parsed options to filter instances in a graph segment. /// the filtergraph segment to process /// reserved for future use, caller must set to 0 for now public static int avfilter_graph_segment_apply_opts(AVFilterGraphSegment* @seg, int @flags) => vectors.avfilter_graph_segment_apply_opts(@seg, @flags); /// Create filters specified in a graph segment. /// the filtergraph segment to process /// reserved for future use, caller must set to 0 for now public static int avfilter_graph_segment_create_filters(AVFilterGraphSegment* @seg, int @flags) => vectors.avfilter_graph_segment_create_filters(@seg, @flags); /// Free the provided AVFilterGraphSegment and everything associated with it. /// double pointer to the AVFilterGraphSegment to be freed. NULL will be written to this pointer on exit from this function. public static void avfilter_graph_segment_free(AVFilterGraphSegment** @seg) => vectors.avfilter_graph_segment_free(@seg); /// Initialize all filter instances in a graph segment. /// the filtergraph segment to process /// reserved for future use, caller must set to 0 for now public static int avfilter_graph_segment_init(AVFilterGraphSegment* @seg, int @flags) => vectors.avfilter_graph_segment_init(@seg, @flags); /// Link filters in a graph segment. /// the filtergraph segment to process /// reserved for future use, caller must set to 0 for now /// a linked list of all free (unlinked) inputs of the filters in this graph segment will be returned here. It is to be freed by the caller using avfilter_inout_free(). /// a linked list of all free (unlinked) outputs of the filters in this graph segment will be returned here. It is to be freed by the caller using avfilter_inout_free(). public static int avfilter_graph_segment_link(AVFilterGraphSegment* @seg, int @flags, AVFilterInOut** @inputs, AVFilterInOut** @outputs) => vectors.avfilter_graph_segment_link(@seg, @flags, @inputs, @outputs); /// Parse a textual filtergraph description into an intermediate form. /// Filter graph the parsed segment is associated with. Will only be used for logging and similar auxiliary purposes. The graph will not be actually modified by this function - the parsing results are instead stored in seg for further processing. /// a string describing the filtergraph segment /// reserved for future use, caller must set to 0 for now /// A pointer to the newly-created AVFilterGraphSegment is written here on success. The graph segment is owned by the caller and must be freed with avfilter_graph_segment_free() before graph itself is freed. public static int avfilter_graph_segment_parse(AVFilterGraph* @graph, string @graph_str, int @flags, AVFilterGraphSegment** @seg) => vectors.avfilter_graph_segment_parse(@graph, @graph_str, @flags, @seg); /// Send a command to one or more filter instances. /// the filter graph /// the filter(s) to which the command should be sent "all" sends to all filters otherwise it can be a filter or filter instance name which will send the command to all matching filters. /// the command to send, for handling simplicity all commands must be alphanumeric only /// the argument for the command /// a buffer with size res_size where the filter(s) can return a response. public static int avfilter_graph_send_command(AVFilterGraph* @graph, string @target, string @cmd, string @arg, byte* @res, int @res_len, int @flags) => vectors.avfilter_graph_send_command(@graph, @target, @cmd, @arg, @res, @res_len, @flags); /// Enable or disable automatic format conversion inside the graph. /// any of the AVFILTER_AUTO_CONVERT_* constants public static void avfilter_graph_set_auto_convert(AVFilterGraph* @graph, uint @flags) => vectors.avfilter_graph_set_auto_convert(@graph, @flags); /// Initialize a filter with the supplied dictionary of options. /// uninitialized filter context to initialize /// An AVDictionary filled with options for this filter. On return this parameter will be destroyed and replaced with a dict containing options that were not found. This dictionary must be freed by the caller. May be NULL, then this function is equivalent to avfilter_init_str() with the second parameter set to NULL. /// 0 on success, a negative AVERROR on failure public static int avfilter_init_dict(AVFilterContext* @ctx, AVDictionary** @options) => vectors.avfilter_init_dict(@ctx, @options); /// Initialize a filter with the supplied parameters. /// uninitialized filter context to initialize /// Options to initialize the filter with. This must be a ':'-separated list of options in the 'key=value' form. May be NULL if the options have been set directly using the AVOptions API or there are no options that need to be set. /// 0 on success, a negative AVERROR on failure public static int avfilter_init_str(AVFilterContext* @ctx, string @args) => vectors.avfilter_init_str(@ctx, @args); /// Allocate a single AVFilterInOut entry. Must be freed with avfilter_inout_free(). /// allocated AVFilterInOut on success, NULL on failure. public static AVFilterInOut* avfilter_inout_alloc() => vectors.avfilter_inout_alloc(); /// Free the supplied list of AVFilterInOut and set *inout to NULL. If *inout is NULL, do nothing. public static void avfilter_inout_free(AVFilterInOut** @inout) => vectors.avfilter_inout_free(@inout); /// Insert a filter in the middle of an existing link. /// the link into which the filter should be inserted /// the filter to be inserted /// the input pad on the filter to connect /// the output pad on the filter to connect /// zero on success public static int avfilter_insert_filter(AVFilterLink* @link, AVFilterContext* @filt, uint @filt_srcpad_idx, uint @filt_dstpad_idx) => vectors.avfilter_insert_filter(@link, @filt, @filt_srcpad_idx, @filt_dstpad_idx); /// Return the libavfilter license. public static string avfilter_license() => vectors.avfilter_license(); /// Link two filters together. /// the source filter /// index of the output pad on the source filter /// the destination filter /// index of the input pad on the destination filter /// zero on success public static int avfilter_link(AVFilterContext* @src, uint @srcpad, AVFilterContext* @dst, uint @dstpad) => vectors.avfilter_link(@src, @srcpad, @dst, @dstpad); [Obsolete("this function should never be called by users")] public static void avfilter_link_free(AVFilterLink** @link) => vectors.avfilter_link_free(@link); /// Get the name of an AVFilterPad. /// an array of AVFilterPads /// index of the pad in the array; it is the caller's responsibility to ensure the index is valid /// name of the pad_idx'th pad in pads public static string avfilter_pad_get_name(AVFilterPad* @pads, int @pad_idx) => vectors.avfilter_pad_get_name(@pads, @pad_idx); /// Get the type of an AVFilterPad. /// an array of AVFilterPads /// index of the pad in the array; it is the caller's responsibility to ensure the index is valid /// type of the pad_idx'th pad in pads public static AVMediaType avfilter_pad_get_type(AVFilterPad* @pads, int @pad_idx) => vectors.avfilter_pad_get_type(@pads, @pad_idx); /// Make the filter instance process a command. It is recommended to use avfilter_graph_send_command(). public static int avfilter_process_command(AVFilterContext* @filter, string @cmd, string @arg, byte* @res, int @res_len, int @flags) => vectors.avfilter_process_command(@filter, @cmd, @arg, @res, @res_len, @flags); /// Return the LIBAVFILTER_VERSION_INT constant. public static uint avfilter_version() => vectors.avfilter_version(); /// Allocate an AVFormatContext for an output format. avformat_free_context() can be used to free the context and everything allocated by the framework within it. /// pointee is set to the created format context, or to NULL in case of failure /// format to use for allocating the context, if NULL format_name and filename are used instead /// the name of output format to use for allocating the context, if NULL filename is used instead /// the name of the filename to use for allocating the context, may be NULL /// >= 0 in case of success, a negative AVERROR code in case of failure public static int avformat_alloc_output_context2(AVFormatContext** @ctx, AVOutputFormat* @oformat, string @format_name, string @filename) => vectors.avformat_alloc_output_context2(@ctx, @oformat, @format_name, @filename); /// Return the libavformat build-time configuration. public static string avformat_configuration() => vectors.avformat_configuration(); /// Discard all internally buffered data. This can be useful when dealing with discontinuities in the byte stream. Generally works only with formats that can resync. This includes headerless formats like MPEG-TS/TS but should also work with NUT, Ogg and in a limited way AVI for example. /// media file handle /// >=0 on success, error code otherwise public static int avformat_flush(AVFormatContext* @s) => vectors.avformat_flush(@s); /// Free an AVFormatContext and all its streams. /// context to free public static void avformat_free_context(AVFormatContext* @s) => vectors.avformat_free_context(@s); /// Get the AVClass for AVFormatContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. public static AVClass* avformat_get_class() => vectors.avformat_get_class(); /// Returns the table mapping MOV FourCCs for audio to AVCodecID. /// the table mapping MOV FourCCs for audio to AVCodecID. public static AVCodecTag* avformat_get_mov_audio_tags() => vectors.avformat_get_mov_audio_tags(); /// Returns the table mapping MOV FourCCs for video to libavcodec AVCodecID. /// the table mapping MOV FourCCs for video to libavcodec AVCodecID. public static AVCodecTag* avformat_get_mov_video_tags() => vectors.avformat_get_mov_video_tags(); /// Returns the table mapping RIFF FourCCs for audio to AVCodecID. /// the table mapping RIFF FourCCs for audio to AVCodecID. public static AVCodecTag* avformat_get_riff_audio_tags() => vectors.avformat_get_riff_audio_tags(); /// @{ Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the following code: /// the table mapping RIFF FourCCs for video to libavcodec AVCodecID. public static AVCodecTag* avformat_get_riff_video_tags() => vectors.avformat_get_riff_video_tags(); /// Get the index entry count for the given AVStream. /// stream /// the number of index entries in the stream public static int avformat_index_get_entries_count(AVStream* @st) => vectors.avformat_index_get_entries_count(@st); /// Get the AVIndexEntry corresponding to the given index. /// Stream containing the requested AVIndexEntry. /// The desired index. /// A pointer to the requested AVIndexEntry if it exists, NULL otherwise. public static AVIndexEntry* avformat_index_get_entry(AVStream* @st, int @idx) => vectors.avformat_index_get_entry(@st, @idx); /// Get the AVIndexEntry corresponding to the given timestamp. /// Stream containing the requested AVIndexEntry. /// Timestamp to retrieve the index entry for. /// If AVSEEK_FLAG_BACKWARD then the returned entry will correspond to the timestamp which is < = the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise. /// A pointer to the requested AVIndexEntry if it exists, NULL otherwise. public static AVIndexEntry* avformat_index_get_entry_from_timestamp(AVStream* @st, long @wanted_timestamp, int @flags) => vectors.avformat_index_get_entry_from_timestamp(@st, @wanted_timestamp, @flags); /// Allocate the stream private data and initialize the codec, but do not write the header. May optionally be used before avformat_write_header() to initialize stream parameters before actually writing the header. If using this function, do not pass the same options to avformat_write_header(). /// Media file handle, must be allocated with avformat_alloc_context(). Its "oformat" field must be set to the desired output format; Its "pb" field must be set to an already opened ::AVIOContext. /// An ::AVDictionary filled with AVFormatContext and muxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. public static int avformat_init_output(AVFormatContext* @s, AVDictionary** @options) => vectors.avformat_init_output(@s, @options); /// Return the libavformat license. public static string avformat_license() => vectors.avformat_license(); /// Check if the stream st contained in s is matched by the stream specifier spec. /// >0 if st is matched by spec; 0 if st is not matched by spec; AVERROR code if spec is invalid public static int avformat_match_stream_specifier(AVFormatContext* @s, AVStream* @st, string @spec) => vectors.avformat_match_stream_specifier(@s, @st, @spec); /// Undo the initialization done by avformat_network_init. Call it only once for each time you called avformat_network_init. public static int avformat_network_deinit() => vectors.avformat_network_deinit(); /// Do global initialization of network libraries. This is optional, and not recommended anymore. public static int avformat_network_init() => vectors.avformat_network_init(); /// Add a new stream to a media file. /// media file handle /// unused, does nothing /// newly created stream or NULL on error. public static AVStream* avformat_new_stream(AVFormatContext* @s, AVCodec* @c) => vectors.avformat_new_stream(@s, @c); /// Test if the given container can store a codec. /// container to check for compatibility /// codec to potentially store in container /// standards compliance level, one of FF_COMPLIANCE_* /// 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. A negative number if this information is not available. public static int avformat_query_codec(AVOutputFormat* @ofmt, AVCodecID @codec_id, int @std_compliance) => vectors.avformat_query_codec(@ofmt, @codec_id, @std_compliance); public static int avformat_queue_attached_pictures(AVFormatContext* @s) => vectors.avformat_queue_attached_pictures(@s); /// Add an already allocated stream to a stream group. /// stream group belonging to a media file. /// stream in the media file to add to the group. public static int avformat_stream_group_add_stream(AVStreamGroup* @stg, AVStream* @st) => vectors.avformat_stream_group_add_stream(@stg, @st); /// Add a new empty stream group to a media file. /// media file handle /// newly created group or NULL on error. public static AVStreamGroup* avformat_stream_group_create(AVFormatContext* @s, AVStreamGroupParamsType @type, AVDictionary** @options) => vectors.avformat_stream_group_create(@s, @type, @options); /// Returns a string identifying the stream group type, or NULL if unknown /// a string identifying the stream group type, or NULL if unknown public static string avformat_stream_group_name(AVStreamGroupParamsType @type) => vectors.avformat_stream_group_name(@type); /// Transfer internal timing information from one stream to another. /// target output format for ost /// output stream which needs timings copy and adjustments /// reference input stream to copy timings from /// define from where the stream codec timebase needs to be imported public static int avformat_transfer_internal_stream_timing_info(AVOutputFormat* @ofmt, AVStream* @ost, AVStream* @ist, AVTimebaseSource @copy_tb) => vectors.avformat_transfer_internal_stream_timing_info(@ofmt, @ost, @ist, @copy_tb); /// Return the LIBAVFORMAT_VERSION_INT constant. public static uint avformat_version() => vectors.avformat_version(); /// Allocate the stream private data and write the stream header to an output media file. /// Media file handle, must be allocated with avformat_alloc_context(). Its "oformat" field must be set to the desired output format; Its "pb" field must be set to an already opened ::AVIOContext. /// An ::AVDictionary filled with AVFormatContext and muxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. public static int avformat_write_header(AVFormatContext* @s, AVDictionary** @options) => vectors.avformat_write_header(@s, @options); /// Accept and allocate a client context on a server context. /// the server context /// the client context, must be unallocated /// >= 0 on success or a negative value corresponding to an AVERROR on failure public static int avio_accept(AVIOContext* @s, AVIOContext** @c) => vectors.avio_accept(@s, @c); /// Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url, or a negative value corresponding to an AVERROR code in case of failure. The returned access flags are masked by the value in flags. public static int avio_check(string @url, int @flags) => vectors.avio_check(@url, @flags); /// Close the resource accessed by the AVIOContext s and free it. This function can only be used if s was opened by avio_open(). /// 0 on success, an AVERROR < 0 on error. public static int avio_close(AVIOContext* @s) => vectors.avio_close(@s); /// Close directory. /// directory read context. /// >=0 on success or negative on error. public static int avio_close_dir(AVIODirContext** @s) => vectors.avio_close_dir(@s); /// Return the written size and a pointer to the buffer. The buffer must be freed with av_free(). Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. /// IO context /// pointer to a byte buffer /// the length of the byte buffer public static int avio_close_dyn_buf(AVIOContext* @s, byte** @pbuffer) => vectors.avio_close_dyn_buf(@s, @pbuffer); /// Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL. This function can only be used if s was opened by avio_open(). /// 0 on success, an AVERROR < 0 on error. public static int avio_closep(AVIOContext** @s) => vectors.avio_closep(@s); /// Iterate through names of available protocols. /// A private pointer representing current protocol. It must be a pointer to NULL on first iteration and will be updated by successive calls to avio_enum_protocols. /// If set to 1, iterate over output protocols, otherwise over input protocols. /// A static string containing the name of current protocol or NULL public static string avio_enum_protocols(void** @opaque, int @output) => vectors.avio_enum_protocols(@opaque, @output); /// Similar to feof() but also returns nonzero on read errors. /// non zero if and only if at end of file or a read error happened when reading. public static int avio_feof(AVIOContext* @s) => vectors.avio_feof(@s); /// Return the name of the protocol that will handle the passed URL. /// Name of the protocol or NULL. public static string avio_find_protocol_name(string @url) => vectors.avio_find_protocol_name(@url); /// Force flushing of buffered data. public static void avio_flush(AVIOContext* @s) => vectors.avio_flush(@s); /// Free entry allocated by avio_read_dir(). /// entry to be freed. public static void avio_free_directory_entry(AVIODirEntry** @entry) => vectors.avio_free_directory_entry(@entry); /// Return the written size and a pointer to the buffer. The AVIOContext stream is left intact. The buffer must NOT be freed. No padding is added to the buffer. /// IO context /// pointer to a byte buffer /// the length of the byte buffer public static int avio_get_dyn_buf(AVIOContext* @s, byte** @pbuffer) => vectors.avio_get_dyn_buf(@s, @pbuffer); /// Read a string from pb into buf. The reading will terminate when either a NULL character was encountered, maxlen bytes have been read, or nothing more can be read from pb. The result is guaranteed to be NULL-terminated, it will be truncated if buf is too small. Note that the string is not interpreted or validated in any way, it might get truncated in the middle of a sequence for multi-byte encodings. /// number of bytes read (is always < = maxlen). If reading ends on EOF or error, the return value will be one more than bytes actually read. public static int avio_get_str(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen) => vectors.avio_get_str(@pb, @maxlen, @buf, @buflen); public static int avio_get_str16be(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen) => vectors.avio_get_str16be(@pb, @maxlen, @buf, @buflen); /// Read a UTF-16 string from pb and convert it to UTF-8. The reading will terminate when either a null or invalid character was encountered or maxlen bytes have been read. /// number of bytes read (is always < = maxlen) public static int avio_get_str16le(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen) => vectors.avio_get_str16le(@pb, @maxlen, @buf, @buflen); /// Perform one step of the protocol handshake to accept a new client. This function must be called on a client returned by avio_accept() before using it as a read/write context. It is separate from avio_accept() because it may block. A step of the handshake is defined by places where the application may decide to change the proceedings. For example, on a protocol with a request header and a reply header, each one can constitute a step because the application may use the parameters from the request to change parameters in the reply; or each individual chunk of the request can constitute a step. If the handshake is already finished, avio_handshake() does nothing and returns 0 immediately. /// the client context to perform the handshake on /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code public static int avio_handshake(AVIOContext* @c) => vectors.avio_handshake(@c); /// Create and initialize a AVIOContext for accessing the resource indicated by url. /// Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL. /// resource to access /// flags which control how the resource indicated by url is to be opened /// >= 0 in case of success, a negative value corresponding to an AVERROR code in case of failure public static int avio_open(AVIOContext** @s, string @url, int @flags) => vectors.avio_open(@s, @url, @flags); /// Open directory for reading. /// directory read context. Pointer to a NULL pointer must be passed. /// directory to be listed. /// A dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dictionary containing options that were not found. May be NULL. /// >=0 on success or negative on error. public static int avio_open_dir(AVIODirContext** @s, string @url, AVDictionary** @options) => vectors.avio_open_dir(@s, @url, @options); /// Open a write only memory stream. /// new IO context /// zero if no error. public static int avio_open_dyn_buf(AVIOContext** @s) => vectors.avio_open_dyn_buf(@s); /// Create and initialize a AVIOContext for accessing the resource indicated by url. /// Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL. /// resource to access /// flags which control how the resource indicated by url is to be opened /// an interrupt callback to be used at the protocols level /// A dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. /// >= 0 in case of success, a negative value corresponding to an AVERROR code in case of failure public static int avio_open2(AVIOContext** @s, string @url, int @flags, AVIOInterruptCB* @int_cb, AVDictionary** @options) => vectors.avio_open2(@s, @url, @flags, @int_cb, @options); /// Pause and resume playing - only meaningful if using a network streaming protocol (e.g. MMS). /// IO context from which to call the read_pause function pointer /// 1 for pause, 0 for resume public static int avio_pause(AVIOContext* @h, int @pause) => vectors.avio_pause(@h, @pause); /// Write a NULL terminated array of strings to the context. Usually you don't need to use this function directly but its macro wrapper, avio_print. public static void avio_print_string_array(AVIOContext* @s, byte*[] @strings) => vectors.avio_print_string_array(@s, @strings); /// Writes a formatted string to the context. /// number of bytes written, < 0 on error. public static int avio_printf(AVIOContext* @s, string @fmt) => vectors.avio_printf(@s, @fmt); /// Get AVClass by names of available protocols. /// A AVClass of input protocol name or NULL public static AVClass* avio_protocol_get_class(string @name) => vectors.avio_protocol_get_class(@name); /// Write a NULL-terminated string. /// number of bytes written. public static int avio_put_str(AVIOContext* @s, string @str) => vectors.avio_put_str(@s, @str); /// Convert an UTF-8 string to UTF-16BE and write it. /// the AVIOContext /// NULL-terminated UTF-8 string /// number of bytes written. public static int avio_put_str16be(AVIOContext* @s, string @str) => vectors.avio_put_str16be(@s, @str); /// Convert an UTF-8 string to UTF-16LE and write it. /// the AVIOContext /// NULL-terminated UTF-8 string /// number of bytes written. public static int avio_put_str16le(AVIOContext* @s, string @str) => vectors.avio_put_str16le(@s, @str); /// @{ public static int avio_r8(AVIOContext* @s) => vectors.avio_r8(@s); public static uint avio_rb16(AVIOContext* @s) => vectors.avio_rb16(@s); public static uint avio_rb24(AVIOContext* @s) => vectors.avio_rb24(@s); public static uint avio_rb32(AVIOContext* @s) => vectors.avio_rb32(@s); public static ulong avio_rb64(AVIOContext* @s) => vectors.avio_rb64(@s); /// Read size bytes from AVIOContext into buf. /// number of bytes read or AVERROR public static int avio_read(AVIOContext* @s, byte* @buf, int @size) => vectors.avio_read(@s, @buf, @size); /// Get next directory entry. /// directory read context. /// next entry or NULL when no more entries. /// >=0 on success or negative on error. End of list is not considered an error. public static int avio_read_dir(AVIODirContext* @s, AVIODirEntry** @next) => vectors.avio_read_dir(@s, @next); /// Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed to read fewer bytes than requested. The missing bytes can be read in the next call. This always tries to read at least 1 byte. Useful to reduce latency in certain cases. /// number of bytes read or AVERROR public static int avio_read_partial(AVIOContext* @s, byte* @buf, int @size) => vectors.avio_read_partial(@s, @buf, @size); /// Read contents of h into print buffer, up to max_size bytes, or up to EOF. /// 0 for success (max_size bytes read or EOF reached), negative error code otherwise public static int avio_read_to_bprint(AVIOContext* @h, AVBPrint* @pb, ulong @max_size) => vectors.avio_read_to_bprint(@h, @pb, @max_size); public static uint avio_rl16(AVIOContext* @s) => vectors.avio_rl16(@s); public static uint avio_rl24(AVIOContext* @s) => vectors.avio_rl24(@s); public static uint avio_rl32(AVIOContext* @s) => vectors.avio_rl32(@s); public static ulong avio_rl64(AVIOContext* @s) => vectors.avio_rl64(@s); /// fseek() equivalent for AVIOContext. /// new position or AVERROR. public static long avio_seek(AVIOContext* @s, long @offset, int @whence) => vectors.avio_seek(@s, @offset, @whence); /// Seek to a given timestamp relative to some component stream. Only meaningful if using a network streaming protocol (e.g. MMS.). /// IO context from which to call the seek function pointers /// The stream index that the timestamp is relative to. If stream_index is (-1) the timestamp should be in AV_TIME_BASE units from the beginning of the presentation. If a stream_index >= 0 is used and the protocol does not support seeking based on component streams, the call will fail. /// timestamp in AVStream.time_base units or if there is no stream specified then in AV_TIME_BASE units. /// Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE and AVSEEK_FLAG_ANY. The protocol may silently ignore AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will fail if used and not supported. /// >= 0 on success public static long avio_seek_time(AVIOContext* @h, int @stream_index, long @timestamp, int @flags) => vectors.avio_seek_time(@h, @stream_index, @timestamp, @flags); /// Get the filesize. /// filesize or AVERROR public static long avio_size(AVIOContext* @s) => vectors.avio_size(@s); /// Skip given number of bytes forward /// new position or AVERROR. public static long avio_skip(AVIOContext* @s, long @offset) => vectors.avio_skip(@s, @offset); /// Writes a formatted string to the context taking a va_list. /// number of bytes written, < 0 on error. public static int avio_vprintf(AVIOContext* @s, string @fmt, byte* @ap) => vectors.avio_vprintf(@s, @fmt, @ap); public static void avio_w8(AVIOContext* @s, int @b) => vectors.avio_w8(@s, @b); public static void avio_wb16(AVIOContext* @s, uint @val) => vectors.avio_wb16(@s, @val); public static void avio_wb24(AVIOContext* @s, uint @val) => vectors.avio_wb24(@s, @val); public static void avio_wb32(AVIOContext* @s, uint @val) => vectors.avio_wb32(@s, @val); public static void avio_wb64(AVIOContext* @s, ulong @val) => vectors.avio_wb64(@s, @val); public static void avio_wl16(AVIOContext* @s, uint @val) => vectors.avio_wl16(@s, @val); public static void avio_wl24(AVIOContext* @s, uint @val) => vectors.avio_wl24(@s, @val); public static void avio_wl32(AVIOContext* @s, uint @val) => vectors.avio_wl32(@s, @val); public static void avio_wl64(AVIOContext* @s, ulong @val) => vectors.avio_wl64(@s, @val); public static void avio_write(AVIOContext* @s, byte* @buf, int @size) => vectors.avio_write(@s, @buf, @size); /// Mark the written bytestream as a specific type. /// the AVIOContext /// the stream time the current bytestream pos corresponds to (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not applicable /// the kind of data written starting at the current pos public static void avio_write_marker(AVIOContext* @s, long @time, AVIODataMarkerType @type) => vectors.avio_write_marker(@s, @time, @type); /// Free all allocated data in the given subtitle struct. /// AVSubtitle to free. public static void avsubtitle_free(AVSubtitle* @sub) => vectors.avsubtitle_free(@sub); /// Return the libavutil build-time configuration. public static string avutil_configuration() => vectors.avutil_configuration(); /// Return the libavutil license. public static string avutil_license() => vectors.avutil_license(); /// Return the LIBAVUTIL_VERSION_INT constant. public static uint avutil_version() => vectors.avutil_version(); /// Return the libpostproc build-time configuration. public static string postproc_configuration() => vectors.postproc_configuration(); /// Return the libpostproc license. public static string postproc_license() => vectors.postproc_license(); /// Return the LIBPOSTPROC_VERSION_INT constant. public static uint postproc_version() => vectors.postproc_version(); public static void pp_free_context(void* @ppContext) => vectors.pp_free_context(@ppContext); public static void pp_free_mode(void* @mode) => vectors.pp_free_mode(@mode); public static void* pp_get_context(int @width, int @height, int @flags) => vectors.pp_get_context(@width, @height, @flags); /// Return a pp_mode or NULL if an error occurred. /// the string after "-pp" on the command line /// a number from 0 to PP_QUALITY_MAX public static void* pp_get_mode_by_name_and_quality(string @name, int @quality) => vectors.pp_get_mode_by_name_and_quality(@name, @quality); public static void pp_postprocess(in byte_ptr3 @src, in int3 @srcStride, ref byte_ptr3 @dst, in int3 @dstStride, int @horizontalSize, int @verticalSize, sbyte* @QP_store, int @QP_stride, void* @mode, void* @ppContext, int @pict_type) => vectors.pp_postprocess(@src, @srcStride, ref @dst, @dstStride, @horizontalSize, @verticalSize, @QP_store, @QP_stride, @mode, @ppContext, @pict_type); /// Allocate SwrContext. /// NULL on error, allocated context otherwise public static SwrContext* swr_alloc() => vectors.swr_alloc(); /// Allocate SwrContext if needed and set/reset common parameters. /// Pointer to an existing Swr context if available, or to NULL if not. On success, *ps will be set to the allocated context. /// output channel layout (e.g. AV_CHANNEL_LAYOUT_*) /// output sample format (AV_SAMPLE_FMT_*). /// output sample rate (frequency in Hz) /// input channel layout (e.g. AV_CHANNEL_LAYOUT_*) /// input sample format (AV_SAMPLE_FMT_*). /// input sample rate (frequency in Hz) /// logging level offset /// parent logging context, can be NULL /// 0 on success, a negative AVERROR code on error. On error, the Swr context is freed and *ps set to NULL. public static int swr_alloc_set_opts2(SwrContext** @ps, AVChannelLayout* @out_ch_layout, AVSampleFormat @out_sample_fmt, int @out_sample_rate, AVChannelLayout* @in_ch_layout, AVSampleFormat @in_sample_fmt, int @in_sample_rate, int @log_offset, void* @log_ctx) => vectors.swr_alloc_set_opts2(@ps, @out_ch_layout, @out_sample_fmt, @out_sample_rate, @in_ch_layout, @in_sample_fmt, @in_sample_rate, @log_offset, @log_ctx); /// Generate a channel mixing matrix. /// input channel layout /// output channel layout /// mix level for the center channel /// mix level for the surround channel(s) /// mix level for the low-frequency effects channel /// mixing coefficients; matrix[i + stride * o] is the weight of input channel i in output channel o. /// distance between adjacent input channels in the matrix array /// matrixed stereo downmix mode (e.g. dplii) /// 0 on success, negative AVERROR code on failure public static int swr_build_matrix2(AVChannelLayout* @in_layout, AVChannelLayout* @out_layout, double @center_mix_level, double @surround_mix_level, double @lfe_mix_level, double @maxval, double @rematrix_volume, double* @matrix, long @stride, AVMatrixEncoding @matrix_encoding, void* @log_context) => vectors.swr_build_matrix2(@in_layout, @out_layout, @center_mix_level, @surround_mix_level, @lfe_mix_level, @maxval, @rematrix_volume, @matrix, @stride, @matrix_encoding, @log_context); /// Closes the context so that swr_is_initialized() returns 0. /// Swr context to be closed public static void swr_close(SwrContext* @s) => vectors.swr_close(@s); /// Configure or reconfigure the SwrContext using the information provided by the AVFrames. /// audio resample context /// output AVFrame /// input AVFrame /// 0 on success, AVERROR on failure. public static int swr_config_frame(SwrContext* @swr, AVFrame* @out, AVFrame* @in) => vectors.swr_config_frame(@swr, @out, @in); /// Convert audio. /// allocated Swr context, with parameters set /// output buffers, only the first one need be set in case of packed audio /// amount of space available for output in samples per channel /// input buffers, only the first one need to be set in case of packed audio /// number of input samples available in one channel /// number of samples output per channel, negative value on error public static int swr_convert(SwrContext* @s, byte** @out, int @out_count, byte** @in, int @in_count) => vectors.swr_convert(@s, @out, @out_count, @in, @in_count); /// Convert the samples in the input AVFrame and write them to the output AVFrame. /// audio resample context /// output AVFrame /// input AVFrame /// 0 on success, AVERROR on failure or nonmatching configuration. public static int swr_convert_frame(SwrContext* @swr, AVFrame* @output, AVFrame* @input) => vectors.swr_convert_frame(@swr, @output, @input); /// Drops the specified number of output samples. /// allocated Swr context /// number of samples to be dropped /// >= 0 on success, or a negative AVERROR code on failure public static int swr_drop_output(SwrContext* @s, int @count) => vectors.swr_drop_output(@s, @count); /// Free the given SwrContext and set the pointer to NULL. /// a pointer to a pointer to Swr context public static void swr_free(SwrContext** @s) => vectors.swr_free(@s); /// Get the AVClass for SwrContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. /// the AVClass of SwrContext public static AVClass* swr_get_class() => vectors.swr_get_class(); /// Gets the delay the next input sample will experience relative to the next output sample. /// swr context /// timebase in which the returned delay will be: public static long swr_get_delay(SwrContext* @s, long @base) => vectors.swr_get_delay(@s, @base); /// Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples. This depends on the internal state, and anything changing the internal state (like further swr_convert() calls) will may change the number of samples swr_get_out_samples() returns for the same number of input samples. /// number of input samples. public static int swr_get_out_samples(SwrContext* @s, int @in_samples) => vectors.swr_get_out_samples(@s, @in_samples); /// Initialize context after user parameters have been set. /// Swr context to initialize /// AVERROR error code in case of failure. public static int swr_init(SwrContext* @s) => vectors.swr_init(@s); /// Injects the specified number of silence samples. /// allocated Swr context /// number of samples to be dropped /// >= 0 on success, or a negative AVERROR code on failure public static int swr_inject_silence(SwrContext* @s, int @count) => vectors.swr_inject_silence(@s, @count); /// Check whether an swr context has been initialized or not. /// Swr context to check /// positive if it has been initialized, 0 if not initialized public static int swr_is_initialized(SwrContext* @s) => vectors.swr_is_initialized(@s); /// Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate) units. /// initialized Swr context /// timestamp for the next input sample, INT64_MIN if unknown /// the output timestamp for the next output sample public static long swr_next_pts(SwrContext* @s, long @pts) => vectors.swr_next_pts(@s, @pts); /// Set a customized input channel mapping. /// allocated Swr context, not yet initialized /// customized input channel mapping (array of channel indexes, -1 for a muted channel) /// >= 0 on success, or AVERROR error code in case of failure. public static int swr_set_channel_mapping(SwrContext* @s, int* @channel_map) => vectors.swr_set_channel_mapping(@s, @channel_map); /// Activate resampling compensation ("soft" compensation). This function is internally called when needed in swr_next_pts(). /// allocated Swr context. If it is not initialized, or SWR_FLAG_RESAMPLE is not set, swr_init() is called with the flag set. /// delta in PTS per sample /// number of samples to compensate for /// >= 0 on success, AVERROR error codes if: public static int swr_set_compensation(SwrContext* @s, int @sample_delta, int @compensation_distance) => vectors.swr_set_compensation(@s, @sample_delta, @compensation_distance); /// Set a customized remix matrix. /// allocated Swr context, not yet initialized /// remix coefficients; matrix[i + stride * o] is the weight of input channel i in output channel o /// offset between lines of the matrix /// >= 0 on success, or AVERROR error code in case of failure. public static int swr_set_matrix(SwrContext* @s, double* @matrix, int @stride) => vectors.swr_set_matrix(@s, @matrix, @stride); /// Return the swr build-time configuration. public static string swresample_configuration() => vectors.swresample_configuration(); /// Return the swr license. public static string swresample_license() => vectors.swresample_license(); /// Return the LIBSWRESAMPLE_VERSION_INT constant. public static uint swresample_version() => vectors.swresample_version(); /// Allocate an empty SwsContext. This must be filled and passed to sws_init_context(). For filling see AVOptions, options.c and sws_setColorspaceDetails(). public static SwsContext* sws_alloc_context() => vectors.sws_alloc_context(); /// Allocate and return an uninitialized vector with length coefficients. public static SwsVector* sws_allocVec(int @length) => vectors.sws_allocVec(@length); /// Convert an 8-bit paletted frame into a frame with a color depth of 24 bits. /// source frame buffer /// destination frame buffer /// number of pixels to convert /// array with [256] entries, which must match color arrangement (RGB or BGR) of src public static void sws_convertPalette8ToPacked24(byte* @src, byte* @dst, int @num_pixels, byte* @palette) => vectors.sws_convertPalette8ToPacked24(@src, @dst, @num_pixels, @palette); /// Convert an 8-bit paletted frame into a frame with a color depth of 32 bits. /// source frame buffer /// destination frame buffer /// number of pixels to convert /// array with [256] entries, which must match color arrangement (RGB or BGR) of src public static void sws_convertPalette8ToPacked32(byte* @src, byte* @dst, int @num_pixels, byte* @palette) => vectors.sws_convertPalette8ToPacked32(@src, @dst, @num_pixels, @palette); /// Finish the scaling process for a pair of source/destination frames previously submitted with sws_frame_start(). Must be called after all sws_send_slice() and sws_receive_slice() calls are done, before any new sws_frame_start() calls. /// The scaling context public static void sws_frame_end(SwsContext* @c) => vectors.sws_frame_end(@c); /// Initialize the scaling process for a given pair of source/destination frames. Must be called before any calls to sws_send_slice() and sws_receive_slice(). /// The scaling context /// The destination frame. /// The source frame. The data buffers must be allocated, but the frame data does not have to be ready at this point. Data availability is then signalled by sws_send_slice(). /// 0 on success, a negative AVERROR code on failure public static int sws_frame_start(SwsContext* @c, AVFrame* @dst, AVFrame* @src) => vectors.sws_frame_start(@c, @dst, @src); /// Free the swscaler context swsContext. If swsContext is NULL, then does nothing. public static void sws_freeContext(SwsContext* @swsContext) => vectors.sws_freeContext(@swsContext); public static void sws_freeFilter(SwsFilter* @filter) => vectors.sws_freeFilter(@filter); public static void sws_freeVec(SwsVector* @a) => vectors.sws_freeVec(@a); /// Get the AVClass for swsContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. public static AVClass* sws_get_class() => vectors.sws_get_class(); /// Check if context can be reused, otherwise reallocate a new one. public static SwsContext* sws_getCachedContext(SwsContext* @context, int @srcW, int @srcH, AVPixelFormat @srcFormat, int @dstW, int @dstH, AVPixelFormat @dstFormat, int @flags, SwsFilter* @srcFilter, SwsFilter* @dstFilter, double* @param) => vectors.sws_getCachedContext(@context, @srcW, @srcH, @srcFormat, @dstW, @dstH, @dstFormat, @flags, @srcFilter, @dstFilter, @param); /// Return a pointer to yuv<->rgb coefficients for the given colorspace suitable for sws_setColorspaceDetails(). /// One of the SWS_CS_* macros. If invalid, SWS_CS_DEFAULT is used. public static int* sws_getCoefficients(int @colorspace) => vectors.sws_getCoefficients(@colorspace); /// Returns A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. /// A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. public static int sws_getColorspaceDetails(SwsContext* @c, int** @inv_table, int* @srcRange, int** @table, int* @dstRange, int* @brightness, int* @contrast, int* @saturation) => vectors.sws_getColorspaceDetails(@c, @inv_table, @srcRange, @table, @dstRange, @brightness, @contrast, @saturation); /// Allocate and return an SwsContext. You need it to perform scaling/conversion operations using sws_scale(). /// the width of the source image /// the height of the source image /// the source image format /// the width of the destination image /// the height of the destination image /// the destination image format /// specify which algorithm and options to use for rescaling /// extra parameters to tune the used scaler For SWS_BICUBIC param[0] and [1] tune the shape of the basis function, param[0] tunes f(1) and param[1] f´(1) For SWS_GAUSS param[0] tunes the exponent and thus cutoff frequency For SWS_LANCZOS param[0] tunes the width of the window function /// a pointer to an allocated context, or NULL in case of error public static SwsContext* sws_getContext(int @srcW, int @srcH, AVPixelFormat @srcFormat, int @dstW, int @dstH, AVPixelFormat @dstFormat, int @flags, SwsFilter* @srcFilter, SwsFilter* @dstFilter, double* @param) => vectors.sws_getContext(@srcW, @srcH, @srcFormat, @dstW, @dstH, @dstFormat, @flags, @srcFilter, @dstFilter, @param); public static SwsFilter* sws_getDefaultFilter(float @lumaGBlur, float @chromaGBlur, float @lumaSharpen, float @chromaSharpen, float @chromaHShift, float @chromaVShift, int @verbose) => vectors.sws_getDefaultFilter(@lumaGBlur, @chromaGBlur, @lumaSharpen, @chromaSharpen, @chromaHShift, @chromaVShift, @verbose); /// Return a normalized Gaussian curve used to filter stuff quality = 3 is high quality, lower is lower quality. public static SwsVector* sws_getGaussianVec(double @variance, double @quality) => vectors.sws_getGaussianVec(@variance, @quality); /// Initialize the swscaler context sws_context. /// zero or positive value on success, a negative value on error public static int sws_init_context(SwsContext* @sws_context, SwsFilter* @srcFilter, SwsFilter* @dstFilter) => vectors.sws_init_context(@sws_context, @srcFilter, @dstFilter); /// Returns a positive value if an endianness conversion for pix_fmt is supported, 0 otherwise. /// the pixel format /// a positive value if an endianness conversion for pix_fmt is supported, 0 otherwise. public static int sws_isSupportedEndiannessConversion(AVPixelFormat @pix_fmt) => vectors.sws_isSupportedEndiannessConversion(@pix_fmt); /// Return a positive value if pix_fmt is a supported input format, 0 otherwise. public static int sws_isSupportedInput(AVPixelFormat @pix_fmt) => vectors.sws_isSupportedInput(@pix_fmt); /// Return a positive value if pix_fmt is a supported output format, 0 otherwise. public static int sws_isSupportedOutput(AVPixelFormat @pix_fmt) => vectors.sws_isSupportedOutput(@pix_fmt); /// Scale all the coefficients of a so that their sum equals height. public static void sws_normalizeVec(SwsVector* @a, double @height) => vectors.sws_normalizeVec(@a, @height); /// Request a horizontal slice of the output data to be written into the frame previously provided to sws_frame_start(). /// The scaling context /// first row of the slice; must be a multiple of sws_receive_slice_alignment() /// number of rows in the slice; must be a multiple of sws_receive_slice_alignment(), except for the last slice (i.e. when slice_start+slice_height is equal to output frame height) /// a non-negative number if the data was successfully written into the output AVERROR(EAGAIN) if more input data needs to be provided before the output can be produced another negative AVERROR code on other kinds of scaling failure public static int sws_receive_slice(SwsContext* @c, uint @slice_start, uint @slice_height) => vectors.sws_receive_slice(@c, @slice_start, @slice_height); /// Get the alignment required for slices /// The scaling context /// alignment required for output slices requested with sws_receive_slice(). Slice offsets and sizes passed to sws_receive_slice() must be multiples of the value returned from this function. public static uint sws_receive_slice_alignment(SwsContext* @c) => vectors.sws_receive_slice_alignment(@c); /// Scale the image slice in srcSlice and put the resulting scaled slice in the image in dst. A slice is a sequence of consecutive rows in an image. /// the scaling context previously created with sws_getContext() /// the array containing the pointers to the planes of the source slice /// the array containing the strides for each plane of the source image /// the position in the source image of the slice to process, that is the number (counted starting from zero) in the image of the first row of the slice /// the height of the source slice, that is the number of rows in the slice /// the array containing the pointers to the planes of the destination image /// the array containing the strides for each plane of the destination image /// the height of the output slice public static int sws_scale(SwsContext* @c, byte*[] @srcSlice, int[] @srcStride, int @srcSliceY, int @srcSliceH, byte*[] @dst, int[] @dstStride) => vectors.sws_scale(@c, @srcSlice, @srcStride, @srcSliceY, @srcSliceH, @dst, @dstStride); /// Scale source data from src and write the output to dst. /// The scaling context /// The destination frame. See documentation for sws_frame_start() for more details. /// The source frame. /// 0 on success, a negative AVERROR code on failure public static int sws_scale_frame(SwsContext* @c, AVFrame* @dst, AVFrame* @src) => vectors.sws_scale_frame(@c, @dst, @src); /// Scale all the coefficients of a by the scalar value. public static void sws_scaleVec(SwsVector* @a, double @scalar) => vectors.sws_scaleVec(@a, @scalar); /// Indicate that a horizontal slice of input data is available in the source frame previously provided to sws_frame_start(). The slices may be provided in any order, but may not overlap. For vertically subsampled pixel formats, the slices must be aligned according to subsampling. /// The scaling context /// first row of the slice /// number of rows in the slice /// a non-negative number on success, a negative AVERROR code on failure. public static int sws_send_slice(SwsContext* @c, uint @slice_start, uint @slice_height) => vectors.sws_send_slice(@c, @slice_start, @slice_height); /// Returns A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. /// the scaling context /// the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] /// flag indicating the while-black range of the input (1=jpeg / 0=mpeg) /// the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] /// flag indicating the while-black range of the output (1=jpeg / 0=mpeg) /// 16.16 fixed point brightness correction /// 16.16 fixed point contrast correction /// 16.16 fixed point saturation correction /// A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. public static int sws_setColorspaceDetails(SwsContext* @c, in int4 @inv_table, int @srcRange, in int4 @table, int @dstRange, int @brightness, int @contrast, int @saturation) => vectors.sws_setColorspaceDetails(@c, @inv_table, @srcRange, @table, @dstRange, @brightness, @contrast, @saturation); /// Return the libswscale build-time configuration. public static string swscale_configuration() => vectors.swscale_configuration(); /// Return the libswscale license. public static string swscale_license() => vectors.swscale_license(); /// Color conversion and scaling library. public static uint swscale_version() => vectors.swscale_version(); */ #endregion } }