/*----------------------------------------------------------------
// 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 unsafe partial struct _GUID
// {
// public ulong @Data1;
// public ushort @Data2;
// public ushort @Data3;
// public byte8 @Data4;
// }
// public unsafe partial struct _iobuf
// {
// public void* @_Placeholder;
// }
// public unsafe partial struct AVBitStreamFilter
// {
// public byte* @name;
// /// A list of codec ids supported by the filter, terminated by AV_CODEC_ID_NONE. May be NULL, in that case the bitstream filter works with any codec id.
// public AVCodecID* @codec_ids;
// /// A class for the private data, used to declare bitstream filter private AVOptions. This field is NULL for bitstream filters that do not declare any options.
// public AVClass* @priv_class;
// }
// /// The bitstream filter state.
// public unsafe partial struct AVBSFContext
// {
// /// A class for logging and AVOptions
// public AVClass* @av_class;
// /// The bitstream filter this context is an instance of.
// public AVBitStreamFilter* @filter;
// /// Opaque filter-specific private data. If filter->priv_class is non-NULL, this is an AVOptions-enabled struct.
// public void* @priv_data;
// /// Parameters of the input stream. This field is allocated in av_bsf_alloc(), it needs to be filled by the caller before av_bsf_init().
// public AVCodecParameters* @par_in;
// /// Parameters of the output stream. This field is allocated in av_bsf_alloc(), it is set by the filter in av_bsf_init().
// public AVCodecParameters* @par_out;
// /// The timebase used for the timestamps of the input packets. Set by the caller before av_bsf_init().
// public AVRational @time_base_in;
// /// The timebase used for the timestamps of the output packets. Set by the filter in av_bsf_init().
// public AVRational @time_base_out;
// }
/// A reference to a data buffer.
public unsafe partial struct AVBufferRef
{
public AVBuffer* @buffer;
/// The data buffer. It is considered writable if and only if this is the only reference to the buffer, in which case av_buffer_is_writable() returns 1.
public byte* @data;
/// Size of data in bytes.
public ulong @size;
}
// /// This structure contains the parameters describing the frames that will be passed to this filter.
// public unsafe partial struct AVBufferSrcParameters
// {
// /// video: the pixel format, value corresponds to enum AVPixelFormat audio: the sample format, value corresponds to enum AVSampleFormat
// public int @format;
// /// The timebase to be used for the timestamps on the input frames.
// public AVRational @time_base;
// /// Video only, the display dimensions of the input frames.
// public int @width;
// /// Video only, the display dimensions of the input frames.
// public int @height;
// /// Video only, the sample (pixel) aspect ratio.
// public AVRational @sample_aspect_ratio;
// /// Video only, the frame rate of the input video. This field must only be set to a non-zero value if input stream has a known constant framerate and should be left at its initial value if the framerate is variable or unknown.
// public AVRational @frame_rate;
// /// Video with a hwaccel pixel format only. This should be a reference to an AVHWFramesContext instance describing the input frames.
// public AVBufferRef* @hw_frames_ctx;
// /// Audio only, the audio sampling rate in samples per second.
// public int @sample_rate;
// /// Audio only, the audio channel layout
// public AVChannelLayout @ch_layout;
// /// Video only, the YUV colorspace and range.
// public AVColorSpace @color_space;
// public AVColorRange @color_range;
// }
/// An AVChannelCustom defines a single channel within a custom order layout
public unsafe partial struct AVChannelCustom
{
public AVChannel @id;
public byte16 @name;
public void* @opaque;
}
/// An AVChannelLayout holds information about the channel layout of audio data.
public unsafe partial struct AVChannelLayout
{
/// Channel order used in this layout. This is a mandatory field.
public AVChannelOrder @order;
/// Number of channels in this layout. Mandatory field.
public int @nb_channels;
public AVChannelLayout_u @u;
/// For some private data of the user.
public void* @opaque;
}
/// Details about which channels are present in this layout. For AV_CHANNEL_ORDER_UNSPEC, this field is undefined and must not be used.
[StructLayout(LayoutKind.Explicit)]
public unsafe partial struct AVChannelLayout_u
{
/// This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels. It is a bitmask, where the position of each set bit means that the AVChannel with the corresponding value is present.
[FieldOffset(0)]
public ulong @mask;
/// This member must be used when the channel order is AV_CHANNEL_ORDER_CUSTOM. It is a nb_channels-sized array, with each element signalling the presence of the AVChannel with the corresponding value in map[i].id.
[FieldOffset(0)]
public AVChannelCustom* @map;
}
public unsafe partial struct AVChapter
{
/// unique ID to identify the chapter
public long @id;
/// time base in which the start/end timestamps are specified
public AVRational @time_base;
/// chapter start/end time in time_base units
public long @start;
/// chapter start/end time in time_base units
public long @end;
public AVDictionary* @metadata;
}
/// Describe the class of an AVClass context structure. That is an arbitrary struct of which the first field is a pointer to an AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
public unsafe partial struct AVClass
{
/// The name of the class; usually it is the same name as the context structure type to which the AVClass is associated.
public byte* @class_name;
/// A pointer to a function which returns the name of a context instance ctx associated with the class.
public AVClass_item_name_func @item_name;
/// a pointer to the first option specified in the class if any or NULL
public AVOption* @option;
/// LIBAVUTIL_VERSION with which this structure was created. This is used to allow fields to be added without requiring major version bumps everywhere.
public int @version;
/// Offset in the structure where log_level_offset is stored. 0 means there is no such variable
public int @log_level_offset_offset;
/// Offset in the structure where a pointer to the parent context for logging is stored. For example a decoder could pass its AVCodecContext to eval as such a parent context, which an av_log() implementation could then leverage to display the parent context. The offset can be NULL.
public int @parent_log_context_offset;
/// Category used for visualization (like color) This is only set if the category is equal for all objects using this class. available since version (51 << 16 | 56 << 8 | 100)
public AVClassCategory @category;
/// Callback to return the category. available since version (51 << 16 | 59 << 8 | 100)
public AVClass_get_category_func @get_category;
/// Callback to return the supported/allowed ranges. available since version (52.12)
public AVClass_query_ranges_func @query_ranges;
/// Return next AVOptions-enabled child or NULL
public AVClass_child_next_func @child_next;
/// Iterate over the AVClasses corresponding to potential AVOptions-enabled children.
public AVClass_child_class_iterate_func @child_class_iterate;
}
/// AVCodec.
public unsafe partial struct AVCodec
{
/// Name of the codec implementation. The name is globally unique among encoders and among decoders (but an encoder and a decoder can share the same name). This is the primary way to find a codec from the user perspective.
public byte* @name;
/// Descriptive name for the codec, meant to be more human readable than name. You should use the NULL_IF_CONFIG_SMALL() macro to define it.
public byte* @long_name;
public AVMediaType @type;
public AVCodecID @id;
/// Codec capabilities. see AV_CODEC_CAP_*
public int @capabilities;
/// maximum value for lowres supported by the decoder
public byte @max_lowres;
/// array of supported framerates, or NULL if any, array is terminated by {0,0}
public AVRational* @supported_framerates;
/// array of supported pixel formats, or NULL if unknown, array is terminated by -1
public AVPixelFormat* @pix_fmts;
/// array of supported audio samplerates, or NULL if unknown, array is terminated by 0
public int* @supported_samplerates;
/// array of supported sample formats, or NULL if unknown, array is terminated by -1
public AVSampleFormat* @sample_fmts;
/// AVClass for the private context
public AVClass* @priv_class;
/// array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN}
public AVProfile* @profiles;
/// Group name of the codec implementation. This is a short symbolic name of the wrapper backing this codec. A wrapper uses some kind of external implementation for the codec, such as an external library, or a codec implementation provided by the OS or the hardware. If this field is NULL, this is a builtin, libavcodec native codec. If non-NULL, this will be the suffix in AVCodec.name in most cases (usually AVCodec.name will be of the form "<codec_name>_<wrapper_name>").
public byte* @wrapper_name;
/// Array of supported channel layouts, terminated with a zeroed layout.
public AVChannelLayout* @ch_layouts;
}
/// main external API structure. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. You can use AVOptions (av_opt* / av_set/get*()) to access these fields from user applications. The name string for AVOptions options matches the associated command line parameter name and can be found in libavcodec/options_table.h The AVOption/command line parameter names differ in some cases from the C structure field names for historic reasons or brevity. sizeof(AVCodecContext) must not be used outside libav*.
public unsafe partial struct AVCodecContext
{
/// information on struct for av_log - set by avcodec_alloc_context3
public AVClass* @av_class;
public int @log_level_offset;
public AVMediaType @codec_type;
public AVCodec* @codec;
public AVCodecID @codec_id;
/// fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). This is used to work around some encoder bugs. A demuxer should set this to what is stored in the field used to identify the codec. If there are multiple such fields in a container then the demuxer should choose the one which maximizes the information about the used codec. If the codec tag field in a container is larger than 32 bits then the demuxer should remap the longer ID to 32 bits with a table or other structure. Alternatively a new extra_codec_tag + size could be added but for this a clear advantage must be demonstrated first. - encoding: Set by user, if not then the default based on codec_id will be used. - decoding: Set by user, will be converted to uppercase by libavcodec during init.
public uint @codec_tag;
public void* @priv_data;
/// Private context used for internal data.
public AVCodecInternal* @internal;
/// Private data of the user, can be used to carry app specific stuff. - encoding: Set by user. - decoding: Set by user.
public void* @opaque;
/// the average bitrate - encoding: Set by user; unused for constant quantizer encoding. - decoding: Set by user, may be overwritten by libavcodec if this info is available in the stream
public long @bit_rate;
/// AV_CODEC_FLAG_*. - encoding: Set by user. - decoding: Set by user.
public int @flags;
/// AV_CODEC_FLAG2_* - encoding: Set by user. - decoding: Set by user.
public int @flags2;
/// some codecs need / can use extradata like Huffman tables. MJPEG: Huffman tables rv10: additional flags MPEG-4: global headers (they can be in the bitstream or here) The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger than extradata_size to avoid problems if it is read with the bitstream reader. The bytewise contents of extradata must not depend on the architecture or CPU endianness. Must be allocated with the av_malloc() family of functions. - encoding: Set/allocated/freed by libavcodec. - decoding: Set/allocated/freed by user.
public byte* @extradata;
public int @extradata_size;
/// This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented. For fixed-fps content, timebase should be 1/framerate and timestamp increments should be identically 1. This often, but not always is the inverse of the frame rate or field rate for video. 1/time_base is not the average frame rate if the frame rate is not constant.
public AVRational @time_base;
/// Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. - encoding: unused. - decoding: set by user.
public AVRational @pkt_timebase;
/// - decoding: For codecs that store a framerate value in the compressed bitstream, the decoder may export it here. { 0, 1} when unknown. - encoding: May be used to signal the framerate of CFR content to an encoder.
public AVRational @framerate;
/// For some codecs, the time base is closer to the field rate than the frame rate. Most notably, H.264 and MPEG-2 specify time_base as half of frame duration if no telecine is used ...
[Obsolete("- decoding: Use AVCodecDescriptor.props & AV_CODEC_PROP_FIELDS - encoding: Set AVCodecContext.framerate instead")]
public int @ticks_per_frame;
/// Codec delay.
public int @delay;
/// picture width / height.
public int @width;
/// picture width / height.
public int @height;
/// Bitstream width / height, may be different from width/height e.g. when the decoded frame is cropped before being output or lowres is enabled.
public int @coded_width;
/// Bitstream width / height, may be different from width/height e.g. when the decoded frame is cropped before being output or lowres is enabled.
public int @coded_height;
/// sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel. Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - encoding: Set by user. - decoding: Set by libavcodec.
public AVRational @sample_aspect_ratio;
/// Pixel format, see AV_PIX_FMT_xxx. May be set by the demuxer if known from headers. May be overridden by the decoder if it knows better.
public AVPixelFormat @pix_fmt;
/// Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - encoding: unused. - decoding: Set by libavcodec before calling get_format()
public AVPixelFormat @sw_pix_fmt;
/// Chromaticity coordinates of the source primaries. - encoding: Set by user - decoding: Set by libavcodec
public AVColorPrimaries @color_primaries;
/// Color Transfer Characteristic. - encoding: Set by user - decoding: Set by libavcodec
public AVColorTransferCharacteristic @color_trc;
/// YUV colorspace type. - encoding: Set by user - decoding: Set by libavcodec
public AVColorSpace @colorspace;
/// MPEG vs JPEG YUV range. - encoding: Set by user to override the default output color range value, If not specified, libavcodec sets the color range depending on the output format. - decoding: Set by libavcodec, can be set by the user to propagate the color range to components reading from the decoder context.
public AVColorRange @color_range;
/// This defines the location of chroma samples. - encoding: Set by user - decoding: Set by libavcodec
public AVChromaLocation @chroma_sample_location;
/// Field order - encoding: set by libavcodec - decoding: Set by user.
public AVFieldOrder @field_order;
/// number of reference frames - encoding: Set by user. - decoding: Set by lavc.
public int @refs;
/// Size of the frame reordering buffer in the decoder. For MPEG-2 it is 1 IPB or 0 low delay IP. - encoding: Set by libavcodec. - decoding: Set by libavcodec.
public int @has_b_frames;
/// slice flags - encoding: unused - decoding: Set by user.
public int @slice_flags;
/// If non NULL, 'draw_horiz_band' is called by the libavcodec decoder to draw a horizontal band. It improves cache usage. Not all codecs can do that. You must check the codec capabilities beforehand. When multithreading is used, it may be called from multiple threads at the same time; threads might draw different parts of the same AVFrame, or multiple AVFrames, and there is no guarantee that slices will be drawn in order. The function is also used by hardware acceleration APIs. It is called at least once during frame decoding to pass the data needed for hardware render. In that mode instead of pixel data, AVFrame points to a structure specific to the acceleration API. The application reads the structure and can change some fields to indicate progress or mark state. - encoding: unused - decoding: Set by user.
public AVCodecContext_draw_horiz_band_func @draw_horiz_band;
/// Callback to negotiate the pixel format. Decoding only, may be set by the caller before avcodec_open2().
public AVCodecContext_get_format_func @get_format;
/// maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 relative to the input. - encoding: Set by user. - decoding: unused
public int @max_b_frames;
/// qscale factor between IP and B-frames If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - encoding: Set by user. - decoding: unused
public float @b_quant_factor;
/// qscale offset between IP and B-frames - encoding: Set by user. - decoding: unused
public float @b_quant_offset;
/// qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + offset). If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - encoding: Set by user. - decoding: unused
public float @i_quant_factor;
/// qscale offset between P and I-frames - encoding: Set by user. - decoding: unused
public float @i_quant_offset;
/// luminance masking (0-> disabled) - encoding: Set by user. - decoding: unused
public float @lumi_masking;
/// temporary complexity masking (0-> disabled) - encoding: Set by user. - decoding: unused
public float @temporal_cplx_masking;
/// spatial complexity masking (0-> disabled) - encoding: Set by user. - decoding: unused
public float @spatial_cplx_masking;
/// p block masking (0-> disabled) - encoding: Set by user. - decoding: unused
public float @p_masking;
/// darkness masking (0-> disabled) - encoding: Set by user. - decoding: unused
public float @dark_masking;
/// noise vs. sse weight for the nsse comparison function - encoding: Set by user. - decoding: unused
public int @nsse_weight;
/// motion estimation comparison function - encoding: Set by user. - decoding: unused
public int @me_cmp;
/// subpixel motion estimation comparison function - encoding: Set by user. - decoding: unused
public int @me_sub_cmp;
/// macroblock comparison function (not supported yet) - encoding: Set by user. - decoding: unused
public int @mb_cmp;
/// interlaced DCT comparison function - encoding: Set by user. - decoding: unused
public int @ildct_cmp;
/// ME diamond size & shape - encoding: Set by user. - decoding: unused
public int @dia_size;
/// amount of previous MV predictors (2a+1 x 2a+1 square) - encoding: Set by user. - decoding: unused
public int @last_predictor_count;
/// motion estimation prepass comparison function - encoding: Set by user. - decoding: unused
public int @me_pre_cmp;
/// ME prepass diamond size & shape - encoding: Set by user. - decoding: unused
public int @pre_dia_size;
/// subpel ME quality - encoding: Set by user. - decoding: unused
public int @me_subpel_quality;
/// maximum motion estimation search range in subpel units If 0 then no limit.
public int @me_range;
/// macroblock decision mode - encoding: Set by user. - decoding: unused
public int @mb_decision;
/// custom intra quantization matrix Must be allocated with the av_malloc() family of functions, and will be freed in avcodec_free_context(). - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. - decoding: Set/allocated/freed by libavcodec.
public ushort* @intra_matrix;
/// custom inter quantization matrix Must be allocated with the av_malloc() family of functions, and will be freed in avcodec_free_context(). - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. - decoding: Set/allocated/freed by libavcodec.
public ushort* @inter_matrix;
/// custom intra quantization matrix - encoding: Set by user, can be NULL. - decoding: unused.
public ushort* @chroma_intra_matrix;
/// precision of the intra DC coefficient - 8 - encoding: Set by user. - decoding: Set by libavcodec
public int @intra_dc_precision;
/// minimum MB Lagrange multiplier - encoding: Set by user. - decoding: unused
public int @mb_lmin;
/// maximum MB Lagrange multiplier - encoding: Set by user. - decoding: unused
public int @mb_lmax;
/// - encoding: Set by user. - decoding: unused
public int @bidir_refine;
/// minimum GOP size - encoding: Set by user. - decoding: unused
public int @keyint_min;
/// the number of pictures in a group of pictures, or 0 for intra_only - encoding: Set by user. - decoding: unused
public int @gop_size;
/// Note: Value depends upon the compare function used for fullpel ME. - encoding: Set by user. - decoding: unused
public int @mv0_threshold;
/// Number of slices. Indicates number of picture subdivisions. Used for parallelized decoding. - encoding: Set by user - decoding: unused
public int @slices;
/// samples per second
public int @sample_rate;
/// sample format
public AVSampleFormat @sample_fmt;
/// Audio channel layout. - encoding: must be set by the caller, to one of AVCodec.ch_layouts. - decoding: may be set by the caller if known e.g. from the container. The decoder can then override during decoding as needed.
public AVChannelLayout @ch_layout;
/// Number of samples per channel in an audio frame.
public int @frame_size;
/// number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
public int @block_align;
/// Audio cutoff bandwidth (0 means "automatic") - encoding: Set by user. - decoding: unused
public int @cutoff;
/// Type of service that the audio stream conveys. - encoding: Set by user. - decoding: Set by libavcodec.
public AVAudioServiceType @audio_service_type;
/// desired sample format - encoding: Not used. - decoding: Set by user. Decoder will decode to this format if it can.
public AVSampleFormat @request_sample_fmt;
/// Audio only. The number of "priming" samples (padding) inserted by the encoder at the beginning of the audio. I.e. this number of leading decoded samples must be discarded by the caller to get the original audio without leading padding.
public int @initial_padding;
/// Audio only. The amount of padding (in samples) appended by the encoder to the end of the audio. I.e. this number of decoded samples must be discarded by the caller from the end of the stream to get the original audio without any trailing padding.
public int @trailing_padding;
/// Number of samples to skip after a discontinuity - decoding: unused - encoding: set by libavcodec
public int @seek_preroll;
/// This callback is called at the beginning of each frame to get data buffer(s) for it. There may be one contiguous buffer for all the data or there may be a buffer per each data plane or anything in between. What this means is, you may set however many entries in buf[] you feel necessary. Each buffer must be reference-counted using the AVBuffer API (see description of buf[] below).
public AVCodecContext_get_buffer2_func @get_buffer2;
/// number of bits the bitstream is allowed to diverge from the reference. the reference can be CBR (for CBR pass1) or VBR (for pass2) - encoding: Set by user; unused for constant quantizer encoding. - decoding: unused
public int @bit_rate_tolerance;
/// Global quality for codecs which cannot change it per frame. This should be proportional to MPEG-1/2/4 qscale. - encoding: Set by user. - decoding: unused
public int @global_quality;
/// - encoding: Set by user. - decoding: unused
public int @compression_level;
/// amount of qscale change between easy & hard scenes (0.0-1.0)
public float @qcompress;
/// amount of qscale smoothing over time (0.0-1.0)
public float @qblur;
/// minimum quantizer - encoding: Set by user. - decoding: unused
public int @qmin;
/// maximum quantizer - encoding: Set by user. - decoding: unused
public int @qmax;
/// maximum quantizer difference between frames - encoding: Set by user. - decoding: unused
public int @max_qdiff;
/// decoder bitstream buffer size - encoding: Set by user. - decoding: May be set by libavcodec.
public int @rc_buffer_size;
/// ratecontrol override, see RcOverride - encoding: Allocated/set/freed by user. - decoding: unused
public int @rc_override_count;
public RcOverride* @rc_override;
/// maximum bitrate - encoding: Set by user. - decoding: Set by user, may be overwritten by libavcodec.
public long @rc_max_rate;
/// minimum bitrate - encoding: Set by user. - decoding: unused
public long @rc_min_rate;
/// Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow. - encoding: Set by user. - decoding: unused.
public float @rc_max_available_vbv_use;
/// Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow. - encoding: Set by user. - decoding: unused.
public float @rc_min_vbv_overflow_use;
/// Number of bits which should be loaded into the rc buffer before decoding starts. - encoding: Set by user. - decoding: unused
public int @rc_initial_buffer_occupancy;
/// trellis RD quantization - encoding: Set by user. - decoding: unused
public int @trellis;
/// pass1 encoding statistics output buffer - encoding: Set by libavcodec. - decoding: unused
public byte* @stats_out;
/// pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed here. - encoding: Allocated/set/freed by user. - decoding: unused
public byte* @stats_in;
/// Work around bugs in encoders which sometimes cannot be detected automatically. - encoding: Set by user - decoding: Set by user
public int @workaround_bugs;
/// strictly follow the standard (MPEG-4, ...). - encoding: Set by user. - decoding: Set by user. Setting this to STRICT or higher means the encoder and decoder will generally do stupid things, whereas setting it to unofficial or lower will mean the encoder might produce output that is not supported by all spec-compliant decoders. Decoders don't differentiate between normal, unofficial and experimental (that is, they always try to decode things when they can) unless they are explicitly asked to behave stupidly (=strictly conform to the specs) This may only be set to one of the FF_COMPLIANCE_* values in defs.h.
public int @strict_std_compliance;
/// error concealment flags - encoding: unused - decoding: Set by user.
public int @error_concealment;
/// debug - encoding: Set by user. - decoding: Set by user.
public int @debug;
/// Error recognition; may misdetect some more or less valid parts as errors. This is a bitfield of the AV_EF_* values defined in defs.h.
public int @err_recognition;
/// Hardware accelerator in use - encoding: unused. - decoding: Set by libavcodec
public AVHWAccel* @hwaccel;
/// Legacy hardware accelerator context.
public void* @hwaccel_context;
/// A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames. The reference is set by the caller and afterwards owned (and freed) by libavcodec - it should never be read by the caller after being set.
public AVBufferRef* @hw_frames_ctx;
/// A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/decoder. The reference is set by the caller and afterwards owned (and freed) by libavcodec.
public AVBufferRef* @hw_device_ctx;
/// Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated decoding (if active). - encoding: unused - decoding: Set by user (either before avcodec_open2(), or in the AVCodecContext.get_format callback)
public int @hwaccel_flags;
/// Video decoding only. Sets the number of extra hardware frames which the decoder will allocate for use by the caller. This must be set before avcodec_open2() is called.
public int @extra_hw_frames;
/// error - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. - decoding: unused
public ulong8 @error;
/// DCT algorithm, see FF_DCT_* below - encoding: Set by user. - decoding: unused
public int @dct_algo;
/// IDCT algorithm, see FF_IDCT_* below. - encoding: Set by user. - decoding: Set by user.
public int @idct_algo;
/// bits per sample/pixel from the demuxer (needed for huffyuv). - encoding: Set by libavcodec. - decoding: Set by user.
public int @bits_per_coded_sample;
/// Bits per sample/pixel of internal libavcodec pixel/sample format. - encoding: set by user. - decoding: set by libavcodec.
public int @bits_per_raw_sample;
/// thread count is used to decide how many independent tasks should be passed to execute() - encoding: Set by user. - decoding: Set by user.
public int @thread_count;
/// Which multithreading methods to use. Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, so clients which cannot provide future frames should not use it.
public int @thread_type;
/// Which multithreading methods are in use by the codec. - encoding: Set by libavcodec. - decoding: Set by libavcodec.
public int @active_thread_type;
/// The codec may call this to execute several independent things. It will return only after finishing all tasks. The user may replace this with some multithreaded implementation, the default implementation will execute the parts serially.
public AVCodecContext_execute_func @execute;
/// The codec may call this to execute several independent things. It will return only after finishing all tasks. The user may replace this with some multithreaded implementation, the default implementation will execute the parts serially.
public AVCodecContext_execute2_func @execute2;
/// profile - encoding: Set by user. - decoding: Set by libavcodec. See the AV_PROFILE_* defines in defs.h.
public int @profile;
/// Encoding level descriptor. - encoding: Set by user, corresponds to a specific level defined by the codec, usually corresponding to the profile level, if not specified it is set to FF_LEVEL_UNKNOWN. - decoding: Set by libavcodec. See AV_LEVEL_* in defs.h.
public int @level;
/// Properties of the stream that gets decoded - encoding: unused - decoding: set by libavcodec
public uint @properties;
/// Skip loop filtering for selected frames. - encoding: unused - decoding: Set by user.
public AVDiscard @skip_loop_filter;
/// Skip IDCT/dequantization for selected frames. - encoding: unused - decoding: Set by user.
public AVDiscard @skip_idct;
/// Skip decoding for selected frames. - encoding: unused - decoding: Set by user.
public AVDiscard @skip_frame;
/// Skip processing alpha if supported by codec. Note that if the format uses pre-multiplied alpha (common with VP6, and recommended due to better video quality/compression) the image will look as if alpha-blended onto a black background. However for formats that do not use pre-multiplied alpha there might be serious artefacts (though e.g. libswscale currently assumes pre-multiplied alpha anyway).
public int @skip_alpha;
/// Number of macroblock rows at the top which are skipped. - encoding: unused - decoding: Set by user.
public int @skip_top;
/// Number of macroblock rows at the bottom which are skipped. - encoding: unused - decoding: Set by user.
public int @skip_bottom;
/// low resolution decoding, 1-> 1/2 size, 2->1/4 size - encoding: unused - decoding: Set by user.
public int @lowres;
/// AVCodecDescriptor - encoding: unused. - decoding: set by libavcodec.
public AVCodecDescriptor* @codec_descriptor;
/// Character encoding of the input subtitles file. - decoding: set by user - encoding: unused
public byte* @sub_charenc;
/// Subtitles character encoding mode. Formats or codecs might be adjusting this setting (if they are doing the conversion themselves for instance). - decoding: set by libavcodec - encoding: unused
public int @sub_charenc_mode;
/// Header containing style information for text subtitles. For SUBTITLE_ASS subtitle type, it should contain the whole ASS [Script Info] and [V4+ Styles] section, plus the [Events] line and the Format line following. It shouldn't include any Dialogue line. - encoding: Set/allocated/freed by user (before avcodec_open2()) - decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
public int @subtitle_header_size;
public byte* @subtitle_header;
/// dump format separator. can be ", " or " " or anything else - encoding: Set by user. - decoding: Set by user.
public byte* @dump_separator;
/// ',' separated list of allowed decoders. If NULL then all are allowed - encoding: unused - decoding: set by user
public byte* @codec_whitelist;
/// Additional data associated with the entire coded stream.
public AVPacketSideData* @coded_side_data;
public int @nb_coded_side_data;
/// Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame, packet, or coded stream side data by decoders and encoders.
public int @export_side_data;
/// The number of pixels per image to maximally accept.
public long @max_pixels;
/// Video decoding only. Certain video codecs support cropping, meaning that only a sub-rectangle of the decoded frame is intended for display. This option controls how cropping is handled by libavcodec.
public int @apply_cropping;
/// The percentage of damaged samples to discard a frame.
public int @discard_damaged_percentage;
/// The number of samples per frame to maximally accept.
public long @max_samples;
/// This callback is called at the beginning of each packet to get a data buffer for it.
public AVCodecContext_get_encode_buffer_func @get_encode_buffer;
/// Frame counter, set by libavcodec.
public long @frame_num;
/// Decoding only. May be set by the caller before avcodec_open2() to an av_malloc()'ed array (or via AVOptions). Owned and freed by the decoder afterwards.
public int* @side_data_prefer_packet;
/// Number of entries in side_data_prefer_packet.
public uint @nb_side_data_prefer_packet;
/// Array containing static side data, such as HDR10 CLL / MDCV structures. Side data entries should be allocated by usage of helpers defined in libavutil/frame.h.
public AVFrameSideData** @decoded_side_data;
public int @nb_decoded_side_data;
}
/// This struct describes the properties of a single codec described by an AVCodecID.
public unsafe partial struct AVCodecDescriptor
{
public AVCodecID @id;
public AVMediaType @type;
/// Name of the codec described by this descriptor. It is non-empty and unique for each codec descriptor. It should contain alphanumeric characters and '_' only.
public byte* @name;
/// A more descriptive name for this codec. May be NULL.
public byte* @long_name;
/// Codec properties, a combination of AV_CODEC_PROP_* flags.
public int @props;
/// MIME type(s) associated with the codec. May be NULL; if not, a NULL-terminated array of MIME types. The first item is always non-NULL and is the preferred MIME type.
public byte** @mime_types;
/// If non-NULL, an array of profiles recognized for this codec. Terminated with AV_PROFILE_UNKNOWN.
public AVProfile* @profiles;
}
// public unsafe partial struct AVCodecHWConfig
// {
// /// For decoders, a hardware pixel format which that decoder may be able to decode to if suitable hardware is available.
// public AVPixelFormat @pix_fmt;
// /// Bit set of AV_CODEC_HW_CONFIG_METHOD_* flags, describing the possible setup methods which can be used with this configuration.
// public int @methods;
// /// The device type associated with the configuration.
// public AVHWDeviceType @device_type;
// }
/// This struct describes the properties of an encoded stream.
public unsafe partial struct AVCodecParameters
{
/// General type of the encoded data.
public AVMediaType @codec_type;
/// Specific type of the encoded data (the codec used).
public AVCodecID @codec_id;
/// Additional information about the codec (corresponds to the AVI FOURCC).
public uint @codec_tag;
/// Extra binary data needed for initializing the decoder, codec-dependent.
public byte* @extradata;
/// Size of the extradata content in bytes.
public int @extradata_size;
/// Additional data associated with the entire stream.
public AVPacketSideData* @coded_side_data;
/// Amount of entries in coded_side_data.
public int @nb_coded_side_data;
/// - video: the pixel format, the value corresponds to enum AVPixelFormat. - audio: the sample format, the value corresponds to enum AVSampleFormat.
public int @format;
/// The average bitrate of the encoded data (in bits per second).
public long @bit_rate;
/// The number of bits per sample in the codedwords.
public int @bits_per_coded_sample;
/// This is the number of valid bits in each output sample. If the sample format has more bits, the least significant bits are additional padding bits, which are always 0. Use right shifts to reduce the sample to its actual size. For example, audio formats with 24 bit samples will have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. To get the original sample use "(int32_t)sample >> 8"."
public int @bits_per_raw_sample;
/// Codec-specific bitstream restrictions that the stream conforms to.
public int @profile;
public int @level;
/// Video only. The dimensions of the video frame in pixels.
public int @width;
public int @height;
/// Video only. The aspect ratio (width / height) which a single pixel should have when displayed.
public AVRational @sample_aspect_ratio;
/// Video only. Number of frames per second, for streams with constant frame durations. Should be set to { 0, 1 } when some frames have differing durations or if the value is not known.
public AVRational @framerate;
/// Video only. The order of the fields in interlaced video.
public AVFieldOrder @field_order;
/// Video only. Additional colorspace characteristics.
public AVColorRange @color_range;
public AVColorPrimaries @color_primaries;
public AVColorTransferCharacteristic @color_trc;
public AVColorSpace @color_space;
public AVChromaLocation @chroma_location;
/// Video only. Number of delayed frames.
public int @video_delay;
/// Audio only. The channel layout and number of channels.
public AVChannelLayout @ch_layout;
/// Audio only. The number of audio samples per second.
public int @sample_rate;
/// Audio only. The number of bytes per coded audio frame, required by some formats.
public int @block_align;
/// Audio only. Audio frame size, if known. Required by some formats to be static.
public int @frame_size;
/// Audio only. The amount of padding (in samples) inserted by the encoder at the beginning of the audio. I.e. this number of leading decoded samples must be discarded by the caller to get the original audio without leading padding.
public int @initial_padding;
/// Audio only. The amount of padding (in samples) appended by the encoder to the end of the audio. I.e. this number of decoded samples must be discarded by the caller from the end of the stream to get the original audio without any trailing padding.
public int @trailing_padding;
/// Audio only. Number of samples to skip after a discontinuity.
public int @seek_preroll;
}
public unsafe partial struct AVCodecParser
{
public int7 @codec_ids;
public int @priv_data_size;
public AVCodecParser_parser_init_func @parser_init;
public AVCodecParser_parser_parse_func @parser_parse;
public AVCodecParser_parser_close_func @parser_close;
public AVCodecParser_split_func @split;
}
public unsafe partial struct AVCodecParserContext
{
public void* @priv_data;
public AVCodecParser* @parser;
public long @frame_offset;
public long @cur_offset;
public long @next_frame_offset;
public int @pict_type;
/// This field is used for proper frame duration computation in lavf. It signals, how much longer the frame duration of the current frame is compared to normal frame duration.
public int @repeat_pict;
public long @pts;
public long @dts;
public long @last_pts;
public long @last_dts;
public int @fetch_timestamp;
public int @cur_frame_start_index;
public long4 @cur_frame_offset;
public long4 @cur_frame_pts;
public long4 @cur_frame_dts;
public int @flags;
/// byte offset from starting packet start
public long @offset;
public long4 @cur_frame_end;
/// Set by parser to 1 for key frames and 0 for non-key frames. It is initialized to -1, so if the parser doesn't set this flag, old-style fallback using AV_PICTURE_TYPE_I picture type as key frames will be used.
public int @key_frame;
/// Synchronization point for start of timestamp generation.
public int @dts_sync_point;
/// Offset of the current timestamp against last timestamp sync point in units of AVCodecContext.time_base.
public int @dts_ref_dts_delta;
/// Presentation delay of current frame in units of AVCodecContext.time_base.
public int @pts_dts_delta;
/// Position of the packet in file.
public long4 @cur_frame_pos;
/// Byte position of currently parsed frame in stream.
public long @pos;
/// Previous frame byte position.
public long @last_pos;
/// Duration of the current frame. For audio, this is in units of 1 / AVCodecContext.sample_rate. For all other types, this is in units of AVCodecContext.time_base.
public int @duration;
public AVFieldOrder @field_order;
/// Indicate whether a picture is coded as a frame, top field or bottom field.
public AVPictureStructure @picture_structure;
/// Picture number incremented in presentation or output order. This field may be reinitialized at the first picture of a new sequence.
public int @output_picture_number;
/// Dimensions of the decoded video intended for presentation.
public int @width;
public int @height;
/// Dimensions of the coded video.
public int @coded_width;
public int @coded_height;
/// The format of the coded data, corresponds to enum AVPixelFormat for video and for enum AVSampleFormat for audio.
public int @format;
}
public unsafe partial struct AVComponentDescriptor
{
/// Which of the 4 planes contains the component.
public int @plane;
/// Number of elements between 2 horizontally consecutive pixels. Elements are bits for bitstream formats, bytes otherwise.
public int @step;
/// Number of elements before the component of the first pixel. Elements are bits for bitstream formats, bytes otherwise.
public int @offset;
/// Number of least significant bits that must be shifted away to get the value.
public int @shift;
/// Number of bits in the component.
public int @depth;
}
// /// Content light level needed by to transmit HDR over HDMI (CTA-861.3).
// public unsafe partial struct AVContentLightMetadata
// {
// /// Max content light level (cd/m^2).
// public uint @MaxCLL;
// /// Max average light level per frame (cd/m^2).
// public uint @MaxFALL;
// }
// /// This structure describes the bitrate properties of an encoded bitstream. It roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD parameters for H.264/HEVC.
// public unsafe partial struct AVCPBProperties
// {
// /// Maximum bitrate of the stream, in bits per second. Zero if unknown or unspecified.
// public long @max_bitrate;
// /// Minimum bitrate of the stream, in bits per second. Zero if unknown or unspecified.
// public long @min_bitrate;
// /// Average bitrate of the stream, in bits per second. Zero if unknown or unspecified.
// public long @avg_bitrate;
// /// The size of the buffer to which the ratecontrol is applied, in bits. Zero if unknown or unspecified.
// public long @buffer_size;
// /// The delay between the time the packet this structure is associated with is received and the time when it should be decoded, in periods of a 27MHz clock.
// public ulong @vbv_delay;
// }
// /// D3D11 frame descriptor for pool allocation.
// public unsafe partial struct AVD3D11FrameDescriptor
// {
// /// The texture in which the frame is located. The reference count is managed by the AVBufferRef, and destroying the reference will release the interface.
// public ID3D11Texture2D* @texture;
// /// The index into the array texture element representing the frame, or 0 if the texture is not an array texture.
// public long @index;
// }
// /// This structure is used to provides the necessary configurations and data to the Direct3D11 leviathan HWAccel implementation.
// public unsafe partial struct AVD3D11VAContext
// {
// /// D3D11 decoder object
// public ID3D11VideoDecoder* @decoder;
// /// D3D11 VideoContext
// public ID3D11VideoContext* @video_context;
// /// D3D11 configuration used to create the decoder
// public D3D11_VIDEO_DECODER_CONFIG* @cfg;
// /// The number of surface in the surface array
// public uint @surface_count;
// /// The array of Direct3D surfaces used to create the decoder
// public ID3D11VideoDecoderOutputView** @surface;
// /// A bit field configuring the workarounds needed for using the decoder
// public ulong @workaround;
// /// Private to the leviathan AVHWAccel implementation
// public uint @report_id;
// /// Mutex to access video_context
// public void* @context_mutex;
// }
// /// This struct is allocated as AVHWDeviceContext.hwctx
// public unsafe partial struct AVD3D11VADeviceContext
// {
// /// Device used for texture creation and access. This can also be used to set the libavcodec decoding device.
// public ID3D11Device* @device;
// /// If unset, this will be set from the device field on init.
// public ID3D11DeviceContext* @device_context;
// /// If unset, this will be set from the device field on init.
// public ID3D11VideoDevice* @video_device;
// /// If unset, this will be set from the device_context field on init.
// public ID3D11VideoContext* @video_context;
// /// Callbacks for locking. They protect accesses to device_context and video_context calls. They also protect access to the internal staging texture (for av_hwframe_transfer_data() calls). They do NOT protect access to hwcontext or decoder state in general.
// public AVD3D11VADeviceContext_lock_func @lock;
// public AVD3D11VADeviceContext_unlock_func @unlock;
// public void* @lock_ctx;
// }
// /// This struct is allocated as AVHWFramesContext.hwctx
// public unsafe partial struct AVD3D11VAFramesContext
// {
// /// The canonical texture used for pool allocation. If this is set to NULL on init, the hwframes implementation will allocate and set an array texture if initial_pool_size > 0.
// public ID3D11Texture2D* @texture;
// /// D3D11_TEXTURE2D_DESC.BindFlags used for texture creation. The user must at least set D3D11_BIND_DECODER if the frames context is to be used for video decoding. This field is ignored/invalid if a user-allocated texture is provided.
// public uint @BindFlags;
// /// D3D11_TEXTURE2D_DESC.MiscFlags used for texture creation. This field is ignored/invalid if a user-allocated texture is provided.
// public uint @MiscFlags;
// /// In case if texture structure member above is not NULL contains the same texture pointer for all elements and different indexes into the array texture. In case if texture structure member above is NULL, all elements contains pointers to separate non-array textures and 0 indexes. This field is ignored/invalid if a user-allocated texture is provided.
// public AVD3D11FrameDescriptor* @texture_infos;
// }
// /// Structure describes basic parameters of the device.
// public unsafe partial struct AVDeviceInfo
// {
// /// device name, format depends on device
// public byte* @device_name;
// /// human friendly name
// public byte* @device_description;
// /// array indicating what media types(s), if any, a device can provide. If null, cannot provide any
// public AVMediaType* @media_types;
// /// length of media_types array, 0 if device cannot provide any media types
// public int @nb_media_types;
// }
// /// List of devices.
// public unsafe partial struct AVDeviceInfoList
// {
// /// list of autodetected devices
// public AVDeviceInfo** @devices;
// /// number of autodetected devices
// public int @nb_devices;
// /// index of default device or -1 if no default
// public int @default_device;
// }
// public unsafe partial struct AVDeviceRect
// {
// /// x coordinate of top left corner
// public int @x;
// /// y coordinate of top left corner
// public int @y;
// /// width
// public int @width;
// /// height
// public int @height;
// }
// /// @}
// public unsafe partial struct AVDictionaryEntry
// {
// public byte* @key;
// public byte* @value;
// }
// /// This struct is allocated as AVHWDeviceContext.hwctx
// public unsafe partial struct AVDXVA2DeviceContext
// {
// public IDirect3DDeviceManager9* @devmgr;
// }
// /// This struct is allocated as AVHWFramesContext.hwctx
// public unsafe partial struct AVDXVA2FramesContext
// {
// /// The surface type (e.g. DXVA2_VideoProcessorRenderTarget or DXVA2_VideoDecoderRenderTarget). Must be set by the caller.
// public ulong @surface_type;
// /// The surface pool. When an external pool is not provided by the caller, this will be managed (allocated and filled on init, freed on uninit) by libavutil.
// public IDirect3DSurface9** @surfaces;
// public int @nb_surfaces;
// /// Certain drivers require the decoder to be destroyed before the surfaces. To allow internally managed pools to work properly in such cases, this field is provided.
// public IDirectXVideoDecoder* @decoder_to_release;
// }
/// This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2016 standard.
// public unsafe partial struct AVDynamicHDRPlus
// {
// /// Country code by Rec. ITU-T T.35 Annex A. The value shall be 0xB5.
// public byte @itu_t_t35_country_code;
// /// Application version in the application defining document in ST-2094 suite. The value shall be set to 0.
// public byte @application_version;
// /// The number of processing windows. The value shall be in the range of 1 to 3, inclusive.
// public byte @num_windows;
// /// The color transform parameters for every processing window.
// public AVHDRPlusColorTransformParams3 @params;
// /// The nominal maximum display luminance of the targeted system display, in units of 0.0001 candelas per square metre. The value shall be in the range of 0 to 10000, inclusive.
// public AVRational @targeted_system_display_maximum_luminance;
// /// This flag shall be equal to 0 in bit streams conforming to this version of this Specification. The value 1 is reserved for future use.
// public byte @targeted_system_display_actual_peak_luminance_flag;
// /// The number of rows in the targeted system_display_actual_peak_luminance array. The value shall be in the range of 2 to 25, inclusive.
// public byte @num_rows_targeted_system_display_actual_peak_luminance;
// /// The number of columns in the targeted_system_display_actual_peak_luminance array. The value shall be in the range of 2 to 25, inclusive.
// public byte @num_cols_targeted_system_display_actual_peak_luminance;
// /// The normalized actual peak luminance of the targeted system display. The values should be in the range of 0 to 1, inclusive and in multiples of 1/15.
// public AVRational25x25 @targeted_system_display_actual_peak_luminance;
// /// This flag shall be equal to 0 in bitstreams conforming to this version of this Specification. The value 1 is reserved for future use.
// public byte @mastering_display_actual_peak_luminance_flag;
// /// The number of rows in the mastering_display_actual_peak_luminance array. The value shall be in the range of 2 to 25, inclusive.
// public byte @num_rows_mastering_display_actual_peak_luminance;
// /// The number of columns in the mastering_display_actual_peak_luminance array. The value shall be in the range of 2 to 25, inclusive.
// public byte @num_cols_mastering_display_actual_peak_luminance;
// /// The normalized actual peak luminance of the mastering display used for mastering the image essence. The values should be in the range of 0 to 1, inclusive and in multiples of 1/15.
// public AVRational25x25 @mastering_display_actual_peak_luminance;
// }
/// Filter definition. This defines the pads a filter contains, and all the callback functions used to interact with the filter.
public unsafe partial struct AVFilter
{
/// Filter name. Must be non-NULL and unique among filters.
public byte* @name;
/// A description of the filter. May be NULL.
public byte* @description;
/// List of static inputs.
public AVFilterPad* @inputs;
/// List of static outputs.
public AVFilterPad* @outputs;
/// A class for the private data, used to declare filter private AVOptions. This field is NULL for filters that do not declare any options.
public AVClass* @priv_class;
/// A combination of AVFILTER_FLAG_*
public int @flags;
/// The number of entries in the list of inputs.
public byte @nb_inputs;
/// The number of entries in the list of outputs.
public byte @nb_outputs;
/// This field determines the state of the formats union. It is an enum FilterFormatsState value.
public byte @formats_state;
/// Filter pre-initialization function
public AVFilter_preinit_func @preinit;
/// Filter initialization function.
public AVFilter_init_func @init;
/// Filter uninitialization function.
public AVFilter_uninit_func @uninit;
public AVFilter_formats @formats;
/// size of private data to allocate for the filter
public int @priv_size;
/// Additional flags for avfilter internal use only.
public int @flags_internal;
/// Make the filter instance process a command.
public AVFilter_process_command_func @process_command;
/// Filter activation function.
public AVFilter_activate_func @activate;
}
/// The state of the following union is determined by formats_state. See the documentation of enum FilterFormatsState in internal.h.
[StructLayout(LayoutKind.Explicit)]
public unsafe partial struct AVFilter_formats
{
/// Query formats supported by the filter on its inputs and outputs.
[FieldOffset(0)]
public _query_func_func @query_func;
/// A pointer to an array of admissible pixel formats delimited by AV_PIX_FMT_NONE. The generic code will use this list to indicate that this filter supports each of these pixel formats, provided that all inputs and outputs use the same pixel format.
[FieldOffset(0)]
public AVPixelFormat* @pixels_list;
/// Analogous to pixels, but delimited by AV_SAMPLE_FMT_NONE and restricted to filters that only have AVMEDIA_TYPE_AUDIO inputs and outputs.
[FieldOffset(0)]
public AVSampleFormat* @samples_list;
/// Equivalent to { pix_fmt, AV_PIX_FMT_NONE } as pixels_list.
[FieldOffset(0)]
public AVPixelFormat @pix_fmt;
/// Equivalent to { sample_fmt, AV_SAMPLE_FMT_NONE } as samples_list.
[FieldOffset(0)]
public AVSampleFormat @sample_fmt;
}
// /// A filterchain is a list of filter specifications.
// public unsafe partial struct AVFilterChain
// {
// public AVFilterParams** @filters;
// public ulong @nb_filters;
// }
/// An instance of a filter
public unsafe partial struct AVFilterContext
{
/// needed for av_log() and filters common options
public AVClass* @av_class;
/// the AVFilter of which this is an instance
public AVFilter* @filter;
/// name of this filter instance
public byte* @name;
/// array of input pads
public AVFilterPad* @input_pads;
/// array of pointers to input links
public AVFilterLink** @inputs;
/// number of input pads
public uint @nb_inputs;
/// array of output pads
public AVFilterPad* @output_pads;
/// array of pointers to output links
public AVFilterLink** @outputs;
/// number of output pads
public uint @nb_outputs;
/// private data for use by the filter
public void* @priv;
/// filtergraph this filter belongs to
public AVFilterGraph* @graph;
/// Type of multithreading being allowed/used. A combination of AVFILTER_THREAD_* flags.
public int @thread_type;
/// Max number of threads allowed in this filter instance. If <= 0, its value is ignored. Overrides global number of threads set per filter graph.
public int @nb_threads;
public AVFilterCommand* @command_queue;
/// enable expression string
public byte* @enable_str;
/// parsed expression (AVExpr*)
public void* @enable;
/// variable values for the enable expression
public double* @var_values;
/// the enabled state from the last expression evaluation
public int @is_disabled;
/// For filters which will create hardware frames, sets the device the filter should create them in. All other filters will ignore this field: in particular, a filter which consumes or processes hardware frames will instead use the hw_frames_ctx field in AVFilterLink to carry the hardware context information.
public AVBufferRef* @hw_device_ctx;
/// Ready status of the filter. A non-0 value means that the filter needs activating; a higher value suggests a more urgent activation.
public uint @ready;
/// Sets the number of extra hardware frames which the filter will allocate on its output links for use in following filters or by the caller.
public int @extra_hw_frames;
}
/// Lists of formats / etc. supported by an end of a link.
public unsafe partial struct AVFilterFormatsConfig
{
/// List of supported formats (pixel or sample).
public AVFilterFormats* @formats;
/// Lists of supported sample rates, only for audio.
public AVFilterFormats* @samplerates;
/// Lists of supported channel layouts, only for audio.
public AVFilterChannelLayouts* @channel_layouts;
/// AVColorSpace
public AVFilterFormats* @color_spaces;
/// AVColorRange
public AVFilterFormats* @color_ranges;
}
public unsafe partial struct AVFilterGraph
{
public AVClass* @av_class;
public AVFilterContext** @filters;
public uint @nb_filters;
/// sws options to use for the auto-inserted scale filters
public byte* @scale_sws_opts;
/// Type of multithreading allowed for filters in this graph. A combination of AVFILTER_THREAD_* flags.
public int @thread_type;
/// Maximum number of threads used by filters in this graph. May be set by the caller before adding any filters to the filtergraph. Zero (the default) means that the number of threads is determined automatically.
public int @nb_threads;
/// Opaque user data. May be set by the caller to an arbitrary value, e.g. to be used from callbacks like AVFilterGraph.execute. Libavfilter will not touch this field in any way.
public void* @opaque;
/// This callback may be set by the caller immediately after allocating the graph and before adding any filters to it, to provide a custom multithreading implementation.
public AVFilterGraph_execute_func @execute;
/// swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions
public byte* @aresample_swr_opts;
}
// /// A parsed representation of a filtergraph segment.
// public unsafe partial struct AVFilterGraphSegment
// {
// /// The filtergraph this segment is associated with. Set by avfilter_graph_segment_parse().
// public AVFilterGraph* @graph;
// /// A list of filter chain contained in this segment. Set in avfilter_graph_segment_parse().
// public AVFilterChain** @chains;
// public ulong @nb_chains;
// /// A string containing a colon-separated list of key=value options applied to all scale filters in this segment.
// public byte* @scale_sws_opts;
// }
/// A linked-list of the inputs/outputs of the filter chain.
public unsafe partial struct AVFilterInOut
{
/// unique name for this input/output in the list
public byte* @name;
/// filter context associated to this input/output
public AVFilterContext* @filter_ctx;
/// index of the filt_ctx pad to use for linking
public int @pad_idx;
/// next input/input in the list, NULL if this is the last
public AVFilterInOut* @next;
}
/// A link between two filters. This contains pointers to the source and destination filters between which this link exists, and the indexes of the pads involved. In addition, this link also contains the parameters which have been negotiated and agreed upon between the filter, such as image dimensions, format, etc.
public unsafe partial struct AVFilterLink
{
/// source filter
public AVFilterContext* @src;
/// output pad on the source filter
public AVFilterPad* @srcpad;
/// dest filter
public AVFilterContext* @dst;
/// input pad on the dest filter
public AVFilterPad* @dstpad;
/// filter media type
public AVMediaType @type;
/// agreed upon media format
public int @format;
/// agreed upon image width
public int @w;
/// agreed upon image height
public int @h;
/// agreed upon sample aspect ratio
public AVRational @sample_aspect_ratio;
/// agreed upon YUV color space
public AVColorSpace @colorspace;
/// agreed upon YUV color range
public AVColorRange @color_range;
/// samples per second
public int @sample_rate;
/// channel layout of current buffer (see libavutil/channel_layout.h)
public AVChannelLayout @ch_layout;
/// Define the time base used by the PTS of the frames/samples which will pass through this link. During the configuration stage, each filter is supposed to change only the output timebase, while the timebase of the input link is assumed to be an unchangeable property.
public AVRational @time_base;
/// Lists of supported formats / etc. supported by the input filter.
public AVFilterFormatsConfig @incfg;
/// Lists of supported formats / etc. supported by the output filter.
public AVFilterFormatsConfig @outcfg;
/// Graph the filter belongs to.
public AVFilterGraph* @graph;
/// Current timestamp of the link, as defined by the most recent frame(s), in link time_base units.
public long @current_pts;
/// Current timestamp of the link, as defined by the most recent frame(s), in AV_TIME_BASE units.
public long @current_pts_us;
/// Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists.
public AVRational @frame_rate;
/// Minimum number of samples to filter at once. If filter_frame() is called with fewer samples, it will accumulate them in fifo. This field and the related ones must not be changed after filtering has started. If 0, all related fields are ignored.
public int @min_samples;
/// Maximum number of samples to filter at once. If filter_frame() is called with more samples, it will split them.
public int @max_samples;
/// Number of past frames sent through the link.
public long @frame_count_in;
/// Number of past frames sent through the link.
public long @frame_count_out;
/// Number of past samples sent through the link.
public long @sample_count_in;
/// Number of past samples sent through the link.
public long @sample_count_out;
/// True if a frame is currently wanted on the output of this filter. Set when ff_request_frame() is called by the output, cleared when a frame is filtered.
public int @frame_wanted_out;
/// For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
public AVBufferRef* @hw_frames_ctx;
}
// /// Parameters of a filter's input or output pad.
// public unsafe partial struct AVFilterPadParams
// {
// /// An av_malloc()'ed string containing the pad label.
// public byte* @label;
// }
// /// Parameters describing a filter to be created in a filtergraph.
// public unsafe partial struct AVFilterParams
// {
// /// The filter context.
// public AVFilterContext* @filter;
// /// Name of the AVFilter to be used.
// public byte* @filter_name;
// /// Name to be used for this filter instance.
// public byte* @instance_name;
// /// Options to be apllied to the filter.
// public AVDictionary* @opts;
// public AVFilterPadParams** @inputs;
// public uint @nb_inputs;
// public AVFilterPadParams** @outputs;
// public uint @nb_outputs;
// }
/// Format I/O context. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVFormatContext) must not be used outside libav*, use avformat_alloc_context() to create an AVFormatContext.
public unsafe partial struct AVFormatContext
{
/// A class for logging and avoptions. Set by avformat_alloc_context(). Exports (de)muxer private options if they exist.
public AVClass* @av_class;
/// The input container format.
public AVInputFormat* @iformat;
/// The output container format.
public AVOutputFormat* @oformat;
/// Format private data. This is an AVOptions-enabled struct if and only if iformat/oformat.priv_class is not NULL.
public void* @priv_data;
/// I/O context.
public AVIOContext* @pb;
/// Flags signalling stream properties. A combination of AVFMTCTX_*. Set by libavformat.
public int @ctx_flags;
/// Number of elements in AVFormatContext.streams.
public uint @nb_streams;
/// A list of all streams in the file. New streams are created with avformat_new_stream().
public AVStream** @streams;
/// Number of elements in AVFormatContext.stream_groups.
public uint @nb_stream_groups;
/// A list of all stream groups in the file. New groups are created with avformat_stream_group_create(), and filled with avformat_stream_group_add_stream().
public AVStreamGroup** @stream_groups;
/// Number of chapters in AVChapter array. When muxing, chapters are normally written in the file header, so nb_chapters should normally be initialized before write_header is called. Some muxers (e.g. mov and mkv) can also write chapters in the trailer. To write chapters in the trailer, nb_chapters must be zero when write_header is called and non-zero when write_trailer is called. - muxing: set by user - demuxing: set by libavformat
public uint @nb_chapters;
public AVChapter** @chapters;
/// input or output URL. Unlike the old filename field, this field has no length restriction.
public byte* @url;
/// Position of the first frame of the component, in AV_TIME_BASE fractional seconds. NEVER set this value directly: It is deduced from the AVStream values.
public long @start_time;
/// Duration of the stream, in AV_TIME_BASE fractional seconds. Only set this value if you know none of the individual stream durations and also do not set any of them. This is deduced from the AVStream values if not set.
public long @duration;
/// Total stream bitrate in bit/s, 0 if not available. Never set it directly if the file_size and the duration are known as leviathan can compute it automatically.
public long @bit_rate;
public uint @packet_size;
public int @max_delay;
/// Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. Set by the user before avformat_open_input() / avformat_write_header().
public int @flags;
/// Maximum number of bytes read from input in order to determine stream properties. Used when reading the global header and in avformat_find_stream_info().
public long @probesize;
/// Maximum duration (in AV_TIME_BASE units) of the data read from input in avformat_find_stream_info(). Demuxing only, set by the caller before avformat_find_stream_info(). Can be set to 0 to let avformat choose using a heuristic.
public long @max_analyze_duration;
public byte* @key;
public int @keylen;
public uint @nb_programs;
public AVProgram** @programs;
/// Forced video codec_id. Demuxing: Set by user.
public AVCodecID @video_codec_id;
/// Forced audio codec_id. Demuxing: Set by user.
public AVCodecID @audio_codec_id;
/// Forced subtitle codec_id. Demuxing: Set by user.
public AVCodecID @subtitle_codec_id;
/// Forced Data codec_id. Demuxing: Set by user.
public AVCodecID @data_codec_id;
/// Metadata that applies to the whole file.
public AVDictionary* @metadata;
/// Start time of the stream in real world time, in microseconds since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the stream was captured at this real world time. - muxing: Set by the caller before avformat_write_header(). If set to either 0 or AV_NOPTS_VALUE, then the current wall-time will be used. - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that the value may become known after some number of frames have been received.
public long @start_time_realtime;
/// The number of frames used for determining the framerate in avformat_find_stream_info(). Demuxing only, set by the caller before avformat_find_stream_info().
public int @fps_probe_size;
/// Error recognition; higher values will detect more errors but may misdetect some more or less valid parts as errors. Demuxing only, set by the caller before avformat_open_input().
public int @error_recognition;
/// Custom interrupt callbacks for the I/O layer.
public AVIOInterruptCB @interrupt_callback;
/// Flags to enable debugging.
public int @debug;
/// The maximum number of streams. - encoding: unused - decoding: set by user
public int @max_streams;
/// Maximum amount of memory in bytes to use for the index of each stream. If the index exceeds this size, entries will be discarded as needed to maintain a smaller size. This can lead to slower or less accurate seeking (depends on demuxer). Demuxers for which a full in-memory index is mandatory will ignore this. - muxing: unused - demuxing: set by user
public uint @max_index_size;
/// Maximum amount of memory in bytes to use for buffering frames obtained from realtime capture devices.
public uint @max_picture_buffer;
/// Maximum buffering duration for interleaving.
public long @max_interleave_delta;
/// Maximum number of packets to read while waiting for the first timestamp. Decoding only.
public int @max_ts_probe;
/// Max chunk time in microseconds. Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user - decoding: unused
public int @max_chunk_duration;
/// Max chunk size in bytes Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user - decoding: unused
public int @max_chunk_size;
/// Maximum number of packets that can be probed - encoding: unused - decoding: set by user
public int @max_probe_packets;
/// Allow non-standard and experimental extension
public int @strict_std_compliance;
/// Flags indicating events happening on the file, a combination of AVFMT_EVENT_FLAG_*.
public int @event_flags;
/// Avoid negative timestamps during muxing. Any value of the AVFMT_AVOID_NEG_TS_* constants. Note, this works better when using av_interleaved_write_frame(). - muxing: Set by user - demuxing: unused
public int @avoid_negative_ts;
/// Audio preload in microseconds. Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user - decoding: unused
public int @audio_preload;
/// forces the use of wallclock timestamps as pts/dts of packets This has undefined results in the presence of B frames. - encoding: unused - decoding: Set by user
public int @use_wallclock_as_timestamps;
/// Skip duration calcuation in estimate_timings_from_pts. - encoding: unused - decoding: set by user
public int @skip_estimate_duration_from_pts;
/// avio flags, used to force AVIO_FLAG_DIRECT. - encoding: unused - decoding: Set by user
public int @avio_flags;
/// The duration field can be estimated through various ways, and this field can be used to know how the duration was estimated. - encoding: unused - decoding: Read by user
public AVDurationEstimationMethod @duration_estimation_method;
/// Skip initial bytes when opening stream - encoding: unused - decoding: Set by user
public long @skip_initial_bytes;
/// Correct single timestamp overflows - encoding: unused - decoding: Set by user
public uint @correct_ts_overflow;
/// Force seeking to any (also non key) frames. - encoding: unused - decoding: Set by user
public int @seek2any;
/// Flush the I/O context after each packet. - encoding: Set by user - decoding: unused
public int @flush_packets;
/// format probing score. The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes the format. - encoding: unused - decoding: set by avformat, read by user
public int @probe_score;
/// Maximum number of bytes read from input in order to identify the AVInputFormat "input format". Only used when the format is not set explicitly by the caller.
public int @format_probesize;
/// ',' separated list of allowed decoders. If NULL then all are allowed - encoding: unused - decoding: set by user
public byte* @codec_whitelist;
/// ',' separated list of allowed demuxers. If NULL then all are allowed - encoding: unused - decoding: set by user
public byte* @format_whitelist;
/// ',' separated list of allowed protocols. - encoding: unused - decoding: set by user
public byte* @protocol_whitelist;
/// ',' separated list of disallowed protocols. - encoding: unused - decoding: set by user
public byte* @protocol_blacklist;
/// IO repositioned flag. This is set by avformat when the underlaying IO context read pointer is repositioned, for example when doing byte based seeking. Demuxers can use the flag to detect such changes.
public int @io_repositioned;
/// Forced video codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user
public AVCodec* @video_codec;
/// Forced audio codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user
public AVCodec* @audio_codec;
/// Forced subtitle codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user
public AVCodec* @subtitle_codec;
/// Forced data codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user
public AVCodec* @data_codec;
/// Number of bytes to be written as padding in a metadata header. Demuxing: Unused. Muxing: Set by user.
public int @metadata_header_padding;
/// User data. This is a place for some private data of the user.
public void* @opaque;
/// Callback used by devices to communicate with application.
public AVFormatContext_control_message_cb_func @control_message_cb;
/// Output timestamp offset, in microseconds. Muxing: set by user
public long @output_ts_offset;
/// dump format separator. can be ", " or " " or anything else - muxing: Set by user. - demuxing: Set by user.
public byte* @dump_separator;
/// A callback for opening new IO streams.
public AVFormatContext_io_open_func @io_open;
/// A callback for closing the streams opened with AVFormatContext.io_open().
public AVFormatContext_io_close2_func @io_close2;
}
/// This structure describes decoded (raw) audio or video data.
public unsafe partial struct AVFrame
{
/// pointer to the picture/channel planes. This might be different from the first allocated byte. For video, it could even point to the end of the image data.
public byte_ptr8 @data;
/// For video, a positive or negative value, which is typically indicating the size in bytes of each picture line, but it can also be: - the negative byte size of lines for vertical flipping (with data[n] pointing to the end of the data - a positive or negative multiple of the byte size as for accessing even and odd fields of a frame (possibly flipped)
public int8 @linesize;
/// pointers to the data planes/channels.
public byte** @extended_data;
/// Video frames only. The coded dimensions (in pixels) of the video frame, i.e. the size of the rectangle that contains some well-defined values.
public int @width;
/// Video frames only. The coded dimensions (in pixels) of the video frame, i.e. the size of the rectangle that contains some well-defined values.
public int @height;
/// number of audio samples (per channel) described by this frame
public int @nb_samples;
/// format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames, enum AVSampleFormat for audio)
public int @format;
/// 1 -> keyframe, 0-> not
[Obsolete("Use AV_FRAME_FLAG_KEY instead")]
public int @key_frame;
/// Picture type of the frame.
public AVPictureType @pict_type;
/// Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
public AVRational @sample_aspect_ratio;
/// Presentation timestamp in time_base units (time when frame should be shown to user).
public long @pts;
/// DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) This is also the Presentation time of this AVFrame calculated from only AVPacket.dts values without pts values.
public long @pkt_dts;
/// Time base for the timestamps in this frame. In the future, this field may be set on frames output by decoders or filters, but its value will be by default ignored on input to encoders or filters.
public AVRational @time_base;
/// quality (between 1 (good) and FF_LAMBDA_MAX (bad))
public int @quality;
/// Frame owner's private data.
public void* @opaque;
/// Number of fields in this frame which should be repeated, i.e. the total duration of this frame should be repeat_pict + 2 normal field durations.
public int @repeat_pict;
/// The content of the picture is interlaced.
[Obsolete("Use AV_FRAME_FLAG_INTERLACED instead")]
public int @interlaced_frame;
/// If the content is interlaced, is top field displayed first.
[Obsolete("Use AV_FRAME_FLAG_TOP_FIELD_FIRST instead")]
public int @top_field_first;
/// Tell user application that palette has changed from previous frame.
public int @palette_has_changed;
/// Sample rate of the audio data.
public int @sample_rate;
/// AVBuffer references backing the data for this frame. All the pointers in data and extended_data must point inside one of the buffers in buf or extended_buf. This array must be filled contiguously -- if buf[i] is non-NULL then buf[j] must also be non-NULL for all j < i.
public AVBufferRef_ptr8 @buf;
/// For planar audio which requires more than AV_NUM_DATA_POINTERS AVBufferRef pointers, this array will hold all the references which cannot fit into AVFrame.buf.
public AVBufferRef** @extended_buf;
/// Number of elements in extended_buf.
public int @nb_extended_buf;
public AVFrameSideData** @side_data;
public int @nb_side_data;
/// Frame flags, a combination of lavu_frame_flags
public int @flags;
/// MPEG vs JPEG YUV range. - encoding: Set by user - decoding: Set by libavcodec
public AVColorRange @color_range;
public AVColorPrimaries @color_primaries;
public AVColorTransferCharacteristic @color_trc;
/// YUV colorspace type. - encoding: Set by user - decoding: Set by libavcodec
public AVColorSpace @colorspace;
public AVChromaLocation @chroma_location;
/// frame timestamp estimated using various heuristics, in stream time base - encoding: unused - decoding: set by libavcodec, read by user.
public long @best_effort_timestamp;
/// reordered pos from the last AVPacket that has been input into the decoder - encoding: unused - decoding: Read by user.
[Obsolete("use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user data from packets to frames")]
public long @pkt_pos;
/// metadata. - encoding: Set by user. - decoding: Set by libavcodec.
public AVDictionary* @metadata;
/// decode error flags of the frame, set to a combination of FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there were errors during the decoding. - encoding: unused - decoding: set by libavcodec, read by user.
public int @decode_error_flags;
/// size of the corresponding packet containing the compressed frame. It is set to a negative value if unknown. - encoding: unused - decoding: set by libavcodec, read by user.
[Obsolete("use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user data from packets to frames")]
public int @pkt_size;
/// For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame.
public AVBufferRef* @hw_frames_ctx;
/// Frame owner's private data.
public AVBufferRef* @opaque_ref;
/// cropping Video frames only. The number of pixels to discard from the the top/bottom/left/right border of the frame to obtain the sub-rectangle of the frame intended for presentation. @{
public ulong @crop_top;
public ulong @crop_bottom;
public ulong @crop_left;
public ulong @crop_right;
/// AVBufferRef for internal use by a single libav* library. Must not be used to transfer data between libraries. Has to be NULL when ownership of the frame leaves the respective library.
public AVBufferRef* @private_ref;
/// Channel layout of the audio data.
public AVChannelLayout @ch_layout;
/// Duration of the frame, in the same units as pts. 0 if unknown.
public long @duration;
}
/// Structure to hold side data for an AVFrame.
public unsafe partial struct AVFrameSideData
{
public AVFrameSideDataType @type;
public byte* @data;
public ulong @size;
public AVDictionary* @metadata;
public AVBufferRef* @buf;
}
/// Color transform parameters at a processing window in a dynamic metadata for SMPTE 2094-40.
public unsafe partial struct AVHDRPlusColorTransformParams
{
/// The relative x coordinate of the top left pixel of the processing window. The value shall be in the range of 0 and 1, inclusive and in multiples of 1/(width of Picture - 1). The value 1 corresponds to the absolute coordinate of width of Picture - 1. The value for first processing window shall be 0.
public AVRational @window_upper_left_corner_x;
/// The relative y coordinate of the top left pixel of the processing window. The value shall be in the range of 0 and 1, inclusive and in multiples of 1/(height of Picture - 1). The value 1 corresponds to the absolute coordinate of height of Picture - 1. The value for first processing window shall be 0.
public AVRational @window_upper_left_corner_y;
/// The relative x coordinate of the bottom right pixel of the processing window. The value shall be in the range of 0 and 1, inclusive and in multiples of 1/(width of Picture - 1). The value 1 corresponds to the absolute coordinate of width of Picture - 1. The value for first processing window shall be 1.
public AVRational @window_lower_right_corner_x;
/// The relative y coordinate of the bottom right pixel of the processing window. The value shall be in the range of 0 and 1, inclusive and in multiples of 1/(height of Picture - 1). The value 1 corresponds to the absolute coordinate of height of Picture - 1. The value for first processing window shall be 1.
public AVRational @window_lower_right_corner_y;
/// The x coordinate of the center position of the concentric internal and external ellipses of the elliptical pixel selector in the processing window. The value shall be in the range of 0 to (width of Picture - 1), inclusive and in multiples of 1 pixel.
public ushort @center_of_ellipse_x;
/// The y coordinate of the center position of the concentric internal and external ellipses of the elliptical pixel selector in the processing window. The value shall be in the range of 0 to (height of Picture - 1), inclusive and in multiples of 1 pixel.
public ushort @center_of_ellipse_y;
/// The clockwise rotation angle in degree of arc with respect to the positive direction of the x-axis of the concentric internal and external ellipses of the elliptical pixel selector in the processing window. The value shall be in the range of 0 to 180, inclusive and in multiples of 1.
public byte @rotation_angle;
/// The semi-major axis value of the internal ellipse of the elliptical pixel selector in amount of pixels in the processing window. The value shall be in the range of 1 to 65535, inclusive and in multiples of 1 pixel.
public ushort @semimajor_axis_internal_ellipse;
/// The semi-major axis value of the external ellipse of the elliptical pixel selector in amount of pixels in the processing window. The value shall not be less than semimajor_axis_internal_ellipse of the current processing window. The value shall be in the range of 1 to 65535, inclusive and in multiples of 1 pixel.
public ushort @semimajor_axis_external_ellipse;
/// The semi-minor axis value of the external ellipse of the elliptical pixel selector in amount of pixels in the processing window. The value shall be in the range of 1 to 65535, inclusive and in multiples of 1 pixel.
public ushort @semiminor_axis_external_ellipse;
/// Overlap process option indicates one of the two methods of combining rendered pixels in the processing window in an image with at least one elliptical pixel selector. For overlapping elliptical pixel selectors in an image, overlap_process_option shall have the same value.
public AVHDRPlusOverlapProcessOption @overlap_process_option;
/// The maximum of the color components of linearized RGB values in the processing window in the scene. The values should be in the range of 0 to 1, inclusive and in multiples of 0.00001. maxscl[ 0 ], maxscl[ 1 ], and maxscl[ 2 ] are corresponding to R, G, B color components respectively.
public AVRational3 @maxscl;
/// The average of linearized maxRGB values in the processing window in the scene. The value should be in the range of 0 to 1, inclusive and in multiples of 0.00001.
public AVRational @average_maxrgb;
/// The number of linearized maxRGB values at given percentiles in the processing window in the scene. The maximum value shall be 15.
public byte @num_distribution_maxrgb_percentiles;
/// The linearized maxRGB values at given percentiles in the processing window in the scene.
public AVHDRPlusPercentile15 @distribution_maxrgb;
/// The fraction of selected pixels in the image that contains the brightest pixel in the scene. The value shall be in the range of 0 to 1, inclusive and in multiples of 0.001.
public AVRational @fraction_bright_pixels;
/// This flag indicates that the metadata for the tone mapping function in the processing window is present (for value of 1).
public byte @tone_mapping_flag;
/// The x coordinate of the separation point between the linear part and the curved part of the tone mapping function. The value shall be in the range of 0 to 1, excluding 0 and in multiples of 1/4095.
public AVRational @knee_point_x;
/// The y coordinate of the separation point between the linear part and the curved part of the tone mapping function. The value shall be in the range of 0 to 1, excluding 0 and in multiples of 1/4095.
public AVRational @knee_point_y;
/// The number of the intermediate anchor parameters of the tone mapping function in the processing window. The maximum value shall be 15.
public byte @num_bezier_curve_anchors;
/// The intermediate anchor parameters of the tone mapping function in the processing window in the scene. The values should be in the range of 0 to 1, inclusive and in multiples of 1/1023.
public AVRational15 @bezier_curve_anchors;
/// This flag shall be equal to 0 in bitstreams conforming to this version of this Specification. Other values are reserved for future use.
public byte @color_saturation_mapping_flag;
/// The color saturation gain in the processing window in the scene. The value shall be in the range of 0 to 63/8, inclusive and in multiples of 1/8. The default value shall be 1.
public AVRational @color_saturation_weight;
}
/// Represents the percentile at a specific percentage in a distribution.
public unsafe partial struct AVHDRPlusPercentile
{
/// The percentage value corresponding to a specific percentile linearized RGB value in the processing window in the scene. The value shall be in the range of 0 to100, inclusive.
public byte @percentage;
/// The linearized maxRGB value at a specific percentile in the processing window in the scene. The value shall be in the range of 0 to 1, inclusive and in multiples of 0.00001.
public AVRational @percentile;
}
public unsafe partial struct AVHWAccel
{
/// Name of the hardware accelerated codec. The name is globally unique among encoders and among decoders (but an encoder and a decoder can share the same name).
public byte* @name;
/// Type of codec implemented by the hardware accelerator.
public AVMediaType @type;
/// Codec implemented by the hardware accelerator.
public AVCodecID @id;
/// Supported pixel format.
public AVPixelFormat @pix_fmt;
/// Hardware accelerated codec capabilities. see AV_HWACCEL_CODEC_CAP_*
public int @capabilities;
}
/// This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e. state that is not tied to a concrete processing configuration. E.g., in an API that supports hardware-accelerated encoding and decoding, this struct will (if possible) wrap the state that is common to both encoding and decoding and from which specific instances of encoders or decoders can be derived.
public unsafe partial struct AVHWDeviceContext
{
/// A class for logging. Set by av_hwdevice_ctx_alloc().
public AVClass* @av_class;
/// This field identifies the underlying API used for hardware access.
public AVHWDeviceType @type;
/// The format-specific data, allocated and freed by libavutil along with this context.
public void* @hwctx;
/// This field may be set by the caller before calling av_hwdevice_ctx_init().
public AVHWDeviceContext_free_func @free;
/// Arbitrary user data, to be used e.g. by the free() callback.
public void* @user_opaque;
}
// /// This struct describes the constraints on hardware frames attached to a given device with a hardware-specific configuration. This is returned by av_hwdevice_get_hwframe_constraints() and must be freed by av_hwframe_constraints_free() after use.
// public unsafe partial struct AVHWFramesConstraints
// {
// /// A list of possible values for format in the hw_frames_ctx, terminated by AV_PIX_FMT_NONE. This member will always be filled.
// public AVPixelFormat* @valid_hw_formats;
// /// A list of possible values for sw_format in the hw_frames_ctx, terminated by AV_PIX_FMT_NONE. Can be NULL if this information is not known.
// public AVPixelFormat* @valid_sw_formats;
// /// The minimum size of frames in this hw_frames_ctx. (Zero if not known.)
// public int @min_width;
// public int @min_height;
// /// The maximum size of frames in this hw_frames_ctx. (INT_MAX if not known / no limit.)
// public int @max_width;
// public int @max_height;
// }
/// This struct describes a set or pool of "hardware" frames (i.e. those with data not located in normal system memory). All the frames in the pool are assumed to be allocated in the same way and interchangeable.
public unsafe partial struct AVHWFramesContext
{
/// A class for logging.
public AVClass* @av_class;
/// A reference to the parent AVHWDeviceContext. This reference is owned and managed by the enclosing AVHWFramesContext, but the caller may derive additional references from it.
public AVBufferRef* @device_ref;
/// The parent AVHWDeviceContext. This is simply a pointer to device_ref->data provided for convenience.
public AVHWDeviceContext* @device_ctx;
/// The format-specific data, allocated and freed automatically along with this context.
public void* @hwctx;
/// This field may be set by the caller before calling av_hwframe_ctx_init().
public AVHWFramesContext_free_func @free;
/// Arbitrary user data, to be used e.g. by the free() callback.
public void* @user_opaque;
/// A pool from which the frames are allocated by av_hwframe_get_buffer(). This field may be set by the caller before calling av_hwframe_ctx_init(). The buffers returned by calling av_buffer_pool_get() on this pool must have the properties described in the documentation in the corresponding hw type's header (hwcontext_*.h). The pool will be freed strictly before this struct's free() callback is invoked.
public AVBufferPool* @pool;
/// Initial size of the frame pool. If a device type does not support dynamically resizing the pool, then this is also the maximum pool size.
public int @initial_pool_size;
/// The pixel format identifying the underlying HW surface type.
public AVPixelFormat @format;
/// The pixel format identifying the actual data layout of the hardware frames.
public AVPixelFormat @sw_format;
/// The allocated dimensions of the frames in this pool.
public int @width;
/// The allocated dimensions of the frames in this pool.
public int @height;
}
// public unsafe partial struct AVIndexEntry
// {
// public long @pos;
// /// Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available when seeking to this entry. That means preferable PTS on keyframe based formats. But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better is known
// public long @timestamp;
// /// Flag is used to indicate which frame should be discarded after decoding.
// public int @flags2_size30;
// /// Minimum distance between this and the previous keyframe, used to avoid unneeded searching.
// public int @min_distance;
// }
/// @{
public unsafe partial struct AVInputFormat
{
/// A comma separated list of short names for the format. New names may be appended with a minor bump.
public byte* @name;
/// Descriptive name for the format, meant to be more human-readable than name. You should use the NULL_IF_CONFIG_SMALL() macro to define it.
public byte* @long_name;
/// Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, AVFMT_NOTIMESTAMPS, AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS.
public int @flags;
/// If extensions are defined, then no probe is done. You should usually not use extension format guessing because it is not reliable enough
public byte* @extensions;
public AVCodecTag** @codec_tag;
/// AVClass for the private context
public AVClass* @priv_class;
/// Comma-separated list of mime types. It is used check for matching mime types while probing.
public byte* @mime_type;
}
/// Bytestream IO Context. New public fields can be added with minor version bumps. Removal, reordering and changes to existing public fields require a major version bump. sizeof(AVIOContext) must not be used outside libav*.
public unsafe partial struct AVIOContext
{
/// A class for private options.
public AVClass* @av_class;
/// Start of the buffer.
public byte* @buffer;
/// Maximum buffer size
public int @buffer_size;
/// Current position in the buffer
public byte* @buf_ptr;
/// End of the data, may be less than buffer+buffer_size if the read function returned less data than requested, e.g. for streams where no more data has been received yet.
public byte* @buf_end;
/// A private pointer, passed to the read/write/seek/... functions.
public void* @opaque;
public AVIOContext_read_packet_func @read_packet;
public AVIOContext_write_packet_func @write_packet;
public AVIOContext_seek_func @seek;
/// position in the file of the current buffer
public long @pos;
/// true if was unable to read due to error or eof
public int @eof_reached;
/// contains the error code or 0 if no error happened
public int @error;
/// true if open for writing
public int @write_flag;
public int @max_packet_size;
/// Try to buffer at least this amount of data before flushing it.
public int @min_packet_size;
public ulong @checksum;
public byte* @checksum_ptr;
public AVIOContext_update_checksum_func @update_checksum;
/// Pause or resume playback for network streaming protocols - e.g. MMS.
public AVIOContext_read_pause_func @read_pause;
/// Seek to a given timestamp in stream with the specified stream_index. Needed for some network streaming protocols which don't support seeking to byte position.
public AVIOContext_read_seek_func @read_seek;
/// A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
public int @seekable;
/// avio_read and avio_write should if possible be satisfied directly instead of going through a buffer, and avio_seek will always call the underlying seek function directly.
public int @direct;
/// ',' separated list of allowed protocols.
public byte* @protocol_whitelist;
/// ',' separated list of disallowed protocols.
public byte* @protocol_blacklist;
/// A callback that is used instead of write_packet.
public AVIOContext_write_data_type_func @write_data_type;
/// If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly small chunks of data returned from the callback).
public int @ignore_boundary_point;
/// Maximum reached position before a backward seek in the write buffer, used keeping track of already written data for a later flush.
public byte* @buf_ptr_max;
/// Read-only statistic of bytes read for this AVIOContext.
public long @bytes_read;
/// Read-only statistic of bytes written for this AVIOContext.
public long @bytes_written;
}
// /// Describes single entry of the directory.
// public unsafe partial struct AVIODirEntry
// {
// /// Filename
// public byte* @name;
// /// Type of the entry
// public int @type;
// /// Set to 1 when name is encoded with UTF-8, 0 otherwise. Name can be encoded with UTF-8 even though 0 is set.
// public int @utf8;
// /// File size in bytes, -1 if unknown.
// public long @size;
// /// Time of last modification in microseconds since unix epoch, -1 if unknown.
// public long @modification_timestamp;
// /// Time of last access in microseconds since unix epoch, -1 if unknown.
// public long @access_timestamp;
// /// Time of last status change in microseconds since unix epoch, -1 if unknown.
// public long @status_change_timestamp;
// /// User ID of owner, -1 if unknown.
// public long @user_id;
// /// Group ID of owner, -1 if unknown.
// public long @group_id;
// /// Unix file mode, -1 if unknown.
// public long @filemode;
// }
/// Callback for checking whether to abort blocking functions. AVERROR_EXIT is returned in this case by the interrupted function. During blocking operations, callback is called with opaque as parameter. If the callback returns 1, the blocking operation will be aborted.
public unsafe partial struct AVIOInterruptCB
{
public AVIOInterruptCB_callback_func @callback;
public void* @opaque;
}
// /// Mastering display metadata capable of representing the color volume of the display used to master the content (SMPTE 2086:2014).
// public unsafe partial struct AVMasteringDisplayMetadata
// {
// /// CIE 1931 xy chromaticity coords of color primaries (r, g, b order).
// public AVRational3x2 @display_primaries;
// /// CIE 1931 xy chromaticity coords of white point.
// public AVRational2 @white_point;
// /// Min luminance of mastering display (cd/m^2).
// public AVRational @min_luminance;
// /// Max luminance of mastering display (cd/m^2).
// public AVRational @max_luminance;
// /// Flag indicating whether the display primaries (and white point) are set.
// public int @has_primaries;
// /// Flag indicating whether the luminance (min_ and max_) have been set.
// public int @has_luminance;
// }
/// AVOption
public unsafe partial struct AVOption
{
public byte* @name;
/// short English help text
public byte* @help;
/// Native access only.
public int @offset;
public AVOptionType @type;
public AVOption_default_val @default_val;
/// minimum valid value for the option
public double @min;
/// maximum valid value for the option
public double @max;
/// A combination of AV_OPT_FLAG_*.
public int @flags;
/// The logical unit to which the option belongs. Non-constant options and corresponding named constants share the same unit. May be NULL.
public byte* @unit;
}
/// Native access only, except when documented otherwise. the default value for scalar options
[StructLayout(LayoutKind.Explicit)]
public unsafe partial struct AVOption_default_val
{
[FieldOffset(0)]
public long @i64;
[FieldOffset(0)]
public double @dbl;
[FieldOffset(0)]
public byte* @str;
[FieldOffset(0)]
public AVRational @q;
/// Used for AV_OPT_TYPE_FLAG_ARRAY options. May be NULL.
[FieldOffset(0)]
public AVOptionArrayDef* @arr;
}
/// May be set as default_val for AV_OPT_TYPE_FLAG_ARRAY options.
public unsafe partial struct AVOptionArrayDef
{
/// Native access only.
public byte* @def;
/// Minimum number of elements in the array. When this field is non-zero, def must be non-NULL and contain at least this number of elements.
public uint @size_min;
/// Maximum number of elements in the array, 0 when unlimited.
public uint @size_max;
/// Separator between array elements in string representations of this option, used by av_opt_set() and av_opt_get(). It must be a printable ASCII character, excluding alphanumeric and the backslash. A comma is used when sep=0.
public byte @sep;
}
/// A single allowed range of values, or a single allowed value.
public unsafe partial struct AVOptionRange
{
public byte* @str;
/// Value range. For string ranges this represents the min/max length. For dimensions this represents the min/max pixel count or width/height in multi-component case.
public double @value_min;
/// Value range. For string ranges this represents the min/max length. For dimensions this represents the min/max pixel count or width/height in multi-component case.
public double @value_max;
/// Value's component range. For string this represents the unicode range for chars, 0-127 limits to ASCII.
public double @component_min;
/// Value's component range. For string this represents the unicode range for chars, 0-127 limits to ASCII.
public double @component_max;
/// Range flag. If set to 1 the struct encodes a range, if set to 0 a single value.
public int @is_range;
}
/// List of AVOptionRange structs.
public unsafe partial struct AVOptionRanges
{
/// Array of option ranges.
public AVOptionRange** @range;
/// Number of ranges per component.
public int @nb_ranges;
/// Number of componentes.
public int @nb_components;
}
/// @{
public unsafe partial struct AVOutputFormat
{
public byte* @name;
/// Descriptive name for the format, meant to be more human-readable than name. You should use the NULL_IF_CONFIG_SMALL() macro to define it.
public byte* @long_name;
public byte* @mime_type;
/// comma-separated filename extensions
public byte* @extensions;
/// default audio codec
public AVCodecID @audio_codec;
/// default video codec
public AVCodecID @video_codec;
/// default subtitle codec
public AVCodecID @subtitle_codec;
/// can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE
public int @flags;
/// List of supported codec_id-codec_tag pairs, ordered by "better choice first". The arrays are all terminated by AV_CODEC_ID_NONE.
public AVCodecTag** @codec_tag;
/// AVClass for the private context
public AVClass* @priv_class;
}
/// This structure stores compressed data. It is typically exported by demuxers and then passed as input to decoders, or received as output from encoders and then passed to muxers.
public unsafe partial struct AVPacket
{
/// A reference to the reference-counted buffer where the packet data is stored. May be NULL, then the packet data is not reference-counted.
public AVBufferRef* @buf;
/// Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will be presented to the user. Can be AV_NOPTS_VALUE if it is not stored in the file. pts MUST be larger or equal to dts as presentation cannot happen before decompression, unless one wants to view hex dumps. Some formats misuse the terms dts and pts/cts to mean something different. Such timestamps must be converted to true pts/dts before they are stored in AVPacket.
public long @pts;
/// Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed. Can be AV_NOPTS_VALUE if it is not stored in the file.
public long @dts;
public byte* @data;
public int @size;
public int @stream_index;
/// A combination of AV_PKT_FLAG values
public int @flags;
/// Additional packet data that can be provided by the container. Packet can contain several types of side information.
public AVPacketSideData* @side_data;
public int @side_data_elems;
/// Duration of this packet in AVStream->time_base units, 0 if unknown. Equals next_pts - this_pts in presentation order.
public long @duration;
/// byte position in stream, -1 if unknown
public long @pos;
/// for some private data of the user
public void* @opaque;
/// AVBufferRef for free use by the API user. leviathan will never check the contents of the buffer ref. leviathan calls av_buffer_unref() on it when the packet is unreferenced. av_packet_copy_props() calls create a new reference with av_buffer_ref() for the target packet's opaque_ref field.
public AVBufferRef* @opaque_ref;
/// Time base of the packet's timestamps. In the future, this field may be set on packets output by encoders or demuxers, but its value will be by default ignored on input to decoders or muxers.
public AVRational @time_base;
}
public unsafe partial struct AVPacketList
{
public AVPacket @pkt;
public AVPacketList* @next;
}
/// This structure stores auxiliary information for decoding, presenting, or otherwise processing the coded stream. It is typically exported by demuxers and encoders and can be fed to decoders and muxers either in a per packet basis, or as global side data (applying to the entire coded stream).
public unsafe partial struct AVPacketSideData
{
public byte* @data;
public ulong @size;
public AVPacketSideDataType @type;
}
// /// Pan Scan area. This specifies the area which should be displayed. Note there may be multiple such areas for one frame.
// public unsafe partial struct AVPanScan
// {
// /// id - encoding: Set by user. - decoding: Set by libavcodec.
// public int @id;
// /// width and height in 1/16 pel - encoding: Set by user. - decoding: Set by libavcodec.
// public int @width;
// public int @height;
// /// position of the top left corner in 1/16 pel for up to 3 fields/frames - encoding: Set by user. - decoding: Set by libavcodec.
// public short3x2 @position;
// }
// /// Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes of an image. It also stores the subsampling factors and number of components.
// public unsafe partial struct AVPixFmtDescriptor
// {
// public byte* @name;
// /// The number of components each pixel has, (1-4)
// public byte @nb_components;
// /// Amount to shift the luma width right to find the chroma width. For YV12 this is 1 for example. chroma_width = AV_CEIL_RSHIFT(luma_width, log2_chroma_w) The note above is needed to ensure rounding up. This value only refers to the chroma components.
// public byte @log2_chroma_w;
// /// Amount to shift the luma height right to find the chroma height. For YV12 this is 1 for example. chroma_height= AV_CEIL_RSHIFT(luma_height, log2_chroma_h) The note above is needed to ensure rounding up. This value only refers to the chroma components.
// public byte @log2_chroma_h;
// /// Combination of AV_PIX_FMT_FLAG_... flags.
// public ulong @flags;
// /// Parameters that describe how pixels are packed. If the format has 1 or 2 components, then luma is 0. If the format has 3 or 4 components: if the RGB flag is set then 0 is red, 1 is green and 2 is blue; otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
// public AVComponentDescriptor4 @comp;
// /// Alternative comma-separated names.
// public byte* @alias;
// }
// /// This structure contains the data a format has to probe a file.
// public unsafe partial struct AVProbeData
// {
// public byte* @filename;
// /// Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
// public byte* @buf;
// /// Size of buf except extra allocated bytes
// public int @buf_size;
// /// mime_type, when known.
// public byte* @mime_type;
// }
// /// This structure supplies correlation between a packet timestamp and a wall clock production time. The definition follows the Producer Reference Time ('prft') as defined in ISO/IEC 14496-12
// public unsafe partial struct AVProducerReferenceTime
// {
// /// A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()).
// public long @wallclock;
// public int @flags;
// }
/// AVProfile.
public unsafe partial struct AVProfile
{
public int @profile;
/// short name for the profile
public byte* @name;
}
/// New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVProgram) must not be used outside libav*.
public unsafe partial struct AVProgram
{
public int @id;
public int @flags;
/// selects which program to discard and which to feed to the caller
public AVDiscard @discard;
public uint* @stream_index;
public uint @nb_stream_indexes;
public AVDictionary* @metadata;
public int @program_num;
public int @pmt_pid;
public int @pcr_pid;
public int @pmt_version;
/// *************************************************************** All fields below this line are not part of the public API. They may not be used outside of libavformat and can be changed and removed at will. New public fields should be added right above. ****************************************************************
public long @start_time;
public long @end_time;
/// reference dts for wrap detection
public long @pts_wrap_reference;
/// behavior on wrap detection
public int @pts_wrap_behavior;
}
/// Rational number (pair of numerator and denominator).
public unsafe partial struct AVRational
{
/// Numerator
public int @num;
/// Denominator
public int @den;
}
// /// Structure describing a single Region Of Interest.
// public unsafe partial struct AVRegionOfInterest
// {
// /// Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)).
// public uint @self_size;
// /// Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge of the frame to the left and right edges of the rectangle defining this region of interest.
// public int @top;
// public int @bottom;
// public int @left;
// public int @right;
// /// Quantisation offset.
// public AVRational @qoffset;
// }
/// Stream structure. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVStream) must not be used outside libav*.
public unsafe partial struct AVStream
{
/// A class for avoptions. Set on stream creation.
public AVClass* @av_class;
/// stream index in AVFormatContext
public int @index;
/// Format-specific stream ID. decoding: set by libavformat encoding: set by the user, replaced by libavformat if left unset
public int @id;
/// Codec parameters associated with this stream. Allocated and freed by libavformat in avformat_new_stream() and avformat_free_context() respectively.
public AVCodecParameters* @codecpar;
public void* @priv_data;
/// This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
public AVRational @time_base;
/// Decoding: pts of the first frame of the stream in presentation order, in stream time base. Only set this if you are absolutely 100% sure that the value you set it to really is the pts of the first frame. This may be undefined (AV_NOPTS_VALUE).
public long @start_time;
/// Decoding: duration of the stream, in stream time base. If a source file does not specify a duration, but does specify a bitrate, this value will be estimated from bitrate and file size.
public long @duration;
/// number of frames in this stream if known or 0
public long @nb_frames;
/// Stream disposition - a combination of AV_DISPOSITION_* flags. - demuxing: set by libavformat when creating the stream or in avformat_find_stream_info(). - muxing: may be set by the caller before avformat_write_header().
public int @disposition;
/// Selects which packets can be discarded at will and do not need to be demuxed.
public AVDiscard @discard;
/// sample aspect ratio (0 if unknown) - encoding: Set by user. - decoding: Set by libavformat.
public AVRational @sample_aspect_ratio;
public AVDictionary* @metadata;
/// Average framerate
public AVRational @avg_frame_rate;
/// For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet will contain the attached picture.
public AVPacket @attached_pic;
/// An array of side data that applies to the whole stream (i.e. the container does not allow it to change between packets).
[Obsolete("use AVStream's \"codecpar side data\".")]
public AVPacketSideData* @side_data;
/// The number of elements in the AVStream.side_data array.
[Obsolete("use AVStream's \"codecpar side data\".")]
public int @nb_side_data;
/// Flags indicating events happening on the stream, a combination of AVSTREAM_EVENT_FLAG_*.
public int @event_flags;
/// Real base framerate of the stream. This is the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream). Note, this value is just a guess! For example, if the time base is 1/90000 and all frames have either approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.
public AVRational @r_frame_rate;
/// Number of bits in timestamps. Used for wrapping control.
public int @pts_wrap_bits;
}
public unsafe partial struct AVStreamGroup
{
/// A class for avoptions. Set by avformat_stream_group_create().
public AVClass* @av_class;
public void* @priv_data;
/// Group index in AVFormatContext.
public uint @index;
/// Group type-specific group ID.
public long @id;
/// Group type
public AVStreamGroupParamsType @type;
public AVStreamGroup_params @params;
/// Metadata that applies to the whole group.
public AVDictionary* @metadata;
/// Number of elements in AVStreamGroup.streams.
public uint @nb_streams;
/// A list of streams in the group. New entries are created with avformat_stream_group_add_stream().
public AVStream** @streams;
/// Stream group disposition - a combination of AV_DISPOSITION_* flags. This field currently applies to all defined AVStreamGroupParamsType.
public int @disposition;
}
/// Group type-specific parameters
[StructLayout(LayoutKind.Explicit)]
public unsafe partial struct AVStreamGroup_params
{
[FieldOffset(0)]
public AVIAMFAudioElement* @iamf_audio_element;
[FieldOffset(0)]
public AVIAMFMixPresentation* @iamf_mix_presentation;
[FieldOffset(0)]
public AVStreamGroupTileGrid* @tile_grid;
}
/// AVStreamGroupTileGrid holds information on how to combine several independent images on a single canvas for presentation.
public unsafe partial struct AVStreamGroupTileGrid
{
public AVClass* @av_class;
/// Amount of tiles in the grid.
public uint @nb_tiles;
/// Width of the canvas.
public int @coded_width;
/// Width of the canvas.
public int @coded_height;
public AVStreamGroupTileGrid_offsets* @offsets;
/// The pixel value per channel in RGBA format used if no pixel of any tile is located at a particular pixel location.
public byte4 @background;
/// Offset in pixels from the left edge of the canvas where the actual image meant for presentation starts.
public int @horizontal_offset;
/// Offset in pixels from the top edge of the canvas where the actual image meant for presentation starts.
public int @vertical_offset;
/// Width of the final image for presentation.
public int @width;
/// Height of the final image for presentation.
public int @height;
}
/// An nb_tiles sized array of offsets in pixels from the topleft edge of the canvas, indicating where each stream should be placed. It must be allocated with the av_malloc() family of functions.
public unsafe partial struct AVStreamGroupTileGrid_offsets
{
/// Index of the stream in the group this tile references.
public uint @idx;
/// Offset in pixels from the left edge of the canvas where the tile should be placed.
public int @horizontal;
/// Offset in pixels from the top edge of the canvas where the tile should be placed.
public int @vertical;
}
// public unsafe partial struct AVSubtitle
// {
// public ushort @format;
// public uint @start_display_time;
// public uint @end_display_time;
// public uint @num_rects;
// public AVSubtitleRect** @rects;
// /// Same as packet pts, in AV_TIME_BASE
// public long @pts;
// }
// public unsafe partial struct AVSubtitleRect
// {
// /// top left corner of pict, undefined when pict is not set
// public int @x;
// /// top left corner of pict, undefined when pict is not set
// public int @y;
// /// width of pict, undefined when pict is not set
// public int @w;
// /// height of pict, undefined when pict is not set
// public int @h;
// /// number of colors in pict, undefined when pict is not set
// public int @nb_colors;
// /// data+linesize for the bitmap of this subtitle. Can be set for text/ass as well once they are rendered.
// public byte_ptr4 @data;
// public int4 @linesize;
// public int @flags;
// public AVSubtitleType @type;
// /// 0 terminated plain UTF-8 text
// public byte* @text;
// /// 0 terminated ASS/SSA compatible event line. The presentation of this is unaffected by the other values in this struct.
// public byte* @ass;
// }
// public unsafe partial struct AVTimecode
// {
// /// timecode frame start (first base frame number)
// public int @start;
// /// flags such as drop frame, +24 hours support, ...
// public uint @flags;
// /// frame rate in rational form
// public AVRational @rate;
// /// frame per second; must be consistent with the rate field
// public uint @fps;
// }
// public unsafe partial struct D3D11_VIDEO_DECODER_CONFIG
// {
// public _GUID @guidConfigBitstreamEncryption;
// public _GUID @guidConfigMBcontrolEncryption;
// public _GUID @guidConfigResidDiffEncryption;
// public uint @ConfigBitstreamRaw;
// public uint @ConfigMBcontrolRasterOrder;
// public uint @ConfigResidDiffHost;
// public uint @ConfigSpatialResid8;
// public uint @ConfigResid8Subtraction;
// public uint @ConfigSpatialHost8or9Clipping;
// public uint @ConfigSpatialResidInterleaved;
// public uint @ConfigIntraResidUnsigned;
// public uint @ConfigResidDiffAccelerator;
// public uint @ConfigHostInverseScan;
// public uint @ConfigSpecificIDCT;
// public uint @Config4GroupedCoefs;
// public ushort @ConfigMinRenderTargetBuffCount;
// public ushort @ConfigDecoderSpecific;
// }
// public unsafe partial struct ID3D11Device
// {
// public ID3D11DeviceVtbl* @lpVtbl;
// }
// public unsafe partial struct ID3D11DeviceContext
// {
// public ID3D11DeviceContextVtbl* @lpVtbl;
// }
// public unsafe partial struct ID3D11DeviceContextVtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @GetDevice;
// public void* @GetPrivateData;
// public void* @SetPrivateData;
// public void* @SetPrivateDataInterface;
// public void* @VSSetConstantBuffers;
// public void* @PSSetShaderResources;
// public void* @PSSetShader;
// public void* @PSSetSamplers;
// public void* @VSSetShader;
// public void* @DrawIndexed;
// public void* @Draw;
// public void* @Map;
// public void* @Unmap;
// public void* @PSSetConstantBuffers;
// public void* @IASetInputLayout;
// public void* @IASetVertexBuffers;
// public void* @IASetIndexBuffer;
// public void* @DrawIndexedInstanced;
// public void* @DrawInstanced;
// public void* @GSSetConstantBuffers;
// public void* @GSSetShader;
// public void* @IASetPrimitiveTopology;
// public void* @VSSetShaderResources;
// public void* @VSSetSamplers;
// public void* @Begin;
// public void* @End;
// public void* @GetData;
// public void* @SetPredication;
// public void* @GSSetShaderResources;
// public void* @GSSetSamplers;
// public void* @OMSetRenderTargets;
// public void* @OMSetRenderTargetsAndUnorderedAccessViews;
// public void* @OMSetBlendState;
// public void* @OMSetDepthStencilState;
// public void* @SOSetTargets;
// public void* @DrawAuto;
// public void* @DrawIndexedInstancedIndirect;
// public void* @DrawInstancedIndirect;
// public void* @Dispatch;
// public void* @DispatchIndirect;
// public void* @RSSetState;
// public void* @RSSetViewports;
// public void* @RSSetScissorRects;
// public void* @CopySubresourceRegion;
// public void* @CopyResource;
// public void* @UpdateSubresource;
// public void* @CopyStructureCount;
// public void* @ClearRenderTargetView;
// public void* @ClearUnorderedAccessViewUint;
// public void* @ClearUnorderedAccessViewFloat;
// public void* @ClearDepthStencilView;
// public void* @GenerateMips;
// public void* @SetResourceMinLOD;
// public void* @GetResourceMinLOD;
// public void* @ResolveSubresource;
// public void* @ExecuteCommandList;
// public void* @HSSetShaderResources;
// public void* @HSSetShader;
// public void* @HSSetSamplers;
// public void* @HSSetConstantBuffers;
// public void* @DSSetShaderResources;
// public void* @DSSetShader;
// public void* @DSSetSamplers;
// public void* @DSSetConstantBuffers;
// public void* @CSSetShaderResources;
// public void* @CSSetUnorderedAccessViews;
// public void* @CSSetShader;
// public void* @CSSetSamplers;
// public void* @CSSetConstantBuffers;
// public void* @VSGetConstantBuffers;
// public void* @PSGetShaderResources;
// public void* @PSGetShader;
// public void* @PSGetSamplers;
// public void* @VSGetShader;
// public void* @PSGetConstantBuffers;
// public void* @IAGetInputLayout;
// public void* @IAGetVertexBuffers;
// public void* @IAGetIndexBuffer;
// public void* @GSGetConstantBuffers;
// public void* @GSGetShader;
// public void* @IAGetPrimitiveTopology;
// public void* @VSGetShaderResources;
// public void* @VSGetSamplers;
// public void* @GetPredication;
// public void* @GSGetShaderResources;
// public void* @GSGetSamplers;
// public void* @OMGetRenderTargets;
// public void* @OMGetRenderTargetsAndUnorderedAccessViews;
// public void* @OMGetBlendState;
// public void* @OMGetDepthStencilState;
// public void* @SOGetTargets;
// public void* @RSGetState;
// public void* @RSGetViewports;
// public void* @RSGetScissorRects;
// public void* @HSGetShaderResources;
// public void* @HSGetShader;
// public void* @HSGetSamplers;
// public void* @HSGetConstantBuffers;
// public void* @DSGetShaderResources;
// public void* @DSGetShader;
// public void* @DSGetSamplers;
// public void* @DSGetConstantBuffers;
// public void* @CSGetShaderResources;
// public void* @CSGetUnorderedAccessViews;
// public void* @CSGetShader;
// public void* @CSGetSamplers;
// public void* @CSGetConstantBuffers;
// public void* @ClearState;
// public void* @Flush;
// public void* @GetType;
// public void* @GetContextFlags;
// public void* @FinishCommandList;
// }
// public unsafe partial struct ID3D11DeviceVtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @CreateBuffer;
// public void* @CreateTexture1D;
// public void* @CreateTexture2D;
// public void* @CreateTexture3D;
// public void* @CreateShaderResourceView;
// public void* @CreateUnorderedAccessView;
// public void* @CreateRenderTargetView;
// public void* @CreateDepthStencilView;
// public void* @CreateInputLayout;
// public void* @CreateVertexShader;
// public void* @CreateGeometryShader;
// public void* @CreateGeometryShaderWithStreamOutput;
// public void* @CreatePixelShader;
// public void* @CreateHullShader;
// public void* @CreateDomainShader;
// public void* @CreateComputeShader;
// public void* @CreateClassLinkage;
// public void* @CreateBlendState;
// public void* @CreateDepthStencilState;
// public void* @CreateRasterizerState;
// public void* @CreateSamplerState;
// public void* @CreateQuery;
// public void* @CreatePredicate;
// public void* @CreateCounter;
// public void* @CreateDeferredContext;
// public void* @OpenSharedResource;
// public void* @CheckFormatSupport;
// public void* @CheckMultisampleQualityLevels;
// public void* @CheckCounterInfo;
// public void* @CheckCounter;
// public void* @CheckFeatureSupport;
// public void* @GetPrivateData;
// public void* @SetPrivateData;
// public void* @SetPrivateDataInterface;
// public void* @GetFeatureLevel;
// public void* @GetCreationFlags;
// public void* @GetDeviceRemovedReason;
// public void* @GetImmediateContext;
// public void* @SetExceptionMode;
// public void* @GetExceptionMode;
// }
// public unsafe partial struct ID3D11Texture2D
// {
// public ID3D11Texture2DVtbl* @lpVtbl;
// }
// public unsafe partial struct ID3D11Texture2DVtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @GetDevice;
// public void* @GetPrivateData;
// public void* @SetPrivateData;
// public void* @SetPrivateDataInterface;
// public void* @GetType;
// public void* @SetEvictionPriority;
// public void* @GetEvictionPriority;
// public void* @GetDesc;
// }
// public unsafe partial struct ID3D11VideoContext
// {
// public ID3D11VideoContextVtbl* @lpVtbl;
// }
// public unsafe partial struct ID3D11VideoContextVtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @GetDevice;
// public void* @GetPrivateData;
// public void* @SetPrivateData;
// public void* @SetPrivateDataInterface;
// public void* @GetDecoderBuffer;
// public void* @ReleaseDecoderBuffer;
// public void* @DecoderBeginFrame;
// public void* @DecoderEndFrame;
// public void* @SubmitDecoderBuffers;
// public void* @DecoderExtension;
// public void* @VideoProcessorSetOutputTargetRect;
// public void* @VideoProcessorSetOutputBackgroundColor;
// public void* @VideoProcessorSetOutputColorSpace;
// public void* @VideoProcessorSetOutputAlphaFillMode;
// public void* @VideoProcessorSetOutputConstriction;
// public void* @VideoProcessorSetOutputStereoMode;
// public void* @VideoProcessorSetOutputExtension;
// public void* @VideoProcessorGetOutputTargetRect;
// public void* @VideoProcessorGetOutputBackgroundColor;
// public void* @VideoProcessorGetOutputColorSpace;
// public void* @VideoProcessorGetOutputAlphaFillMode;
// public void* @VideoProcessorGetOutputConstriction;
// public void* @VideoProcessorGetOutputStereoMode;
// public void* @VideoProcessorGetOutputExtension;
// public void* @VideoProcessorSetStreamFrameFormat;
// public void* @VideoProcessorSetStreamColorSpace;
// public void* @VideoProcessorSetStreamOutputRate;
// public void* @VideoProcessorSetStreamSourceRect;
// public void* @VideoProcessorSetStreamDestRect;
// public void* @VideoProcessorSetStreamAlpha;
// public void* @VideoProcessorSetStreamPalette;
// public void* @VideoProcessorSetStreamPixelAspectRatio;
// public void* @VideoProcessorSetStreamLumaKey;
// public void* @VideoProcessorSetStreamStereoFormat;
// public void* @VideoProcessorSetStreamAutoProcessingMode;
// public void* @VideoProcessorSetStreamFilter;
// public void* @VideoProcessorSetStreamExtension;
// public void* @VideoProcessorGetStreamFrameFormat;
// public void* @VideoProcessorGetStreamColorSpace;
// public void* @VideoProcessorGetStreamOutputRate;
// public void* @VideoProcessorGetStreamSourceRect;
// public void* @VideoProcessorGetStreamDestRect;
// public void* @VideoProcessorGetStreamAlpha;
// public void* @VideoProcessorGetStreamPalette;
// public void* @VideoProcessorGetStreamPixelAspectRatio;
// public void* @VideoProcessorGetStreamLumaKey;
// public void* @VideoProcessorGetStreamStereoFormat;
// public void* @VideoProcessorGetStreamAutoProcessingMode;
// public void* @VideoProcessorGetStreamFilter;
// public void* @VideoProcessorGetStreamExtension;
// public void* @VideoProcessorBlt;
// public void* @NegotiateCryptoSessionKeyExchange;
// public void* @EncryptionBlt;
// public void* @DecryptionBlt;
// public void* @StartSessionKeyRefresh;
// public void* @FinishSessionKeyRefresh;
// public void* @GetEncryptionBltKey;
// public void* @NegotiateAuthenticatedChannelKeyExchange;
// public void* @QueryAuthenticatedChannel;
// public void* @ConfigureAuthenticatedChannel;
// public void* @VideoProcessorSetStreamRotation;
// public void* @VideoProcessorGetStreamRotation;
// }
// public unsafe partial struct ID3D11VideoDecoder
// {
// public ID3D11VideoDecoderVtbl* @lpVtbl;
// }
// public unsafe partial struct ID3D11VideoDecoderOutputView
// {
// public ID3D11VideoDecoderOutputViewVtbl* @lpVtbl;
// }
// public unsafe partial struct ID3D11VideoDecoderOutputViewVtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @GetDevice;
// public void* @GetPrivateData;
// public void* @SetPrivateData;
// public void* @SetPrivateDataInterface;
// public void* @GetResource;
// public void* @GetDesc;
// }
// public unsafe partial struct ID3D11VideoDecoderVtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @GetDevice;
// public void* @GetPrivateData;
// public void* @SetPrivateData;
// public void* @SetPrivateDataInterface;
// public void* @GetCreationParameters;
// public void* @GetDriverHandle;
// }
// public unsafe partial struct ID3D11VideoDevice
// {
// public ID3D11VideoDeviceVtbl* @lpVtbl;
// }
// public unsafe partial struct ID3D11VideoDeviceVtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @CreateVideoDecoder;
// public void* @CreateVideoProcessor;
// public void* @CreateAuthenticatedChannel;
// public void* @CreateCryptoSession;
// public void* @CreateVideoDecoderOutputView;
// public void* @CreateVideoProcessorInputView;
// public void* @CreateVideoProcessorOutputView;
// public void* @CreateVideoProcessorEnumerator;
// public void* @GetVideoDecoderProfileCount;
// public void* @GetVideoDecoderProfile;
// public void* @CheckVideoDecoderFormat;
// public void* @GetVideoDecoderConfigCount;
// public void* @GetVideoDecoderConfig;
// public void* @GetContentProtectionCaps;
// public void* @CheckCryptoKeyExchange;
// public void* @SetPrivateData;
// public void* @SetPrivateDataInterface;
// }
// public unsafe partial struct IDirect3DDeviceManager9
// {
// public IDirect3DDeviceManager9Vtbl* @lpVtbl;
// }
// public unsafe partial struct IDirect3DDeviceManager9Vtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @ResetDevice;
// public void* @OpenDeviceHandle;
// public void* @CloseDeviceHandle;
// public void* @TestDevice;
// public void* @LockDevice;
// public void* @UnlockDevice;
// public void* @GetVideoService;
// }
// public unsafe partial struct IDirect3DSurface9
// {
// public IDirect3DSurface9Vtbl* @lpVtbl;
// }
// public unsafe partial struct IDirect3DSurface9Vtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @GetDevice;
// public void* @SetPrivateData;
// public void* @GetPrivateData;
// public void* @FreePrivateData;
// public void* @SetPriority;
// public void* @GetPriority;
// public void* @PreLoad;
// public void* @GetType;
// public void* @GetContainer;
// public void* @GetDesc;
// public void* @LockRect;
// public void* @UnlockRect;
// public void* @GetDC;
// public void* @ReleaseDC;
// }
// public unsafe partial struct IDirectXVideoDecoder
// {
// public IDirectXVideoDecoderVtbl* @lpVtbl;
// }
// public unsafe partial struct IDirectXVideoDecoderVtbl
// {
// public void* @QueryInterface;
// public void* @AddRef;
// public void* @Release;
// public void* @GetVideoDecoderService;
// public void* @GetCreationParameters;
// public void* @GetBuffer;
// public void* @ReleaseBuffer;
// public void* @BeginFrame;
// public void* @EndFrame;
// public void* @Execute;
// }
public unsafe partial struct RcOverride
{
public int @start_frame;
public int @end_frame;
public int @qscale;
public float @quality_factor;
}
// public unsafe partial struct SwsFilter
// {
// public SwsVector* @lumH;
// public SwsVector* @lumV;
// public SwsVector* @chrH;
// public SwsVector* @chrV;
// }
// public unsafe partial struct SwsVector
// {
// /// pointer to the list of coefficients
// public double* @coeff;
// /// number of coefficients in the vector
// public int @length;
// }
// /// Context for an Audio FIFO Buffer.
// /// This struct is incomplete.
// public unsafe partial struct AVAudioFifo
// {
// }
// /// @}
// /// This struct is incomplete.
// public unsafe partial struct AVBPrint
// {
// }
// /// Structure for chain/list of bitstream filters. Empty list can be allocated by av_bsf_list_alloc().
// /// This struct is incomplete.
// public unsafe partial struct AVBSFList
// {
// }
/// A reference counted buffer type. It is opaque and is meant to be used through references (AVBufferRef).
/// This struct is incomplete.
public unsafe partial struct AVBuffer
{
}
/// The buffer pool. This structure is opaque and not meant to be accessed directly. It is allocated with av_buffer_pool_init() and freed with av_buffer_pool_uninit().
/// This struct is incomplete.
public unsafe partial struct AVBufferPool
{
}
/// This struct is incomplete.
public unsafe partial struct AVCodecInternal
{
}
/// **********************************************
/// This struct is incomplete.
public unsafe partial struct AVCodecTag
{
}
/// This struct is incomplete.
public unsafe partial struct AVDictionary
{
}
/// This struct is incomplete.
public unsafe partial struct AVFilterChannelLayouts
{
}
/// This struct is incomplete.
public unsafe partial struct AVFilterCommand
{
}
/// This struct is incomplete.
public unsafe partial struct AVFilterFormats
{
}
/// This struct is incomplete.
public unsafe partial struct AVFilterPad
{
}
/// This struct is incomplete.
public unsafe partial struct AVIAMFAudioElement
{
}
/// This struct is incomplete.
public unsafe partial struct AVIAMFMixPresentation
{
}
// /// This struct is incomplete.
// public unsafe partial struct AVIODirContext
// {
// }
// /// Low-complexity tree container
// /// This struct is incomplete.
// public unsafe partial struct AVTreeNode
// {
// }
// /// The libswresample context. Unlike libavcodec and libavformat, this structure is opaque. This means that if you would like to set options, you must use the avoptions API and cannot directly set values to members of the structure.
// /// This struct is incomplete.
// public unsafe partial struct SwrContext
// {
// }
// /// This struct is incomplete.
// public unsafe partial struct SwsContext
// {
// }
}