diff --git a/Directory.Build.props b/Directory.Build.props index 25ef434..934ef0e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ $(AssemblyName) - 6.0.0.2 + 6.1.0 Ruslan Balanukhin Rationale One FFmpeg.AutoGen diff --git a/FFmpeg.AutoGen.Abstractions/generated/Delegates.g.cs b/FFmpeg.AutoGen.Abstractions/generated/Delegates.g.cs index 0d1fb61..9439814 100644 --- a/FFmpeg.AutoGen.Abstractions/generated/Delegates.g.cs +++ b/FFmpeg.AutoGen.Abstractions/generated/Delegates.g.cs @@ -345,70 +345,6 @@ public unsafe struct AVFormatContext_io_open_func public static implicit operator AVFormatContext_io_open_func(AVFormatContext_io_open func) => new AVFormatContext_io_open_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; } -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_alloc_frame (AVCodecContext* @avctx, AVFrame* @frame); -public unsafe struct AVHWAccel_alloc_frame_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_alloc_frame_func(AVHWAccel_alloc_frame func) => new AVHWAccel_alloc_frame_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_decode_params (AVCodecContext* @avctx, int @type, byte* @buf, uint @buf_size); -public unsafe struct AVHWAccel_decode_params_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_decode_params_func(AVHWAccel_decode_params func) => new AVHWAccel_decode_params_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_decode_slice (AVCodecContext* @avctx, byte* @buf, uint @buf_size); -public unsafe struct AVHWAccel_decode_slice_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_decode_slice_func(AVHWAccel_decode_slice func) => new AVHWAccel_decode_slice_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_end_frame (AVCodecContext* @avctx); -public unsafe struct AVHWAccel_end_frame_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_end_frame_func(AVHWAccel_end_frame func) => new AVHWAccel_end_frame_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_frame_params (AVCodecContext* @avctx, AVBufferRef* @hw_frames_ctx); -public unsafe struct AVHWAccel_frame_params_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_frame_params_func(AVHWAccel_frame_params func) => new AVHWAccel_frame_params_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_init (AVCodecContext* @avctx); -public unsafe struct AVHWAccel_init_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_init_func(AVHWAccel_init func) => new AVHWAccel_init_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_start_frame (AVCodecContext* @avctx, byte* @buf, uint @buf_size); -public unsafe struct AVHWAccel_start_frame_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_start_frame_func(AVHWAccel_start_frame func) => new AVHWAccel_start_frame_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_uninit (AVCodecContext* @avctx); -public unsafe struct AVHWAccel_uninit_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_uninit_func(AVHWAccel_uninit func) => new AVHWAccel_uninit_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public unsafe delegate void AVHWDeviceContext_free (AVHWDeviceContext* @ctx); public unsafe struct AVHWDeviceContext_free_func diff --git a/FFmpeg.AutoGen.Abstractions/generated/Enums.g.cs b/FFmpeg.AutoGen.Abstractions/generated/Enums.g.cs index 25077e3..32fe4fe 100644 --- a/FFmpeg.AutoGen.Abstractions/generated/Enums.g.cs +++ b/FFmpeg.AutoGen.Abstractions/generated/Enums.g.cs @@ -433,6 +433,10 @@ public enum AVCodecID : int @AV_CODEC_ID_WBMP = 263, @AV_CODEC_ID_MEDIA100 = 264, @AV_CODEC_ID_VQC = 265, + @AV_CODEC_ID_PDV = 266, + @AV_CODEC_ID_EVC = 267, + @AV_CODEC_ID_RTV1 = 268, + @AV_CODEC_ID_VMIX = 269, /// A dummy id pointing at the start of audio codecs @AV_CODEC_ID_FIRST_AUDIO = 65536, @AV_CODEC_ID_PCM_S16LE = 65536, @@ -642,6 +646,8 @@ public enum AVCodecID : int @AV_CODEC_ID_FTR = 86116, @AV_CODEC_ID_WAVARC = 86117, @AV_CODEC_ID_RKA = 86118, + @AV_CODEC_ID_AC4 = 86119, + @AV_CODEC_ID_OSQ = 86120, /// A dummy ID pointing at the start of subtitle codecs. @AV_CODEC_ID_FIRST_SUBTITLE = 94208, @AV_CODEC_ID_DVD_SUBTITLE = 94208, @@ -685,6 +691,7 @@ public enum AVCodecID : int @AV_CODEC_ID_DVD_NAV = 98312, @AV_CODEC_ID_TIMED_ID3 = 98313, @AV_CODEC_ID_BIN_DATA = 98314, + @AV_CODEC_ID_SMPTE_2038 = 98315, /// codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it @AV_CODEC_ID_PROBE = 102400, /// _FAKE_ codec to indicate a raw MPEG-2 TS stream (only used by libavformat) @@ -883,7 +890,6 @@ public enum AVDurationEstimationMethod : int @AVFMT_DURATION_FROM_BITRATE = 2, } -/// @{ public enum AVFieldOrder : int { @AV_FIELD_UNKNOWN = 0, @@ -966,6 +972,8 @@ public enum AVFrameSideDataType : int @AV_FRAME_DATA_DYNAMIC_HDR_VIVID = 25, /// Ambient viewing environment metadata, as defined by H.274. @AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT = 26, + /// Provide encoder-specific hinting information about changed/unchanged portions of a frame. It can be used to pass information about which macroblocks can be skipped because they didn't change from the corresponding ones in the previous frame. This could be useful for applications which know this information in advance to speed up encoding. + @AV_FRAME_DATA_VIDEO_HINT = 27, } /// Option for overlapping elliptical pixel selectors in an image. @@ -1087,7 +1095,7 @@ public enum AVOptionType : int @AV_OPT_TYPE_CHLAYOUT = 19, } -/// Types and functions for working with AVPacket. @{ +/// Types and functions for working with AVPacketSideData. @{ public enum AVPacketSideDataType : int { /// An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette. This side data signals that a new palette is present. @@ -1645,8 +1653,20 @@ public enum AVPixelFormat : int @AV_PIX_FMT_RGBAF32BE = 220, /// IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian @AV_PIX_FMT_RGBAF32LE = 221, + /// interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian + @AV_PIX_FMT_P212BE = 222, + /// interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian + @AV_PIX_FMT_P212LE = 223, + /// interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian + @AV_PIX_FMT_P412BE = 224, + /// interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian + @AV_PIX_FMT_P412LE = 225, + /// planar GBR 4:4:4:4 56bpp, big-endian + @AV_PIX_FMT_GBRAP14BE = 226, + /// planar GBR 4:4:4:4 56bpp, little-endian + @AV_PIX_FMT_GBRAP14LE = 227, /// number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - @AV_PIX_FMT_NB = 222, + @AV_PIX_FMT_NB = 228, } /// Rounding methods. diff --git a/FFmpeg.AutoGen.Abstractions/generated/Structs.g.cs b/FFmpeg.AutoGen.Abstractions/generated/Structs.g.cs index 0a2e646..5ad9877 100644 --- a/FFmpeg.AutoGen.Abstractions/generated/Structs.g.cs +++ b/FFmpeg.AutoGen.Abstractions/generated/Structs.g.cs @@ -177,7 +177,7 @@ public unsafe partial struct AVCodec public ulong* @channel_layouts; /// AVClass for the private context public AVClass* @priv_class; - /// array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} + /// 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; @@ -219,6 +219,7 @@ public unsafe partial struct AVCodecContext /// 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; /// 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; @@ -318,7 +319,7 @@ public unsafe partial struct AVCodecContext 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 - decoding: Set by libavcodec + /// 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; @@ -364,7 +365,7 @@ public unsafe partial struct AVCodecContext 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: unused + /// 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; @@ -426,9 +427,9 @@ public unsafe partial struct AVCodecContext public AVCodecContext_execute2_func @execute2; /// noise vs. sse weight for the nsse comparison function - encoding: Set by user. - decoding: unused public int @nsse_weight; - /// profile - encoding: Set by user. - decoding: Set by libavcodec. + /// profile - encoding: Set by user. - decoding: Set by libavcodec. See the AV_PROFILE_* defines in defs.h. public int @profile; - /// level - encoding: Set by user. - decoding: Set by libavcodec. + /// 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; /// Skip loop filtering for selected frames. - encoding: unused - decoding: Set by user. public AVDiscard @skip_loop_filter; @@ -445,7 +446,7 @@ public unsafe partial struct AVCodecContext public AVRational @framerate; /// Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - encoding: unused. - decoding: Set by libavcodec before calling get_format() public AVPixelFormat @sw_pix_fmt; - /// Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - encoding unused. - decoding set by user. + /// Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. - encoding: unused. - decoding: set by user. public AVRational @pkt_timebase; /// AVCodecDescriptor - encoding: unused. - decoding: set by libavcodec. public AVCodecDescriptor* @codec_descriptor; @@ -516,7 +517,7 @@ public unsafe partial struct AVCodecDescriptor 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 FF_PROFILE_UNKNOWN. + /// If non-NULL, an array of profiles recognized for this codec. Terminated with AV_PROFILE_UNKNOWN. public AVProfile* @profiles; } @@ -589,6 +590,12 @@ public unsafe partial struct AVCodecParameters public int @seek_preroll; /// Audio only. The channel layout and number of channels. public AVChannelLayout @ch_layout; + /// 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; + /// 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; } public unsafe partial struct AVCodecParser @@ -1274,6 +1281,7 @@ public unsafe partial struct AVFrame /// 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; @@ -1291,13 +1299,15 @@ public unsafe partial struct AVFrame public int @display_picture_number; /// quality (between 1 (good) and FF_LAMBDA_MAX (bad)) public int @quality; - /// for some private data of the user + /// Frame owner's private data. public void* @opaque; - /// When decoding, this signals how much the picture must be delayed. extra_delay = repeat_pict / (2*fps) + /// 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; @@ -1329,6 +1339,7 @@ public unsafe partial struct AVFrame /// 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; /// duration of the corresponding packet, expressed in AVStream->time_base units, 0 if unknown. - encoding: unused - decoding: Read by user. [Obsolete("use duration instead")] @@ -1341,10 +1352,11 @@ public unsafe partial struct AVFrame [Obsolete("use ch_layout instead")] public int @channels; /// 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; - /// AVBufferRef for free use by the API user. FFmpeg will never check the contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when the frame is unreferenced. av_frame_copy_props() calls create a new reference with av_buffer_ref() for the target frame's opaque_ref field. + /// 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; @@ -1441,28 +1453,6 @@ public unsafe partial struct AVHWAccel public AVPixelFormat @pix_fmt; /// Hardware accelerated codec capabilities. see AV_HWACCEL_CODEC_CAP_* public int @capabilities; - /// Allocate a custom buffer - public AVHWAccel_alloc_frame_func @alloc_frame; - /// Called at the beginning of each frame or field picture. - public AVHWAccel_start_frame_func @start_frame; - /// Callback for parameter data (SPS/PPS/VPS etc). - public AVHWAccel_decode_params_func @decode_params; - /// Callback for each slice. - public AVHWAccel_decode_slice_func @decode_slice; - /// Called at the end of each frame or field picture. - public AVHWAccel_end_frame_func @end_frame; - /// Size of per-frame hardware accelerator private data. - public int @frame_priv_data_size; - /// Initialize the hwaccel private data. - public AVHWAccel_init_func @init; - /// Uninitialize the hwaccel private data. - public AVHWAccel_uninit_func @uninit; - /// Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data. - public int @priv_data_size; - /// Internal hwaccel capabilities. - public int @caps_internal; - /// Fill the given hw_frames context with current codec parameters. Called from get_format. Refer to avcodec_get_hw_frames_parameters() for details. - public AVHWAccel_frame_params_func @frame_params; } /// 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. @@ -1627,7 +1617,6 @@ public unsafe partial struct AVIOContext 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; @@ -1768,7 +1757,7 @@ public unsafe partial struct AVOutputFormat 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_ALLOW_FLUSH, AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE + /// 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; @@ -1811,6 +1800,7 @@ public unsafe partial struct AVPacketList 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; @@ -1954,8 +1944,10 @@ public unsafe partial struct AVStream /// 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; diff --git a/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.functions.facade.g.cs b/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.functions.facade.g.cs index 5f35fd8..f78ed09 100644 --- a/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.functions.facade.g.cs +++ b/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.functions.facade.g.cs @@ -95,6 +95,9 @@ public static unsafe partial class ffmpeg /// number of samples actually written, or negative AVERROR code on failure. If successful, the number of samples actually written will always be nb_samples. public static int av_audio_fifo_write(AVAudioFifo* @af, void** @data, int @nb_samples) => vectors.av_audio_fifo_write(@af, @data, @nb_samples); + /// 0th order modified bessel function of the first kind. + public static double av_bessel_i0(double @x) => vectors.av_bessel_i0(@x); + /// Append a description of a channel layout to a bprint buffer. [Obsolete("use av_channel_layout_describe()")] public static void av_bprint_channel_layout(AVBPrint* @bp, int @nb_channels, ulong @channel_layout) => vectors.av_bprint_channel_layout(@bp, @nb_channels, @channel_layout); @@ -693,6 +696,18 @@ public static unsafe partial class ffmpeg /// The AVDynamicHDRPlus structure to be filled by caller or NULL on failure. public static AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data(AVFrame* @frame) => vectors.av_dynamic_hdr_plus_create_side_data(@frame); + /// Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). The T.35 buffer must begin with the application mode, skipping the country code, terminal provider codes, and application identifier. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// The byte array containing the raw ITU-T T.35 data. + /// Size of the data array in bytes. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + public static int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus* @s, byte* @data, ulong @size) => vectors.av_dynamic_hdr_plus_from_t35(@s, @data, @size); + + /// Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, excluding the first 48 bytes of the header, and beginning with the application mode. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + public static int av_dynamic_hdr_plus_to_t35(AVDynamicHDRPlus* @s, byte** @data, ulong* @size) => vectors.av_dynamic_hdr_plus_to_t35(@s, @data, @size); + /// Add the pointer to an element to a dynamic array. /// Pointer to the array to grow /// Pointer to the number of elements in the array @@ -887,6 +902,10 @@ public static unsafe partial class ffmpeg /// Remove and free all side data instances of the given type. public static void av_frame_remove_side_data(AVFrame* @frame, AVFrameSideDataType @type) => vectors.av_frame_remove_side_data(@frame, @type); + /// Ensure the destination frame refers to the same data described by the source frame, either by creating a new reference for each AVBufferRef from src if they differ from those in dst, by allocating new buffers and copying data if src is not reference counted, or by unrefencing it if src is empty. + /// 0 on success, a negative AVERROR on error. On error, dst is unreferenced. + public static int av_frame_replace(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_replace(@dst, @src); + /// Returns a string identifying the side data type /// a string identifying the side data type public static string av_frame_side_data_name(AVFrameSideDataType @type) => vectors.av_frame_side_data_name(@type); @@ -1081,7 +1100,7 @@ public static unsafe partial class ffmpeg /// index in an internal list, starting at 0 /// channel layout mask /// name of the layout - /// 0 if the layout exists, < 0 if index is beyond the limits + /// 0 if the layout exists, < 0 if index is beyond the limits [Obsolete("use av_channel_layout_standard()")] public static int av_get_standard_channel_layout(uint @index, ulong* @layout, byte** @name) => vectors.av_get_standard_channel_layout(@index, @layout, @name); @@ -1295,7 +1314,7 @@ public static unsafe partial class ffmpeg /// the AVPixelFormat of the image /// width of the image in pixels /// height of the image in pixels - public static void av_image_copy(ref byte_ptr4 @dst_data, ref int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => vectors.av_image_copy(ref @dst_data, ref @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); + public static void av_image_copy(ref byte_ptr4 @dst_data, in int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => vectors.av_image_copy(ref @dst_data, @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); /// Copy image plane from src to dst. That is, copy "height" number of lines of "bytewidth" bytes each. The first byte of each successive line is separated by *_linesize bytes. /// destination plane to copy to @@ -1413,7 +1432,7 @@ public static unsafe partial class ffmpeg /// Write a packet to an output media file ensuring correct interleaving. /// media file handle - /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. + /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. /// 0 on success, a negative AVERROR on error. public static int av_interleaved_write_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_interleaved_write_frame(@s, @pkt); @@ -1654,14 +1673,14 @@ public static unsafe partial class ffmpeg /// Check if given option is set to its default value. /// AVClass object to check option on /// option to be checked - /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error public static int av_opt_is_set_to_default(void* @obj, AVOption* @o) => vectors.av_opt_is_set_to_default(@obj, @o); /// Check if given option is set to its default value. /// AVClass object to check option on /// option name /// combination of AV_OPT_SEARCH_* - /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error public static int av_opt_is_set_to_default_by_name(void* @obj, string @name, int @search_flags) => vectors.av_opt_is_set_to_default_by_name(@obj, @name, @search_flags); /// Iterate over all AVOptions belonging to obj. @@ -1859,8 +1878,43 @@ public static unsafe partial class ffmpeg /// 0 on success, < 0 on failure public static int av_packet_shrink_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size) => vectors.av_packet_shrink_side_data(@pkt, @type, @size); + /// Wrap existing data as packet side data. + /// pointer to an array of side data to which the side data should be added. *sd may be NULL, in which case the array will be initialized + /// pointer to an integer containing the number of entries in the array. The integer value will be increased by 1 on success. + /// side data type + /// a data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to the side data array on success + /// size of the data array + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise On failure, the side data array is unchanged and the data remains owned by the caller. + public static AVPacketSideData* av_packet_side_data_add(AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags) => vectors.av_packet_side_data_add(@sd, @nb_sd, @type, @data, @size, @flags); + + /// Convenience function to free all the side data stored in an array, and the array itself. + /// pointer to array of side data to free. Will be set to NULL upon return. + /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. + public static void av_packet_side_data_free(AVPacketSideData** @sd, int* @nb_sd) => vectors.av_packet_side_data_free(@sd, @nb_sd); + + /// Get side information from a side data array. + /// the array from which the side data should be fetched + /// value containing the number of entries in the array. + /// desired side information type + /// pointer to side data if present or NULL otherwise + public static AVPacketSideData* av_packet_side_data_get(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type) => vectors.av_packet_side_data_get(@sd, @nb_sd, @type); + public static string av_packet_side_data_name(AVPacketSideDataType @type) => vectors.av_packet_side_data_name(@type); + /// Allocate a new packet side data. + /// side data type + /// desired side data size + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise. + public static AVPacketSideData* av_packet_side_data_new(AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags) => vectors.av_packet_side_data_new(@psd, @pnb_sd, @type, @size, @flags); + + /// Remove side data of the given type from a side data array. + /// the array from which the side data should be removed + /// pointer to an integer containing the number of entries in the array. Will be reduced by the amount of entries removed upon return + /// side information type + public static void av_packet_side_data_remove(AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type) => vectors.av_packet_side_data_remove(@sd, @nb_sd, @type); + /// Unpack a dictionary from side_data. /// data from side_data /// size of the data @@ -2163,6 +2217,7 @@ public static unsafe partial class ffmpeg /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to st. /// side information size /// zero on success, a negative AVERROR code on failure. On failure, the stream is unchanged and the data remains owned by the caller. + [Obsolete("use av_packet_side_data_add() with the stream's \"codecpar side data\"")] public static int av_stream_add_side_data(AVStream* @st, AVPacketSideDataType @type, byte* @data, ulong @size) => vectors.av_stream_add_side_data(@st, @type, @data, @size); /// Get the AVClass for AVStream. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. @@ -2183,6 +2238,7 @@ public static unsafe partial class ffmpeg /// desired side information type /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. /// pointer to data if present or NULL otherwise + [Obsolete("use av_packet_side_data_get() with the stream's \"codecpar side data\"")] public static byte* av_stream_get_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong* @size) => vectors.av_stream_get_side_data(@stream, @type, @size); /// Allocate new information from stream. @@ -2190,6 +2246,7 @@ public static unsafe partial class ffmpeg /// desired side information type /// side information size /// pointer to fresh allocated data or NULL otherwise + [Obsolete("use av_packet_side_data_new() with the stream's \"codecpar side data\"")] public static byte* av_stream_new_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong @size) => vectors.av_stream_new_side_data(@stream, @type, @size); /// Put a description of the AVERROR code errnum in errbuf. In case of failure the global variable errno is set to indicate the error. Even in case of failure av_strerror() will print a generic error message indicating the errnum provided to errbuf. @@ -2354,7 +2411,7 @@ public static unsafe partial class ffmpeg /// Write a packet to an output media file. /// media file handle - /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. + /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. /// < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush public static int av_write_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_write_frame(@s, @pkt); @@ -2380,7 +2437,7 @@ public static unsafe partial class ffmpeg public static int av_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame) => vectors.av_write_uncoded_frame(@s, @stream_index, @frame); /// Test whether a muxer supports uncoded frame. - /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not + /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not public static int av_write_uncoded_frame_query(AVFormatContext* @s, int @stream_index) => vectors.av_write_uncoded_frame_query(@s, @stream_index); /// Encode extradata length to a buffer. Used by xiph codecs. @@ -2531,7 +2588,7 @@ public static unsafe partial class ffmpeg /// Initialize the AVCodecContext to use the given AVCodec. Prior to using this function the context has to be allocated with avcodec_alloc_context3(). /// The context to initialize. /// The codec to open this context for. If a non-NULL codec has been previously passed to avcodec_alloc_context3() or for this context, then this parameter MUST be either NULL or equal to the previously passed codec. - /// A dictionary filled with AVCodecContext and codec-private options. On return this object will be filled with options that were not found. + /// A dictionary filled with AVCodecContext and codec-private options, which are set on top of the options already set in avctx, can be NULL. On return this object will be filled with options that were not found in the avctx codec context. /// zero on success, a negative value on error public static int avcodec_open2(AVCodecContext* @avctx, AVCodec* @codec, AVDictionary** @options) => vectors.avcodec_open2(@avctx, @codec, @options); @@ -3062,7 +3119,7 @@ public static unsafe partial class ffmpeg /// Perform one step of the protocol handshake to accept a new client. This function must be called on a client returned by avio_accept() before using it as a read/write context. It is separate from avio_accept() because it may block. A step of the handshake is defined by places where the application may decide to change the proceedings. For example, on a protocol with a request header and a reply header, each one can constitute a step because the application may use the parameters from the request to change parameters in the reply; or each individual chunk of the request can constitute a step. If the handshake is already finished, avio_handshake() does nothing and returns 0 immediately. /// the client context to perform the handshake on - /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code + /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code public static int avio_handshake(AVIOContext* @c) => vectors.avio_handshake(@c); /// Create and initialize a AVIOContext for accessing the resource indicated by url. diff --git a/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.functions.inline.g.cs b/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.functions.inline.g.cs index 5983841..f06d0c6 100644 --- a/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.functions.inline.g.cs +++ b/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.functions.inline.g.cs @@ -185,6 +185,13 @@ public static uint av_float2int(float @f) } // original body hash: uBvsHd8EeFnxDvSdDE1+k5Um29kCuf0aEJhAvDy0wZk= + /// Wrapper around av_image_copy() to workaround the limitation that the conversion from uint8_t * const * to const uint8_t * const * is not performed automatically in C. + public static void av_image_copy2(ref byte_ptr4 @dst_data, in int4 @dst_linesizes, ref byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) + { + av_image_copy(ref dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt, width, height); + } + // original body hash: RdaM2zKuF7t0cNJItdh1SZPg9WiOfPpTwty5cHDiZ2A= + /// Reinterpret a 64-bit integer as a double. public static double av_int2double(ulong @i) { diff --git a/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.macros.g.cs b/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.macros.g.cs index ccd9256..2dd715d 100644 --- a/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.macros.g.cs +++ b/FFmpeg.AutoGen.Abstractions/generated/ffmpeg.macros.g.cs @@ -43,12 +43,14 @@ public static unsafe partial class ffmpeg public static readonly ulong AV_CH_LAYOUT_2_1 = AV_CH_LAYOUT_STEREO | AV_CH_BACK_CENTER; /// AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) public static readonly ulong AV_CH_LAYOUT_2_2 = AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT; - /// AV_CH_LAYOUT_22POINT2 = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) - public static readonly ulong AV_CH_LAYOUT_22POINT2 = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_BACK_CENTER | AV_CH_LOW_FREQUENCY_2 | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT | AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_CENTER | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT | AV_CH_TOP_SIDE_LEFT | AV_CH_TOP_SIDE_RIGHT | AV_CH_TOP_BACK_CENTER | AV_CH_BOTTOM_FRONT_CENTER | AV_CH_BOTTOM_FRONT_LEFT | AV_CH_BOTTOM_FRONT_RIGHT; + /// AV_CH_LAYOUT_22POINT2 = (AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_22POINT2 = AV_CH_LAYOUT_7POINT1POINT4_BACK | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_BACK_CENTER | AV_CH_LOW_FREQUENCY_2 | AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_CENTER | AV_CH_TOP_SIDE_LEFT | AV_CH_TOP_SIDE_RIGHT | AV_CH_TOP_BACK_CENTER | AV_CH_BOTTOM_FRONT_CENTER | AV_CH_BOTTOM_FRONT_LEFT | AV_CH_BOTTOM_FRONT_RIGHT; /// AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY) public static readonly ulong AV_CH_LAYOUT_2POINT1 = AV_CH_LAYOUT_STEREO | AV_CH_LOW_FREQUENCY; /// AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY) public static readonly ulong AV_CH_LAYOUT_3POINT1 = AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY; + /// AV_CH_LAYOUT_3POINT1POINT2 = (AV_CH_LAYOUT_3POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_3POINT1POINT2 = AV_CH_LAYOUT_3POINT1 | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT; /// AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER) public static readonly ulong AV_CH_LAYOUT_4POINT0 = AV_CH_LAYOUT_SURROUND | AV_CH_BACK_CENTER; /// AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY) @@ -61,6 +63,10 @@ public static unsafe partial class ffmpeg public static readonly ulong AV_CH_LAYOUT_5POINT1 = AV_CH_LAYOUT_5POINT0 | AV_CH_LOW_FREQUENCY; /// AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY) public static readonly ulong AV_CH_LAYOUT_5POINT1_BACK = AV_CH_LAYOUT_5POINT0_BACK | AV_CH_LOW_FREQUENCY; + /// AV_CH_LAYOUT_5POINT1POINT2_BACK = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_5POINT1POINT2_BACK = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT; + /// AV_CH_LAYOUT_5POINT1POINT4_BACK = (AV_CH_LAYOUT_5POINT1POINT2_BACK|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) + public static readonly ulong AV_CH_LAYOUT_5POINT1POINT4_BACK = AV_CH_LAYOUT_5POINT1POINT2_BACK | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT; /// AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER) public static readonly ulong AV_CH_LAYOUT_6POINT0 = AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_CENTER; /// AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) @@ -77,12 +83,16 @@ public static unsafe partial class ffmpeg public static readonly ulong AV_CH_LAYOUT_7POINT0_FRONT = AV_CH_LAYOUT_5POINT0 | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; /// AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) public static readonly ulong AV_CH_LAYOUT_7POINT1 = AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT; - /// AV_CH_LAYOUT_7POINT1_TOP_BACK = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) - public static readonly ulong AV_CH_LAYOUT_7POINT1_TOP_BACK = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT; + /// AV_CH_LAYOUT_7POINT1_TOP_BACK = AV_CH_LAYOUT_5POINT1POINT2_BACK + public static readonly ulong AV_CH_LAYOUT_7POINT1_TOP_BACK = AV_CH_LAYOUT_5POINT1POINT2_BACK; /// AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) public static readonly ulong AV_CH_LAYOUT_7POINT1_WIDE = AV_CH_LAYOUT_5POINT1 | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; /// AV_CH_LAYOUT_7POINT1_WIDE_BACK = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) public static readonly ulong AV_CH_LAYOUT_7POINT1_WIDE_BACK = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; + /// AV_CH_LAYOUT_7POINT1POINT2 = (AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_7POINT1POINT2 = AV_CH_LAYOUT_7POINT1 | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT; + /// AV_CH_LAYOUT_7POINT1POINT4_BACK = (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) + public static readonly ulong AV_CH_LAYOUT_7POINT1POINT4_BACK = AV_CH_LAYOUT_7POINT1POINT2 | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT; /// AV_CH_LAYOUT_CUBE = (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) public static readonly ulong AV_CH_LAYOUT_CUBE = AV_CH_LAYOUT_QUAD | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT; /// AV_CH_LAYOUT_HEXADECAGONAL = (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) @@ -146,12 +156,15 @@ public static unsafe partial class ffmpeg // public static AV_CHANNEL_LAYOUT_22POINT2 = AV_CHANNEL_LAYOUT_MASK(0x18, AV_CH_LAYOUT_22POINT2); // public static AV_CHANNEL_LAYOUT_2POINT1 = AV_CHANNEL_LAYOUT_MASK(0x3, AV_CH_LAYOUT_2POINT1); // public static AV_CHANNEL_LAYOUT_3POINT1 = AV_CHANNEL_LAYOUT_MASK(0x4, AV_CH_LAYOUT_3POINT1); + // public static AV_CHANNEL_LAYOUT_3POINT1POINT2 = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_3POINT1POINT2); // public static AV_CHANNEL_LAYOUT_4POINT0 = AV_CHANNEL_LAYOUT_MASK(0x4, AV_CH_LAYOUT_4POINT0); // public static AV_CHANNEL_LAYOUT_4POINT1 = AV_CHANNEL_LAYOUT_MASK(0x5, AV_CH_LAYOUT_4POINT1); // public static AV_CHANNEL_LAYOUT_5POINT0 = AV_CHANNEL_LAYOUT_MASK(0x5, AV_CH_LAYOUT_5POINT0); // public static AV_CHANNEL_LAYOUT_5POINT0_BACK = AV_CHANNEL_LAYOUT_MASK(0x5, AV_CH_LAYOUT_5POINT0_BACK); // public static AV_CHANNEL_LAYOUT_5POINT1 = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_5POINT1); // public static AV_CHANNEL_LAYOUT_5POINT1_BACK = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_5POINT1_BACK); + // public static AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_5POINT1POINT2_BACK); + // public static AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK = AV_CHANNEL_LAYOUT_MASK(0xa, AV_CH_LAYOUT_5POINT1POINT4_BACK); // public static AV_CHANNEL_LAYOUT_6POINT0 = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_6POINT0); // public static AV_CHANNEL_LAYOUT_6POINT0_FRONT = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_6POINT0_FRONT); // public static AV_CHANNEL_LAYOUT_6POINT1 = AV_CHANNEL_LAYOUT_MASK(0x7, AV_CH_LAYOUT_6POINT1); @@ -160,10 +173,12 @@ public static unsafe partial class ffmpeg // public static AV_CHANNEL_LAYOUT_7POINT0 = AV_CHANNEL_LAYOUT_MASK(0x7, AV_CH_LAYOUT_7POINT0); // public static AV_CHANNEL_LAYOUT_7POINT0_FRONT = AV_CHANNEL_LAYOUT_MASK(0x7, AV_CH_LAYOUT_7POINT0_FRONT); // public static AV_CHANNEL_LAYOUT_7POINT1 = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_7POINT1); - // public static AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_7POINT1_TOP_BACK); + // public static AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK = AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK; // public static AV_CHANNEL_LAYOUT_7POINT1_WIDE = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_7POINT1_WIDE); // public static AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_7POINT1_WIDE_BACK); - // public static AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER = { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }}; + // public static AV_CHANNEL_LAYOUT_7POINT1POINT2 = AV_CHANNEL_LAYOUT_MASK(0xa, AV_CH_LAYOUT_7POINT1POINT2); + // public static AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK = AV_CHANNEL_LAYOUT_MASK(0xc, AV_CH_LAYOUT_7POINT1POINT4_BACK); + // public static AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER = { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, /* .nb_channels */ 4, /* .u.mask */ { 0 }, /* .opaque */ NULL }; // public static AV_CHANNEL_LAYOUT_CUBE = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_CUBE); // public static AV_CHANNEL_LAYOUT_HEXADECAGONAL = AV_CHANNEL_LAYOUT_MASK(0x10, AV_CH_LAYOUT_HEXADECAGONAL); // public static AV_CHANNEL_LAYOUT_HEXAGONAL = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_HEXAGONAL); @@ -299,6 +314,8 @@ public static unsafe partial class ffmpeg public static readonly int AV_CODEC_ID_IFF_BYTERUN1 = 136; /// AV_CODEC_PROP_BITMAP_SUB = 0x1 << 0x10 public const int AV_CODEC_PROP_BITMAP_SUB = 0x1 << 0x10; + /// AV_CODEC_PROP_FIELDS = 0x1 << 0x4 + public const int AV_CODEC_PROP_FIELDS = 0x1 << 0x4; /// AV_CODEC_PROP_INTRA_ONLY = 0x1 << 0x0 public const int AV_CODEC_PROP_INTRA_ONLY = 0x1 << 0x0; /// AV_CODEC_PROP_LOSSLESS = 0x1 << 0x2 @@ -345,12 +362,16 @@ public static unsafe partial class ffmpeg public const int AV_CPU_FLAG_BMI2 = 0x40000; /// AV_CPU_FLAG_CMOV = 0x1000 public const int AV_CPU_FLAG_CMOV = 0x1000; + /// AV_CPU_FLAG_DOTPROD = 0x1 << 0x8 + public const int AV_CPU_FLAG_DOTPROD = 0x1 << 0x8; /// AV_CPU_FLAG_FMA3 = 0x10000 public const int AV_CPU_FLAG_FMA3 = 0x10000; /// AV_CPU_FLAG_FMA4 = 0x800 public const int AV_CPU_FLAG_FMA4 = 0x800; /// AV_CPU_FLAG_FORCE = 0x80000000U public const uint AV_CPU_FLAG_FORCE = 0x80000000U; + /// AV_CPU_FLAG_I8MM = 0x1 << 0x9 + public const int AV_CPU_FLAG_I8MM = 0x1 << 0x9; /// AV_CPU_FLAG_LASX = 0x1 << 0x1 public const int AV_CPU_FLAG_LASX = 0x1 << 0x1; /// AV_CPU_FLAG_LSX = 0x1 << 0x0 @@ -369,6 +390,8 @@ public static unsafe partial class ffmpeg public const int AV_CPU_FLAG_NEON = 0x1 << 0x5; /// AV_CPU_FLAG_POWER8 = 0x4 public const int AV_CPU_FLAG_POWER8 = 0x4; + /// AV_CPU_FLAG_RVB_ADDR = 0x1 << 0x8 + public const int AV_CPU_FLAG_RVB_ADDR = 0x1 << 0x8; /// AV_CPU_FLAG_RVB_BASIC = 0x1 << 0x7 public const int AV_CPU_FLAG_RVB_BASIC = 0x1 << 0x7; /// AV_CPU_FLAG_RVD = 0x1 << 0x2 @@ -496,6 +519,12 @@ public static unsafe partial class ffmpeg public const int AV_FRAME_FLAG_CORRUPT = 0x1 << 0x0; /// AV_FRAME_FLAG_DISCARD = (1 << 2) public const int AV_FRAME_FLAG_DISCARD = 0x1 << 0x2; + /// AV_FRAME_FLAG_INTERLACED = (1 << 3) + public const int AV_FRAME_FLAG_INTERLACED = 0x1 << 0x3; + /// AV_FRAME_FLAG_KEY = (1 << 1) + public const int AV_FRAME_FLAG_KEY = 0x1 << 0x1; + /// AV_FRAME_FLAG_TOP_FIELD_FIRST = (1 << 4) + public const int AV_FRAME_FLAG_TOP_FIELD_FIRST = 0x1 << 0x4; // public static AV_GCC_VERSION_AT_LEAST = x; // public static AV_GCC_VERSION_AT_MOST = x; /// AV_GET_BUFFER_FLAG_REF = 0x1 << 0x0 @@ -508,6 +537,8 @@ public static unsafe partial class ffmpeg public const int AV_HAVE_BIGENDIAN = 0x0; /// AV_HAVE_FAST_UNALIGNED = 1 public const int AV_HAVE_FAST_UNALIGNED = 0x1; + /// AV_HDR_PLUS_MAX_PAYLOAD_SIZE = 0x38b + public const int AV_HDR_PLUS_MAX_PAYLOAD_SIZE = 0x38b; /// AV_HWACCEL_CODEC_CAP_EXPERIMENTAL = 0x200 public const int AV_HWACCEL_CODEC_CAP_EXPERIMENTAL = 0x200; /// AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = 0x1 << 0x1 @@ -526,6 +557,8 @@ public static unsafe partial class ffmpeg // public static AV_IS_INPUT_DEVICE = (category)((category)(==41) || (category)(==43) || (category)(==45)); // public static AV_IS_OUTPUT_DEVICE = (category)((category)(==40) || (category)(==42) || (category)(==44)); // public static AV_JOIN = a; + /// AV_LEVEL_UNKNOWN = -99 + public const int AV_LEVEL_UNKNOWN = -0x63; // public static AV_LOG_C = (x)((x)(<<0x8)); /// AV_LOG_DEBUG = 48 public const int AV_LOG_DEBUG = 0x30; @@ -634,6 +667,7 @@ public static unsafe partial class ffmpeg public const int AV_PIX_FMT_FLAG_RGB = 0x1 << 0x5; // public static AV_PIX_FMT_GBRAP10 = AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE); // public static AV_PIX_FMT_GBRAP12 = AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE); + // public static AV_PIX_FMT_GBRAP14 = AV_PIX_FMT_NE(GBRAP14BE, GBRAP14LE); // public static AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE); // public static AV_PIX_FMT_GBRAPF32 = AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE); // public static AV_PIX_FMT_GBRP10 = AV_PIX_FMT_NE(GBRP10BE, GBRP10LE); @@ -654,8 +688,10 @@ public static unsafe partial class ffmpeg // public static AV_PIX_FMT_P012 = AV_PIX_FMT_NE(P012BE, P012LE); // public static AV_PIX_FMT_P016 = AV_PIX_FMT_NE(P016BE, P016LE); // public static AV_PIX_FMT_P210 = AV_PIX_FMT_NE(P210BE, P210LE); + // public static AV_PIX_FMT_P212 = AV_PIX_FMT_NE(P212BE, P212LE); // public static AV_PIX_FMT_P216 = AV_PIX_FMT_NE(P216BE, P216LE); // public static AV_PIX_FMT_P410 = AV_PIX_FMT_NE(P410BE, P410LE); + // public static AV_PIX_FMT_P412 = AV_PIX_FMT_NE(P412BE, P412LE); // public static AV_PIX_FMT_P416 = AV_PIX_FMT_NE(P416BE, P416LE); // public static AV_PIX_FMT_RGB32 = AV_PIX_FMT_NE(ARGB, BGRA); // public static AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_NE(RGBA, ABGR); @@ -719,6 +755,222 @@ public static unsafe partial class ffmpeg // public static av_popcount64 = av_popcount64_c; // public static AV_PRAGMA = (s) _Pragma(#s); // public static av_printf_format = fmtpos; + /// AV_PROFILE_AAC_ELD = 38 + public const int AV_PROFILE_AAC_ELD = 0x26; + /// AV_PROFILE_AAC_HE = 4 + public const int AV_PROFILE_AAC_HE = 0x4; + /// AV_PROFILE_AAC_HE_V2 = 28 + public const int AV_PROFILE_AAC_HE_V2 = 0x1c; + /// AV_PROFILE_AAC_LD = 22 + public const int AV_PROFILE_AAC_LD = 0x16; + /// AV_PROFILE_AAC_LOW = 1 + public const int AV_PROFILE_AAC_LOW = 0x1; + /// AV_PROFILE_AAC_LTP = 3 + public const int AV_PROFILE_AAC_LTP = 0x3; + /// AV_PROFILE_AAC_MAIN = 0 + public const int AV_PROFILE_AAC_MAIN = 0x0; + /// AV_PROFILE_AAC_SSR = 2 + public const int AV_PROFILE_AAC_SSR = 0x2; + /// AV_PROFILE_ARIB_PROFILE_A = 0 + public const int AV_PROFILE_ARIB_PROFILE_A = 0x0; + /// AV_PROFILE_ARIB_PROFILE_C = 1 + public const int AV_PROFILE_ARIB_PROFILE_C = 0x1; + /// AV_PROFILE_AV1_HIGH = 1 + public const int AV_PROFILE_AV1_HIGH = 0x1; + /// AV_PROFILE_AV1_MAIN = 0 + public const int AV_PROFILE_AV1_MAIN = 0x0; + /// AV_PROFILE_AV1_PROFESSIONAL = 2 + public const int AV_PROFILE_AV1_PROFESSIONAL = 0x2; + /// AV_PROFILE_DNXHD = 0 + public const int AV_PROFILE_DNXHD = 0x0; + /// AV_PROFILE_DNXHR_444 = 5 + public const int AV_PROFILE_DNXHR_444 = 0x5; + /// AV_PROFILE_DNXHR_HQ = 3 + public const int AV_PROFILE_DNXHR_HQ = 0x3; + /// AV_PROFILE_DNXHR_HQX = 4 + public const int AV_PROFILE_DNXHR_HQX = 0x4; + /// AV_PROFILE_DNXHR_LB = 1 + public const int AV_PROFILE_DNXHR_LB = 0x1; + /// AV_PROFILE_DNXHR_SQ = 2 + public const int AV_PROFILE_DNXHR_SQ = 0x2; + /// AV_PROFILE_DTS = 20 + public const int AV_PROFILE_DTS = 0x14; + /// AV_PROFILE_DTS_96_24 = 40 + public const int AV_PROFILE_DTS_96_24 = 0x28; + /// AV_PROFILE_DTS_ES = 30 + public const int AV_PROFILE_DTS_ES = 0x1e; + /// AV_PROFILE_DTS_EXPRESS = 70 + public const int AV_PROFILE_DTS_EXPRESS = 0x46; + /// AV_PROFILE_DTS_HD_HRA = 50 + public const int AV_PROFILE_DTS_HD_HRA = 0x32; + /// AV_PROFILE_DTS_HD_MA = 60 + public const int AV_PROFILE_DTS_HD_MA = 0x3c; + /// AV_PROFILE_DTS_HD_MA_X = 61 + public const int AV_PROFILE_DTS_HD_MA_X = 0x3d; + /// AV_PROFILE_DTS_HD_MA_X_IMAX = 62 + public const int AV_PROFILE_DTS_HD_MA_X_IMAX = 0x3e; + /// AV_PROFILE_EAC3_DDP_ATMOS = 30 + public const int AV_PROFILE_EAC3_DDP_ATMOS = 0x1e; + /// AV_PROFILE_EVC_BASELINE = 0 + public const int AV_PROFILE_EVC_BASELINE = 0x0; + /// AV_PROFILE_EVC_MAIN = 1 + public const int AV_PROFILE_EVC_MAIN = 0x1; + /// AV_PROFILE_H264_BASELINE = 66 + public const int AV_PROFILE_H264_BASELINE = 0x42; + /// AV_PROFILE_H264_CAVLC_444 = 44 + public const int AV_PROFILE_H264_CAVLC_444 = 0x2c; + /// AV_PROFILE_H264_CONSTRAINED = (1<<9) + public const int AV_PROFILE_H264_CONSTRAINED = 0x1 << 0x9; + /// AV_PROFILE_H264_CONSTRAINED_BASELINE = (66|AV_PROFILE_H264_CONSTRAINED) + public const int AV_PROFILE_H264_CONSTRAINED_BASELINE = 0x42 | AV_PROFILE_H264_CONSTRAINED; + /// AV_PROFILE_H264_EXTENDED = 88 + public const int AV_PROFILE_H264_EXTENDED = 0x58; + /// AV_PROFILE_H264_HIGH = 100 + public const int AV_PROFILE_H264_HIGH = 0x64; + /// AV_PROFILE_H264_HIGH_10 = 110 + public const int AV_PROFILE_H264_HIGH_10 = 0x6e; + /// AV_PROFILE_H264_HIGH_10_INTRA = (110|AV_PROFILE_H264_INTRA) + public const int AV_PROFILE_H264_HIGH_10_INTRA = 0x6e | AV_PROFILE_H264_INTRA; + /// AV_PROFILE_H264_HIGH_422 = 122 + public const int AV_PROFILE_H264_HIGH_422 = 0x7a; + /// AV_PROFILE_H264_HIGH_422_INTRA = (122|AV_PROFILE_H264_INTRA) + public const int AV_PROFILE_H264_HIGH_422_INTRA = 0x7a | AV_PROFILE_H264_INTRA; + /// AV_PROFILE_H264_HIGH_444 = 144 + public const int AV_PROFILE_H264_HIGH_444 = 0x90; + /// AV_PROFILE_H264_HIGH_444_INTRA = (244|AV_PROFILE_H264_INTRA) + public const int AV_PROFILE_H264_HIGH_444_INTRA = 0xf4 | AV_PROFILE_H264_INTRA; + /// AV_PROFILE_H264_HIGH_444_PREDICTIVE = 244 + public const int AV_PROFILE_H264_HIGH_444_PREDICTIVE = 0xf4; + /// AV_PROFILE_H264_INTRA = (1<<11) + public const int AV_PROFILE_H264_INTRA = 0x1 << 0xb; + /// AV_PROFILE_H264_MAIN = 77 + public const int AV_PROFILE_H264_MAIN = 0x4d; + /// AV_PROFILE_H264_MULTIVIEW_HIGH = 118 + public const int AV_PROFILE_H264_MULTIVIEW_HIGH = 0x76; + /// AV_PROFILE_H264_STEREO_HIGH = 128 + public const int AV_PROFILE_H264_STEREO_HIGH = 0x80; + /// AV_PROFILE_HEVC_MAIN = 1 + public const int AV_PROFILE_HEVC_MAIN = 0x1; + /// AV_PROFILE_HEVC_MAIN_10 = 2 + public const int AV_PROFILE_HEVC_MAIN_10 = 0x2; + /// AV_PROFILE_HEVC_MAIN_STILL_PICTURE = 3 + public const int AV_PROFILE_HEVC_MAIN_STILL_PICTURE = 0x3; + /// AV_PROFILE_HEVC_REXT = 4 + public const int AV_PROFILE_HEVC_REXT = 0x4; + /// AV_PROFILE_HEVC_SCC = 9 + public const int AV_PROFILE_HEVC_SCC = 0x9; + /// AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 32768 + public const int AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 0x8000; + /// AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 1 + public const int AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0x1; + /// AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 2 + public const int AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 0x2; + /// AV_PROFILE_JPEG2000_DCINEMA_2K = 3 + public const int AV_PROFILE_JPEG2000_DCINEMA_2K = 0x3; + /// AV_PROFILE_JPEG2000_DCINEMA_4K = 4 + public const int AV_PROFILE_JPEG2000_DCINEMA_4K = 0x4; + /// AV_PROFILE_KLVA_ASYNC = 1 + public const int AV_PROFILE_KLVA_ASYNC = 0x1; + /// AV_PROFILE_KLVA_SYNC = 0 + public const int AV_PROFILE_KLVA_SYNC = 0x0; + /// AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT = 0xc0 + public const int AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT = 0xc0; + /// AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT = 0xc1 + public const int AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT = 0xc1; + /// AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS = 0xc3 + public const int AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS = 0xc3; + /// AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT = 0xc2 + public const int AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT = 0xc2; + /// AV_PROFILE_MJPEG_JPEG_LS = 0xf7 + public const int AV_PROFILE_MJPEG_JPEG_LS = 0xf7; + /// AV_PROFILE_MPEG2_422 = 0 + public const int AV_PROFILE_MPEG2_422 = 0x0; + /// AV_PROFILE_MPEG2_AAC_HE = 131 + public const int AV_PROFILE_MPEG2_AAC_HE = 0x83; + /// AV_PROFILE_MPEG2_AAC_LOW = 128 + public const int AV_PROFILE_MPEG2_AAC_LOW = 0x80; + /// AV_PROFILE_MPEG2_HIGH = 1 + public const int AV_PROFILE_MPEG2_HIGH = 0x1; + /// AV_PROFILE_MPEG2_MAIN = 4 + public const int AV_PROFILE_MPEG2_MAIN = 0x4; + /// AV_PROFILE_MPEG2_SIMPLE = 5 + public const int AV_PROFILE_MPEG2_SIMPLE = 0x5; + /// AV_PROFILE_MPEG2_SNR_SCALABLE = 3 + public const int AV_PROFILE_MPEG2_SNR_SCALABLE = 0x3; + /// AV_PROFILE_MPEG2_SS = 2 + public const int AV_PROFILE_MPEG2_SS = 0x2; + /// AV_PROFILE_MPEG4_ADVANCED_CODING = 11 + public const int AV_PROFILE_MPEG4_ADVANCED_CODING = 0xb; + /// AV_PROFILE_MPEG4_ADVANCED_CORE = 12 + public const int AV_PROFILE_MPEG4_ADVANCED_CORE = 0xc; + /// AV_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9 + public const int AV_PROFILE_MPEG4_ADVANCED_REAL_TIME = 0x9; + /// AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13 + public const int AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 0xd; + /// AV_PROFILE_MPEG4_ADVANCED_SIMPLE = 15 + public const int AV_PROFILE_MPEG4_ADVANCED_SIMPLE = 0xf; + /// AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7 + public const int AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 0x7; + /// AV_PROFILE_MPEG4_CORE = 2 + public const int AV_PROFILE_MPEG4_CORE = 0x2; + /// AV_PROFILE_MPEG4_CORE_SCALABLE = 10 + public const int AV_PROFILE_MPEG4_CORE_SCALABLE = 0xa; + /// AV_PROFILE_MPEG4_HYBRID = 8 + public const int AV_PROFILE_MPEG4_HYBRID = 0x8; + /// AV_PROFILE_MPEG4_MAIN = 3 + public const int AV_PROFILE_MPEG4_MAIN = 0x3; + /// AV_PROFILE_MPEG4_N_BIT = 4 + public const int AV_PROFILE_MPEG4_N_BIT = 0x4; + /// AV_PROFILE_MPEG4_SCALABLE_TEXTURE = 5 + public const int AV_PROFILE_MPEG4_SCALABLE_TEXTURE = 0x5; + /// AV_PROFILE_MPEG4_SIMPLE = 0 + public const int AV_PROFILE_MPEG4_SIMPLE = 0x0; + /// AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6 + public const int AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 0x6; + /// AV_PROFILE_MPEG4_SIMPLE_SCALABLE = 1 + public const int AV_PROFILE_MPEG4_SIMPLE_SCALABLE = 0x1; + /// AV_PROFILE_MPEG4_SIMPLE_STUDIO = 14 + public const int AV_PROFILE_MPEG4_SIMPLE_STUDIO = 0xe; + /// AV_PROFILE_PRORES_4444 = 4 + public const int AV_PROFILE_PRORES_4444 = 0x4; + /// AV_PROFILE_PRORES_HQ = 3 + public const int AV_PROFILE_PRORES_HQ = 0x3; + /// AV_PROFILE_PRORES_LT = 1 + public const int AV_PROFILE_PRORES_LT = 0x1; + /// AV_PROFILE_PRORES_PROXY = 0 + public const int AV_PROFILE_PRORES_PROXY = 0x0; + /// AV_PROFILE_PRORES_STANDARD = 2 + public const int AV_PROFILE_PRORES_STANDARD = 0x2; + /// AV_PROFILE_PRORES_XQ = 5 + public const int AV_PROFILE_PRORES_XQ = 0x5; + /// AV_PROFILE_RESERVED = -100 + public const int AV_PROFILE_RESERVED = -0x64; + /// AV_PROFILE_SBC_MSBC = 1 + public const int AV_PROFILE_SBC_MSBC = 0x1; + /// AV_PROFILE_TRUEHD_ATMOS = 30 + public const int AV_PROFILE_TRUEHD_ATMOS = 0x1e; + /// AV_PROFILE_UNKNOWN = -99 + public const int AV_PROFILE_UNKNOWN = -0x63; + /// AV_PROFILE_VC1_ADVANCED = 3 + public const int AV_PROFILE_VC1_ADVANCED = 0x3; + /// AV_PROFILE_VC1_COMPLEX = 2 + public const int AV_PROFILE_VC1_COMPLEX = 0x2; + /// AV_PROFILE_VC1_MAIN = 1 + public const int AV_PROFILE_VC1_MAIN = 0x1; + /// AV_PROFILE_VC1_SIMPLE = 0 + public const int AV_PROFILE_VC1_SIMPLE = 0x0; + /// AV_PROFILE_VP9_0 = 0 + public const int AV_PROFILE_VP9_0 = 0x0; + /// AV_PROFILE_VP9_1 = 1 + public const int AV_PROFILE_VP9_1 = 0x1; + /// AV_PROFILE_VP9_2 = 2 + public const int AV_PROFILE_VP9_2 = 0x2; + /// AV_PROFILE_VP9_3 = 3 + public const int AV_PROFILE_VP9_3 = 0x3; + /// AV_PROFILE_VVC_MAIN_10 = 1 + public const int AV_PROFILE_VVC_MAIN_10 = 0x1; + /// AV_PROFILE_VVC_MAIN_10_444 = 33 + public const int AV_PROFILE_VVC_MAIN_10_444 = 0x21; /// AV_PROGRAM_RUNNING = 1 public const int AV_PROGRAM_RUNNING = 0x1; /// AV_PTS_WRAP_ADD_OFFSET = 1 @@ -815,6 +1067,8 @@ public static unsafe partial class ffmpeg public const int AVFILTER_FLAG_DYNAMIC_INPUTS = 0x1 << 0x0; /// AVFILTER_FLAG_DYNAMIC_OUTPUTS = 0x1 << 0x1 public const int AVFILTER_FLAG_DYNAMIC_OUTPUTS = 0x1 << 0x1; + /// AVFILTER_FLAG_HWDEVICE = 0x1 << 0x4 + public const int AVFILTER_FLAG_HWDEVICE = 0x1 << 0x4; /// AVFILTER_FLAG_METADATA_ONLY = 0x1 << 0x3 public const int AVFILTER_FLAG_METADATA_ONLY = 0x1 << 0x3; /// AVFILTER_FLAG_SLICE_THREADS = 0x1 << 0x2 @@ -963,46 +1217,80 @@ public static unsafe partial class ffmpeg /// AVSTREAM_INIT_IN_WRITE_HEADER = 0 public const int AVSTREAM_INIT_IN_WRITE_HEADER = 0x0; // public static AVUNERROR = (e) (-(e)); + /// FF_API_ALLOW_FLUSH = (LIBAVFORMAT_VERSION_MAJOR < 61) + public const bool FF_API_ALLOW_FLUSH = LIBAVFORMAT_VERSION_MAJOR < 0x3d; /// FF_API_AV_FOPEN_UTF8 = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_AV_FOPEN_UTF8 = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_AVCODEC_CHROMA_POS = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_AVCODEC_CHROMA_POS = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_AVCTX_FRAME_NUMBER = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_AVCTX_FRAME_NUMBER = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_AVFFT = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_AVFFT = LIBAVCODEC_VERSION_MAJOR < 0x3e; /// FF_API_AVFORMAT_IO_CLOSE = (LIBAVFORMAT_VERSION_MAJOR < 61) public const bool FF_API_AVFORMAT_IO_CLOSE = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_AVIO_WRITE_NONCONST = (LIBAVFORMAT_VERSION_MAJOR < 61) + public const bool FF_API_AVIO_WRITE_NONCONST = LIBAVFORMAT_VERSION_MAJOR < 0x3d; /// FF_API_AVIODIRCONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 61) public const bool FF_API_AVIODIRCONTEXT = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_AVSTREAM_SIDE_DATA = (LIBAVFORMAT_VERSION_MAJOR < 61) + public const bool FF_API_AVSTREAM_SIDE_DATA = LIBAVFORMAT_VERSION_MAJOR < 0x3d; /// FF_API_AYUV_CODECID = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_AYUV_CODECID = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_COMPUTE_PKT_FIELDS2 = (LIBAVFORMAT_VERSION_MAJOR < 61) public const bool FF_API_COMPUTE_PKT_FIELDS2 = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_DROPCHANGED = (LIBAVCODEC_VERSION_MAJOR < 61) + public const bool FF_API_DROPCHANGED = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_FF_PROFILE_LEVEL = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_FF_PROFILE_LEVEL = LIBAVCODEC_VERSION_MAJOR < 0x3e; /// FF_API_FIFO_OLD_API = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_FIFO_OLD_API = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_FIFO_PEEK2 = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_FIFO_PEEK2 = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_FRAME_KEY = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_FRAME_KEY = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_FRAME_PICTURE_NUMBER = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_FRAME_PICTURE_NUMBER = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_FRAME_PKT = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_FRAME_PKT = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_GET_END_PTS = (LIBAVFORMAT_VERSION_MAJOR < 61) public const bool FF_API_GET_END_PTS = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_HDR_VIVID_THREE_SPLINE = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_HDR_VIVID_THREE_SPLINE = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_IDCT_NONE = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_IDCT_NONE = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_INIT_PACKET = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_INIT_PACKET = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_INTERLACED_FRAME = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_INTERLACED_FRAME = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_LAVF_SHORTEST = (LIBAVFORMAT_VERSION_MAJOR < 61) + public const bool FF_API_LAVF_SHORTEST = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_LIBPLACEBO_OPTS = LIBAVFILTER_VERSION_MAJOR < 0xa + public const bool FF_API_LIBPLACEBO_OPTS = LIBAVFILTER_VERSION_MAJOR < 0xa; /// FF_API_OLD_CHANNEL_LAYOUT = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_OLD_CHANNEL_LAYOUT = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_PALETTE_HAS_CHANGED = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_PALETTE_HAS_CHANGED = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_PKT_DURATION = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_PKT_DURATION = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_R_FRAME_RATE = 1 public const int FF_API_R_FRAME_RATE = 0x1; /// FF_API_REORDERED_OPAQUE = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_REORDERED_OPAQUE = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_SLICE_OFFSET = (LIBAVCODEC_VERSION_MAJOR < 61) + public const bool FF_API_SLICE_OFFSET = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_SUBFRAMES = (LIBAVCODEC_VERSION_MAJOR < 61) + public const bool FF_API_SUBFRAMES = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_SVTAV1_OPTS = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_SVTAV1_OPTS = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_TICKS_PER_FRAME = (LIBAVCODEC_VERSION_MAJOR < 61) + public const bool FF_API_TICKS_PER_FRAME = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_VT_HWACCEL_CONTEXT = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_VT_HWACCEL_CONTEXT = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_VT_OUTPUT_CALLBACK = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_VT_OUTPUT_CALLBACK = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_VULKAN_CONTIGUOUS_MEMORY = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_VULKAN_CONTIGUOUS_MEMORY = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_XVMC = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_XVMC = LIBAVUTIL_VERSION_MAJOR < 0x3b; // public static FF_ARRAY_ELEMS = (a) (sizeof(a) / sizeof((a)[0])); @@ -1261,6 +1549,16 @@ public static unsafe partial class ffmpeg public const int FF_PROFILE_DTS_HD_HRA = 0x32; /// FF_PROFILE_DTS_HD_MA = 0x3c public const int FF_PROFILE_DTS_HD_MA = 0x3c; + /// FF_PROFILE_DTS_HD_MA_X = 0x3d + public const int FF_PROFILE_DTS_HD_MA_X = 0x3d; + /// FF_PROFILE_DTS_HD_MA_X_IMAX = 0x3e + public const int FF_PROFILE_DTS_HD_MA_X_IMAX = 0x3e; + /// FF_PROFILE_EAC3_DDP_ATMOS = 0x1e + public const int FF_PROFILE_EAC3_DDP_ATMOS = 0x1e; + /// FF_PROFILE_EVC_BASELINE = 0x0 + public const int FF_PROFILE_EVC_BASELINE = 0x0; + /// FF_PROFILE_EVC_MAIN = 0x1 + public const int FF_PROFILE_EVC_MAIN = 0x1; /// FF_PROFILE_H264_BASELINE = 0x42 public const int FF_PROFILE_H264_BASELINE = 0x42; /// FF_PROFILE_H264_CAVLC_444 = 0x2c @@ -1303,6 +1601,8 @@ public static unsafe partial class ffmpeg public const int FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 0x3; /// FF_PROFILE_HEVC_REXT = 0x4 public const int FF_PROFILE_HEVC_REXT = 0x4; + /// FF_PROFILE_HEVC_SCC = 0x9 + public const int FF_PROFILE_HEVC_SCC = 0x9; /// FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 0x8000 public const int FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 0x8000; /// FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0x1 @@ -1391,6 +1691,8 @@ public static unsafe partial class ffmpeg public const int FF_PROFILE_RESERVED = -0x64; /// FF_PROFILE_SBC_MSBC = 0x1 public const int FF_PROFILE_SBC_MSBC = 0x1; + /// FF_PROFILE_TRUEHD_ATMOS = 0x1e + public const int FF_PROFILE_TRUEHD_ATMOS = 0x1e; /// FF_PROFILE_UNKNOWN = -0x63 public const int FF_PROFILE_UNKNOWN = -0x63; /// FF_PROFILE_VC1_ADVANCED = 0x3 @@ -1456,10 +1758,10 @@ public static unsafe partial class ffmpeg public static readonly int LIBAVCODEC_VERSION_INT = AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO); /// LIBAVCODEC_VERSION_MAJOR = 60 public const int LIBAVCODEC_VERSION_MAJOR = 0x3c; - /// LIBAVCODEC_VERSION_MICRO = 0x64 - public const int LIBAVCODEC_VERSION_MICRO = 0x64; - /// LIBAVCODEC_VERSION_MINOR = 0x3 - public const int LIBAVCODEC_VERSION_MINOR = 0x3; + /// LIBAVCODEC_VERSION_MICRO = 0x66 + public const int LIBAVCODEC_VERSION_MICRO = 0x66; + /// LIBAVCODEC_VERSION_MINOR = 0x1f + public const int LIBAVCODEC_VERSION_MINOR = 0x1f; /// LIBAVDEVICE_BUILD = LIBAVDEVICE_VERSION_INT public static readonly int LIBAVDEVICE_BUILD = LIBAVDEVICE_VERSION_INT; /// LIBAVDEVICE_IDENT = "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) @@ -1472,8 +1774,8 @@ public static unsafe partial class ffmpeg public const int LIBAVDEVICE_VERSION_MAJOR = 0x3c; /// LIBAVDEVICE_VERSION_MICRO = 100 public const int LIBAVDEVICE_VERSION_MICRO = 0x64; - /// LIBAVDEVICE_VERSION_MINOR = 1 - public const int LIBAVDEVICE_VERSION_MINOR = 0x1; + /// LIBAVDEVICE_VERSION_MINOR = 3 + public const int LIBAVDEVICE_VERSION_MINOR = 0x3; /// LIBAVFILTER_BUILD = LIBAVFILTER_VERSION_INT public static readonly int LIBAVFILTER_BUILD = LIBAVFILTER_VERSION_INT; /// LIBAVFILTER_IDENT = "Lavfi" @@ -1486,8 +1788,8 @@ public static unsafe partial class ffmpeg public const int LIBAVFILTER_VERSION_MAJOR = 0x9; /// LIBAVFILTER_VERSION_MICRO = 0x64 public const int LIBAVFILTER_VERSION_MICRO = 0x64; - /// LIBAVFILTER_VERSION_MINOR = 0x3 - public const int LIBAVFILTER_VERSION_MINOR = 0x3; + /// LIBAVFILTER_VERSION_MINOR = 0xc + public const int LIBAVFILTER_VERSION_MINOR = 0xc; /// LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT public static readonly int LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; /// LIBAVFORMAT_IDENT = "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) @@ -1500,8 +1802,8 @@ public static unsafe partial class ffmpeg public const int LIBAVFORMAT_VERSION_MAJOR = 0x3c; /// LIBAVFORMAT_VERSION_MICRO = 100 public const int LIBAVFORMAT_VERSION_MICRO = 0x64; - /// LIBAVFORMAT_VERSION_MINOR = 3 - public const int LIBAVFORMAT_VERSION_MINOR = 0x3; + /// LIBAVFORMAT_VERSION_MINOR = 16 + public const int LIBAVFORMAT_VERSION_MINOR = 0x10; /// LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT public static readonly int LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT; /// LIBAVUTIL_IDENT = "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) @@ -1514,8 +1816,8 @@ public static unsafe partial class ffmpeg public const int LIBAVUTIL_VERSION_MAJOR = 0x3a; /// LIBAVUTIL_VERSION_MICRO = 100 public const int LIBAVUTIL_VERSION_MICRO = 0x64; - /// LIBAVUTIL_VERSION_MINOR = 2 - public const int LIBAVUTIL_VERSION_MINOR = 0x2; + /// LIBAVUTIL_VERSION_MINOR = 29 + public const int LIBAVUTIL_VERSION_MINOR = 0x1d; /// LIBPOSTPROC_BUILD = LIBPOSTPROC_VERSION_INT public static readonly int LIBPOSTPROC_BUILD = LIBPOSTPROC_VERSION_INT; /// LIBPOSTPROC_IDENT = "postproc" @@ -1528,8 +1830,8 @@ public static unsafe partial class ffmpeg public const int LIBPOSTPROC_VERSION_MAJOR = 0x39; /// LIBPOSTPROC_VERSION_MICRO = 0x64 public const int LIBPOSTPROC_VERSION_MICRO = 0x64; - /// LIBPOSTPROC_VERSION_MINOR = 0x1 - public const int LIBPOSTPROC_VERSION_MINOR = 0x1; + /// LIBPOSTPROC_VERSION_MINOR = 0x3 + public const int LIBPOSTPROC_VERSION_MINOR = 0x3; /// LIBSWRESAMPLE_BUILD = LIBSWRESAMPLE_VERSION_INT public static readonly int LIBSWRESAMPLE_BUILD = LIBSWRESAMPLE_VERSION_INT; /// LIBSWRESAMPLE_IDENT = "SwR" @@ -1542,8 +1844,8 @@ public static unsafe partial class ffmpeg public const int LIBSWRESAMPLE_VERSION_MAJOR = 0x4; /// LIBSWRESAMPLE_VERSION_MICRO = 0x64 public const int LIBSWRESAMPLE_VERSION_MICRO = 0x64; - /// LIBSWRESAMPLE_VERSION_MINOR = 0xa - public const int LIBSWRESAMPLE_VERSION_MINOR = 0xa; + /// LIBSWRESAMPLE_VERSION_MINOR = 0xc + public const int LIBSWRESAMPLE_VERSION_MINOR = 0xc; /// LIBSWSCALE_BUILD = LIBSWSCALE_VERSION_INT public static readonly int LIBSWSCALE_BUILD = LIBSWSCALE_VERSION_INT; /// LIBSWSCALE_IDENT = "SwS" @@ -1556,26 +1858,60 @@ public static unsafe partial class ffmpeg public const int LIBSWSCALE_VERSION_MAJOR = 0x7; /// LIBSWSCALE_VERSION_MICRO = 0x64 public const int LIBSWSCALE_VERSION_MICRO = 0x64; - /// LIBSWSCALE_VERSION_MINOR = 0x1 - public const int LIBSWSCALE_VERSION_MINOR = 0x1; + /// LIBSWSCALE_VERSION_MINOR = 0x5 + public const int LIBSWSCALE_VERSION_MINOR = 0x5; + /// M_1_PI = 0.31830988618379067154 + public const double M_1_PI = 0.3183098861837907D; + /// M_1_PIf = 0.31830988618379067154f + public const float M_1_PIf = 0.31830987F; + /// M_2_PI = 0.63661977236758134308 + public const double M_2_PI = 0.6366197723675814D; + /// M_2_PIf = 0.63661977236758134308f + public const float M_2_PIf = 0.63661975F; + /// M_2_SQRTPI = 1.12837916709551257390 + public const double M_2_SQRTPI = 1.1283791670955126D; + /// M_2_SQRTPIf = 1.12837916709551257390f + public const float M_2_SQRTPIf = 1.1283792F; /// M_E = 2.7182818284590452354 public const double M_E = 2.718281828459045D; + /// M_Ef = 2.7182818284590452354f + public const float M_Ef = 2.7182817F; /// M_LN10 = 2.30258509299404568402 public const double M_LN10 = 2.302585092994046D; + /// M_LN10f = 2.30258509299404568402f + public const float M_LN10f = 2.3025851F; /// M_LN2 = 0.69314718055994530942 public const double M_LN2 = 0.6931471805599453D; + /// M_LN2f = 0.69314718055994530942f + public const float M_LN2f = 0.6931472F; /// M_LOG2_10 = 3.32192809488736234787 public const double M_LOG2_10 = 3.321928094887362D; + /// M_LOG2_10f = 3.32192809488736234787f + public const float M_LOG2_10f = 3.321928F; /// M_PHI = 1.61803398874989484820 public const double M_PHI = 1.618033988749895D; + /// M_PHIf = 1.61803398874989484820f + public const float M_PHIf = 1.618034F; /// M_PI = 3.14159265358979323846 public const double M_PI = 3.141592653589793D; /// M_PI_2 = 1.57079632679489661923 public const double M_PI_2 = 1.5707963267948966D; + /// M_PI_2f = 1.57079632679489661923f + public const float M_PI_2f = 1.5707964F; + /// M_PI_4 = 0.78539816339744830962 + public const double M_PI_4 = 0.7853981633974483D; + /// M_PI_4f = 0.78539816339744830962f + public const float M_PI_4f = 0.7853982F; + /// M_PIf = 3.14159265358979323846f + public const float M_PIf = 3.1415927F; /// M_SQRT1_2 = 0.70710678118654752440 public const double M_SQRT1_2 = 0.7071067811865476D; + /// M_SQRT1_2f = 0.70710678118654752440f + public const float M_SQRT1_2f = 0.70710677F; /// M_SQRT2 = 1.41421356237309504880 public const double M_SQRT2 = 1.4142135623730951D; + /// M_SQRT2f = 1.41421356237309504880f + public const float M_SQRT2f = 1.4142135F; // public static MKBETAG = a; // public static MKTAG = a; /// PARSER_FLAG_COMPLETE_FRAMES = 0x1 diff --git a/FFmpeg.AutoGen.Abstractions/generated/vectors.g.cs b/FFmpeg.AutoGen.Abstractions/generated/vectors.g.cs index b974e83..42aa4d0 100644 --- a/FFmpeg.AutoGen.Abstractions/generated/vectors.g.cs +++ b/FFmpeg.AutoGen.Abstractions/generated/vectors.g.cs @@ -65,6 +65,10 @@ public static unsafe partial class vectors public delegate int av_audio_fifo_write_delegate(AVAudioFifo* @af, void** @data, int @nb_samples); public static av_audio_fifo_write_delegate av_audio_fifo_write; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate double av_bessel_i0_delegate(double @x); + public static av_bessel_i0_delegate av_bessel_i0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void av_bprint_channel_layout_delegate(AVBPrint* @bp, int @nb_channels, ulong @channel_layout); public static av_bprint_channel_layout_delegate av_bprint_channel_layout; @@ -710,6 +714,14 @@ public delegate void av_dump_format_delegate(AVFormatContext* @ic, int @index, public delegate AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data_delegate(AVFrame* @frame); public static av_dynamic_hdr_plus_create_side_data_delegate av_dynamic_hdr_plus_create_side_data; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dynamic_hdr_plus_from_t35_delegate(AVDynamicHDRPlus* @s, byte* @data, ulong @size); + public static av_dynamic_hdr_plus_from_t35_delegate av_dynamic_hdr_plus_from_t35; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dynamic_hdr_plus_to_t35_delegate(AVDynamicHDRPlus* @s, byte** @data, ulong* @size); + public static av_dynamic_hdr_plus_to_t35_delegate av_dynamic_hdr_plus_to_t35; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void av_dynarray_add_delegate(void* @tab_ptr, int* @nb_ptr, void* @elem); public static av_dynarray_add_delegate av_dynarray_add; @@ -896,6 +908,10 @@ public delegate int av_filename_number_test_delegate( public delegate void av_frame_remove_side_data_delegate(AVFrame* @frame, AVFrameSideDataType @type); public static av_frame_remove_side_data_delegate av_frame_remove_side_data; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_replace_delegate(AVFrame* @dst, AVFrame* @src); + public static av_frame_replace_delegate av_frame_replace; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] public delegate string av_frame_side_data_name_delegate(AVFrameSideDataType @type); @@ -1285,7 +1301,7 @@ public delegate AVHWDeviceType av_hwdevice_find_type_by_name_delegate( public static av_image_check_size2_delegate av_image_check_size2; [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void av_image_copy_delegate(ref byte_ptr4 @dst_data, ref int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); + public delegate void av_image_copy_delegate(ref byte_ptr4 @dst_data, in int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); public static av_image_copy_delegate av_image_copy; [UnmanagedFunctionPointer(CallingConvention.Cdecl)] @@ -2056,11 +2072,31 @@ public delegate int av_opt_set_video_rate_delegate(void* @obj, public delegate int av_packet_shrink_side_data_delegate(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size); public static av_packet_shrink_side_data_delegate av_packet_shrink_side_data; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPacketSideData* av_packet_side_data_add_delegate(AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags); + public static av_packet_side_data_add_delegate av_packet_side_data_add; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_side_data_free_delegate(AVPacketSideData** @sd, int* @nb_sd); + public static av_packet_side_data_free_delegate av_packet_side_data_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPacketSideData* av_packet_side_data_get_delegate(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type); + public static av_packet_side_data_get_delegate av_packet_side_data_get; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] public delegate string av_packet_side_data_name_delegate(AVPacketSideDataType @type); public static av_packet_side_data_name_delegate av_packet_side_data_name; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPacketSideData* av_packet_side_data_new_delegate(AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags); + public static av_packet_side_data_new_delegate av_packet_side_data_new; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_side_data_remove_delegate(AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type); + public static av_packet_side_data_remove_delegate av_packet_side_data_remove; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int av_packet_unpack_dictionary_delegate(byte* @data, ulong @size, AVDictionary** @dict); public static av_packet_unpack_dictionary_delegate av_packet_unpack_dictionary; diff --git a/FFmpeg.AutoGen.Bindings.DynamicallyLinked/generated/DynamicallyLinkedBindings.g.cs b/FFmpeg.AutoGen.Bindings.DynamicallyLinked/generated/DynamicallyLinkedBindings.g.cs index c14bbc3..5979e1e 100644 --- a/FFmpeg.AutoGen.Bindings.DynamicallyLinked/generated/DynamicallyLinkedBindings.g.cs +++ b/FFmpeg.AutoGen.Bindings.DynamicallyLinked/generated/DynamicallyLinkedBindings.g.cs @@ -111,6 +111,10 @@ public static unsafe partial class DynamicallyLinkedBindings [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] public static extern int av_audio_fifo_write(AVAudioFifo* @af, void** @data, int @nb_samples); + /// 0th order modified bessel function of the first kind. + [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] + public static extern double av_bessel_i0(double @x); + /// Append a description of a channel layout to a bprint buffer. [Obsolete("use av_channel_layout_describe()")] [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] @@ -970,6 +974,20 @@ public static extern void av_dump_format(AVFormatContext* @ic, int @index, [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] public static extern AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data(AVFrame* @frame); + /// Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). The T.35 buffer must begin with the application mode, skipping the country code, terminal provider codes, and application identifier. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// The byte array containing the raw ITU-T T.35 data. + /// Size of the data array in bytes. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus* @s, byte* @data, ulong @size); + + /// Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, excluding the first 48 bytes of the header, and beginning with the application mode. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dynamic_hdr_plus_to_t35(AVDynamicHDRPlus* @s, byte** @data, ulong* @size); + /// Add the pointer to an element to a dynamic array. /// Pointer to the array to grow /// Pointer to the number of elements in the array @@ -1233,6 +1251,11 @@ public static extern int av_filename_number_test( [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] public static extern void av_frame_remove_side_data(AVFrame* @frame, AVFrameSideDataType @type); + /// Ensure the destination frame refers to the same data described by the source frame, either by creating a new reference for each AVBufferRef from src if they differ from those in dst, by allocating new buffers and copying data if src is not reference counted, or by unrefencing it if src is empty. + /// 0 on success, a negative AVERROR on error. On error, dst is unreferenced. + [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_replace(AVFrame* @dst, AVFrame* @src); + /// Returns a string identifying the side data type /// a string identifying the side data type [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] @@ -1510,7 +1533,7 @@ public static extern AVSampleFormat av_get_sample_fmt( /// index in an internal list, starting at 0 /// channel layout mask /// name of the layout - /// 0 if the layout exists, < 0 if index is beyond the limits + /// 0 if the layout exists, < 0 if index is beyond the limits [Obsolete("use av_channel_layout_standard()")] [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] public static extern int av_get_standard_channel_layout(uint @index, ulong* @layout, byte** @name); @@ -1808,7 +1831,7 @@ public static extern AVHWDeviceType av_hwdevice_find_type_by_name( /// width of the image in pixels /// height of the image in pixels [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] - public static extern void av_image_copy(ref byte_ptr4 @dst_data, ref int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); + public static extern void av_image_copy(ref byte_ptr4 @dst_data, in int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); /// Copy image plane from src to dst. That is, copy "height" number of lines of "bytewidth" bytes each. The first byte of each successive line is separated by *_linesize bytes. /// destination plane to copy to @@ -1943,7 +1966,7 @@ public static extern AVHWDeviceType av_hwdevice_find_type_by_name( /// Write a packet to an output media file ensuring correct interleaving. /// media file handle - /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. + /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. /// 0 on success, a negative AVERROR on error. [DllImport("avformat-60", CallingConvention = CallingConvention.Cdecl)] public static extern int av_interleaved_write_frame(AVFormatContext* @s, AVPacket* @pkt); @@ -2430,7 +2453,7 @@ public static extern int av_opt_get_video_rate(void* @obj, /// Check if given option is set to its default value. /// AVClass object to check option on /// option to be checked - /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] public static extern int av_opt_is_set_to_default(void* @obj, AVOption* @o); @@ -2438,7 +2461,7 @@ public static extern int av_opt_get_video_rate(void* @obj, /// AVClass object to check option on /// option name /// combination of AV_OPT_SEARCH_* - /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error [DllImport("avutil-58", CallingConvention = CallingConvention.Cdecl)] public static extern int av_opt_is_set_to_default_by_name(void* @obj, #if NETSTANDARD2_1_OR_GREATER @@ -2798,10 +2821,50 @@ public static extern int av_opt_set_video_rate(void* @obj, [DllImport("avcodec-60", CallingConvention = CallingConvention.Cdecl)] public static extern int av_packet_shrink_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size); + /// Wrap existing data as packet side data. + /// pointer to an array of side data to which the side data should be added. *sd may be NULL, in which case the array will be initialized + /// pointer to an integer containing the number of entries in the array. The integer value will be increased by 1 on success. + /// side data type + /// a data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to the side data array on success + /// size of the data array + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise On failure, the side data array is unchanged and the data remains owned by the caller. + [DllImport("avcodec-60", CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacketSideData* av_packet_side_data_add(AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags); + + /// Convenience function to free all the side data stored in an array, and the array itself. + /// pointer to array of side data to free. Will be set to NULL upon return. + /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. + [DllImport("avcodec-60", CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_side_data_free(AVPacketSideData** @sd, int* @nb_sd); + + /// Get side information from a side data array. + /// the array from which the side data should be fetched + /// value containing the number of entries in the array. + /// desired side information type + /// pointer to side data if present or NULL otherwise + [DllImport("avcodec-60", CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacketSideData* av_packet_side_data_get(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type); + [DllImport("avcodec-60", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] public static extern string av_packet_side_data_name(AVPacketSideDataType @type); + /// Allocate a new packet side data. + /// side data type + /// desired side data size + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise. + [DllImport("avcodec-60", CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacketSideData* av_packet_side_data_new(AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags); + + /// Remove side data of the given type from a side data array. + /// the array from which the side data should be removed + /// pointer to an integer containing the number of entries in the array. Will be reduced by the amount of entries removed upon return + /// side information type + [DllImport("avcodec-60", CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_side_data_remove(AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type); + /// Unpack a dictionary from side_data. /// data from side_data /// size of the data @@ -3197,6 +3260,7 @@ public static extern int av_set_options_string(void* @ctx, /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to st. /// side information size /// zero on success, a negative AVERROR code on failure. On failure, the stream is unchanged and the data remains owned by the caller. + [Obsolete("use av_packet_side_data_add() with the stream's \"codecpar side data\"")] [DllImport("avformat-60", CallingConvention = CallingConvention.Cdecl)] public static extern int av_stream_add_side_data(AVStream* @st, AVPacketSideDataType @type, byte* @data, ulong @size); @@ -3222,6 +3286,7 @@ public static extern int av_set_options_string(void* @ctx, /// desired side information type /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. /// pointer to data if present or NULL otherwise + [Obsolete("use av_packet_side_data_get() with the stream's \"codecpar side data\"")] [DllImport("avformat-60", CallingConvention = CallingConvention.Cdecl)] public static extern byte* av_stream_get_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong* @size); @@ -3230,6 +3295,7 @@ public static extern int av_set_options_string(void* @ctx, /// desired side information type /// side information size /// pointer to fresh allocated data or NULL otherwise + [Obsolete("use av_packet_side_data_new() with the stream's \"codecpar side data\"")] [DllImport("avformat-60", CallingConvention = CallingConvention.Cdecl)] public static extern byte* av_stream_new_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong @size); @@ -3450,7 +3516,7 @@ public static extern void av_vlog(void* @avcl, int @level, /// Write a packet to an output media file. /// media file handle - /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. + /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. /// < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush [DllImport("avformat-60", CallingConvention = CallingConvention.Cdecl)] public static extern int av_write_frame(AVFormatContext* @s, AVPacket* @pkt); @@ -3481,7 +3547,7 @@ public static extern void av_vlog(void* @avcl, int @level, public static extern int av_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame); /// Test whether a muxer supports uncoded frame. - /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not + /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not [DllImport("avformat-60", CallingConvention = CallingConvention.Cdecl)] public static extern int av_write_uncoded_frame_query(AVFormatContext* @s, int @stream_index); @@ -3688,7 +3754,7 @@ public static extern void av_vlog(void* @avcl, int @level, /// Initialize the AVCodecContext to use the given AVCodec. Prior to using this function the context has to be allocated with avcodec_alloc_context3(). /// The context to initialize. /// The codec to open this context for. If a non-NULL codec has been previously passed to avcodec_alloc_context3() or for this context, then this parameter MUST be either NULL or equal to the previously passed codec. - /// A dictionary filled with AVCodecContext and codec-private options. On return this object will be filled with options that were not found. + /// A dictionary filled with AVCodecContext and codec-private options, which are set on top of the options already set in avctx, can be NULL. On return this object will be filled with options that were not found in the avctx codec context. /// zero on success, a negative value on error [DllImport("avcodec-60", CallingConvention = CallingConvention.Cdecl)] public static extern int avcodec_open2(AVCodecContext* @avctx, AVCodec* @codec, AVDictionary** @options); @@ -4499,7 +4565,7 @@ public static extern string avio_find_protocol_name( /// Perform one step of the protocol handshake to accept a new client. This function must be called on a client returned by avio_accept() before using it as a read/write context. It is separate from avio_accept() because it may block. A step of the handshake is defined by places where the application may decide to change the proceedings. For example, on a protocol with a request header and a reply header, each one can constitute a step because the application may use the parameters from the request to change parameters in the reply; or each individual chunk of the request can constitute a step. If the handshake is already finished, avio_handshake() does nothing and returns 0 immediately. /// the client context to perform the handshake on - /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code + /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code [DllImport("avformat-60", CallingConvention = CallingConvention.Cdecl)] public static extern int avio_handshake(AVIOContext* @c); @@ -5184,6 +5250,7 @@ public unsafe static void Initialize() vectors.av_audio_fifo_size = av_audio_fifo_size; vectors.av_audio_fifo_space = av_audio_fifo_space; vectors.av_audio_fifo_write = av_audio_fifo_write; + vectors.av_bessel_i0 = av_bessel_i0; vectors.av_bprint_channel_layout = av_bprint_channel_layout; vectors.av_bsf_alloc = av_bsf_alloc; vectors.av_bsf_flush = av_bsf_flush; @@ -5312,6 +5379,8 @@ public unsafe static void Initialize() vectors.av_dump_format = av_dump_format; vectors.av_dynamic_hdr_plus_alloc = av_dynamic_hdr_plus_alloc; vectors.av_dynamic_hdr_plus_create_side_data = av_dynamic_hdr_plus_create_side_data; + vectors.av_dynamic_hdr_plus_from_t35 = av_dynamic_hdr_plus_from_t35; + vectors.av_dynamic_hdr_plus_to_t35 = av_dynamic_hdr_plus_to_t35; vectors.av_dynarray_add = av_dynarray_add; vectors.av_dynarray_add_nofree = av_dynarray_add_nofree; vectors.av_dynarray2_add = av_dynarray2_add; @@ -5351,6 +5420,7 @@ public unsafe static void Initialize() vectors.av_frame_new_side_data_from_buf = av_frame_new_side_data_from_buf; vectors.av_frame_ref = av_frame_ref; vectors.av_frame_remove_side_data = av_frame_remove_side_data; + vectors.av_frame_replace = av_frame_replace; vectors.av_frame_side_data_name = av_frame_side_data_name; vectors.av_frame_unref = av_frame_unref; vectors.av_free = av_free; @@ -5540,7 +5610,12 @@ public unsafe static void Initialize() vectors.av_packet_ref = av_packet_ref; vectors.av_packet_rescale_ts = av_packet_rescale_ts; vectors.av_packet_shrink_side_data = av_packet_shrink_side_data; + vectors.av_packet_side_data_add = av_packet_side_data_add; + vectors.av_packet_side_data_free = av_packet_side_data_free; + vectors.av_packet_side_data_get = av_packet_side_data_get; vectors.av_packet_side_data_name = av_packet_side_data_name; + vectors.av_packet_side_data_new = av_packet_side_data_new; + vectors.av_packet_side_data_remove = av_packet_side_data_remove; vectors.av_packet_unpack_dictionary = av_packet_unpack_dictionary; vectors.av_packet_unref = av_packet_unref; vectors.av_parse_cpu_caps = av_parse_cpu_caps; diff --git a/FFmpeg.AutoGen.Bindings.DynamicallyLoaded/generated/DynamicallyLoadedBindings.g.cs b/FFmpeg.AutoGen.Bindings.DynamicallyLoaded/generated/DynamicallyLoadedBindings.g.cs index fb4eb21..915bd17 100644 --- a/FFmpeg.AutoGen.Bindings.DynamicallyLoaded/generated/DynamicallyLoadedBindings.g.cs +++ b/FFmpeg.AutoGen.Bindings.DynamicallyLoaded/generated/DynamicallyLoadedBindings.g.cs @@ -103,6 +103,12 @@ public unsafe static void Initialize() return vectors.av_audio_fifo_write(@af, @data, @nb_samples); }; + vectors.av_bessel_i0 = (double @x) => + { + vectors.av_bessel_i0 = FunctionResolver.GetFunctionDelegate("avutil", "av_bessel_i0", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_bessel_i0(@x); + }; + vectors.av_bprint_channel_layout = (AVBPrint* @bp, int @nb_channels, ulong @channel_layout) => { vectors.av_bprint_channel_layout = FunctionResolver.GetFunctionDelegate("avutil", "av_bprint_channel_layout", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; @@ -871,6 +877,18 @@ public unsafe static void Initialize() return vectors.av_dynamic_hdr_plus_create_side_data(@frame); }; + vectors.av_dynamic_hdr_plus_from_t35 = (AVDynamicHDRPlus* @s, byte* @data, ulong @size) => + { + vectors.av_dynamic_hdr_plus_from_t35 = FunctionResolver.GetFunctionDelegate("avutil", "av_dynamic_hdr_plus_from_t35", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_dynamic_hdr_plus_from_t35(@s, @data, @size); + }; + + vectors.av_dynamic_hdr_plus_to_t35 = (AVDynamicHDRPlus* @s, byte** @data, ulong* @size) => + { + vectors.av_dynamic_hdr_plus_to_t35 = FunctionResolver.GetFunctionDelegate("avutil", "av_dynamic_hdr_plus_to_t35", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_dynamic_hdr_plus_to_t35(@s, @data, @size); + }; + vectors.av_dynarray_add = (void* @tab_ptr, int* @nb_ptr, void* @elem) => { vectors.av_dynarray_add = FunctionResolver.GetFunctionDelegate("avutil", "av_dynarray_add", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; @@ -1105,6 +1123,12 @@ public unsafe static void Initialize() vectors.av_frame_remove_side_data(@frame, @type); }; + vectors.av_frame_replace = (AVFrame* @dst, AVFrame* @src) => + { + vectors.av_frame_replace = FunctionResolver.GetFunctionDelegate("avutil", "av_frame_replace", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_frame_replace(@dst, @src); + }; + vectors.av_frame_side_data_name = (AVFrameSideDataType @type) => { vectors.av_frame_side_data_name = FunctionResolver.GetFunctionDelegate("avutil", "av_frame_side_data_name", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; @@ -1549,10 +1573,10 @@ public unsafe static void Initialize() return vectors.av_image_check_size2(@w, @h, @max_pixels, @pix_fmt, @log_offset, @log_ctx); }; - vectors.av_image_copy = (ref byte_ptr4 @dst_data, ref int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => + vectors.av_image_copy = (ref byte_ptr4 @dst_data, in int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => { vectors.av_image_copy = FunctionResolver.GetFunctionDelegate("avutil", "av_image_copy", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; - vectors.av_image_copy(ref @dst_data, ref @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); + vectors.av_image_copy(ref @dst_data, @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); }; vectors.av_image_copy_plane = (byte* @dst, int @dst_linesize, byte* @src, int @src_linesize, int @bytewidth, int @height) => @@ -2239,12 +2263,42 @@ public unsafe static void Initialize() return vectors.av_packet_shrink_side_data(@pkt, @type, @size); }; + vectors.av_packet_side_data_add = (AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags) => + { + vectors.av_packet_side_data_add = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_add", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_packet_side_data_add(@sd, @nb_sd, @type, @data, @size, @flags); + }; + + vectors.av_packet_side_data_free = (AVPacketSideData** @sd, int* @nb_sd) => + { + vectors.av_packet_side_data_free = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_free", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + vectors.av_packet_side_data_free(@sd, @nb_sd); + }; + + vectors.av_packet_side_data_get = (AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type) => + { + vectors.av_packet_side_data_get = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_get", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_packet_side_data_get(@sd, @nb_sd, @type); + }; + vectors.av_packet_side_data_name = (AVPacketSideDataType @type) => { vectors.av_packet_side_data_name = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_name", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; return vectors.av_packet_side_data_name(@type); }; + vectors.av_packet_side_data_new = (AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags) => + { + vectors.av_packet_side_data_new = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_new", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_packet_side_data_new(@psd, @pnb_sd, @type, @size, @flags); + }; + + vectors.av_packet_side_data_remove = (AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type) => + { + vectors.av_packet_side_data_remove = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_remove", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + vectors.av_packet_side_data_remove(@sd, @nb_sd, @type); + }; + vectors.av_packet_unpack_dictionary = (byte* @data, ulong @size, AVDictionary** @dict) => { vectors.av_packet_unpack_dictionary = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_unpack_dictionary", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; diff --git a/FFmpeg.AutoGen.Bindings.StaticallyLinked/generated/StaticallyLinkedBindings.g.cs b/FFmpeg.AutoGen.Bindings.StaticallyLinked/generated/StaticallyLinkedBindings.g.cs index 9ce420f..b75209a 100644 --- a/FFmpeg.AutoGen.Bindings.StaticallyLinked/generated/StaticallyLinkedBindings.g.cs +++ b/FFmpeg.AutoGen.Bindings.StaticallyLinked/generated/StaticallyLinkedBindings.g.cs @@ -111,6 +111,10 @@ public static unsafe partial class StaticallyLinkedBindings [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_audio_fifo_write(AVAudioFifo* @af, void** @data, int @nb_samples); + /// 0th order modified bessel function of the first kind. + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern double av_bessel_i0(double @x); + /// Append a description of a channel layout to a bprint buffer. [Obsolete("use av_channel_layout_describe()")] [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] @@ -970,6 +974,20 @@ public static extern void av_dump_format(AVFormatContext* @ic, int @index, [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data(AVFrame* @frame); + /// Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). The T.35 buffer must begin with the application mode, skipping the country code, terminal provider codes, and application identifier. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// The byte array containing the raw ITU-T T.35 data. + /// Size of the data array in bytes. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus* @s, byte* @data, ulong @size); + + /// Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, excluding the first 48 bytes of the header, and beginning with the application mode. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dynamic_hdr_plus_to_t35(AVDynamicHDRPlus* @s, byte** @data, ulong* @size); + /// Add the pointer to an element to a dynamic array. /// Pointer to the array to grow /// Pointer to the number of elements in the array @@ -1233,6 +1251,11 @@ public static extern int av_filename_number_test( [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern void av_frame_remove_side_data(AVFrame* @frame, AVFrameSideDataType @type); + /// Ensure the destination frame refers to the same data described by the source frame, either by creating a new reference for each AVBufferRef from src if they differ from those in dst, by allocating new buffers and copying data if src is not reference counted, or by unrefencing it if src is empty. + /// 0 on success, a negative AVERROR on error. On error, dst is unreferenced. + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_replace(AVFrame* @dst, AVFrame* @src); + /// Returns a string identifying the side data type /// a string identifying the side data type [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] @@ -1510,7 +1533,7 @@ public static extern AVSampleFormat av_get_sample_fmt( /// index in an internal list, starting at 0 /// channel layout mask /// name of the layout - /// 0 if the layout exists, < 0 if index is beyond the limits + /// 0 if the layout exists, < 0 if index is beyond the limits [Obsolete("use av_channel_layout_standard()")] [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_get_standard_channel_layout(uint @index, ulong* @layout, byte** @name); @@ -1808,7 +1831,7 @@ public static extern AVHWDeviceType av_hwdevice_find_type_by_name( /// width of the image in pixels /// height of the image in pixels [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] - public static extern void av_image_copy(ref byte_ptr4 @dst_data, ref int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); + public static extern void av_image_copy(ref byte_ptr4 @dst_data, in int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); /// Copy image plane from src to dst. That is, copy "height" number of lines of "bytewidth" bytes each. The first byte of each successive line is separated by *_linesize bytes. /// destination plane to copy to @@ -1943,7 +1966,7 @@ public static extern AVHWDeviceType av_hwdevice_find_type_by_name( /// Write a packet to an output media file ensuring correct interleaving. /// media file handle - /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. + /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. /// 0 on success, a negative AVERROR on error. [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_interleaved_write_frame(AVFormatContext* @s, AVPacket* @pkt); @@ -2430,7 +2453,7 @@ public static extern int av_opt_get_video_rate(void* @obj, /// Check if given option is set to its default value. /// AVClass object to check option on /// option to be checked - /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_opt_is_set_to_default(void* @obj, AVOption* @o); @@ -2438,7 +2461,7 @@ public static extern int av_opt_get_video_rate(void* @obj, /// AVClass object to check option on /// option name /// combination of AV_OPT_SEARCH_* - /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_opt_is_set_to_default_by_name(void* @obj, #if NETSTANDARD2_1_OR_GREATER @@ -2798,10 +2821,50 @@ public static extern int av_opt_set_video_rate(void* @obj, [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_packet_shrink_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size); + /// Wrap existing data as packet side data. + /// pointer to an array of side data to which the side data should be added. *sd may be NULL, in which case the array will be initialized + /// pointer to an integer containing the number of entries in the array. The integer value will be increased by 1 on success. + /// side data type + /// a data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to the side data array on success + /// size of the data array + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise On failure, the side data array is unchanged and the data remains owned by the caller. + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacketSideData* av_packet_side_data_add(AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags); + + /// Convenience function to free all the side data stored in an array, and the array itself. + /// pointer to array of side data to free. Will be set to NULL upon return. + /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_side_data_free(AVPacketSideData** @sd, int* @nb_sd); + + /// Get side information from a side data array. + /// the array from which the side data should be fetched + /// value containing the number of entries in the array. + /// desired side information type + /// pointer to side data if present or NULL otherwise + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacketSideData* av_packet_side_data_get(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type); + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] public static extern string av_packet_side_data_name(AVPacketSideDataType @type); + /// Allocate a new packet side data. + /// side data type + /// desired side data size + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise. + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacketSideData* av_packet_side_data_new(AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags); + + /// Remove side data of the given type from a side data array. + /// the array from which the side data should be removed + /// pointer to an integer containing the number of entries in the array. Will be reduced by the amount of entries removed upon return + /// side information type + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_side_data_remove(AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type); + /// Unpack a dictionary from side_data. /// data from side_data /// size of the data @@ -3197,6 +3260,7 @@ public static extern int av_set_options_string(void* @ctx, /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to st. /// side information size /// zero on success, a negative AVERROR code on failure. On failure, the stream is unchanged and the data remains owned by the caller. + [Obsolete("use av_packet_side_data_add() with the stream's \"codecpar side data\"")] [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_stream_add_side_data(AVStream* @st, AVPacketSideDataType @type, byte* @data, ulong @size); @@ -3222,6 +3286,7 @@ public static extern int av_set_options_string(void* @ctx, /// desired side information type /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. /// pointer to data if present or NULL otherwise + [Obsolete("use av_packet_side_data_get() with the stream's \"codecpar side data\"")] [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern byte* av_stream_get_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong* @size); @@ -3230,6 +3295,7 @@ public static extern int av_set_options_string(void* @ctx, /// desired side information type /// side information size /// pointer to fresh allocated data or NULL otherwise + [Obsolete("use av_packet_side_data_new() with the stream's \"codecpar side data\"")] [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern byte* av_stream_new_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong @size); @@ -3450,7 +3516,7 @@ public static extern void av_vlog(void* @avcl, int @level, /// Write a packet to an output media file. /// media file handle - /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. + /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. /// < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_write_frame(AVFormatContext* @s, AVPacket* @pkt); @@ -3481,7 +3547,7 @@ public static extern void av_vlog(void* @avcl, int @level, public static extern int av_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame); /// Test whether a muxer supports uncoded frame. - /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not + /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int av_write_uncoded_frame_query(AVFormatContext* @s, int @stream_index); @@ -3688,7 +3754,7 @@ public static extern void av_vlog(void* @avcl, int @level, /// Initialize the AVCodecContext to use the given AVCodec. Prior to using this function the context has to be allocated with avcodec_alloc_context3(). /// The context to initialize. /// The codec to open this context for. If a non-NULL codec has been previously passed to avcodec_alloc_context3() or for this context, then this parameter MUST be either NULL or equal to the previously passed codec. - /// A dictionary filled with AVCodecContext and codec-private options. On return this object will be filled with options that were not found. + /// A dictionary filled with AVCodecContext and codec-private options, which are set on top of the options already set in avctx, can be NULL. On return this object will be filled with options that were not found in the avctx codec context. /// zero on success, a negative value on error [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int avcodec_open2(AVCodecContext* @avctx, AVCodec* @codec, AVDictionary** @options); @@ -4499,7 +4565,7 @@ public static extern string avio_find_protocol_name( /// Perform one step of the protocol handshake to accept a new client. This function must be called on a client returned by avio_accept() before using it as a read/write context. It is separate from avio_accept() because it may block. A step of the handshake is defined by places where the application may decide to change the proceedings. For example, on a protocol with a request header and a reply header, each one can constitute a step because the application may use the parameters from the request to change parameters in the reply; or each individual chunk of the request can constitute a step. If the handshake is already finished, avio_handshake() does nothing and returns 0 immediately. /// the client context to perform the handshake on - /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code + /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] public static extern int avio_handshake(AVIOContext* @c); @@ -5184,6 +5250,7 @@ public unsafe static void Initialize() vectors.av_audio_fifo_size = av_audio_fifo_size; vectors.av_audio_fifo_space = av_audio_fifo_space; vectors.av_audio_fifo_write = av_audio_fifo_write; + vectors.av_bessel_i0 = av_bessel_i0; vectors.av_bprint_channel_layout = av_bprint_channel_layout; vectors.av_bsf_alloc = av_bsf_alloc; vectors.av_bsf_flush = av_bsf_flush; @@ -5312,6 +5379,8 @@ public unsafe static void Initialize() vectors.av_dump_format = av_dump_format; vectors.av_dynamic_hdr_plus_alloc = av_dynamic_hdr_plus_alloc; vectors.av_dynamic_hdr_plus_create_side_data = av_dynamic_hdr_plus_create_side_data; + vectors.av_dynamic_hdr_plus_from_t35 = av_dynamic_hdr_plus_from_t35; + vectors.av_dynamic_hdr_plus_to_t35 = av_dynamic_hdr_plus_to_t35; vectors.av_dynarray_add = av_dynarray_add; vectors.av_dynarray_add_nofree = av_dynarray_add_nofree; vectors.av_dynarray2_add = av_dynarray2_add; @@ -5351,6 +5420,7 @@ public unsafe static void Initialize() vectors.av_frame_new_side_data_from_buf = av_frame_new_side_data_from_buf; vectors.av_frame_ref = av_frame_ref; vectors.av_frame_remove_side_data = av_frame_remove_side_data; + vectors.av_frame_replace = av_frame_replace; vectors.av_frame_side_data_name = av_frame_side_data_name; vectors.av_frame_unref = av_frame_unref; vectors.av_free = av_free; @@ -5540,7 +5610,12 @@ public unsafe static void Initialize() vectors.av_packet_ref = av_packet_ref; vectors.av_packet_rescale_ts = av_packet_rescale_ts; vectors.av_packet_shrink_side_data = av_packet_shrink_side_data; + vectors.av_packet_side_data_add = av_packet_side_data_add; + vectors.av_packet_side_data_free = av_packet_side_data_free; + vectors.av_packet_side_data_get = av_packet_side_data_get; vectors.av_packet_side_data_name = av_packet_side_data_name; + vectors.av_packet_side_data_new = av_packet_side_data_new; + vectors.av_packet_side_data_remove = av_packet_side_data_remove; vectors.av_packet_unpack_dictionary = av_packet_unpack_dictionary; vectors.av_packet_unref = av_packet_unref; vectors.av_parse_cpu_caps = av_parse_cpu_caps; diff --git a/FFmpeg.AutoGen/generated/Delegates.g.cs b/FFmpeg.AutoGen/generated/Delegates.g.cs index 7d90efb..f1029f8 100644 --- a/FFmpeg.AutoGen/generated/Delegates.g.cs +++ b/FFmpeg.AutoGen/generated/Delegates.g.cs @@ -345,70 +345,6 @@ public unsafe struct AVFormatContext_io_open_func public static implicit operator AVFormatContext_io_open_func(AVFormatContext_io_open func) => new AVFormatContext_io_open_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; } -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_alloc_frame (AVCodecContext* @avctx, AVFrame* @frame); -public unsafe struct AVHWAccel_alloc_frame_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_alloc_frame_func(AVHWAccel_alloc_frame func) => new AVHWAccel_alloc_frame_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_decode_params (AVCodecContext* @avctx, int @type, byte* @buf, uint @buf_size); -public unsafe struct AVHWAccel_decode_params_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_decode_params_func(AVHWAccel_decode_params func) => new AVHWAccel_decode_params_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_decode_slice (AVCodecContext* @avctx, byte* @buf, uint @buf_size); -public unsafe struct AVHWAccel_decode_slice_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_decode_slice_func(AVHWAccel_decode_slice func) => new AVHWAccel_decode_slice_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_end_frame (AVCodecContext* @avctx); -public unsafe struct AVHWAccel_end_frame_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_end_frame_func(AVHWAccel_end_frame func) => new AVHWAccel_end_frame_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_frame_params (AVCodecContext* @avctx, AVBufferRef* @hw_frames_ctx); -public unsafe struct AVHWAccel_frame_params_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_frame_params_func(AVHWAccel_frame_params func) => new AVHWAccel_frame_params_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_init (AVCodecContext* @avctx); -public unsafe struct AVHWAccel_init_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_init_func(AVHWAccel_init func) => new AVHWAccel_init_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_start_frame (AVCodecContext* @avctx, byte* @buf, uint @buf_size); -public unsafe struct AVHWAccel_start_frame_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_start_frame_func(AVHWAccel_start_frame func) => new AVHWAccel_start_frame_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] -public unsafe delegate int AVHWAccel_uninit (AVCodecContext* @avctx); -public unsafe struct AVHWAccel_uninit_func -{ - public IntPtr Pointer; - public static implicit operator AVHWAccel_uninit_func(AVHWAccel_uninit func) => new AVHWAccel_uninit_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; -} - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public unsafe delegate void AVHWDeviceContext_free (AVHWDeviceContext* @ctx); public unsafe struct AVHWDeviceContext_free_func diff --git a/FFmpeg.AutoGen/generated/DynamicallyLoadedBindings.g.cs b/FFmpeg.AutoGen/generated/DynamicallyLoadedBindings.g.cs index 47075dd..780f28b 100644 --- a/FFmpeg.AutoGen/generated/DynamicallyLoadedBindings.g.cs +++ b/FFmpeg.AutoGen/generated/DynamicallyLoadedBindings.g.cs @@ -102,6 +102,12 @@ public unsafe static void Initialize() return vectors.av_audio_fifo_write(@af, @data, @nb_samples); }; + vectors.av_bessel_i0 = (double @x) => + { + vectors.av_bessel_i0 = FunctionResolver.GetFunctionDelegate("avutil", "av_bessel_i0", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_bessel_i0(@x); + }; + vectors.av_bprint_channel_layout = (AVBPrint* @bp, int @nb_channels, ulong @channel_layout) => { vectors.av_bprint_channel_layout = FunctionResolver.GetFunctionDelegate("avutil", "av_bprint_channel_layout", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; @@ -870,6 +876,18 @@ public unsafe static void Initialize() return vectors.av_dynamic_hdr_plus_create_side_data(@frame); }; + vectors.av_dynamic_hdr_plus_from_t35 = (AVDynamicHDRPlus* @s, byte* @data, ulong @size) => + { + vectors.av_dynamic_hdr_plus_from_t35 = FunctionResolver.GetFunctionDelegate("avutil", "av_dynamic_hdr_plus_from_t35", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_dynamic_hdr_plus_from_t35(@s, @data, @size); + }; + + vectors.av_dynamic_hdr_plus_to_t35 = (AVDynamicHDRPlus* @s, byte** @data, ulong* @size) => + { + vectors.av_dynamic_hdr_plus_to_t35 = FunctionResolver.GetFunctionDelegate("avutil", "av_dynamic_hdr_plus_to_t35", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_dynamic_hdr_plus_to_t35(@s, @data, @size); + }; + vectors.av_dynarray_add = (void* @tab_ptr, int* @nb_ptr, void* @elem) => { vectors.av_dynarray_add = FunctionResolver.GetFunctionDelegate("avutil", "av_dynarray_add", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; @@ -1104,6 +1122,12 @@ public unsafe static void Initialize() vectors.av_frame_remove_side_data(@frame, @type); }; + vectors.av_frame_replace = (AVFrame* @dst, AVFrame* @src) => + { + vectors.av_frame_replace = FunctionResolver.GetFunctionDelegate("avutil", "av_frame_replace", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_frame_replace(@dst, @src); + }; + vectors.av_frame_side_data_name = (AVFrameSideDataType @type) => { vectors.av_frame_side_data_name = FunctionResolver.GetFunctionDelegate("avutil", "av_frame_side_data_name", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; @@ -1548,10 +1572,10 @@ public unsafe static void Initialize() return vectors.av_image_check_size2(@w, @h, @max_pixels, @pix_fmt, @log_offset, @log_ctx); }; - vectors.av_image_copy = (ref byte_ptrArray4 @dst_data, ref int_array4 @dst_linesizes, in byte_ptrArray4 @src_data, in int_array4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => + vectors.av_image_copy = (ref byte_ptrArray4 @dst_data, in int_array4 @dst_linesizes, in byte_ptrArray4 @src_data, in int_array4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => { vectors.av_image_copy = FunctionResolver.GetFunctionDelegate("avutil", "av_image_copy", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; - vectors.av_image_copy(ref @dst_data, ref @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); + vectors.av_image_copy(ref @dst_data, @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); }; vectors.av_image_copy_plane = (byte* @dst, int @dst_linesize, byte* @src, int @src_linesize, int @bytewidth, int @height) => @@ -2238,12 +2262,42 @@ public unsafe static void Initialize() return vectors.av_packet_shrink_side_data(@pkt, @type, @size); }; + vectors.av_packet_side_data_add = (AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags) => + { + vectors.av_packet_side_data_add = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_add", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_packet_side_data_add(@sd, @nb_sd, @type, @data, @size, @flags); + }; + + vectors.av_packet_side_data_free = (AVPacketSideData** @sd, int* @nb_sd) => + { + vectors.av_packet_side_data_free = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_free", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + vectors.av_packet_side_data_free(@sd, @nb_sd); + }; + + vectors.av_packet_side_data_get = (AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type) => + { + vectors.av_packet_side_data_get = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_get", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_packet_side_data_get(@sd, @nb_sd, @type); + }; + vectors.av_packet_side_data_name = (AVPacketSideDataType @type) => { vectors.av_packet_side_data_name = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_name", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; return vectors.av_packet_side_data_name(@type); }; + vectors.av_packet_side_data_new = (AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags) => + { + vectors.av_packet_side_data_new = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_new", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + return vectors.av_packet_side_data_new(@psd, @pnb_sd, @type, @size, @flags); + }; + + vectors.av_packet_side_data_remove = (AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type) => + { + vectors.av_packet_side_data_remove = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_side_data_remove", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; + vectors.av_packet_side_data_remove(@sd, @nb_sd, @type); + }; + vectors.av_packet_unpack_dictionary = (byte* @data, ulong @size, AVDictionary** @dict) => { vectors.av_packet_unpack_dictionary = FunctionResolver.GetFunctionDelegate("avcodec", "av_packet_unpack_dictionary", ThrowErrorIfFunctionNotFound) ?? delegate { throw new NotSupportedException(); }; diff --git a/FFmpeg.AutoGen/generated/Enums.g.cs b/FFmpeg.AutoGen/generated/Enums.g.cs index 672210f..1a4bf30 100644 --- a/FFmpeg.AutoGen/generated/Enums.g.cs +++ b/FFmpeg.AutoGen/generated/Enums.g.cs @@ -433,6 +433,10 @@ public enum AVCodecID : int @AV_CODEC_ID_WBMP = 263, @AV_CODEC_ID_MEDIA100 = 264, @AV_CODEC_ID_VQC = 265, + @AV_CODEC_ID_PDV = 266, + @AV_CODEC_ID_EVC = 267, + @AV_CODEC_ID_RTV1 = 268, + @AV_CODEC_ID_VMIX = 269, /// A dummy id pointing at the start of audio codecs @AV_CODEC_ID_FIRST_AUDIO = 65536, @AV_CODEC_ID_PCM_S16LE = 65536, @@ -642,6 +646,8 @@ public enum AVCodecID : int @AV_CODEC_ID_FTR = 86116, @AV_CODEC_ID_WAVARC = 86117, @AV_CODEC_ID_RKA = 86118, + @AV_CODEC_ID_AC4 = 86119, + @AV_CODEC_ID_OSQ = 86120, /// A dummy ID pointing at the start of subtitle codecs. @AV_CODEC_ID_FIRST_SUBTITLE = 94208, @AV_CODEC_ID_DVD_SUBTITLE = 94208, @@ -685,6 +691,7 @@ public enum AVCodecID : int @AV_CODEC_ID_DVD_NAV = 98312, @AV_CODEC_ID_TIMED_ID3 = 98313, @AV_CODEC_ID_BIN_DATA = 98314, + @AV_CODEC_ID_SMPTE_2038 = 98315, /// codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it @AV_CODEC_ID_PROBE = 102400, /// _FAKE_ codec to indicate a raw MPEG-2 TS stream (only used by libavformat) @@ -883,7 +890,6 @@ public enum AVDurationEstimationMethod : int @AVFMT_DURATION_FROM_BITRATE = 2, } -/// @{ public enum AVFieldOrder : int { @AV_FIELD_UNKNOWN = 0, @@ -966,6 +972,8 @@ public enum AVFrameSideDataType : int @AV_FRAME_DATA_DYNAMIC_HDR_VIVID = 25, /// Ambient viewing environment metadata, as defined by H.274. @AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT = 26, + /// Provide encoder-specific hinting information about changed/unchanged portions of a frame. It can be used to pass information about which macroblocks can be skipped because they didn't change from the corresponding ones in the previous frame. This could be useful for applications which know this information in advance to speed up encoding. + @AV_FRAME_DATA_VIDEO_HINT = 27, } /// Option for overlapping elliptical pixel selectors in an image. @@ -1087,7 +1095,7 @@ public enum AVOptionType : int @AV_OPT_TYPE_CHLAYOUT = 19, } -/// Types and functions for working with AVPacket. @{ +/// Types and functions for working with AVPacketSideData. @{ public enum AVPacketSideDataType : int { /// An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette. This side data signals that a new palette is present. @@ -1645,8 +1653,20 @@ public enum AVPixelFormat : int @AV_PIX_FMT_RGBAF32BE = 220, /// IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian @AV_PIX_FMT_RGBAF32LE = 221, + /// interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian + @AV_PIX_FMT_P212BE = 222, + /// interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian + @AV_PIX_FMT_P212LE = 223, + /// interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian + @AV_PIX_FMT_P412BE = 224, + /// interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian + @AV_PIX_FMT_P412LE = 225, + /// planar GBR 4:4:4:4 56bpp, big-endian + @AV_PIX_FMT_GBRAP14BE = 226, + /// planar GBR 4:4:4:4 56bpp, little-endian + @AV_PIX_FMT_GBRAP14LE = 227, /// number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions - @AV_PIX_FMT_NB = 222, + @AV_PIX_FMT_NB = 228, } /// Rounding methods. diff --git a/FFmpeg.AutoGen/generated/Structs.g.cs b/FFmpeg.AutoGen/generated/Structs.g.cs index e81a1c9..63f037e 100644 --- a/FFmpeg.AutoGen/generated/Structs.g.cs +++ b/FFmpeg.AutoGen/generated/Structs.g.cs @@ -177,7 +177,7 @@ public unsafe partial struct AVCodec public ulong* @channel_layouts; /// AVClass for the private context public AVClass* @priv_class; - /// array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} + /// 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; @@ -219,6 +219,7 @@ public unsafe partial struct AVCodecContext /// 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; /// 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; @@ -318,7 +319,7 @@ public unsafe partial struct AVCodecContext 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 - decoding: Set by libavcodec + /// 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; @@ -364,7 +365,7 @@ public unsafe partial struct AVCodecContext 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: unused + /// 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; @@ -426,9 +427,9 @@ public unsafe partial struct AVCodecContext public AVCodecContext_execute2_func @execute2; /// noise vs. sse weight for the nsse comparison function - encoding: Set by user. - decoding: unused public int @nsse_weight; - /// profile - encoding: Set by user. - decoding: Set by libavcodec. + /// profile - encoding: Set by user. - decoding: Set by libavcodec. See the AV_PROFILE_* defines in defs.h. public int @profile; - /// level - encoding: Set by user. - decoding: Set by libavcodec. + /// 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; /// Skip loop filtering for selected frames. - encoding: unused - decoding: Set by user. public AVDiscard @skip_loop_filter; @@ -445,7 +446,7 @@ public unsafe partial struct AVCodecContext public AVRational @framerate; /// Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - encoding: unused. - decoding: Set by libavcodec before calling get_format() public AVPixelFormat @sw_pix_fmt; - /// Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - encoding unused. - decoding set by user. + /// Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. - encoding: unused. - decoding: set by user. public AVRational @pkt_timebase; /// AVCodecDescriptor - encoding: unused. - decoding: set by libavcodec. public AVCodecDescriptor* @codec_descriptor; @@ -516,7 +517,7 @@ public unsafe partial struct AVCodecDescriptor 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 FF_PROFILE_UNKNOWN. + /// If non-NULL, an array of profiles recognized for this codec. Terminated with AV_PROFILE_UNKNOWN. public AVProfile* @profiles; } @@ -589,6 +590,12 @@ public unsafe partial struct AVCodecParameters public int @seek_preroll; /// Audio only. The channel layout and number of channels. public AVChannelLayout @ch_layout; + /// 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; + /// 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; } public unsafe partial struct AVCodecParser @@ -1274,6 +1281,7 @@ public unsafe partial struct AVFrame /// 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; @@ -1291,13 +1299,15 @@ public unsafe partial struct AVFrame public int @display_picture_number; /// quality (between 1 (good) and FF_LAMBDA_MAX (bad)) public int @quality; - /// for some private data of the user + /// Frame owner's private data. public void* @opaque; - /// When decoding, this signals how much the picture must be delayed. extra_delay = repeat_pict / (2*fps) + /// 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; @@ -1329,6 +1339,7 @@ public unsafe partial struct AVFrame /// 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; /// duration of the corresponding packet, expressed in AVStream->time_base units, 0 if unknown. - encoding: unused - decoding: Read by user. [Obsolete("use duration instead")] @@ -1341,10 +1352,11 @@ public unsafe partial struct AVFrame [Obsolete("use ch_layout instead")] public int @channels; /// 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; - /// AVBufferRef for free use by the API user. FFmpeg will never check the contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when the frame is unreferenced. av_frame_copy_props() calls create a new reference with av_buffer_ref() for the target frame's opaque_ref field. + /// 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; @@ -1441,28 +1453,6 @@ public unsafe partial struct AVHWAccel public AVPixelFormat @pix_fmt; /// Hardware accelerated codec capabilities. see AV_HWACCEL_CODEC_CAP_* public int @capabilities; - /// Allocate a custom buffer - public AVHWAccel_alloc_frame_func @alloc_frame; - /// Called at the beginning of each frame or field picture. - public AVHWAccel_start_frame_func @start_frame; - /// Callback for parameter data (SPS/PPS/VPS etc). - public AVHWAccel_decode_params_func @decode_params; - /// Callback for each slice. - public AVHWAccel_decode_slice_func @decode_slice; - /// Called at the end of each frame or field picture. - public AVHWAccel_end_frame_func @end_frame; - /// Size of per-frame hardware accelerator private data. - public int @frame_priv_data_size; - /// Initialize the hwaccel private data. - public AVHWAccel_init_func @init; - /// Uninitialize the hwaccel private data. - public AVHWAccel_uninit_func @uninit; - /// Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data. - public int @priv_data_size; - /// Internal hwaccel capabilities. - public int @caps_internal; - /// Fill the given hw_frames context with current codec parameters. Called from get_format. Refer to avcodec_get_hw_frames_parameters() for details. - public AVHWAccel_frame_params_func @frame_params; } /// 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. @@ -1627,7 +1617,6 @@ public unsafe partial struct AVIOContext 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; @@ -1768,7 +1757,7 @@ public unsafe partial struct AVOutputFormat 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_ALLOW_FLUSH, AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE + /// 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; @@ -1811,6 +1800,7 @@ public unsafe partial struct AVPacketList 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; @@ -1954,8 +1944,10 @@ public unsafe partial struct AVStream /// 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; diff --git a/FFmpeg.AutoGen/generated/ffmpeg.functions.facade.g.cs b/FFmpeg.AutoGen/generated/ffmpeg.functions.facade.g.cs index ca3d11f..917d3f7 100644 --- a/FFmpeg.AutoGen/generated/ffmpeg.functions.facade.g.cs +++ b/FFmpeg.AutoGen/generated/ffmpeg.functions.facade.g.cs @@ -95,6 +95,9 @@ public static unsafe partial class ffmpeg /// number of samples actually written, or negative AVERROR code on failure. If successful, the number of samples actually written will always be nb_samples. public static int av_audio_fifo_write(AVAudioFifo* @af, void** @data, int @nb_samples) => vectors.av_audio_fifo_write(@af, @data, @nb_samples); + /// 0th order modified bessel function of the first kind. + public static double av_bessel_i0(double @x) => vectors.av_bessel_i0(@x); + /// Append a description of a channel layout to a bprint buffer. [Obsolete("use av_channel_layout_describe()")] public static void av_bprint_channel_layout(AVBPrint* @bp, int @nb_channels, ulong @channel_layout) => vectors.av_bprint_channel_layout(@bp, @nb_channels, @channel_layout); @@ -693,6 +696,18 @@ public static unsafe partial class ffmpeg /// The AVDynamicHDRPlus structure to be filled by caller or NULL on failure. public static AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data(AVFrame* @frame) => vectors.av_dynamic_hdr_plus_create_side_data(@frame); + /// Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). The T.35 buffer must begin with the application mode, skipping the country code, terminal provider codes, and application identifier. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// The byte array containing the raw ITU-T T.35 data. + /// Size of the data array in bytes. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + public static int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus* @s, byte* @data, ulong @size) => vectors.av_dynamic_hdr_plus_from_t35(@s, @data, @size); + + /// Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, excluding the first 48 bytes of the header, and beginning with the application mode. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + public static int av_dynamic_hdr_plus_to_t35(AVDynamicHDRPlus* @s, byte** @data, ulong* @size) => vectors.av_dynamic_hdr_plus_to_t35(@s, @data, @size); + /// Add the pointer to an element to a dynamic array. /// Pointer to the array to grow /// Pointer to the number of elements in the array @@ -887,6 +902,10 @@ public static unsafe partial class ffmpeg /// Remove and free all side data instances of the given type. public static void av_frame_remove_side_data(AVFrame* @frame, AVFrameSideDataType @type) => vectors.av_frame_remove_side_data(@frame, @type); + /// Ensure the destination frame refers to the same data described by the source frame, either by creating a new reference for each AVBufferRef from src if they differ from those in dst, by allocating new buffers and copying data if src is not reference counted, or by unrefencing it if src is empty. + /// 0 on success, a negative AVERROR on error. On error, dst is unreferenced. + public static int av_frame_replace(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_replace(@dst, @src); + /// Returns a string identifying the side data type /// a string identifying the side data type public static string av_frame_side_data_name(AVFrameSideDataType @type) => vectors.av_frame_side_data_name(@type); @@ -1081,7 +1100,7 @@ public static unsafe partial class ffmpeg /// index in an internal list, starting at 0 /// channel layout mask /// name of the layout - /// 0 if the layout exists, < 0 if index is beyond the limits + /// 0 if the layout exists, < 0 if index is beyond the limits [Obsolete("use av_channel_layout_standard()")] public static int av_get_standard_channel_layout(uint @index, ulong* @layout, byte** @name) => vectors.av_get_standard_channel_layout(@index, @layout, @name); @@ -1295,7 +1314,7 @@ public static unsafe partial class ffmpeg /// the AVPixelFormat of the image /// width of the image in pixels /// height of the image in pixels - public static void av_image_copy(ref byte_ptrArray4 @dst_data, ref int_array4 @dst_linesizes, in byte_ptrArray4 @src_data, in int_array4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => vectors.av_image_copy(ref @dst_data, ref @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); + public static void av_image_copy(ref byte_ptrArray4 @dst_data, in int_array4 @dst_linesizes, in byte_ptrArray4 @src_data, in int_array4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => vectors.av_image_copy(ref @dst_data, @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); /// Copy image plane from src to dst. That is, copy "height" number of lines of "bytewidth" bytes each. The first byte of each successive line is separated by *_linesize bytes. /// destination plane to copy to @@ -1413,7 +1432,7 @@ public static unsafe partial class ffmpeg /// Write a packet to an output media file ensuring correct interleaving. /// media file handle - /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. + /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. /// 0 on success, a negative AVERROR on error. public static int av_interleaved_write_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_interleaved_write_frame(@s, @pkt); @@ -1654,14 +1673,14 @@ public static unsafe partial class ffmpeg /// Check if given option is set to its default value. /// AVClass object to check option on /// option to be checked - /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error public static int av_opt_is_set_to_default(void* @obj, AVOption* @o) => vectors.av_opt_is_set_to_default(@obj, @o); /// Check if given option is set to its default value. /// AVClass object to check option on /// option name /// combination of AV_OPT_SEARCH_* - /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error public static int av_opt_is_set_to_default_by_name(void* @obj, string @name, int @search_flags) => vectors.av_opt_is_set_to_default_by_name(@obj, @name, @search_flags); /// Iterate over all AVOptions belonging to obj. @@ -1859,8 +1878,43 @@ public static unsafe partial class ffmpeg /// 0 on success, < 0 on failure public static int av_packet_shrink_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size) => vectors.av_packet_shrink_side_data(@pkt, @type, @size); + /// Wrap existing data as packet side data. + /// pointer to an array of side data to which the side data should be added. *sd may be NULL, in which case the array will be initialized + /// pointer to an integer containing the number of entries in the array. The integer value will be increased by 1 on success. + /// side data type + /// a data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to the side data array on success + /// size of the data array + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise On failure, the side data array is unchanged and the data remains owned by the caller. + public static AVPacketSideData* av_packet_side_data_add(AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags) => vectors.av_packet_side_data_add(@sd, @nb_sd, @type, @data, @size, @flags); + + /// Convenience function to free all the side data stored in an array, and the array itself. + /// pointer to array of side data to free. Will be set to NULL upon return. + /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. + public static void av_packet_side_data_free(AVPacketSideData** @sd, int* @nb_sd) => vectors.av_packet_side_data_free(@sd, @nb_sd); + + /// Get side information from a side data array. + /// the array from which the side data should be fetched + /// value containing the number of entries in the array. + /// desired side information type + /// pointer to side data if present or NULL otherwise + public static AVPacketSideData* av_packet_side_data_get(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type) => vectors.av_packet_side_data_get(@sd, @nb_sd, @type); + public static string av_packet_side_data_name(AVPacketSideDataType @type) => vectors.av_packet_side_data_name(@type); + /// Allocate a new packet side data. + /// side data type + /// desired side data size + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise. + public static AVPacketSideData* av_packet_side_data_new(AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags) => vectors.av_packet_side_data_new(@psd, @pnb_sd, @type, @size, @flags); + + /// Remove side data of the given type from a side data array. + /// the array from which the side data should be removed + /// pointer to an integer containing the number of entries in the array. Will be reduced by the amount of entries removed upon return + /// side information type + public static void av_packet_side_data_remove(AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type) => vectors.av_packet_side_data_remove(@sd, @nb_sd, @type); + /// Unpack a dictionary from side_data. /// data from side_data /// size of the data @@ -2163,6 +2217,7 @@ public static unsafe partial class ffmpeg /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to st. /// side information size /// zero on success, a negative AVERROR code on failure. On failure, the stream is unchanged and the data remains owned by the caller. + [Obsolete("use av_packet_side_data_add() with the stream's \"codecpar side data\"")] public static int av_stream_add_side_data(AVStream* @st, AVPacketSideDataType @type, byte* @data, ulong @size) => vectors.av_stream_add_side_data(@st, @type, @data, @size); /// Get the AVClass for AVStream. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. @@ -2183,6 +2238,7 @@ public static unsafe partial class ffmpeg /// desired side information type /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. /// pointer to data if present or NULL otherwise + [Obsolete("use av_packet_side_data_get() with the stream's \"codecpar side data\"")] public static byte* av_stream_get_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong* @size) => vectors.av_stream_get_side_data(@stream, @type, @size); /// Allocate new information from stream. @@ -2190,6 +2246,7 @@ public static unsafe partial class ffmpeg /// desired side information type /// side information size /// pointer to fresh allocated data or NULL otherwise + [Obsolete("use av_packet_side_data_new() with the stream's \"codecpar side data\"")] public static byte* av_stream_new_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong @size) => vectors.av_stream_new_side_data(@stream, @type, @size); /// Put a description of the AVERROR code errnum in errbuf. In case of failure the global variable errno is set to indicate the error. Even in case of failure av_strerror() will print a generic error message indicating the errnum provided to errbuf. @@ -2354,7 +2411,7 @@ public static unsafe partial class ffmpeg /// Write a packet to an output media file. /// media file handle - /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. + /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. /// < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush public static int av_write_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_write_frame(@s, @pkt); @@ -2380,7 +2437,7 @@ public static unsafe partial class ffmpeg public static int av_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame) => vectors.av_write_uncoded_frame(@s, @stream_index, @frame); /// Test whether a muxer supports uncoded frame. - /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not + /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not public static int av_write_uncoded_frame_query(AVFormatContext* @s, int @stream_index) => vectors.av_write_uncoded_frame_query(@s, @stream_index); /// Encode extradata length to a buffer. Used by xiph codecs. @@ -2531,7 +2588,7 @@ public static unsafe partial class ffmpeg /// Initialize the AVCodecContext to use the given AVCodec. Prior to using this function the context has to be allocated with avcodec_alloc_context3(). /// The context to initialize. /// The codec to open this context for. If a non-NULL codec has been previously passed to avcodec_alloc_context3() or for this context, then this parameter MUST be either NULL or equal to the previously passed codec. - /// A dictionary filled with AVCodecContext and codec-private options. On return this object will be filled with options that were not found. + /// A dictionary filled with AVCodecContext and codec-private options, which are set on top of the options already set in avctx, can be NULL. On return this object will be filled with options that were not found in the avctx codec context. /// zero on success, a negative value on error public static int avcodec_open2(AVCodecContext* @avctx, AVCodec* @codec, AVDictionary** @options) => vectors.avcodec_open2(@avctx, @codec, @options); @@ -3062,7 +3119,7 @@ public static unsafe partial class ffmpeg /// Perform one step of the protocol handshake to accept a new client. This function must be called on a client returned by avio_accept() before using it as a read/write context. It is separate from avio_accept() because it may block. A step of the handshake is defined by places where the application may decide to change the proceedings. For example, on a protocol with a request header and a reply header, each one can constitute a step because the application may use the parameters from the request to change parameters in the reply; or each individual chunk of the request can constitute a step. If the handshake is already finished, avio_handshake() does nothing and returns 0 immediately. /// the client context to perform the handshake on - /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code + /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code public static int avio_handshake(AVIOContext* @c) => vectors.avio_handshake(@c); /// Create and initialize a AVIOContext for accessing the resource indicated by url. diff --git a/FFmpeg.AutoGen/generated/ffmpeg.functions.inline.g.cs b/FFmpeg.AutoGen/generated/ffmpeg.functions.inline.g.cs index 3dda1ac..91c38f0 100644 --- a/FFmpeg.AutoGen/generated/ffmpeg.functions.inline.g.cs +++ b/FFmpeg.AutoGen/generated/ffmpeg.functions.inline.g.cs @@ -185,6 +185,13 @@ public static uint av_float2int(float @f) } // original body hash: uBvsHd8EeFnxDvSdDE1+k5Um29kCuf0aEJhAvDy0wZk= + /// Wrapper around av_image_copy() to workaround the limitation that the conversion from uint8_t * const * to const uint8_t * const * is not performed automatically in C. + public static void av_image_copy2(ref byte_ptrArray4 @dst_data, in int_array4 @dst_linesizes, ref byte_ptrArray4 @src_data, in int_array4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) + { + av_image_copy(ref dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt, width, height); + } + // original body hash: RdaM2zKuF7t0cNJItdh1SZPg9WiOfPpTwty5cHDiZ2A= + /// Reinterpret a 64-bit integer as a double. public static double av_int2double(ulong @i) { diff --git a/FFmpeg.AutoGen/generated/ffmpeg.macros.g.cs b/FFmpeg.AutoGen/generated/ffmpeg.macros.g.cs index 78151a8..38d1ba9 100644 --- a/FFmpeg.AutoGen/generated/ffmpeg.macros.g.cs +++ b/FFmpeg.AutoGen/generated/ffmpeg.macros.g.cs @@ -43,12 +43,14 @@ public static unsafe partial class ffmpeg public static readonly ulong AV_CH_LAYOUT_2_1 = AV_CH_LAYOUT_STEREO | AV_CH_BACK_CENTER; /// AV_CH_LAYOUT_2_2 = (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) public static readonly ulong AV_CH_LAYOUT_2_2 = AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT; - /// AV_CH_LAYOUT_22POINT2 = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) - public static readonly ulong AV_CH_LAYOUT_22POINT2 = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_BACK_CENTER | AV_CH_LOW_FREQUENCY_2 | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT | AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_CENTER | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT | AV_CH_TOP_SIDE_LEFT | AV_CH_TOP_SIDE_RIGHT | AV_CH_TOP_BACK_CENTER | AV_CH_BOTTOM_FRONT_CENTER | AV_CH_BOTTOM_FRONT_LEFT | AV_CH_BOTTOM_FRONT_RIGHT; + /// AV_CH_LAYOUT_22POINT2 = (AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_22POINT2 = AV_CH_LAYOUT_7POINT1POINT4_BACK | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_BACK_CENTER | AV_CH_LOW_FREQUENCY_2 | AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_CENTER | AV_CH_TOP_SIDE_LEFT | AV_CH_TOP_SIDE_RIGHT | AV_CH_TOP_BACK_CENTER | AV_CH_BOTTOM_FRONT_CENTER | AV_CH_BOTTOM_FRONT_LEFT | AV_CH_BOTTOM_FRONT_RIGHT; /// AV_CH_LAYOUT_2POINT1 = (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY) public static readonly ulong AV_CH_LAYOUT_2POINT1 = AV_CH_LAYOUT_STEREO | AV_CH_LOW_FREQUENCY; /// AV_CH_LAYOUT_3POINT1 = (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY) public static readonly ulong AV_CH_LAYOUT_3POINT1 = AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY; + /// AV_CH_LAYOUT_3POINT1POINT2 = (AV_CH_LAYOUT_3POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_3POINT1POINT2 = AV_CH_LAYOUT_3POINT1 | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT; /// AV_CH_LAYOUT_4POINT0 = (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER) public static readonly ulong AV_CH_LAYOUT_4POINT0 = AV_CH_LAYOUT_SURROUND | AV_CH_BACK_CENTER; /// AV_CH_LAYOUT_4POINT1 = (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY) @@ -61,6 +63,10 @@ public static unsafe partial class ffmpeg public static readonly ulong AV_CH_LAYOUT_5POINT1 = AV_CH_LAYOUT_5POINT0 | AV_CH_LOW_FREQUENCY; /// AV_CH_LAYOUT_5POINT1_BACK = (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY) public static readonly ulong AV_CH_LAYOUT_5POINT1_BACK = AV_CH_LAYOUT_5POINT0_BACK | AV_CH_LOW_FREQUENCY; + /// AV_CH_LAYOUT_5POINT1POINT2_BACK = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_5POINT1POINT2_BACK = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT; + /// AV_CH_LAYOUT_5POINT1POINT4_BACK = (AV_CH_LAYOUT_5POINT1POINT2_BACK|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) + public static readonly ulong AV_CH_LAYOUT_5POINT1POINT4_BACK = AV_CH_LAYOUT_5POINT1POINT2_BACK | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT; /// AV_CH_LAYOUT_6POINT0 = (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER) public static readonly ulong AV_CH_LAYOUT_6POINT0 = AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_CENTER; /// AV_CH_LAYOUT_6POINT0_FRONT = (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) @@ -77,12 +83,16 @@ public static unsafe partial class ffmpeg public static readonly ulong AV_CH_LAYOUT_7POINT0_FRONT = AV_CH_LAYOUT_5POINT0 | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; /// AV_CH_LAYOUT_7POINT1 = (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) public static readonly ulong AV_CH_LAYOUT_7POINT1 = AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT; - /// AV_CH_LAYOUT_7POINT1_TOP_BACK = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) - public static readonly ulong AV_CH_LAYOUT_7POINT1_TOP_BACK = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT; + /// AV_CH_LAYOUT_7POINT1_TOP_BACK = AV_CH_LAYOUT_5POINT1POINT2_BACK + public static readonly ulong AV_CH_LAYOUT_7POINT1_TOP_BACK = AV_CH_LAYOUT_5POINT1POINT2_BACK; /// AV_CH_LAYOUT_7POINT1_WIDE = (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) public static readonly ulong AV_CH_LAYOUT_7POINT1_WIDE = AV_CH_LAYOUT_5POINT1 | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; /// AV_CH_LAYOUT_7POINT1_WIDE_BACK = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) public static readonly ulong AV_CH_LAYOUT_7POINT1_WIDE_BACK = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; + /// AV_CH_LAYOUT_7POINT1POINT2 = (AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_7POINT1POINT2 = AV_CH_LAYOUT_7POINT1 | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT; + /// AV_CH_LAYOUT_7POINT1POINT4_BACK = (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) + public static readonly ulong AV_CH_LAYOUT_7POINT1POINT4_BACK = AV_CH_LAYOUT_7POINT1POINT2 | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT; /// AV_CH_LAYOUT_CUBE = (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) public static readonly ulong AV_CH_LAYOUT_CUBE = AV_CH_LAYOUT_QUAD | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT | AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT; /// AV_CH_LAYOUT_HEXADECAGONAL = (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) @@ -146,12 +156,15 @@ public static unsafe partial class ffmpeg // public static AV_CHANNEL_LAYOUT_22POINT2 = AV_CHANNEL_LAYOUT_MASK(0x18, AV_CH_LAYOUT_22POINT2); // public static AV_CHANNEL_LAYOUT_2POINT1 = AV_CHANNEL_LAYOUT_MASK(0x3, AV_CH_LAYOUT_2POINT1); // public static AV_CHANNEL_LAYOUT_3POINT1 = AV_CHANNEL_LAYOUT_MASK(0x4, AV_CH_LAYOUT_3POINT1); + // public static AV_CHANNEL_LAYOUT_3POINT1POINT2 = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_3POINT1POINT2); // public static AV_CHANNEL_LAYOUT_4POINT0 = AV_CHANNEL_LAYOUT_MASK(0x4, AV_CH_LAYOUT_4POINT0); // public static AV_CHANNEL_LAYOUT_4POINT1 = AV_CHANNEL_LAYOUT_MASK(0x5, AV_CH_LAYOUT_4POINT1); // public static AV_CHANNEL_LAYOUT_5POINT0 = AV_CHANNEL_LAYOUT_MASK(0x5, AV_CH_LAYOUT_5POINT0); // public static AV_CHANNEL_LAYOUT_5POINT0_BACK = AV_CHANNEL_LAYOUT_MASK(0x5, AV_CH_LAYOUT_5POINT0_BACK); // public static AV_CHANNEL_LAYOUT_5POINT1 = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_5POINT1); // public static AV_CHANNEL_LAYOUT_5POINT1_BACK = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_5POINT1_BACK); + // public static AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_5POINT1POINT2_BACK); + // public static AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK = AV_CHANNEL_LAYOUT_MASK(0xa, AV_CH_LAYOUT_5POINT1POINT4_BACK); // public static AV_CHANNEL_LAYOUT_6POINT0 = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_6POINT0); // public static AV_CHANNEL_LAYOUT_6POINT0_FRONT = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_6POINT0_FRONT); // public static AV_CHANNEL_LAYOUT_6POINT1 = AV_CHANNEL_LAYOUT_MASK(0x7, AV_CH_LAYOUT_6POINT1); @@ -160,10 +173,12 @@ public static unsafe partial class ffmpeg // public static AV_CHANNEL_LAYOUT_7POINT0 = AV_CHANNEL_LAYOUT_MASK(0x7, AV_CH_LAYOUT_7POINT0); // public static AV_CHANNEL_LAYOUT_7POINT0_FRONT = AV_CHANNEL_LAYOUT_MASK(0x7, AV_CH_LAYOUT_7POINT0_FRONT); // public static AV_CHANNEL_LAYOUT_7POINT1 = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_7POINT1); - // public static AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_7POINT1_TOP_BACK); + // public static AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK = AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK; // public static AV_CHANNEL_LAYOUT_7POINT1_WIDE = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_7POINT1_WIDE); // public static AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_7POINT1_WIDE_BACK); - // public static AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER = { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }}; + // public static AV_CHANNEL_LAYOUT_7POINT1POINT2 = AV_CHANNEL_LAYOUT_MASK(0xa, AV_CH_LAYOUT_7POINT1POINT2); + // public static AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK = AV_CHANNEL_LAYOUT_MASK(0xc, AV_CH_LAYOUT_7POINT1POINT4_BACK); + // public static AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER = { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, /* .nb_channels */ 4, /* .u.mask */ { 0 }, /* .opaque */ NULL }; // public static AV_CHANNEL_LAYOUT_CUBE = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_CUBE); // public static AV_CHANNEL_LAYOUT_HEXADECAGONAL = AV_CHANNEL_LAYOUT_MASK(0x10, AV_CH_LAYOUT_HEXADECAGONAL); // public static AV_CHANNEL_LAYOUT_HEXAGONAL = AV_CHANNEL_LAYOUT_MASK(0x6, AV_CH_LAYOUT_HEXAGONAL); @@ -299,6 +314,8 @@ public static unsafe partial class ffmpeg public static readonly int AV_CODEC_ID_IFF_BYTERUN1 = 136; /// AV_CODEC_PROP_BITMAP_SUB = 0x1 << 0x10 public const int AV_CODEC_PROP_BITMAP_SUB = 0x1 << 0x10; + /// AV_CODEC_PROP_FIELDS = 0x1 << 0x4 + public const int AV_CODEC_PROP_FIELDS = 0x1 << 0x4; /// AV_CODEC_PROP_INTRA_ONLY = 0x1 << 0x0 public const int AV_CODEC_PROP_INTRA_ONLY = 0x1 << 0x0; /// AV_CODEC_PROP_LOSSLESS = 0x1 << 0x2 @@ -345,12 +362,16 @@ public static unsafe partial class ffmpeg public const int AV_CPU_FLAG_BMI2 = 0x40000; /// AV_CPU_FLAG_CMOV = 0x1000 public const int AV_CPU_FLAG_CMOV = 0x1000; + /// AV_CPU_FLAG_DOTPROD = 0x1 << 0x8 + public const int AV_CPU_FLAG_DOTPROD = 0x1 << 0x8; /// AV_CPU_FLAG_FMA3 = 0x10000 public const int AV_CPU_FLAG_FMA3 = 0x10000; /// AV_CPU_FLAG_FMA4 = 0x800 public const int AV_CPU_FLAG_FMA4 = 0x800; /// AV_CPU_FLAG_FORCE = 0x80000000U public const uint AV_CPU_FLAG_FORCE = 0x80000000U; + /// AV_CPU_FLAG_I8MM = 0x1 << 0x9 + public const int AV_CPU_FLAG_I8MM = 0x1 << 0x9; /// AV_CPU_FLAG_LASX = 0x1 << 0x1 public const int AV_CPU_FLAG_LASX = 0x1 << 0x1; /// AV_CPU_FLAG_LSX = 0x1 << 0x0 @@ -369,6 +390,8 @@ public static unsafe partial class ffmpeg public const int AV_CPU_FLAG_NEON = 0x1 << 0x5; /// AV_CPU_FLAG_POWER8 = 0x4 public const int AV_CPU_FLAG_POWER8 = 0x4; + /// AV_CPU_FLAG_RVB_ADDR = 0x1 << 0x8 + public const int AV_CPU_FLAG_RVB_ADDR = 0x1 << 0x8; /// AV_CPU_FLAG_RVB_BASIC = 0x1 << 0x7 public const int AV_CPU_FLAG_RVB_BASIC = 0x1 << 0x7; /// AV_CPU_FLAG_RVD = 0x1 << 0x2 @@ -496,6 +519,12 @@ public static unsafe partial class ffmpeg public const int AV_FRAME_FLAG_CORRUPT = 0x1 << 0x0; /// AV_FRAME_FLAG_DISCARD = (1 << 2) public const int AV_FRAME_FLAG_DISCARD = 0x1 << 0x2; + /// AV_FRAME_FLAG_INTERLACED = (1 << 3) + public const int AV_FRAME_FLAG_INTERLACED = 0x1 << 0x3; + /// AV_FRAME_FLAG_KEY = (1 << 1) + public const int AV_FRAME_FLAG_KEY = 0x1 << 0x1; + /// AV_FRAME_FLAG_TOP_FIELD_FIRST = (1 << 4) + public const int AV_FRAME_FLAG_TOP_FIELD_FIRST = 0x1 << 0x4; // public static AV_GCC_VERSION_AT_LEAST = x; // public static AV_GCC_VERSION_AT_MOST = x; /// AV_GET_BUFFER_FLAG_REF = 0x1 << 0x0 @@ -508,6 +537,8 @@ public static unsafe partial class ffmpeg public const int AV_HAVE_BIGENDIAN = 0x0; /// AV_HAVE_FAST_UNALIGNED = 1 public const int AV_HAVE_FAST_UNALIGNED = 0x1; + /// AV_HDR_PLUS_MAX_PAYLOAD_SIZE = 0x38b + public const int AV_HDR_PLUS_MAX_PAYLOAD_SIZE = 0x38b; /// AV_HWACCEL_CODEC_CAP_EXPERIMENTAL = 0x200 public const int AV_HWACCEL_CODEC_CAP_EXPERIMENTAL = 0x200; /// AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = 0x1 << 0x1 @@ -526,6 +557,8 @@ public static unsafe partial class ffmpeg // public static AV_IS_INPUT_DEVICE = (category)((category)(==41) || (category)(==43) || (category)(==45)); // public static AV_IS_OUTPUT_DEVICE = (category)((category)(==40) || (category)(==42) || (category)(==44)); // public static AV_JOIN = a; + /// AV_LEVEL_UNKNOWN = -99 + public const int AV_LEVEL_UNKNOWN = -0x63; // public static AV_LOG_C = (x)((x)(<<0x8)); /// AV_LOG_DEBUG = 48 public const int AV_LOG_DEBUG = 0x30; @@ -634,6 +667,7 @@ public static unsafe partial class ffmpeg public const int AV_PIX_FMT_FLAG_RGB = 0x1 << 0x5; // public static AV_PIX_FMT_GBRAP10 = AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE); // public static AV_PIX_FMT_GBRAP12 = AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE); + // public static AV_PIX_FMT_GBRAP14 = AV_PIX_FMT_NE(GBRAP14BE, GBRAP14LE); // public static AV_PIX_FMT_GBRAP16 = AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE); // public static AV_PIX_FMT_GBRAPF32 = AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE); // public static AV_PIX_FMT_GBRP10 = AV_PIX_FMT_NE(GBRP10BE, GBRP10LE); @@ -654,8 +688,10 @@ public static unsafe partial class ffmpeg // public static AV_PIX_FMT_P012 = AV_PIX_FMT_NE(P012BE, P012LE); // public static AV_PIX_FMT_P016 = AV_PIX_FMT_NE(P016BE, P016LE); // public static AV_PIX_FMT_P210 = AV_PIX_FMT_NE(P210BE, P210LE); + // public static AV_PIX_FMT_P212 = AV_PIX_FMT_NE(P212BE, P212LE); // public static AV_PIX_FMT_P216 = AV_PIX_FMT_NE(P216BE, P216LE); // public static AV_PIX_FMT_P410 = AV_PIX_FMT_NE(P410BE, P410LE); + // public static AV_PIX_FMT_P412 = AV_PIX_FMT_NE(P412BE, P412LE); // public static AV_PIX_FMT_P416 = AV_PIX_FMT_NE(P416BE, P416LE); // public static AV_PIX_FMT_RGB32 = AV_PIX_FMT_NE(ARGB, BGRA); // public static AV_PIX_FMT_RGB32_1 = AV_PIX_FMT_NE(RGBA, ABGR); @@ -719,6 +755,222 @@ public static unsafe partial class ffmpeg // public static av_popcount64 = av_popcount64_c; // public static AV_PRAGMA = (s) _Pragma(#s); // public static av_printf_format = fmtpos; + /// AV_PROFILE_AAC_ELD = 38 + public const int AV_PROFILE_AAC_ELD = 0x26; + /// AV_PROFILE_AAC_HE = 4 + public const int AV_PROFILE_AAC_HE = 0x4; + /// AV_PROFILE_AAC_HE_V2 = 28 + public const int AV_PROFILE_AAC_HE_V2 = 0x1c; + /// AV_PROFILE_AAC_LD = 22 + public const int AV_PROFILE_AAC_LD = 0x16; + /// AV_PROFILE_AAC_LOW = 1 + public const int AV_PROFILE_AAC_LOW = 0x1; + /// AV_PROFILE_AAC_LTP = 3 + public const int AV_PROFILE_AAC_LTP = 0x3; + /// AV_PROFILE_AAC_MAIN = 0 + public const int AV_PROFILE_AAC_MAIN = 0x0; + /// AV_PROFILE_AAC_SSR = 2 + public const int AV_PROFILE_AAC_SSR = 0x2; + /// AV_PROFILE_ARIB_PROFILE_A = 0 + public const int AV_PROFILE_ARIB_PROFILE_A = 0x0; + /// AV_PROFILE_ARIB_PROFILE_C = 1 + public const int AV_PROFILE_ARIB_PROFILE_C = 0x1; + /// AV_PROFILE_AV1_HIGH = 1 + public const int AV_PROFILE_AV1_HIGH = 0x1; + /// AV_PROFILE_AV1_MAIN = 0 + public const int AV_PROFILE_AV1_MAIN = 0x0; + /// AV_PROFILE_AV1_PROFESSIONAL = 2 + public const int AV_PROFILE_AV1_PROFESSIONAL = 0x2; + /// AV_PROFILE_DNXHD = 0 + public const int AV_PROFILE_DNXHD = 0x0; + /// AV_PROFILE_DNXHR_444 = 5 + public const int AV_PROFILE_DNXHR_444 = 0x5; + /// AV_PROFILE_DNXHR_HQ = 3 + public const int AV_PROFILE_DNXHR_HQ = 0x3; + /// AV_PROFILE_DNXHR_HQX = 4 + public const int AV_PROFILE_DNXHR_HQX = 0x4; + /// AV_PROFILE_DNXHR_LB = 1 + public const int AV_PROFILE_DNXHR_LB = 0x1; + /// AV_PROFILE_DNXHR_SQ = 2 + public const int AV_PROFILE_DNXHR_SQ = 0x2; + /// AV_PROFILE_DTS = 20 + public const int AV_PROFILE_DTS = 0x14; + /// AV_PROFILE_DTS_96_24 = 40 + public const int AV_PROFILE_DTS_96_24 = 0x28; + /// AV_PROFILE_DTS_ES = 30 + public const int AV_PROFILE_DTS_ES = 0x1e; + /// AV_PROFILE_DTS_EXPRESS = 70 + public const int AV_PROFILE_DTS_EXPRESS = 0x46; + /// AV_PROFILE_DTS_HD_HRA = 50 + public const int AV_PROFILE_DTS_HD_HRA = 0x32; + /// AV_PROFILE_DTS_HD_MA = 60 + public const int AV_PROFILE_DTS_HD_MA = 0x3c; + /// AV_PROFILE_DTS_HD_MA_X = 61 + public const int AV_PROFILE_DTS_HD_MA_X = 0x3d; + /// AV_PROFILE_DTS_HD_MA_X_IMAX = 62 + public const int AV_PROFILE_DTS_HD_MA_X_IMAX = 0x3e; + /// AV_PROFILE_EAC3_DDP_ATMOS = 30 + public const int AV_PROFILE_EAC3_DDP_ATMOS = 0x1e; + /// AV_PROFILE_EVC_BASELINE = 0 + public const int AV_PROFILE_EVC_BASELINE = 0x0; + /// AV_PROFILE_EVC_MAIN = 1 + public const int AV_PROFILE_EVC_MAIN = 0x1; + /// AV_PROFILE_H264_BASELINE = 66 + public const int AV_PROFILE_H264_BASELINE = 0x42; + /// AV_PROFILE_H264_CAVLC_444 = 44 + public const int AV_PROFILE_H264_CAVLC_444 = 0x2c; + /// AV_PROFILE_H264_CONSTRAINED = (1<<9) + public const int AV_PROFILE_H264_CONSTRAINED = 0x1 << 0x9; + /// AV_PROFILE_H264_CONSTRAINED_BASELINE = (66|AV_PROFILE_H264_CONSTRAINED) + public const int AV_PROFILE_H264_CONSTRAINED_BASELINE = 0x42 | AV_PROFILE_H264_CONSTRAINED; + /// AV_PROFILE_H264_EXTENDED = 88 + public const int AV_PROFILE_H264_EXTENDED = 0x58; + /// AV_PROFILE_H264_HIGH = 100 + public const int AV_PROFILE_H264_HIGH = 0x64; + /// AV_PROFILE_H264_HIGH_10 = 110 + public const int AV_PROFILE_H264_HIGH_10 = 0x6e; + /// AV_PROFILE_H264_HIGH_10_INTRA = (110|AV_PROFILE_H264_INTRA) + public const int AV_PROFILE_H264_HIGH_10_INTRA = 0x6e | AV_PROFILE_H264_INTRA; + /// AV_PROFILE_H264_HIGH_422 = 122 + public const int AV_PROFILE_H264_HIGH_422 = 0x7a; + /// AV_PROFILE_H264_HIGH_422_INTRA = (122|AV_PROFILE_H264_INTRA) + public const int AV_PROFILE_H264_HIGH_422_INTRA = 0x7a | AV_PROFILE_H264_INTRA; + /// AV_PROFILE_H264_HIGH_444 = 144 + public const int AV_PROFILE_H264_HIGH_444 = 0x90; + /// AV_PROFILE_H264_HIGH_444_INTRA = (244|AV_PROFILE_H264_INTRA) + public const int AV_PROFILE_H264_HIGH_444_INTRA = 0xf4 | AV_PROFILE_H264_INTRA; + /// AV_PROFILE_H264_HIGH_444_PREDICTIVE = 244 + public const int AV_PROFILE_H264_HIGH_444_PREDICTIVE = 0xf4; + /// AV_PROFILE_H264_INTRA = (1<<11) + public const int AV_PROFILE_H264_INTRA = 0x1 << 0xb; + /// AV_PROFILE_H264_MAIN = 77 + public const int AV_PROFILE_H264_MAIN = 0x4d; + /// AV_PROFILE_H264_MULTIVIEW_HIGH = 118 + public const int AV_PROFILE_H264_MULTIVIEW_HIGH = 0x76; + /// AV_PROFILE_H264_STEREO_HIGH = 128 + public const int AV_PROFILE_H264_STEREO_HIGH = 0x80; + /// AV_PROFILE_HEVC_MAIN = 1 + public const int AV_PROFILE_HEVC_MAIN = 0x1; + /// AV_PROFILE_HEVC_MAIN_10 = 2 + public const int AV_PROFILE_HEVC_MAIN_10 = 0x2; + /// AV_PROFILE_HEVC_MAIN_STILL_PICTURE = 3 + public const int AV_PROFILE_HEVC_MAIN_STILL_PICTURE = 0x3; + /// AV_PROFILE_HEVC_REXT = 4 + public const int AV_PROFILE_HEVC_REXT = 0x4; + /// AV_PROFILE_HEVC_SCC = 9 + public const int AV_PROFILE_HEVC_SCC = 0x9; + /// AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 32768 + public const int AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 0x8000; + /// AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 1 + public const int AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0x1; + /// AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 2 + public const int AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 0x2; + /// AV_PROFILE_JPEG2000_DCINEMA_2K = 3 + public const int AV_PROFILE_JPEG2000_DCINEMA_2K = 0x3; + /// AV_PROFILE_JPEG2000_DCINEMA_4K = 4 + public const int AV_PROFILE_JPEG2000_DCINEMA_4K = 0x4; + /// AV_PROFILE_KLVA_ASYNC = 1 + public const int AV_PROFILE_KLVA_ASYNC = 0x1; + /// AV_PROFILE_KLVA_SYNC = 0 + public const int AV_PROFILE_KLVA_SYNC = 0x0; + /// AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT = 0xc0 + public const int AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT = 0xc0; + /// AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT = 0xc1 + public const int AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT = 0xc1; + /// AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS = 0xc3 + public const int AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS = 0xc3; + /// AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT = 0xc2 + public const int AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT = 0xc2; + /// AV_PROFILE_MJPEG_JPEG_LS = 0xf7 + public const int AV_PROFILE_MJPEG_JPEG_LS = 0xf7; + /// AV_PROFILE_MPEG2_422 = 0 + public const int AV_PROFILE_MPEG2_422 = 0x0; + /// AV_PROFILE_MPEG2_AAC_HE = 131 + public const int AV_PROFILE_MPEG2_AAC_HE = 0x83; + /// AV_PROFILE_MPEG2_AAC_LOW = 128 + public const int AV_PROFILE_MPEG2_AAC_LOW = 0x80; + /// AV_PROFILE_MPEG2_HIGH = 1 + public const int AV_PROFILE_MPEG2_HIGH = 0x1; + /// AV_PROFILE_MPEG2_MAIN = 4 + public const int AV_PROFILE_MPEG2_MAIN = 0x4; + /// AV_PROFILE_MPEG2_SIMPLE = 5 + public const int AV_PROFILE_MPEG2_SIMPLE = 0x5; + /// AV_PROFILE_MPEG2_SNR_SCALABLE = 3 + public const int AV_PROFILE_MPEG2_SNR_SCALABLE = 0x3; + /// AV_PROFILE_MPEG2_SS = 2 + public const int AV_PROFILE_MPEG2_SS = 0x2; + /// AV_PROFILE_MPEG4_ADVANCED_CODING = 11 + public const int AV_PROFILE_MPEG4_ADVANCED_CODING = 0xb; + /// AV_PROFILE_MPEG4_ADVANCED_CORE = 12 + public const int AV_PROFILE_MPEG4_ADVANCED_CORE = 0xc; + /// AV_PROFILE_MPEG4_ADVANCED_REAL_TIME = 9 + public const int AV_PROFILE_MPEG4_ADVANCED_REAL_TIME = 0x9; + /// AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 13 + public const int AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 0xd; + /// AV_PROFILE_MPEG4_ADVANCED_SIMPLE = 15 + public const int AV_PROFILE_MPEG4_ADVANCED_SIMPLE = 0xf; + /// AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 7 + public const int AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 0x7; + /// AV_PROFILE_MPEG4_CORE = 2 + public const int AV_PROFILE_MPEG4_CORE = 0x2; + /// AV_PROFILE_MPEG4_CORE_SCALABLE = 10 + public const int AV_PROFILE_MPEG4_CORE_SCALABLE = 0xa; + /// AV_PROFILE_MPEG4_HYBRID = 8 + public const int AV_PROFILE_MPEG4_HYBRID = 0x8; + /// AV_PROFILE_MPEG4_MAIN = 3 + public const int AV_PROFILE_MPEG4_MAIN = 0x3; + /// AV_PROFILE_MPEG4_N_BIT = 4 + public const int AV_PROFILE_MPEG4_N_BIT = 0x4; + /// AV_PROFILE_MPEG4_SCALABLE_TEXTURE = 5 + public const int AV_PROFILE_MPEG4_SCALABLE_TEXTURE = 0x5; + /// AV_PROFILE_MPEG4_SIMPLE = 0 + public const int AV_PROFILE_MPEG4_SIMPLE = 0x0; + /// AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 6 + public const int AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 0x6; + /// AV_PROFILE_MPEG4_SIMPLE_SCALABLE = 1 + public const int AV_PROFILE_MPEG4_SIMPLE_SCALABLE = 0x1; + /// AV_PROFILE_MPEG4_SIMPLE_STUDIO = 14 + public const int AV_PROFILE_MPEG4_SIMPLE_STUDIO = 0xe; + /// AV_PROFILE_PRORES_4444 = 4 + public const int AV_PROFILE_PRORES_4444 = 0x4; + /// AV_PROFILE_PRORES_HQ = 3 + public const int AV_PROFILE_PRORES_HQ = 0x3; + /// AV_PROFILE_PRORES_LT = 1 + public const int AV_PROFILE_PRORES_LT = 0x1; + /// AV_PROFILE_PRORES_PROXY = 0 + public const int AV_PROFILE_PRORES_PROXY = 0x0; + /// AV_PROFILE_PRORES_STANDARD = 2 + public const int AV_PROFILE_PRORES_STANDARD = 0x2; + /// AV_PROFILE_PRORES_XQ = 5 + public const int AV_PROFILE_PRORES_XQ = 0x5; + /// AV_PROFILE_RESERVED = -100 + public const int AV_PROFILE_RESERVED = -0x64; + /// AV_PROFILE_SBC_MSBC = 1 + public const int AV_PROFILE_SBC_MSBC = 0x1; + /// AV_PROFILE_TRUEHD_ATMOS = 30 + public const int AV_PROFILE_TRUEHD_ATMOS = 0x1e; + /// AV_PROFILE_UNKNOWN = -99 + public const int AV_PROFILE_UNKNOWN = -0x63; + /// AV_PROFILE_VC1_ADVANCED = 3 + public const int AV_PROFILE_VC1_ADVANCED = 0x3; + /// AV_PROFILE_VC1_COMPLEX = 2 + public const int AV_PROFILE_VC1_COMPLEX = 0x2; + /// AV_PROFILE_VC1_MAIN = 1 + public const int AV_PROFILE_VC1_MAIN = 0x1; + /// AV_PROFILE_VC1_SIMPLE = 0 + public const int AV_PROFILE_VC1_SIMPLE = 0x0; + /// AV_PROFILE_VP9_0 = 0 + public const int AV_PROFILE_VP9_0 = 0x0; + /// AV_PROFILE_VP9_1 = 1 + public const int AV_PROFILE_VP9_1 = 0x1; + /// AV_PROFILE_VP9_2 = 2 + public const int AV_PROFILE_VP9_2 = 0x2; + /// AV_PROFILE_VP9_3 = 3 + public const int AV_PROFILE_VP9_3 = 0x3; + /// AV_PROFILE_VVC_MAIN_10 = 1 + public const int AV_PROFILE_VVC_MAIN_10 = 0x1; + /// AV_PROFILE_VVC_MAIN_10_444 = 33 + public const int AV_PROFILE_VVC_MAIN_10_444 = 0x21; /// AV_PROGRAM_RUNNING = 1 public const int AV_PROGRAM_RUNNING = 0x1; /// AV_PTS_WRAP_ADD_OFFSET = 1 @@ -815,6 +1067,8 @@ public static unsafe partial class ffmpeg public const int AVFILTER_FLAG_DYNAMIC_INPUTS = 0x1 << 0x0; /// AVFILTER_FLAG_DYNAMIC_OUTPUTS = 0x1 << 0x1 public const int AVFILTER_FLAG_DYNAMIC_OUTPUTS = 0x1 << 0x1; + /// AVFILTER_FLAG_HWDEVICE = 0x1 << 0x4 + public const int AVFILTER_FLAG_HWDEVICE = 0x1 << 0x4; /// AVFILTER_FLAG_METADATA_ONLY = 0x1 << 0x3 public const int AVFILTER_FLAG_METADATA_ONLY = 0x1 << 0x3; /// AVFILTER_FLAG_SLICE_THREADS = 0x1 << 0x2 @@ -963,46 +1217,80 @@ public static unsafe partial class ffmpeg /// AVSTREAM_INIT_IN_WRITE_HEADER = 0 public const int AVSTREAM_INIT_IN_WRITE_HEADER = 0x0; // public static AVUNERROR = (e) (-(e)); + /// FF_API_ALLOW_FLUSH = (LIBAVFORMAT_VERSION_MAJOR < 61) + public const bool FF_API_ALLOW_FLUSH = LIBAVFORMAT_VERSION_MAJOR < 0x3d; /// FF_API_AV_FOPEN_UTF8 = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_AV_FOPEN_UTF8 = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_AVCODEC_CHROMA_POS = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_AVCODEC_CHROMA_POS = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_AVCTX_FRAME_NUMBER = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_AVCTX_FRAME_NUMBER = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_AVFFT = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_AVFFT = LIBAVCODEC_VERSION_MAJOR < 0x3e; /// FF_API_AVFORMAT_IO_CLOSE = (LIBAVFORMAT_VERSION_MAJOR < 61) public const bool FF_API_AVFORMAT_IO_CLOSE = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_AVIO_WRITE_NONCONST = (LIBAVFORMAT_VERSION_MAJOR < 61) + public const bool FF_API_AVIO_WRITE_NONCONST = LIBAVFORMAT_VERSION_MAJOR < 0x3d; /// FF_API_AVIODIRCONTEXT = (LIBAVFORMAT_VERSION_MAJOR < 61) public const bool FF_API_AVIODIRCONTEXT = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_AVSTREAM_SIDE_DATA = (LIBAVFORMAT_VERSION_MAJOR < 61) + public const bool FF_API_AVSTREAM_SIDE_DATA = LIBAVFORMAT_VERSION_MAJOR < 0x3d; /// FF_API_AYUV_CODECID = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_AYUV_CODECID = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_COMPUTE_PKT_FIELDS2 = (LIBAVFORMAT_VERSION_MAJOR < 61) public const bool FF_API_COMPUTE_PKT_FIELDS2 = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_DROPCHANGED = (LIBAVCODEC_VERSION_MAJOR < 61) + public const bool FF_API_DROPCHANGED = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_FF_PROFILE_LEVEL = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_FF_PROFILE_LEVEL = LIBAVCODEC_VERSION_MAJOR < 0x3e; /// FF_API_FIFO_OLD_API = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_FIFO_OLD_API = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_FIFO_PEEK2 = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_FIFO_PEEK2 = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_FRAME_KEY = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_FRAME_KEY = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_FRAME_PICTURE_NUMBER = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_FRAME_PICTURE_NUMBER = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_FRAME_PKT = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_FRAME_PKT = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_GET_END_PTS = (LIBAVFORMAT_VERSION_MAJOR < 61) public const bool FF_API_GET_END_PTS = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_HDR_VIVID_THREE_SPLINE = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_HDR_VIVID_THREE_SPLINE = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_IDCT_NONE = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_IDCT_NONE = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_INIT_PACKET = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_INIT_PACKET = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_INTERLACED_FRAME = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_INTERLACED_FRAME = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_LAVF_SHORTEST = (LIBAVFORMAT_VERSION_MAJOR < 61) + public const bool FF_API_LAVF_SHORTEST = LIBAVFORMAT_VERSION_MAJOR < 0x3d; + /// FF_API_LIBPLACEBO_OPTS = LIBAVFILTER_VERSION_MAJOR < 0xa + public const bool FF_API_LIBPLACEBO_OPTS = LIBAVFILTER_VERSION_MAJOR < 0xa; /// FF_API_OLD_CHANNEL_LAYOUT = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_OLD_CHANNEL_LAYOUT = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_PALETTE_HAS_CHANGED = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_PALETTE_HAS_CHANGED = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_PKT_DURATION = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_PKT_DURATION = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_R_FRAME_RATE = 1 public const int FF_API_R_FRAME_RATE = 0x1; /// FF_API_REORDERED_OPAQUE = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_REORDERED_OPAQUE = LIBAVUTIL_VERSION_MAJOR < 0x3b; + /// FF_API_SLICE_OFFSET = (LIBAVCODEC_VERSION_MAJOR < 61) + public const bool FF_API_SLICE_OFFSET = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_SUBFRAMES = (LIBAVCODEC_VERSION_MAJOR < 61) + public const bool FF_API_SUBFRAMES = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_SVTAV1_OPTS = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_SVTAV1_OPTS = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_TICKS_PER_FRAME = (LIBAVCODEC_VERSION_MAJOR < 61) + public const bool FF_API_TICKS_PER_FRAME = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_VT_HWACCEL_CONTEXT = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_VT_HWACCEL_CONTEXT = LIBAVCODEC_VERSION_MAJOR < 0x3d; /// FF_API_VT_OUTPUT_CALLBACK = (LIBAVCODEC_VERSION_MAJOR < 61) public const bool FF_API_VT_OUTPUT_CALLBACK = LIBAVCODEC_VERSION_MAJOR < 0x3d; + /// FF_API_VULKAN_CONTIGUOUS_MEMORY = (LIBAVUTIL_VERSION_MAJOR < 59) + public const bool FF_API_VULKAN_CONTIGUOUS_MEMORY = LIBAVUTIL_VERSION_MAJOR < 0x3b; /// FF_API_XVMC = (LIBAVUTIL_VERSION_MAJOR < 59) public const bool FF_API_XVMC = LIBAVUTIL_VERSION_MAJOR < 0x3b; // public static FF_ARRAY_ELEMS = (a) (sizeof(a) / sizeof((a)[0])); @@ -1261,6 +1549,16 @@ public static unsafe partial class ffmpeg public const int FF_PROFILE_DTS_HD_HRA = 0x32; /// FF_PROFILE_DTS_HD_MA = 0x3c public const int FF_PROFILE_DTS_HD_MA = 0x3c; + /// FF_PROFILE_DTS_HD_MA_X = 0x3d + public const int FF_PROFILE_DTS_HD_MA_X = 0x3d; + /// FF_PROFILE_DTS_HD_MA_X_IMAX = 0x3e + public const int FF_PROFILE_DTS_HD_MA_X_IMAX = 0x3e; + /// FF_PROFILE_EAC3_DDP_ATMOS = 0x1e + public const int FF_PROFILE_EAC3_DDP_ATMOS = 0x1e; + /// FF_PROFILE_EVC_BASELINE = 0x0 + public const int FF_PROFILE_EVC_BASELINE = 0x0; + /// FF_PROFILE_EVC_MAIN = 0x1 + public const int FF_PROFILE_EVC_MAIN = 0x1; /// FF_PROFILE_H264_BASELINE = 0x42 public const int FF_PROFILE_H264_BASELINE = 0x42; /// FF_PROFILE_H264_CAVLC_444 = 0x2c @@ -1303,6 +1601,8 @@ public static unsafe partial class ffmpeg public const int FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 0x3; /// FF_PROFILE_HEVC_REXT = 0x4 public const int FF_PROFILE_HEVC_REXT = 0x4; + /// FF_PROFILE_HEVC_SCC = 0x9 + public const int FF_PROFILE_HEVC_SCC = 0x9; /// FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 0x8000 public const int FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION = 0x8000; /// FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0x1 @@ -1391,6 +1691,8 @@ public static unsafe partial class ffmpeg public const int FF_PROFILE_RESERVED = -0x64; /// FF_PROFILE_SBC_MSBC = 0x1 public const int FF_PROFILE_SBC_MSBC = 0x1; + /// FF_PROFILE_TRUEHD_ATMOS = 0x1e + public const int FF_PROFILE_TRUEHD_ATMOS = 0x1e; /// FF_PROFILE_UNKNOWN = -0x63 public const int FF_PROFILE_UNKNOWN = -0x63; /// FF_PROFILE_VC1_ADVANCED = 0x3 @@ -1456,10 +1758,10 @@ public static unsafe partial class ffmpeg public static readonly int LIBAVCODEC_VERSION_INT = AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO); /// LIBAVCODEC_VERSION_MAJOR = 60 public const int LIBAVCODEC_VERSION_MAJOR = 0x3c; - /// LIBAVCODEC_VERSION_MICRO = 0x64 - public const int LIBAVCODEC_VERSION_MICRO = 0x64; - /// LIBAVCODEC_VERSION_MINOR = 0x3 - public const int LIBAVCODEC_VERSION_MINOR = 0x3; + /// LIBAVCODEC_VERSION_MICRO = 0x66 + public const int LIBAVCODEC_VERSION_MICRO = 0x66; + /// LIBAVCODEC_VERSION_MINOR = 0x1f + public const int LIBAVCODEC_VERSION_MINOR = 0x1f; /// LIBAVDEVICE_BUILD = LIBAVDEVICE_VERSION_INT public static readonly int LIBAVDEVICE_BUILD = LIBAVDEVICE_VERSION_INT; /// LIBAVDEVICE_IDENT = "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) @@ -1472,8 +1774,8 @@ public static unsafe partial class ffmpeg public const int LIBAVDEVICE_VERSION_MAJOR = 0x3c; /// LIBAVDEVICE_VERSION_MICRO = 100 public const int LIBAVDEVICE_VERSION_MICRO = 0x64; - /// LIBAVDEVICE_VERSION_MINOR = 1 - public const int LIBAVDEVICE_VERSION_MINOR = 0x1; + /// LIBAVDEVICE_VERSION_MINOR = 3 + public const int LIBAVDEVICE_VERSION_MINOR = 0x3; /// LIBAVFILTER_BUILD = LIBAVFILTER_VERSION_INT public static readonly int LIBAVFILTER_BUILD = LIBAVFILTER_VERSION_INT; /// LIBAVFILTER_IDENT = "Lavfi" @@ -1486,8 +1788,8 @@ public static unsafe partial class ffmpeg public const int LIBAVFILTER_VERSION_MAJOR = 0x9; /// LIBAVFILTER_VERSION_MICRO = 0x64 public const int LIBAVFILTER_VERSION_MICRO = 0x64; - /// LIBAVFILTER_VERSION_MINOR = 0x3 - public const int LIBAVFILTER_VERSION_MINOR = 0x3; + /// LIBAVFILTER_VERSION_MINOR = 0xc + public const int LIBAVFILTER_VERSION_MINOR = 0xc; /// LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT public static readonly int LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; /// LIBAVFORMAT_IDENT = "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) @@ -1500,8 +1802,8 @@ public static unsafe partial class ffmpeg public const int LIBAVFORMAT_VERSION_MAJOR = 0x3c; /// LIBAVFORMAT_VERSION_MICRO = 100 public const int LIBAVFORMAT_VERSION_MICRO = 0x64; - /// LIBAVFORMAT_VERSION_MINOR = 3 - public const int LIBAVFORMAT_VERSION_MINOR = 0x3; + /// LIBAVFORMAT_VERSION_MINOR = 16 + public const int LIBAVFORMAT_VERSION_MINOR = 0x10; /// LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT public static readonly int LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT; /// LIBAVUTIL_IDENT = "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) @@ -1514,8 +1816,8 @@ public static unsafe partial class ffmpeg public const int LIBAVUTIL_VERSION_MAJOR = 0x3a; /// LIBAVUTIL_VERSION_MICRO = 100 public const int LIBAVUTIL_VERSION_MICRO = 0x64; - /// LIBAVUTIL_VERSION_MINOR = 2 - public const int LIBAVUTIL_VERSION_MINOR = 0x2; + /// LIBAVUTIL_VERSION_MINOR = 29 + public const int LIBAVUTIL_VERSION_MINOR = 0x1d; /// LIBPOSTPROC_BUILD = LIBPOSTPROC_VERSION_INT public static readonly int LIBPOSTPROC_BUILD = LIBPOSTPROC_VERSION_INT; /// LIBPOSTPROC_IDENT = "postproc" @@ -1528,8 +1830,8 @@ public static unsafe partial class ffmpeg public const int LIBPOSTPROC_VERSION_MAJOR = 0x39; /// LIBPOSTPROC_VERSION_MICRO = 0x64 public const int LIBPOSTPROC_VERSION_MICRO = 0x64; - /// LIBPOSTPROC_VERSION_MINOR = 0x1 - public const int LIBPOSTPROC_VERSION_MINOR = 0x1; + /// LIBPOSTPROC_VERSION_MINOR = 0x3 + public const int LIBPOSTPROC_VERSION_MINOR = 0x3; /// LIBSWRESAMPLE_BUILD = LIBSWRESAMPLE_VERSION_INT public static readonly int LIBSWRESAMPLE_BUILD = LIBSWRESAMPLE_VERSION_INT; /// LIBSWRESAMPLE_IDENT = "SwR" @@ -1542,8 +1844,8 @@ public static unsafe partial class ffmpeg public const int LIBSWRESAMPLE_VERSION_MAJOR = 0x4; /// LIBSWRESAMPLE_VERSION_MICRO = 0x64 public const int LIBSWRESAMPLE_VERSION_MICRO = 0x64; - /// LIBSWRESAMPLE_VERSION_MINOR = 0xa - public const int LIBSWRESAMPLE_VERSION_MINOR = 0xa; + /// LIBSWRESAMPLE_VERSION_MINOR = 0xc + public const int LIBSWRESAMPLE_VERSION_MINOR = 0xc; /// LIBSWSCALE_BUILD = LIBSWSCALE_VERSION_INT public static readonly int LIBSWSCALE_BUILD = LIBSWSCALE_VERSION_INT; /// LIBSWSCALE_IDENT = "SwS" @@ -1556,26 +1858,60 @@ public static unsafe partial class ffmpeg public const int LIBSWSCALE_VERSION_MAJOR = 0x7; /// LIBSWSCALE_VERSION_MICRO = 0x64 public const int LIBSWSCALE_VERSION_MICRO = 0x64; - /// LIBSWSCALE_VERSION_MINOR = 0x1 - public const int LIBSWSCALE_VERSION_MINOR = 0x1; + /// LIBSWSCALE_VERSION_MINOR = 0x5 + public const int LIBSWSCALE_VERSION_MINOR = 0x5; + /// M_1_PI = 0.31830988618379067154 + public const double M_1_PI = 0.3183098861837907D; + /// M_1_PIf = 0.31830988618379067154f + public const float M_1_PIf = 0.31830987F; + /// M_2_PI = 0.63661977236758134308 + public const double M_2_PI = 0.6366197723675814D; + /// M_2_PIf = 0.63661977236758134308f + public const float M_2_PIf = 0.63661975F; + /// M_2_SQRTPI = 1.12837916709551257390 + public const double M_2_SQRTPI = 1.1283791670955126D; + /// M_2_SQRTPIf = 1.12837916709551257390f + public const float M_2_SQRTPIf = 1.1283792F; /// M_E = 2.7182818284590452354 public const double M_E = 2.718281828459045D; + /// M_Ef = 2.7182818284590452354f + public const float M_Ef = 2.7182817F; /// M_LN10 = 2.30258509299404568402 public const double M_LN10 = 2.302585092994046D; + /// M_LN10f = 2.30258509299404568402f + public const float M_LN10f = 2.3025851F; /// M_LN2 = 0.69314718055994530942 public const double M_LN2 = 0.6931471805599453D; + /// M_LN2f = 0.69314718055994530942f + public const float M_LN2f = 0.6931472F; /// M_LOG2_10 = 3.32192809488736234787 public const double M_LOG2_10 = 3.321928094887362D; + /// M_LOG2_10f = 3.32192809488736234787f + public const float M_LOG2_10f = 3.321928F; /// M_PHI = 1.61803398874989484820 public const double M_PHI = 1.618033988749895D; + /// M_PHIf = 1.61803398874989484820f + public const float M_PHIf = 1.618034F; /// M_PI = 3.14159265358979323846 public const double M_PI = 3.141592653589793D; /// M_PI_2 = 1.57079632679489661923 public const double M_PI_2 = 1.5707963267948966D; + /// M_PI_2f = 1.57079632679489661923f + public const float M_PI_2f = 1.5707964F; + /// M_PI_4 = 0.78539816339744830962 + public const double M_PI_4 = 0.7853981633974483D; + /// M_PI_4f = 0.78539816339744830962f + public const float M_PI_4f = 0.7853982F; + /// M_PIf = 3.14159265358979323846f + public const float M_PIf = 3.1415927F; /// M_SQRT1_2 = 0.70710678118654752440 public const double M_SQRT1_2 = 0.7071067811865476D; + /// M_SQRT1_2f = 0.70710678118654752440f + public const float M_SQRT1_2f = 0.70710677F; /// M_SQRT2 = 1.41421356237309504880 public const double M_SQRT2 = 1.4142135623730951D; + /// M_SQRT2f = 1.41421356237309504880f + public const float M_SQRT2f = 1.4142135F; // public static MKBETAG = a; // public static MKTAG = a; /// PARSER_FLAG_COMPLETE_FRAMES = 0x1 diff --git a/FFmpeg.AutoGen/generated/vectors.g.cs b/FFmpeg.AutoGen/generated/vectors.g.cs index d586578..d03f98b 100644 --- a/FFmpeg.AutoGen/generated/vectors.g.cs +++ b/FFmpeg.AutoGen/generated/vectors.g.cs @@ -65,6 +65,10 @@ public static unsafe partial class vectors public delegate int av_audio_fifo_write_delegate(AVAudioFifo* @af, void** @data, int @nb_samples); public static av_audio_fifo_write_delegate av_audio_fifo_write; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate double av_bessel_i0_delegate(double @x); + public static av_bessel_i0_delegate av_bessel_i0; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void av_bprint_channel_layout_delegate(AVBPrint* @bp, int @nb_channels, ulong @channel_layout); public static av_bprint_channel_layout_delegate av_bprint_channel_layout; @@ -710,6 +714,14 @@ public delegate void av_dump_format_delegate(AVFormatContext* @ic, int @index, public delegate AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data_delegate(AVFrame* @frame); public static av_dynamic_hdr_plus_create_side_data_delegate av_dynamic_hdr_plus_create_side_data; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dynamic_hdr_plus_from_t35_delegate(AVDynamicHDRPlus* @s, byte* @data, ulong @size); + public static av_dynamic_hdr_plus_from_t35_delegate av_dynamic_hdr_plus_from_t35; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dynamic_hdr_plus_to_t35_delegate(AVDynamicHDRPlus* @s, byte** @data, ulong* @size); + public static av_dynamic_hdr_plus_to_t35_delegate av_dynamic_hdr_plus_to_t35; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void av_dynarray_add_delegate(void* @tab_ptr, int* @nb_ptr, void* @elem); public static av_dynarray_add_delegate av_dynarray_add; @@ -896,6 +908,10 @@ public delegate int av_filename_number_test_delegate( public delegate void av_frame_remove_side_data_delegate(AVFrame* @frame, AVFrameSideDataType @type); public static av_frame_remove_side_data_delegate av_frame_remove_side_data; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_replace_delegate(AVFrame* @dst, AVFrame* @src); + public static av_frame_replace_delegate av_frame_replace; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] public delegate string av_frame_side_data_name_delegate(AVFrameSideDataType @type); @@ -1285,7 +1301,7 @@ public delegate AVHWDeviceType av_hwdevice_find_type_by_name_delegate( public static av_image_check_size2_delegate av_image_check_size2; [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void av_image_copy_delegate(ref byte_ptrArray4 @dst_data, ref int_array4 @dst_linesizes, in byte_ptrArray4 @src_data, in int_array4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); + public delegate void av_image_copy_delegate(ref byte_ptrArray4 @dst_data, in int_array4 @dst_linesizes, in byte_ptrArray4 @src_data, in int_array4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); public static av_image_copy_delegate av_image_copy; [UnmanagedFunctionPointer(CallingConvention.Cdecl)] @@ -2056,11 +2072,31 @@ public delegate int av_opt_set_video_rate_delegate(void* @obj, public delegate int av_packet_shrink_side_data_delegate(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size); public static av_packet_shrink_side_data_delegate av_packet_shrink_side_data; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPacketSideData* av_packet_side_data_add_delegate(AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags); + public static av_packet_side_data_add_delegate av_packet_side_data_add; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_side_data_free_delegate(AVPacketSideData** @sd, int* @nb_sd); + public static av_packet_side_data_free_delegate av_packet_side_data_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPacketSideData* av_packet_side_data_get_delegate(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type); + public static av_packet_side_data_get_delegate av_packet_side_data_get; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] public delegate string av_packet_side_data_name_delegate(AVPacketSideDataType @type); public static av_packet_side_data_name_delegate av_packet_side_data_name; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPacketSideData* av_packet_side_data_new_delegate(AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags); + public static av_packet_side_data_new_delegate av_packet_side_data_new; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_side_data_remove_delegate(AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type); + public static av_packet_side_data_remove_delegate av_packet_side_data_remove; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int av_packet_unpack_dictionary_delegate(byte* @data, ulong @size, AVDictionary** @dict); public static av_packet_unpack_dictionary_delegate av_packet_unpack_dictionary; diff --git a/FFmpeg/bin/x64/avcodec-60.dll b/FFmpeg/bin/x64/avcodec-60.dll index d79d7a6..62c811a 100644 Binary files a/FFmpeg/bin/x64/avcodec-60.dll and b/FFmpeg/bin/x64/avcodec-60.dll differ diff --git a/FFmpeg/bin/x64/avdevice-60.dll b/FFmpeg/bin/x64/avdevice-60.dll index 3058b43..dd66976 100644 Binary files a/FFmpeg/bin/x64/avdevice-60.dll and b/FFmpeg/bin/x64/avdevice-60.dll differ diff --git a/FFmpeg/bin/x64/avfilter-9.dll b/FFmpeg/bin/x64/avfilter-9.dll index b266335..6d736ae 100644 Binary files a/FFmpeg/bin/x64/avfilter-9.dll and b/FFmpeg/bin/x64/avfilter-9.dll differ diff --git a/FFmpeg/bin/x64/avformat-60.dll b/FFmpeg/bin/x64/avformat-60.dll index 9534bc6..d42304f 100644 Binary files a/FFmpeg/bin/x64/avformat-60.dll and b/FFmpeg/bin/x64/avformat-60.dll differ diff --git a/FFmpeg/bin/x64/avutil-58.dll b/FFmpeg/bin/x64/avutil-58.dll index 53b4aa5..88af2e2 100644 Binary files a/FFmpeg/bin/x64/avutil-58.dll and b/FFmpeg/bin/x64/avutil-58.dll differ diff --git a/FFmpeg/bin/x64/postproc-57.dll b/FFmpeg/bin/x64/postproc-57.dll index 8442ec9..1f6fa43 100644 Binary files a/FFmpeg/bin/x64/postproc-57.dll and b/FFmpeg/bin/x64/postproc-57.dll differ diff --git a/FFmpeg/bin/x64/swresample-4.dll b/FFmpeg/bin/x64/swresample-4.dll index a4bec2d..1de5de8 100644 Binary files a/FFmpeg/bin/x64/swresample-4.dll and b/FFmpeg/bin/x64/swresample-4.dll differ diff --git a/FFmpeg/bin/x64/swscale-7.dll b/FFmpeg/bin/x64/swscale-7.dll index 8a4a1d7..4e350f7 100644 Binary files a/FFmpeg/bin/x64/swscale-7.dll and b/FFmpeg/bin/x64/swscale-7.dll differ diff --git a/FFmpeg/include/libavcodec/avcodec.h b/FFmpeg/include/libavcodec/avcodec.h index 39881a1..7fb44e2 100644 --- a/FFmpeg/include/libavcodec/avcodec.h +++ b/FFmpeg/include/libavcodec/avcodec.h @@ -31,6 +31,7 @@ #include "libavutil/attributes.h" #include "libavutil/avutil.h" #include "libavutil/buffer.h" +#include "libavutil/channel_layout.h" #include "libavutil/dict.h" #include "libavutil/frame.h" #include "libavutil/log.h" @@ -38,8 +39,6 @@ #include "libavutil/rational.h" #include "codec.h" -#include "codec_desc.h" -#include "codec_par.h" #include "codec_id.h" #include "defs.h" #include "packet.h" @@ -49,8 +48,13 @@ * to avoid unnecessary rebuilds. When included externally, keep including * the full version information. */ #include "version.h" + +#include "codec_desc.h" +#include "codec_par.h" #endif +struct AVCodecParameters; + /** * @defgroup libavc libavcodec * Encoding/Decoding Library @@ -226,11 +230,15 @@ typedef struct RcOverride{ * Use qpel MC. */ #define AV_CODEC_FLAG_QPEL (1 << 4) +#if FF_API_DROPCHANGED /** * Don't output frames whose parameters differ from first * decoded frame in stream. + * + * @deprecated callers should implement this functionality in their own code */ #define AV_CODEC_FLAG_DROPCHANGED (1 << 5) +#endif /** * Request the encoder to output reconstructed frames, i.e.\ frames that would * be produced by decoding the encoded bistream. These frames may be retrieved @@ -239,11 +247,20 @@ typedef struct RcOverride{ * * Should only be used with encoders flagged with the * @ref AV_CODEC_CAP_ENCODER_RECON_FRAME capability. + * + * @note + * Each reconstructed frame returned by the encoder corresponds to the last + * encoded packet, i.e. the frames are returned in coded order rather than + * presentation order. + * + * @note + * Frame parameters (like pixel format or dimensions) do not have to match the + * AVCodecContext values. Make sure to use the values from the returned frame. */ #define AV_CODEC_FLAG_RECON_FRAME (1 << 6) /** * @par decoding - * Request the decoder to propagate each packets AVPacket.opaque and + * Request the decoder to propagate each packet's AVPacket.opaque and * AVPacket.opaque_ref to its corresponding output AVFrame. * * @par encoding: @@ -408,8 +425,6 @@ typedef struct RcOverride{ */ #define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0) -struct AVCodecInternal; - /** * main external API structure. * New fields can be added to the end with minor version bumps. @@ -547,14 +562,22 @@ typedef struct AVCodecContext { */ AVRational time_base; +#if FF_API_TICKS_PER_FRAME /** * 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 ... * * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. + * + * @deprecated + * - decoding: Use AVCodecDescriptor.props & AV_CODEC_PROP_FIELDS + * - encoding: Set AVCodecContext.framerate instead + * */ + attribute_deprecated int ticks_per_frame; +#endif /** * Codec delay. @@ -771,11 +794,13 @@ typedef struct AVCodecContext { */ float dark_masking; +#if FF_API_SLICE_OFFSET /** * slice count * - encoding: Set by libavcodec. * - decoding: Set by user (or 0). */ + attribute_deprecated int slice_count; /** @@ -783,7 +808,9 @@ typedef struct AVCodecContext { * - encoding: Set/allocated by libavcodec. * - decoding: Set/allocated by user (or NULL). */ + attribute_deprecated int *slice_offset; +#endif /** * sample aspect ratio (0 if unknown) @@ -1003,8 +1030,11 @@ typedef struct AVCodecContext { /** * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec + * - 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. */ enum AVColorRange color_range; @@ -1234,7 +1264,7 @@ typedef struct AVCodecContext { /** * decoder bitstream buffer size * - encoding: Set by user. - * - decoding: unused + * - decoding: May be set by libavcodec. */ int rc_buffer_size; @@ -1561,8 +1591,12 @@ typedef struct AVCodecContext { * profile * - encoding: Set by user. * - decoding: Set by libavcodec. + * See the AV_PROFILE_* defines in defs.h. */ int profile; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following defines are deprecated; use AV_PROFILE_* + * in defs.h instead. */ #define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_RESERVED -100 @@ -1584,12 +1618,19 @@ typedef struct AVCodecContext { #define FF_PROFILE_DNXHR_HQX 4 #define FF_PROFILE_DNXHR_444 5 -#define FF_PROFILE_DTS 20 -#define FF_PROFILE_DTS_ES 30 -#define FF_PROFILE_DTS_96_24 40 -#define FF_PROFILE_DTS_HD_HRA 50 -#define FF_PROFILE_DTS_HD_MA 60 -#define FF_PROFILE_DTS_EXPRESS 70 +#define FF_PROFILE_DTS 20 +#define FF_PROFILE_DTS_ES 30 +#define FF_PROFILE_DTS_96_24 40 +#define FF_PROFILE_DTS_HD_HRA 50 +#define FF_PROFILE_DTS_HD_MA 60 +#define FF_PROFILE_DTS_EXPRESS 70 +#define FF_PROFILE_DTS_HD_MA_X 61 +#define FF_PROFILE_DTS_HD_MA_X_IMAX 62 + + +#define FF_PROFILE_EAC3_DDP_ATMOS 30 + +#define FF_PROFILE_TRUEHD_ATMOS 30 #define FF_PROFILE_MPEG2_422 0 #define FF_PROFILE_MPEG2_HIGH 1 @@ -1654,6 +1695,7 @@ typedef struct AVCodecContext { #define FF_PROFILE_HEVC_MAIN_10 2 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3 #define FF_PROFILE_HEVC_REXT 4 +#define FF_PROFILE_HEVC_SCC 9 #define FF_PROFILE_VVC_MAIN_10 1 #define FF_PROFILE_VVC_MAIN_10_444 33 @@ -1683,13 +1725,24 @@ typedef struct AVCodecContext { #define FF_PROFILE_KLVA_SYNC 0 #define FF_PROFILE_KLVA_ASYNC 1 +#define FF_PROFILE_EVC_BASELINE 0 +#define FF_PROFILE_EVC_MAIN 1 +#endif + /** - * level - * - encoding: Set by user. + * 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. */ int level; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN + * in defs.h instead. */ #define FF_LEVEL_UNKNOWN -99 +#endif /** * Skip loop filtering for selected frames. @@ -1757,9 +1810,9 @@ typedef struct AVCodecContext { enum AVPixelFormat sw_pix_fmt; /** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * - encoding unused. - * - decoding set by user. + * Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. + * - encoding: unused. + * - decoding: set by user. */ AVRational pkt_timebase; @@ -1768,7 +1821,7 @@ typedef struct AVCodecContext { * - encoding: unused. * - decoding: set by libavcodec. */ - const AVCodecDescriptor *codec_descriptor; + const struct AVCodecDescriptor *codec_descriptor; /** * Current statistics for PTS correction. @@ -1856,7 +1909,7 @@ typedef struct AVCodecContext { /** * Additional data associated with the entire coded stream. * - * - decoding: unused + * - decoding: may be set by user before calling avcodec_open2(). * - encoding: may be set by libavcodec after avcodec_open2(). */ AVPacketSideData *coded_side_data; @@ -2107,120 +2160,6 @@ typedef struct AVHWAccel { * see AV_HWACCEL_CODEC_CAP_* */ int capabilities; - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - - /** - * Allocate a custom buffer - */ - int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); - - /** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - */ - int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for parameter data (SPS/PPS/VPS etc). - * - * Useful for hardware decoders which keep persistent state about the - * video parameters, and need to receive any changes to update that state. - * - * @param avctx the codec context - * @param type the nal unit type - * @param buf the nal unit data buffer - * @param buf_size the size of the nal unit in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - */ - int (*end_frame)(AVCodecContext *avctx); - - /** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - */ - int frame_priv_data_size; - - /** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - */ - int (*init)(AVCodecContext *avctx); - - /** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - */ - int (*uninit)(AVCodecContext *avctx); - - /** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - */ - int priv_data_size; - - /** - * Internal hwaccel capabilities. - */ - int caps_internal; - - /** - * Fill the given hw_frames context with current codec parameters. Called - * from get_format. Refer to avcodec_get_hw_frames_parameters() for - * details. - * - * This CAN be called before AVHWAccel.init is called, and you must assume - * that avctx->hwaccel_priv_data is invalid. - */ - int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); } AVHWAccel; /** @@ -2395,7 +2334,7 @@ const AVClass *avcodec_get_subtitle_rect_class(void); * * @return >= 0 on success, a negative AVERROR code on failure */ -int avcodec_parameters_from_context(AVCodecParameters *par, +int avcodec_parameters_from_context(struct AVCodecParameters *par, const AVCodecContext *codec); /** @@ -2407,7 +2346,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par, * @return >= 0 on success, a negative AVERROR code on failure. */ int avcodec_parameters_to_context(AVCodecContext *codec, - const AVCodecParameters *par); + const struct AVCodecParameters *par); /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this @@ -2417,9 +2356,16 @@ int avcodec_parameters_to_context(AVCodecContext *codec, * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for * retrieving a codec. * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_receive_frame()). + * Depending on the codec, you might need to set options in the codec context + * also for decoding (e.g. width, height, or the pixel or audio sample format in + * the case the information is not available in the bitstream, as when decoding + * raw audio or video). + * + * Options in the codec context can be set either by setting them in the options + * AVDictionary, or by setting the values in the context itself, directly or by + * using the av_opt_set() API before calling this function. * + * Example: * @code * av_dict_set(&opts, "b", "2.5M", 0); * codec = avcodec_find_decoder(AV_CODEC_ID_H264); @@ -2432,17 +2378,36 @@ int avcodec_parameters_to_context(AVCodecContext *codec, * exit(1); * @endcode * + * In the case AVCodecParameters are available (e.g. when demuxing a stream + * using libavformat, and accessing the AVStream contained in the demuxer), the + * codec parameters can be copied to the codec context using + * avcodec_parameters_to_context(), as in the following example: + * + * @code + * AVStream *stream = ...; + * context = avcodec_alloc_context3(codec); + * if (avcodec_parameters_to_context(context, stream->codecpar) < 0) + * exit(1); + * if (avcodec_open2(context, codec, NULL) < 0) + * exit(1); + * @endcode + * + * @note Always call this function before using decoding routines (such as + * @ref avcodec_receive_frame()). + * * @param avctx The context to initialize. * @param codec The codec to open this context for. If a non-NULL codec has been * previously passed to avcodec_alloc_context3() or * for this context, then this parameter MUST be either NULL or * equal to the previously passed codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. + * @param options A dictionary filled with AVCodecContext and codec-private + * options, which are set on top of the options already set in + * avctx, can be NULL. On return this object will be filled with + * options that were not found in the avctx codec context. * * @return zero on success, a negative value on error * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). + * av_dict_set(), av_opt_set(), av_opt_find(), avcodec_parameters_to_context() */ int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options); @@ -2618,7 +2583,7 @@ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); /** * Return decoded output data from a decoder or encoder (when the - * AV_CODEC_FLAG_RECON_FRAME flag is used). + * @ref AV_CODEC_FLAG_RECON_FRAME flag is used). * * @param avctx codec context * @param frame This will be set to a reference-counted video or audio @@ -2632,10 +2597,7 @@ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); * @retval AVERROR_EOF the codec has been fully flushed, and there will be * no more output frames * @retval AVERROR(EINVAL) codec not opened, or it is an encoder without the - * AV_CODEC_FLAG_RECON_FRAME flag enabled - * @retval AVERROR_INPUT_CHANGED current decoded frame has changed parameters with - * respect to first decoded frame. Applicable when flag - * AV_CODEC_FLAG_DROPCHANGED is set. + * @ref AV_CODEC_FLAG_RECON_FRAME flag enabled * @retval "other negative error code" legitimate decoding errors */ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); diff --git a/FFmpeg/include/libavcodec/avfft.h b/FFmpeg/include/libavcodec/avfft.h index 0c0f9b8..e3a0da1 100644 --- a/FFmpeg/include/libavcodec/avfft.h +++ b/FFmpeg/include/libavcodec/avfft.h @@ -19,6 +19,10 @@ #ifndef AVCODEC_AVFFT_H #define AVCODEC_AVFFT_H +#include "libavutil/attributes.h" +#include "version_major.h" +#if FF_API_AVFFT + /** * @file * @ingroup lavc_fft @@ -44,26 +48,42 @@ typedef struct FFTContext FFTContext; * Set up a complex FFT. * @param nbits log2 of the length of the input array * @param inverse if 0 perform the forward transform, if 1 perform the inverse + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT */ +attribute_deprecated FFTContext *av_fft_init(int nbits, int inverse); /** * Do the permutation needed BEFORE calling ff_fft_calc(). + * @deprecated without replacement */ +attribute_deprecated void av_fft_permute(FFTContext *s, FFTComplex *z); /** * Do a complex FFT with the parameters defined in av_fft_init(). The * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + * @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation */ +attribute_deprecated void av_fft_calc(FFTContext *s, FFTComplex *z); +attribute_deprecated void av_fft_end(FFTContext *s); +/** + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT, + * with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc. + */ +attribute_deprecated FFTContext *av_mdct_init(int nbits, int inverse, double scale); +attribute_deprecated void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_end(FFTContext *s); /* Real Discrete Fourier Transform */ @@ -81,9 +101,14 @@ typedef struct RDFTContext RDFTContext; * Set up a real FFT. * @param nbits log2 of the length of the input array * @param trans the type of transform + * + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT */ +attribute_deprecated RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); +attribute_deprecated void av_rdft_calc(RDFTContext *s, FFTSample *data); +attribute_deprecated void av_rdft_end(RDFTContext *s); /* Discrete Cosine Transform */ @@ -106,13 +131,19 @@ enum DCTTransformType { * @param type the type of transform * * @note the first element of the input of DST-I is ignored + * + * @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT */ +attribute_deprecated DCTContext *av_dct_init(int nbits, enum DCTTransformType type); +attribute_deprecated void av_dct_calc(DCTContext *s, FFTSample *data); +attribute_deprecated void av_dct_end (DCTContext *s); /** * @} */ +#endif /* FF_API_AVFFT */ #endif /* AVCODEC_AVFFT_H */ diff --git a/FFmpeg/include/libavcodec/codec.h b/FFmpeg/include/libavcodec/codec.h index 3b1995b..8034f1a 100644 --- a/FFmpeg/include/libavcodec/codec.h +++ b/FFmpeg/include/libavcodec/codec.h @@ -80,6 +80,7 @@ */ #define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6) +#if FF_API_SUBFRAMES /** * Codec can output multiple frames per AVPacket * Normally demuxers return one frame at a time, demuxers which do not do @@ -92,6 +93,8 @@ * as a last resort. */ #define AV_CODEC_CAP_SUBFRAMES (1 << 8) +#endif + /** * Codec is experimental and is thus avoided in favor of non experimental * encoders @@ -214,7 +217,7 @@ typedef struct AVCodec { const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 #endif const AVClass *priv_class; ///< AVClass for the private context - const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} + const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN} /** * Group name of the codec implementation. diff --git a/FFmpeg/include/libavcodec/codec_desc.h b/FFmpeg/include/libavcodec/codec_desc.h index 126b52d..96afd20 100644 --- a/FFmpeg/include/libavcodec/codec_desc.h +++ b/FFmpeg/include/libavcodec/codec_desc.h @@ -60,7 +60,7 @@ typedef struct AVCodecDescriptor { const char *const *mime_types; /** * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. + * Terminated with AV_PROFILE_UNKNOWN. */ const struct AVProfile *profiles; } AVCodecDescriptor; @@ -90,6 +90,12 @@ typedef struct AVCodecDescriptor { * equal. */ #define AV_CODEC_PROP_REORDER (1 << 3) + +/** + * Video codec supports separate coding of fields in interlaced frames. + */ +#define AV_CODEC_PROP_FIELDS (1 << 4) + /** * Subtitle codec is bitmap based * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. diff --git a/FFmpeg/include/libavcodec/codec_id.h b/FFmpeg/include/libavcodec/codec_id.h index 89a4a0c..29b410b 100644 --- a/FFmpeg/include/libavcodec/codec_id.h +++ b/FFmpeg/include/libavcodec/codec_id.h @@ -320,6 +320,10 @@ enum AVCodecID { AV_CODEC_ID_WBMP, AV_CODEC_ID_MEDIA100, AV_CODEC_ID_VQC, + AV_CODEC_ID_PDV, + AV_CODEC_ID_EVC, + AV_CODEC_ID_RTV1, + AV_CODEC_ID_VMIX, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs @@ -538,6 +542,8 @@ enum AVCodecID { AV_CODEC_ID_FTR, AV_CODEC_ID_WAVARC, AV_CODEC_ID_RKA, + AV_CODEC_ID_AC4, + AV_CODEC_ID_OSQ, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. @@ -582,6 +588,7 @@ enum AVCodecID { AV_CODEC_ID_DVD_NAV, AV_CODEC_ID_TIMED_ID3, AV_CODEC_ID_BIN_DATA, + AV_CODEC_ID_SMPTE_2038, AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it diff --git a/FFmpeg/include/libavcodec/codec_par.h b/FFmpeg/include/libavcodec/codec_par.h index f51d27c..64882a9 100644 --- a/FFmpeg/include/libavcodec/codec_par.h +++ b/FFmpeg/include/libavcodec/codec_par.h @@ -29,21 +29,14 @@ #include "libavutil/pixfmt.h" #include "codec_id.h" +#include "defs.h" +#include "packet.h" /** * @addtogroup lavc_core * @{ */ -enum AVFieldOrder { - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, ///< Top coded_first, top displayed first - AV_FIELD_BB, ///< Bottom coded first, bottom displayed first - AV_FIELD_TB, ///< Top coded first, bottom displayed first - AV_FIELD_BT, ///< Bottom coded first, top displayed first -}; - /** * This struct describes the properties of an encoded stream. * @@ -211,6 +204,28 @@ typedef struct AVCodecParameters { * Audio only. The channel layout and number of channels. */ AVChannelLayout ch_layout; + + /** + * 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. + * + * @note This field correponds to values that are stored in codec-level + * headers and is typically overridden by container/transport-layer + * timestamps, when available. It should thus be used only as a last resort, + * when no higher-level timing information is available. + */ + AVRational framerate; + + /** + * Additional data associated with the entire stream. + */ + AVPacketSideData *coded_side_data; + + /** + * Amount of entries in @ref coded_side_data. + */ + int nb_coded_side_data; } AVCodecParameters; /** diff --git a/FFmpeg/include/libavcodec/defs.h b/FFmpeg/include/libavcodec/defs.h index fbe3254..00d840e 100644 --- a/FFmpeg/include/libavcodec/defs.h +++ b/FFmpeg/include/libavcodec/defs.h @@ -61,6 +61,149 @@ #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. + +#define AV_PROFILE_UNKNOWN -99 +#define AV_PROFILE_RESERVED -100 + +#define AV_PROFILE_AAC_MAIN 0 +#define AV_PROFILE_AAC_LOW 1 +#define AV_PROFILE_AAC_SSR 2 +#define AV_PROFILE_AAC_LTP 3 +#define AV_PROFILE_AAC_HE 4 +#define AV_PROFILE_AAC_HE_V2 28 +#define AV_PROFILE_AAC_LD 22 +#define AV_PROFILE_AAC_ELD 38 +#define AV_PROFILE_MPEG2_AAC_LOW 128 +#define AV_PROFILE_MPEG2_AAC_HE 131 + +#define AV_PROFILE_DNXHD 0 +#define AV_PROFILE_DNXHR_LB 1 +#define AV_PROFILE_DNXHR_SQ 2 +#define AV_PROFILE_DNXHR_HQ 3 +#define AV_PROFILE_DNXHR_HQX 4 +#define AV_PROFILE_DNXHR_444 5 + +#define AV_PROFILE_DTS 20 +#define AV_PROFILE_DTS_ES 30 +#define AV_PROFILE_DTS_96_24 40 +#define AV_PROFILE_DTS_HD_HRA 50 +#define AV_PROFILE_DTS_HD_MA 60 +#define AV_PROFILE_DTS_EXPRESS 70 +#define AV_PROFILE_DTS_HD_MA_X 61 +#define AV_PROFILE_DTS_HD_MA_X_IMAX 62 + +#define AV_PROFILE_EAC3_DDP_ATMOS 30 + +#define AV_PROFILE_TRUEHD_ATMOS 30 + +#define AV_PROFILE_MPEG2_422 0 +#define AV_PROFILE_MPEG2_HIGH 1 +#define AV_PROFILE_MPEG2_SS 2 +#define AV_PROFILE_MPEG2_SNR_SCALABLE 3 +#define AV_PROFILE_MPEG2_MAIN 4 +#define AV_PROFILE_MPEG2_SIMPLE 5 + +#define AV_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag +#define AV_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag + +#define AV_PROFILE_H264_BASELINE 66 +#define AV_PROFILE_H264_CONSTRAINED_BASELINE (66|AV_PROFILE_H264_CONSTRAINED) +#define AV_PROFILE_H264_MAIN 77 +#define AV_PROFILE_H264_EXTENDED 88 +#define AV_PROFILE_H264_HIGH 100 +#define AV_PROFILE_H264_HIGH_10 110 +#define AV_PROFILE_H264_HIGH_10_INTRA (110|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_MULTIVIEW_HIGH 118 +#define AV_PROFILE_H264_HIGH_422 122 +#define AV_PROFILE_H264_HIGH_422_INTRA (122|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_STEREO_HIGH 128 +#define AV_PROFILE_H264_HIGH_444 144 +#define AV_PROFILE_H264_HIGH_444_PREDICTIVE 244 +#define AV_PROFILE_H264_HIGH_444_INTRA (244|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_CAVLC_444 44 + +#define AV_PROFILE_VC1_SIMPLE 0 +#define AV_PROFILE_VC1_MAIN 1 +#define AV_PROFILE_VC1_COMPLEX 2 +#define AV_PROFILE_VC1_ADVANCED 3 + +#define AV_PROFILE_MPEG4_SIMPLE 0 +#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE 1 +#define AV_PROFILE_MPEG4_CORE 2 +#define AV_PROFILE_MPEG4_MAIN 3 +#define AV_PROFILE_MPEG4_N_BIT 4 +#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE 5 +#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 +#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 +#define AV_PROFILE_MPEG4_HYBRID 8 +#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 +#define AV_PROFILE_MPEG4_CORE_SCALABLE 10 +#define AV_PROFILE_MPEG4_ADVANCED_CODING 11 +#define AV_PROFILE_MPEG4_ADVANCED_CORE 12 +#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 +#define AV_PROFILE_MPEG4_SIMPLE_STUDIO 14 +#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE 15 + +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1 +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2 +#define AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768 +#define AV_PROFILE_JPEG2000_DCINEMA_2K 3 +#define AV_PROFILE_JPEG2000_DCINEMA_4K 4 + +#define AV_PROFILE_VP9_0 0 +#define AV_PROFILE_VP9_1 1 +#define AV_PROFILE_VP9_2 2 +#define AV_PROFILE_VP9_3 3 + +#define AV_PROFILE_HEVC_MAIN 1 +#define AV_PROFILE_HEVC_MAIN_10 2 +#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE 3 +#define AV_PROFILE_HEVC_REXT 4 +#define AV_PROFILE_HEVC_SCC 9 + +#define AV_PROFILE_VVC_MAIN_10 1 +#define AV_PROFILE_VVC_MAIN_10_444 33 + +#define AV_PROFILE_AV1_MAIN 0 +#define AV_PROFILE_AV1_HIGH 1 +#define AV_PROFILE_AV1_PROFESSIONAL 2 + +#define AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0 +#define AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1 +#define AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2 +#define AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3 +#define AV_PROFILE_MJPEG_JPEG_LS 0xf7 + +#define AV_PROFILE_SBC_MSBC 1 + +#define AV_PROFILE_PRORES_PROXY 0 +#define AV_PROFILE_PRORES_LT 1 +#define AV_PROFILE_PRORES_STANDARD 2 +#define AV_PROFILE_PRORES_HQ 3 +#define AV_PROFILE_PRORES_4444 4 +#define AV_PROFILE_PRORES_XQ 5 + +#define AV_PROFILE_ARIB_PROFILE_A 0 +#define AV_PROFILE_ARIB_PROFILE_C 1 + +#define AV_PROFILE_KLVA_SYNC 0 +#define AV_PROFILE_KLVA_ASYNC 1 + +#define AV_PROFILE_EVC_BASELINE 0 +#define AV_PROFILE_EVC_MAIN 1 + + +#define AV_LEVEL_UNKNOWN -99 + +enum AVFieldOrder { + AV_FIELD_UNKNOWN, + AV_FIELD_PROGRESSIVE, + AV_FIELD_TT, ///< Top coded_first, top displayed first + AV_FIELD_BB, ///< Bottom coded first, bottom displayed first + AV_FIELD_TB, ///< Top coded first, bottom displayed first + AV_FIELD_BT, ///< Bottom coded first, top displayed first +}; + /** * @ingroup lavc_decoding */ diff --git a/FFmpeg/include/libavcodec/dirac.h b/FFmpeg/include/libavcodec/dirac.h index e6d9d34..8c348cd 100644 --- a/FFmpeg/include/libavcodec/dirac.h +++ b/FFmpeg/include/libavcodec/dirac.h @@ -31,7 +31,11 @@ * @author Jordi Ortiz */ -#include "avcodec.h" +#include +#include + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" /** * The spec limits the number of wavelet decompositions to 4 for both diff --git a/FFmpeg/include/libavcodec/packet.h b/FFmpeg/include/libavcodec/packet.h index f28e7e7..b19409b 100644 --- a/FFmpeg/include/libavcodec/packet.h +++ b/FFmpeg/include/libavcodec/packet.h @@ -33,9 +33,9 @@ #include "libavcodec/version_major.h" /** - * @defgroup lavc_packet AVPacket + * @defgroup lavc_packet_side_data AVPacketSideData * - * Types and functions for working with AVPacket. + * Types and functions for working with AVPacketSideData. * @{ */ enum AVPacketSideDataType { @@ -312,12 +312,129 @@ enum AVPacketSideDataType { #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED +/** + * 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). + * + * Global side data is handled as follows: + * - During demuxing, it may be exported through + * @ref AVStream.codecpar.side_data "AVStream's codec parameters", which can + * then be passed as input to decoders through the + * @ref AVCodecContext.coded_side_data "decoder context's side data", for + * initialization. + * - For muxing, it can be fed through @ref AVStream.codecpar.side_data + * "AVStream's codec parameters", typically the output of encoders through + * the @ref AVCodecContext.coded_side_data "encoder context's side data", for + * initialization. + * + * Packet specific side data is handled as follows: + * - During demuxing, it may be exported through @ref AVPacket.side_data + * "AVPacket's side data", which can then be passed as input to decoders. + * - For muxing, it can be fed through @ref AVPacket.side_data "AVPacket's + * side data", typically the output of encoders. + * + * Different modules may accept or export different types of side data + * depending on media type and codec. Refer to @ref AVPacketSideDataType for a + * list of defined types and where they may be found or used. + */ typedef struct AVPacketSideData { uint8_t *data; size_t size; enum AVPacketSideDataType type; } AVPacketSideData; +/** + * Allocate a new packet side data. + * + * @param sd pointer to an array of side data to which the side data should + * be added. *sd may be NULL, in which case the array will be + * initialized. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. The integer value will be increased by 1 on success. + * @param type side data type + * @param size desired side data size + * @param flags currently unused. Must be zero + * + * @return pointer to freshly allocated side data on success, or NULL otherwise. + */ +AVPacketSideData *av_packet_side_data_new(AVPacketSideData **psd, int *pnb_sd, + enum AVPacketSideDataType type, + size_t size, int flags); + +/** + * Wrap existing data as packet side data. + * + * @param sd pointer to an array of side data to which the side data should + * be added. *sd may be NULL, in which case the array will be + * initialized + * @param nb_sd pointer to an integer containing the number of entries in + * the array. The integer value will be increased by 1 on success. + * @param type side data type + * @param data a data array. It must be allocated with the av_malloc() family + * of functions. The ownership of the data is transferred to the + * side data array on success + * @param size size of the data array + * @param flags currently unused. Must be zero + * + * @return pointer to freshly allocated side data on success, or NULL otherwise + * On failure, the side data array is unchanged and the data remains + * owned by the caller. + */ +AVPacketSideData *av_packet_side_data_add(AVPacketSideData **sd, int *nb_sd, + enum AVPacketSideDataType type, + void *data, size_t size, int flags); + +/** + * Get side information from a side data array. + * + * @param sd the array from which the side data should be fetched + * @param nb_sd value containing the number of entries in the array. + * @param type desired side information type + * + * @return pointer to side data if present or NULL otherwise + */ +const AVPacketSideData *av_packet_side_data_get(const AVPacketSideData *sd, + int nb_sd, + enum AVPacketSideDataType type); + +/** + * Remove side data of the given type from a side data array. + * + * @param sd the array from which the side data should be removed + * @param nb_sd pointer to an integer containing the number of entries in + * the array. Will be reduced by the amount of entries removed + * upon return + * @param type side information type + */ +void av_packet_side_data_remove(AVPacketSideData *sd, int *nb_sd, + enum AVPacketSideDataType type); + +/** + * Convenience function to free all the side data stored in an array, and + * the array itself. + * + * @param sd pointer to array of side data to free. Will be set to NULL + * upon return. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. Will be set to 0 upon return. + */ +void av_packet_side_data_free(AVPacketSideData **sd, int *nb_sd); + +const char *av_packet_side_data_name(enum AVPacketSideDataType type); + +/** + * @} + */ + +/** + * @defgroup lavc_packet AVPacket + * + * Types and functions for working with AVPacket. + * @{ + */ + /** * 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 @@ -603,8 +720,6 @@ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size); -const char *av_packet_side_data_name(enum AVPacketSideDataType type); - /** * Pack a dictionary for use in side_data. * diff --git a/FFmpeg/include/libavcodec/version.h b/FFmpeg/include/libavcodec/version.h index 43794ea..1cf9651 100644 --- a/FFmpeg/include/libavcodec/version.h +++ b/FFmpeg/include/libavcodec/version.h @@ -29,8 +29,8 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 3 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MINOR 31 +#define LIBAVCODEC_VERSION_MICRO 102 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/FFmpeg/include/libavcodec/version_major.h b/FFmpeg/include/libavcodec/version_major.h index c2f118b..b9164fe 100644 --- a/FFmpeg/include/libavcodec/version_major.h +++ b/FFmpeg/include/libavcodec/version_major.h @@ -45,6 +45,13 @@ #define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_SLICE_OFFSET (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_SUBFRAMES (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_TICKS_PER_FRAME (LIBAVCODEC_VERSION_MAJOR < 61) +#define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 61) + +#define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62) // reminder to remove CrystalHD decoders on next major bump #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61) diff --git a/FFmpeg/include/libavdevice/version.h b/FFmpeg/include/libavdevice/version.h index ec6c337..7608a86 100644 --- a/FFmpeg/include/libavdevice/version.h +++ b/FFmpeg/include/libavdevice/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVDEVICE_VERSION_MINOR 1 +#define LIBAVDEVICE_VERSION_MINOR 3 #define LIBAVDEVICE_VERSION_MICRO 100 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ diff --git a/FFmpeg/include/libavfilter/avfilter.h b/FFmpeg/include/libavfilter/avfilter.h index d0d4584..d69381a 100644 --- a/FFmpeg/include/libavfilter/avfilter.h +++ b/FFmpeg/include/libavfilter/avfilter.h @@ -131,6 +131,11 @@ enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx); * received by the filter on one of its inputs. */ #define AVFILTER_FLAG_METADATA_ONLY (1 << 3) + +/** + * The filter can create hardware frames using AVFilterContext.hw_device_ctx. + */ +#define AVFILTER_FLAG_HWDEVICE (1 << 4) /** * Some filters support a generic "enable" expression option that can be used * to enable or disable a filter in the timeline. Filters supporting this @@ -444,6 +449,10 @@ struct AVFilterContext { * 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. + * + * May be set by the caller on filters flagged with AVFILTER_FLAG_HWDEVICE + * before initializing the filter with avfilter_init_str() or + * avfilter_init_dict(). */ AVBufferRef *hw_device_ctx; diff --git a/FFmpeg/include/libavfilter/version.h b/FFmpeg/include/libavfilter/version.h index 7e0eb9a..64cd692 100644 --- a/FFmpeg/include/libavfilter/version.h +++ b/FFmpeg/include/libavfilter/version.h @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFILTER_VERSION_MINOR 3 +#define LIBAVFILTER_VERSION_MINOR 12 #define LIBAVFILTER_VERSION_MICRO 100 diff --git a/FFmpeg/include/libavfilter/version_major.h b/FFmpeg/include/libavfilter/version_major.h index 899dfdb..1decc40 100644 --- a/FFmpeg/include/libavfilter/version_major.h +++ b/FFmpeg/include/libavfilter/version_major.h @@ -35,4 +35,6 @@ * the public API and may change, break or disappear at any time. */ +#define FF_API_LIBPLACEBO_OPTS (LIBAVFILTER_VERSION_MAJOR < 10) + #endif /* AVFILTER_VERSION_MAJOR_H */ diff --git a/FFmpeg/include/libavformat/avformat.h b/FFmpeg/include/libavformat/avformat.h index 1916aa2..9e7eca0 100644 --- a/FFmpeg/include/libavformat/avformat.h +++ b/FFmpeg/include/libavformat/avformat.h @@ -307,10 +307,8 @@ * @} */ -#include #include /* FILE */ -#include "libavcodec/codec.h" #include "libavcodec/codec_par.h" #include "libavcodec/defs.h" #include "libavcodec/packet.h" @@ -325,10 +323,13 @@ * to avoid unnecessary rebuilds. When included externally, keep including * the full version information. */ #include "libavformat/version.h" + +#include "libavutil/frame.h" +#include "libavcodec/codec.h" #endif struct AVFormatContext; - +struct AVFrame; struct AVDeviceInfoList; /** @@ -485,7 +486,9 @@ typedef struct AVProbeData { #define AVFMT_NOBINSEARCH 0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */ #define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fall back on generic search */ #define AVFMT_NO_BYTE_SEEK 0x8000 /**< Format does not allow seeking by bytes */ -#define AVFMT_ALLOW_FLUSH 0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */ +#if FF_API_ALLOW_FLUSH +#define AVFMT_ALLOW_FLUSH 0x10000 /**< @deprecated: Just send a NULL packet if you want to flush a muxer. */ +#endif #define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly increasing timestamps, but they must still be monotonic */ @@ -521,7 +524,7 @@ typedef struct AVOutputFormat { /** * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, + * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, * AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE */ int flags; @@ -937,6 +940,7 @@ typedef struct AVStream { */ AVPacket attached_pic; +#if FF_API_AVSTREAM_SIDE_DATA /** * An array of side data that applies to the whole stream (i.e. the * container does not allow it to change between packets). @@ -953,13 +957,20 @@ typedef struct AVStream { * * Freed by libavformat in avformat_free_context(). * - * @see av_format_inject_global_side_data() + * @deprecated use AVStream's @ref AVCodecParameters.coded_side_data + * "codecpar side data". */ + attribute_deprecated AVPacketSideData *side_data; /** * The number of elements in the AVStream.side_data array. + * + * @deprecated use AVStream's @ref AVCodecParameters.nb_coded_side_data + * "codecpar side data". */ + attribute_deprecated int nb_side_data; +#endif /** * Flags indicating events happening on the stream, a combination of @@ -1241,7 +1252,9 @@ typedef struct AVFormatContext { #define AVFMT_FLAG_BITEXACT 0x0400 #define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) #define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats +#if FF_API_LAVF_SHORTEST #define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops. +#endif #define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer /** @@ -1569,7 +1582,7 @@ typedef struct AVFormatContext { * the same codec_id. * Demuxing: Set by user */ - const AVCodec *video_codec; + const struct AVCodec *video_codec; /** * Forced audio codec. @@ -1577,7 +1590,7 @@ typedef struct AVFormatContext { * the same codec_id. * Demuxing: Set by user */ - const AVCodec *audio_codec; + const struct AVCodec *audio_codec; /** * Forced subtitle codec. @@ -1585,7 +1598,7 @@ typedef struct AVFormatContext { * the same codec_id. * Demuxing: Set by user */ - const AVCodec *subtitle_codec; + const struct AVCodec *subtitle_codec; /** * Forced data codec. @@ -1593,7 +1606,7 @@ typedef struct AVFormatContext { * the same codec_id. * Demuxing: Set by user */ - const AVCodec *data_codec; + const struct AVCodec *data_codec; /** * Number of bytes to be written as padding in a metadata header. @@ -1718,6 +1731,12 @@ typedef struct AVFormatContext { /** * This function will cause global side data to be injected in the next packet * of each stream as well as after any subsequent seek. + * + * @note global side data is always available in every AVStream's + * @ref AVCodecParameters.coded_side_data "codecpar side data" array, and + * in a @ref AVCodecContext.coded_side_data "decoder's side data" array if + * initialized with said stream's codecpar. + * @see av_packet_side_data_get() */ void av_format_inject_global_side_data(AVFormatContext *s); @@ -1842,8 +1861,9 @@ const AVClass *av_stream_get_class(void); * * @return newly created stream or NULL on error. */ -AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c); +AVStream *avformat_new_stream(AVFormatContext *s, const struct AVCodec *c); +#if FF_API_AVSTREAM_SIDE_DATA /** * Wrap an existing array as stream side data. * @@ -1856,7 +1876,10 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c); * * @return zero on success, a negative AVERROR code on failure. On failure, * the stream is unchanged and the data remains owned by the caller. + * @deprecated use av_packet_side_data_add() with the stream's + * @ref AVCodecParameters.coded_side_data "codecpar side data" */ +attribute_deprecated int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, uint8_t *data, size_t size); @@ -1868,7 +1891,10 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, * @param size side information size * * @return pointer to fresh allocated data or NULL otherwise + * @deprecated use av_packet_side_data_new() with the stream's + * @ref AVCodecParameters.coded_side_data "codecpar side data" */ +attribute_deprecated uint8_t *av_stream_new_side_data(AVStream *stream, enum AVPacketSideDataType type, size_t size); /** @@ -1880,9 +1906,13 @@ uint8_t *av_stream_new_side_data(AVStream *stream, * or to zero if the desired side data is not present. * * @return pointer to data if present or NULL otherwise + * @deprecated use av_packet_side_data_get() with the stream's + * @ref AVCodecParameters.coded_side_data "codecpar side data" */ +attribute_deprecated uint8_t *av_stream_get_side_data(const AVStream *stream, enum AVPacketSideDataType type, size_t *size); +#endif AVProgram *av_new_program(AVFormatContext *s, int id); @@ -2076,7 +2106,7 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, int wanted_stream_nb, int related_stream, - const AVCodec **decoder_ret, + const struct AVCodec **decoder_ret, int flags); /** @@ -2352,7 +2382,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt); * See av_interleaved_write_uncoded_frame() for details. */ int av_write_uncoded_frame(AVFormatContext *s, int stream_index, - AVFrame *frame); + struct AVFrame *frame); /** * Write an uncoded frame to an output media file. @@ -2371,7 +2401,7 @@ int av_write_uncoded_frame(AVFormatContext *s, int stream_index, * @return >=0 for success, a negative code on error */ int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index, - AVFrame *frame); + struct AVFrame *frame); /** * Test whether a muxer supports uncoded frame. @@ -2759,7 +2789,8 @@ const struct AVCodecTag *avformat_get_mov_audio_tags(void); * @param frame the frame with the aspect ratio to be determined * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea */ -AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame); +AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, + struct AVFrame *frame); /** * Guess the frame rate, based on both the container and codec information. @@ -2769,7 +2800,8 @@ AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *strea * @param frame the frame for which the frame rate should be determined, may be NULL * @return the guessed (valid) frame rate, 0/1 if no idea */ -AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, AVFrame *frame); +AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, + struct AVFrame *frame); /** * Check if the stream st contained in s is matched by the stream specifier diff --git a/FFmpeg/include/libavformat/avio.h b/FFmpeg/include/libavformat/avio.h index 5f13e06..887a397 100644 --- a/FFmpeg/include/libavformat/avio.h +++ b/FFmpeg/include/libavformat/avio.h @@ -238,7 +238,11 @@ typedef struct AVIOContext { void *opaque; /**< A private pointer, passed to the read/write/seek/... functions. */ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size); +#if FF_API_AVIO_WRITE_NONCONST int (*write_packet)(void *opaque, uint8_t *buf, int buf_size); +#else + int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size); +#endif int64_t (*seek)(void *opaque, int64_t offset, int whence); int64_t pos; /**< position in the file of the current buffer */ int eof_reached; /**< true if was unable to read due to error or eof */ @@ -286,8 +290,13 @@ typedef struct AVIOContext { /** * A callback that is used instead of write_packet. */ +#if FF_API_AVIO_WRITE_NONCONST int (*write_data_type)(void *opaque, uint8_t *buf, int buf_size, enum AVIODataMarkerType type, int64_t time); +#else + int (*write_data_type)(void *opaque, const uint8_t *buf, int buf_size, + enum AVIODataMarkerType type, int64_t time); +#endif /** * 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 @@ -407,7 +416,11 @@ AVIOContext *avio_alloc_context( int write_flag, void *opaque, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), +#if FF_API_AVIO_WRITE_NONCONST int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +#else + int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size), +#endif int64_t (*seek)(void *opaque, int64_t offset, int whence)); /** diff --git a/FFmpeg/include/libavformat/version.h b/FFmpeg/include/libavformat/version.h index 7ff1483..9e1f484 100644 --- a/FFmpeg/include/libavformat/version.h +++ b/FFmpeg/include/libavformat/version.h @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFORMAT_VERSION_MINOR 3 +#define LIBAVFORMAT_VERSION_MINOR 16 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ diff --git a/FFmpeg/include/libavformat/version_major.h b/FFmpeg/include/libavformat/version_major.h index 293fbd3..224fdac 100644 --- a/FFmpeg/include/libavformat/version_major.h +++ b/FFmpeg/include/libavformat/version_major.h @@ -45,6 +45,10 @@ #define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 61) #define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 61) #define FF_API_AVFORMAT_IO_CLOSE (LIBAVFORMAT_VERSION_MAJOR < 61) +#define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61) +#define FF_API_LAVF_SHORTEST (LIBAVFORMAT_VERSION_MAJOR < 61) +#define FF_API_ALLOW_FLUSH (LIBAVFORMAT_VERSION_MAJOR < 61) +#define FF_API_AVSTREAM_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 61) #define FF_API_R_FRAME_RATE 1 diff --git a/FFmpeg/include/libavutil/audio_fifo.h b/FFmpeg/include/libavutil/audio_fifo.h index d1e4c85..fa5f59a 100644 --- a/FFmpeg/include/libavutil/audio_fifo.h +++ b/FFmpeg/include/libavutil/audio_fifo.h @@ -91,7 +91,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); * code on failure. If successful, the number of samples * actually written will always be nb_samples. */ -int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -107,7 +107,7 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); * be greater than nb_samples, and will only be less than * nb_samples if av_audio_fifo_size is less than nb_samples. */ -int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -124,7 +124,8 @@ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); * be greater than nb_samples, and will only be less than * nb_samples if av_audio_fifo_size is less than nb_samples. */ -int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset); +int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data, + int nb_samples, int offset); /** * Read data from an AVAudioFifo. @@ -140,7 +141,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs * be greater than nb_samples, and will only be less than * nb_samples if av_audio_fifo_size is less than nb_samples. */ -int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples); /** * Drain data from an AVAudioFifo. diff --git a/FFmpeg/include/libavutil/avassert.h b/FFmpeg/include/libavutil/avassert.h index 51e462b..1895fb7 100644 --- a/FFmpeg/include/libavutil/avassert.h +++ b/FFmpeg/include/libavutil/avassert.h @@ -28,6 +28,9 @@ #define AVUTIL_AVASSERT_H #include +#ifdef HAVE_AV_CONFIG_H +# include "config.h" +#endif #include "log.h" #include "macros.h" diff --git a/FFmpeg/include/libavutil/avstring.h b/FFmpeg/include/libavutil/avstring.h index e260263..fc09534 100644 --- a/FFmpeg/include/libavutil/avstring.h +++ b/FFmpeg/include/libavutil/avstring.h @@ -24,7 +24,6 @@ #include #include #include "attributes.h" -#include "version.h" /** * @addtogroup lavu_string @@ -265,7 +264,7 @@ int av_strncasecmp(const char *a, const char *b, size_t n); /** * Locale-independent strings replace. - * @note This means only ASCII-range characters are replace + * @note This means only ASCII-range characters are replaced. */ char *av_strireplace(const char *str, const char *from, const char *to); diff --git a/FFmpeg/include/libavutil/avutil.h b/FFmpeg/include/libavutil/avutil.h index 64b68bd..a362c8b 100644 --- a/FFmpeg/include/libavutil/avutil.h +++ b/FFmpeg/include/libavutil/avutil.h @@ -257,7 +257,12 @@ const char *av_get_media_type_string(enum AVMediaType media_type); * Internal time base represented as fractional value */ +#ifdef __cplusplus +/* ISO C++ forbids compound-literals. */ +#define AV_TIME_BASE_Q av_make_q(1, AV_TIME_BASE) +#else #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} +#endif /** * @} @@ -294,7 +299,6 @@ char av_get_picture_type_char(enum AVPictureType pict_type); */ #include "common.h" -#include "error.h" #include "rational.h" #include "version.h" #include "macros.h" diff --git a/FFmpeg/include/libavutil/bprint.h b/FFmpeg/include/libavutil/bprint.h index f27d30f..8559745 100644 --- a/FFmpeg/include/libavutil/bprint.h +++ b/FFmpeg/include/libavutil/bprint.h @@ -144,6 +144,9 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); * Init a print buffer using a pre-existing buffer. * * The buffer will not be reallocated. + * In case size equals zero, the AVBPrint will be initialized to use + * the internal buffer as if using AV_BPRINT_SIZE_COUNT_ONLY with + * av_bprint_init(). * * @param buf buffer structure to init * @param buffer byte buffer to use for the string data diff --git a/FFmpeg/include/libavutil/channel_layout.h b/FFmpeg/include/libavutil/channel_layout.h index f345415..c9c404e 100644 --- a/FFmpeg/include/libavutil/channel_layout.h +++ b/FFmpeg/include/libavutil/channel_layout.h @@ -224,6 +224,7 @@ enum AVChannelOrder { #define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER) #define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) #define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_3POINT1POINT2 (AV_CH_LAYOUT_3POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) #define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER) #define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER) #define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY) @@ -232,12 +233,17 @@ enum AVChannelOrder { #define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) #define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) -#define AV_CH_LAYOUT_7POINT1_TOP_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) +#define AV_CH_LAYOUT_5POINT1POINT2_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) #define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT) #define AV_CH_LAYOUT_CUBE (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) +#define AV_CH_LAYOUT_5POINT1POINT4_BACK (AV_CH_LAYOUT_5POINT1POINT2_BACK|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT1POINT2 (AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) +#define AV_CH_LAYOUT_7POINT1POINT4_BACK (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) #define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) #define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT) -#define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) +#define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) + +#define AV_CH_LAYOUT_7POINT1_TOP_BACK AV_CH_LAYOUT_5POINT1POINT2_BACK enum AVMatrixEncoding { AV_MATRIX_ENCODING_NONE, @@ -358,8 +364,16 @@ typedef struct AVChannelLayout { void *opaque; } AVChannelLayout; +/** + * Macro to define native channel layouts + * + * @note This doesn't use designated initializers for compatibility with C++ 17 and older. + */ #define AV_CHANNEL_LAYOUT_MASK(nb, m) \ - { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} + { /* .order */ AV_CHANNEL_ORDER_NATIVE, \ + /* .nb_channels */ (nb), \ + /* .u.mask */ { m }, \ + /* .opaque */ NULL } /** * @name Common pre-defined channel layouts @@ -381,6 +395,7 @@ typedef struct AVChannelLayout { #define AV_CHANNEL_LAYOUT_5POINT1_BACK AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1_BACK) #define AV_CHANNEL_LAYOUT_6POINT0 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0) #define AV_CHANNEL_LAYOUT_6POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0_FRONT) +#define AV_CHANNEL_LAYOUT_3POINT1POINT2 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_3POINT1POINT2) #define AV_CHANNEL_LAYOUT_HEXAGONAL AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_HEXAGONAL) #define AV_CHANNEL_LAYOUT_6POINT1 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1) #define AV_CHANNEL_LAYOUT_6POINT1_BACK AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_BACK) @@ -390,14 +405,23 @@ typedef struct AVChannelLayout { #define AV_CHANNEL_LAYOUT_7POINT1 AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1) #define AV_CHANNEL_LAYOUT_7POINT1_WIDE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE) #define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK) -#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_TOP_BACK) +#define AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_5POINT1POINT2_BACK) #define AV_CHANNEL_LAYOUT_OCTAGONAL AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_OCTAGONAL) #define AV_CHANNEL_LAYOUT_CUBE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_CUBE) +#define AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_5POINT1POINT4_BACK) +#define AV_CHANNEL_LAYOUT_7POINT1POINT2 AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_7POINT1POINT2) +#define AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(12, AV_CH_LAYOUT_7POINT1POINT4_BACK) #define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL) #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX) #define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2) + +#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK + #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \ - { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }} + { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \ + /* .nb_channels */ 4, \ + /* .u.mask */ { 0 }, \ + /* .opaque */ NULL } /** @} */ struct AVBPrint; diff --git a/FFmpeg/include/libavutil/common.h b/FFmpeg/include/libavutil/common.h index fd1404b..de2140a 100644 --- a/FFmpeg/include/libavutil/common.h +++ b/FFmpeg/include/libavutil/common.h @@ -40,6 +40,7 @@ #include #include "attributes.h" +#include "error.h" #include "macros.h" //rounded division & shift diff --git a/FFmpeg/include/libavutil/cpu.h b/FFmpeg/include/libavutil/cpu.h index 8fa5ea9..8dff341 100644 --- a/FFmpeg/include/libavutil/cpu.h +++ b/FFmpeg/include/libavutil/cpu.h @@ -69,6 +69,8 @@ #define AV_CPU_FLAG_NEON (1 << 5) #define AV_CPU_FLAG_ARMV8 (1 << 6) #define AV_CPU_FLAG_VFP_VM (1 << 7) ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations +#define AV_CPU_FLAG_DOTPROD (1 << 8) +#define AV_CPU_FLAG_I8MM (1 << 9) #define AV_CPU_FLAG_SETEND (1 <<16) #define AV_CPU_FLAG_MMI (1 << 0) @@ -87,6 +89,7 @@ #define AV_CPU_FLAG_RVV_I64 (1 << 5) ///< Vectors of 64-bit int's */ #define AV_CPU_FLAG_RVV_F64 (1 << 6) ///< Vectors of double's #define AV_CPU_FLAG_RVB_BASIC (1 << 7) ///< Basic bit-manipulations +#define AV_CPU_FLAG_RVB_ADDR (1 << 8) ///< Address bit-manipulations /** * Return the flags which specify extensions supported by the CPU. diff --git a/FFmpeg/include/libavutil/executor.h b/FFmpeg/include/libavutil/executor.h new file mode 100644 index 0000000..c602bcb --- /dev/null +++ b/FFmpeg/include/libavutil/executor.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2023 Nuo Mi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_EXECUTOR_H +#define AVUTIL_EXECUTOR_H + +typedef struct AVExecutor AVExecutor; +typedef struct AVTask AVTask; + +struct AVTask { + AVTask *next; +}; + +typedef struct AVTaskCallbacks { + void *user_data; + + int local_context_size; + + // return 1 if a's priority > b's priority + int (*priority_higher)(const AVTask *a, const AVTask *b); + + // task is ready for run + int (*ready)(const AVTask *t, void *user_data); + + // run the task + int (*run)(AVTask *t, void *local_context, void *user_data); +} AVTaskCallbacks; + +/** + * Alloc executor + * @param callbacks callback structure for executor + * @param thread_count worker thread number + * @return return the executor + */ +AVExecutor* av_executor_alloc(const AVTaskCallbacks *callbacks, int thread_count); + +/** + * Free executor + * @param e pointer to executor + */ +void av_executor_free(AVExecutor **e); + +/** + * Add task to executor + * @param e pointer to executor + * @param t pointer to task. If NULL, it will wakeup one work thread + */ +void av_executor_execute(AVExecutor *e, AVTask *t); + +#endif //AVUTIL_EXECUTOR_H diff --git a/FFmpeg/include/libavutil/ffversion.h b/FFmpeg/include/libavutil/ffversion.h index 170a559..98cba47 100644 --- a/FFmpeg/include/libavutil/ffversion.h +++ b/FFmpeg/include/libavutil/ffversion.h @@ -1,5 +1,5 @@ /* Automatically generated by version.sh, do not manually edit! */ #ifndef AVUTIL_FFVERSION_H #define AVUTIL_FFVERSION_H -#define FFMPEG_VERSION "6.0-full_build-www.gyan.dev" +#define FFMPEG_VERSION "6.1-full_build-www.gyan.dev" #endif /* AVUTIL_FFVERSION_H */ diff --git a/FFmpeg/include/libavutil/fifo.h b/FFmpeg/include/libavutil/fifo.h index 70f9376..ce3a2ae 100644 --- a/FFmpeg/include/libavutil/fifo.h +++ b/FFmpeg/include/libavutil/fifo.h @@ -200,7 +200,7 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); +int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset); /** * Feed data from a FIFO into a user-provided callback. @@ -217,7 +217,7 @@ int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, +int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems, size_t offset); /** diff --git a/FFmpeg/include/libavutil/frame.h b/FFmpeg/include/libavutil/frame.h index 2580269..c0c1b23 100644 --- a/FFmpeg/include/libavutil/frame.h +++ b/FFmpeg/include/libavutil/frame.h @@ -214,6 +214,16 @@ enum AVFrameSideDataType { * Ambient viewing environment metadata, as defined by H.274. */ AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT, + + /** + * Provide encoder-specific hinting information about changed/unchanged + * portions of a frame. It can be used to pass information about which + * macroblocks can be skipped because they didn't change from the + * corresponding ones in the previous frame. This could be useful for + * applications which know this information in advance to speed up + * encoding. + */ + AV_FRAME_DATA_VIDEO_HINT, }; enum AVActiveFormatDescription { @@ -416,10 +426,15 @@ typedef struct AVFrame { */ int format; +#if FF_API_FRAME_KEY /** * 1 -> keyframe, 0-> not + * + * @deprecated Use AV_FRAME_FLAG_KEY instead */ + attribute_deprecated int key_frame; +#endif /** * Picture type of the frame. @@ -470,30 +485,66 @@ typedef struct AVFrame { int quality; /** - * for some private data of the user + * Frame owner's private data. + * + * This field may be set by the code that allocates/owns the frame data. + * It is then not touched by any library functions, except: + * - it is copied to other references by av_frame_copy_props() (and hence by + * av_frame_ref()); + * - it is set to NULL when the frame is cleared by av_frame_unref() + * - on the caller's explicit request. E.g. libavcodec encoders/decoders + * will copy this field to/from @ref AVPacket "AVPackets" if the caller sets + * @ref AV_CODEC_FLAG_COPY_OPAQUE. + * + * @see opaque_ref the reference-counted analogue */ void *opaque; /** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) + * 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. + * + * For interlaced frames this field may be set to 1, which signals that this + * frame should be presented as 3 fields: beginning with the first field (as + * determined by AV_FRAME_FLAG_TOP_FIELD_FIRST being set or not), followed + * by the second field, and then the first field again. + * + * For progressive frames this field may be set to a multiple of 2, which + * signals that this frame's duration should be (repeat_pict + 2) / 2 + * normal frame durations. + * + * @note This field is computed from MPEG2 repeat_first_field flag and its + * associated flags, H.264 pic_struct from picture timing SEI, and + * their analogues in other codecs. Typically it should only be used when + * higher-layer timing information is not available. */ int repeat_pict; +#if FF_API_INTERLACED_FRAME /** * The content of the picture is interlaced. + * + * @deprecated Use AV_FRAME_FLAG_INTERLACED instead */ + attribute_deprecated int interlaced_frame; /** * If the content is interlaced, is top field displayed first. + * + * @deprecated Use AV_FRAME_FLAG_TOP_FIELD_FIRST instead */ + attribute_deprecated int top_field_first; +#endif +#if FF_API_PALETTE_HAS_CHANGED /** * Tell user application that palette has changed from previous frame. */ + attribute_deprecated int palette_has_changed; +#endif #if FF_API_REORDERED_OPAQUE /** @@ -571,10 +622,23 @@ typedef struct AVFrame { * The frame data may be corrupted, e.g. due to decoding errors. */ #define AV_FRAME_FLAG_CORRUPT (1 << 0) +/** + * A flag to mark frames that are keyframes. + */ +#define AV_FRAME_FLAG_KEY (1 << 1) /** * A flag to mark the frames which need to be decoded, but shouldn't be output. */ #define AV_FRAME_FLAG_DISCARD (1 << 2) +/** + * A flag to mark frames whose content is interlaced. + */ +#define AV_FRAME_FLAG_INTERLACED (1 << 3) +/** + * A flag to mark frames where the top field is displayed first if the content + * is interlaced. + */ +#define AV_FRAME_FLAG_TOP_FIELD_FIRST (1 << 4) /** * @} */ @@ -611,12 +675,17 @@ typedef struct AVFrame { */ int64_t best_effort_timestamp; +#if FF_API_FRAME_PKT /** * reordered pos from the last AVPacket that has been input into the decoder * - encoding: unused * - decoding: Read by user. + * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user + * data from packets to frames */ + attribute_deprecated int64_t pkt_pos; +#endif #if FF_API_PKT_DURATION /** @@ -662,14 +731,19 @@ typedef struct AVFrame { int channels; #endif +#if FF_API_FRAME_PKT /** * 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. + * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user + * data from packets to frames */ + attribute_deprecated int pkt_size; +#endif /** * For hwaccel-format frames, this should be a reference to the @@ -678,13 +752,18 @@ typedef struct AVFrame { AVBufferRef *hw_frames_ctx; /** - * AVBufferRef for free use by the API user. FFmpeg will never check the - * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when - * the frame is unreferenced. av_frame_copy_props() calls create a new - * reference with av_buffer_ref() for the target frame's opaque_ref field. + * Frame owner's private data. * - * This is unrelated to the opaque field, although it serves a similar - * purpose. + * This field may be set by the code that allocates/owns the frame data. + * It is then not touched by any library functions, except: + * - a new reference to the underlying buffer is propagated by + * av_frame_copy_props() (and hence by av_frame_ref()); + * - it is unreferenced in av_frame_unref(); + * - on the caller's explicit request. E.g. libavcodec encoders/decoders + * will propagate a new reference to/from @ref AVPacket "AVPackets" if the + * caller sets @ref AV_CODEC_FLAG_COPY_OPAQUE. + * + * @see opaque the plain pointer analogue */ AVBufferRef *opaque_ref; @@ -767,6 +846,19 @@ void av_frame_free(AVFrame **frame); */ int av_frame_ref(AVFrame *dst, const AVFrame *src); +/** + * Ensure the destination frame refers to the same data described by the source + * frame, either by creating a new reference for each AVBufferRef from src if + * they differ from those in dst, by allocating new buffers and copying data if + * src is not reference counted, or by unrefencing it if src is empty. + * + * Frame properties on dst will be replaced by those from src. + * + * @return 0 on success, a negative AVERROR on error. On error, dst is + * unreferenced. + */ +int av_frame_replace(AVFrame *dst, const AVFrame *src); + /** * Create a new frame that references the same data as src. * @@ -875,7 +967,7 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src); * @return the buffer reference that contains the plane or NULL if the input * frame is not valid. */ -AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane); +AVBufferRef *av_frame_get_plane_buffer(const AVFrame *frame, int plane); /** * Add a new side data to a frame. diff --git a/FFmpeg/include/libavutil/hdr_dynamic_metadata.h b/FFmpeg/include/libavutil/hdr_dynamic_metadata.h index 2d72de5..09e9d8b 100644 --- a/FFmpeg/include/libavutil/hdr_dynamic_metadata.h +++ b/FFmpeg/include/libavutil/hdr_dynamic_metadata.h @@ -340,4 +340,37 @@ AVDynamicHDRPlus *av_dynamic_hdr_plus_alloc(size_t *size); */ AVDynamicHDRPlus *av_dynamic_hdr_plus_create_side_data(AVFrame *frame); +/** + * Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). + * The T.35 buffer must begin with the application mode, skipping the + * country code, terminal provider codes, and application identifier. + * @param s A pointer containing the decoded AVDynamicHDRPlus structure. + * @param data The byte array containing the raw ITU-T T.35 data. + * @param size Size of the data array in bytes. + * + * @return >= 0 on success. Otherwise, returns the appropriate AVERROR. + */ +int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus *s, const uint8_t *data, + size_t size); + +#define AV_HDR_PLUS_MAX_PAYLOAD_SIZE 907 + +/** + * Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, + * excluding the first 48 bytes of the header, and beginning with the application mode. + * @param s A pointer containing the decoded AVDynamicHDRPlus structure. + * @param data[in,out] A pointer to pointer to a byte buffer to be filled with the + * serialized metadata. + * If *data is NULL, a buffer be will be allocated and a pointer to + * it stored in its place. The caller assumes ownership of the buffer. + * May be NULL, in which case the function will only store the + * required buffer size in *size. + * @param size[in,out] A pointer to a size to be set to the returned buffer's size. + * If *data is not NULL, *size must contain the size of the input + * buffer. May be NULL only if *data is NULL. + * + * @return >= 0 on success. Otherwise, returns the appropriate AVERROR. + */ +int av_dynamic_hdr_plus_to_t35(const AVDynamicHDRPlus *s, uint8_t **data, size_t *size); + #endif /* AVUTIL_HDR_DYNAMIC_METADATA_H */ diff --git a/FFmpeg/include/libavutil/hdr_dynamic_vivid_metadata.h b/FFmpeg/include/libavutil/hdr_dynamic_vivid_metadata.h index a34f830..4524a81 100644 --- a/FFmpeg/include/libavutil/hdr_dynamic_vivid_metadata.h +++ b/FFmpeg/include/libavutil/hdr_dynamic_vivid_metadata.h @@ -24,6 +24,52 @@ #include "frame.h" #include "rational.h" +/** + * HDR Vivid three spline params. + */ +typedef struct AVHDRVivid3SplineParams { + /** + * The mode of three Spline. the value shall be in the range + * of 0 to 3, inclusive. + */ + int th_mode; + + /** + * three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive + * and in multiples of 1.0/255. + * + */ + AVRational th_enable_mb; + + /** + * 3Spline_TH_enable of three Spline. + * The value shall be in the range of 0.0 to 1.0, inclusive. + * and in multiples of 1.0/4095. + */ + AVRational th_enable; + + /** + * 3Spline_TH_Delta1 of three Spline. + * The value shall be in the range of 0.0 to 0.25, inclusive, + * and in multiples of 0.25/1023. + */ + AVRational th_delta1; + + /** + * 3Spline_TH_Delta2 of three Spline. + * The value shall be in the range of 0.0 to 0.25, inclusive, + * and in multiples of 0.25/1023. + */ + AVRational th_delta2; + + /** + * 3Spline_enable_Strength of three Spline. + * The value shall be in the range of 0.0 to 1.0, inclusive, + * and in multiples of 1.0/255. + */ + AVRational enable_strength; +} AVHDRVivid3SplineParams; + /** * Color tone mapping parameters at a processing window in a dynamic metadata for * CUVA 005.1:2021. @@ -122,46 +168,61 @@ typedef struct AVHDRVividColorToneMappingParams { */ int three_Spline_num; +#if FF_API_HDR_VIVID_THREE_SPLINE /** * The mode of three Spline. the value shall be in the range * of 0 to 3, inclusive. + * @deprecated Use three_spline instead */ + attribute_deprecated int three_Spline_TH_mode; /** * three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive * and in multiples of 1.0/255. - * + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_TH_enable_MB; /** * 3Spline_TH_enable of three Spline. * The value shall be in the range of 0.0 to 1.0, inclusive. * and in multiples of 1.0/4095. + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_TH_enable; /** * 3Spline_TH_Delta1 of three Spline. * The value shall be in the range of 0.0 to 0.25, inclusive, * and in multiples of 0.25/1023. + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_TH_Delta1; /** * 3Spline_TH_Delta2 of three Spline. * The value shall be in the range of 0.0 to 0.25, inclusive, * and in multiples of 0.25/1023. + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_TH_Delta2; /** * 3Spline_enable_Strength of three Spline. * The value shall be in the range of 0.0 to 1.0, inclusive, * and in multiples of 1.0/255. + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_enable_Strength; +#endif + + AVHDRVivid3SplineParams three_spline[2]; } AVHDRVividColorToneMappingParams; diff --git a/FFmpeg/include/libavutil/hwcontext_cuda.h b/FFmpeg/include/libavutil/hwcontext_cuda.h index cefbe0c..cbad434 100644 --- a/FFmpeg/include/libavutil/hwcontext_cuda.h +++ b/FFmpeg/include/libavutil/hwcontext_cuda.h @@ -62,6 +62,11 @@ typedef struct AVCUDADeviceContext { */ #define AV_CUDA_USE_PRIMARY_CONTEXT (1 << 0) +/** + * Use current device context instead of creating a new one. + */ +#define AV_CUDA_USE_CURRENT_CONTEXT (1 << 1) + /** * @} */ diff --git a/FFmpeg/include/libavutil/hwcontext_vulkan.h b/FFmpeg/include/libavutil/hwcontext_vulkan.h index df86c85..895794c 100644 --- a/FFmpeg/include/libavutil/hwcontext_vulkan.h +++ b/FFmpeg/include/libavutil/hwcontext_vulkan.h @@ -27,6 +27,8 @@ #include "pixfmt.h" #include "frame.h" +typedef struct AVVkFrame AVVkFrame; + /** * @file * API-specific header for AV_HWDEVICE_TYPE_VULKAN. @@ -53,7 +55,7 @@ typedef struct AVVulkanDeviceContext { PFN_vkGetInstanceProcAddr get_proc_addr; /** - * Vulkan instance. Must be at least version 1.2. + * Vulkan instance. Must be at least version 1.3. */ VkInstance inst; @@ -135,6 +137,19 @@ typedef struct AVVulkanDeviceContext { */ int queue_family_decode_index; int nb_decode_queues; + + /** + * Locks a queue, preventing other threads from submitting any command + * buffers to this queue. + * If set to NULL, will be set to lavu-internal functions that utilize a + * mutex. + */ + void (*lock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index); + + /** + * Similar to lock_queue(), unlocks a queue. Must only be called after locking. + */ + void (*unlock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index); } AVVulkanDeviceContext; /** @@ -145,10 +160,14 @@ typedef enum AVVkFrameFlags { * device and tiling during av_hwframe_ctx_init(). */ AV_VK_FRAME_FLAG_NONE = (1ULL << 0), - /* Image planes will be allocated in a single VkDeviceMemory, rather - * than as per-plane VkDeviceMemory allocations. Required for exporting - * to VAAPI on Intel devices. */ +#if FF_API_VULKAN_CONTIGUOUS_MEMORY + /* DEPRECATED: does nothing. Replaced by multiplane images. */ AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY = (1ULL << 1), +#endif + + /* Disables multiplane images. + * This is required to export/import images from CUDA. */ + AV_VK_FRAME_FLAG_DISABLE_MULTIPLANE = (1ULL << 2), } AVVkFrameFlags; /** @@ -156,26 +175,32 @@ typedef enum AVVkFrameFlags { */ typedef struct AVVulkanFramesContext { /** - * Controls the tiling of allocated frames. If left as optimal tiling, - * then during av_hwframe_ctx_init() will decide based on whether the device - * supports DRM modifiers, or if the linear_images flag is set, otherwise - * will allocate optimally-tiled images. + * Controls the tiling of allocated frames. + * If left as VK_IMAGE_TILING_OPTIMAL (0), will use optimal tiling. + * Can be set to VK_IMAGE_TILING_LINEAR to force linear images, + * or VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT to force DMABUF-backed + * images. + * @note Imported frames from other APIs ignore this. */ VkImageTiling tiling; /** - * Defines extra usage of output frames. If left as 0, the following bits - * are set: TRANSFER_SRC, TRANSFER_DST. SAMPLED and STORAGE. + * Defines extra usage of output frames. If non-zero, all flags MUST be + * supported by the VkFormat. Otherwise, will use supported flags amongst: + * - VK_IMAGE_USAGE_SAMPLED_BIT + * - VK_IMAGE_USAGE_STORAGE_BIT + * - VK_IMAGE_USAGE_TRANSFER_SRC_BIT + * - VK_IMAGE_USAGE_TRANSFER_DST_BIT */ VkImageUsageFlagBits usage; /** * Extension data for image creation. - * If VkImageDrmFormatModifierListCreateInfoEXT is present in the chain, - * and the device supports DRM modifiers, then images will be allocated - * with the specific requested DRM modifiers. + * If DRM tiling is used, a VkImageDrmFormatModifierListCreateInfoEXT structure + * can be added to specify the exact modifier to use. + * * Additional structures may be added at av_hwframe_ctx_init() time, - * which will be freed automatically on uninit(), so users need only free + * which will be freed automatically on uninit(), so users must only free * any structures they've allocated themselves. */ void *create_pnext; @@ -195,36 +220,65 @@ typedef struct AVVulkanFramesContext { * av_hwframe_ctx_init(). */ AVVkFrameFlags flags; + + /** + * Flags to set during image creation. If unset, defaults to + * VK_IMAGE_CREATE_ALIAS_BIT. + */ + VkImageCreateFlags img_flags; + + /** + * Vulkan format for each image. MUST be compatible with the pixel format. + * If unset, will be automatically set. + * There are at most two compatible formats for a frame - a multiplane + * format, and a single-plane multi-image format. + */ + VkFormat format[AV_NUM_DATA_POINTERS]; + + /** + * Number of layers each image will have. + */ + int nb_layers; + + /** + * Locks a frame, preventing other threads from changing frame properties. + * Users SHOULD only ever lock just before command submission in order + * to get accurate frame properties, and unlock immediately after command + * submission without waiting for it to finish. + * + * If unset, will be set to lavu-internal functions that utilize a mutex. + */ + void (*lock_frame)(struct AVHWFramesContext *fc, AVVkFrame *vkf); + + /** + * Similar to lock_frame(), unlocks a frame. Must only be called after locking. + */ + void (*unlock_frame)(struct AVHWFramesContext *fc, AVVkFrame *vkf); } AVVulkanFramesContext; /* - * Frame structure, the VkFormat of the image will always match - * the pool's sw_format. - * All frames, imported or allocated, will be created with the - * VK_IMAGE_CREATE_ALIAS_BIT flag set, so the memory may be aliased if needed. - * - * If all queue family indices in the device context are the same, - * images will be created with the EXCLUSIVE sharing mode. Otherwise, all images - * will be created using the CONCURRENT sharing mode. + * Frame structure. * * @note the size of this structure is not part of the ABI, to allocate * you must use @av_vk_frame_alloc(). */ -typedef struct AVVkFrame { +struct AVVkFrame { /** * Vulkan images to which the memory is bound to. + * May be one for multiplane formats, or multiple. */ VkImage img[AV_NUM_DATA_POINTERS]; /** - * The same tiling must be used for all images in the frame. + * Tiling for the frame. */ VkImageTiling tiling; /** - * Memory backing the images. Could be less than the amount of planes, - * in which case the offset value will indicate the binding offset of - * each plane in the memory. + * Memory backing the images. Either one, or as many as there are planes + * in the sw_format. + * In case of having multiple VkImages, but one memory, the offset field + * will indicate the bound offset for each image. */ VkDeviceMemory mem[AV_NUM_DATA_POINTERS]; size_t size[AV_NUM_DATA_POINTERS]; @@ -235,13 +289,13 @@ typedef struct AVVkFrame { VkMemoryPropertyFlagBits flags; /** - * Updated after every barrier + * Updated after every barrier. One per VkImage. */ VkAccessFlagBits access[AV_NUM_DATA_POINTERS]; VkImageLayout layout[AV_NUM_DATA_POINTERS]; /** - * Synchronization timeline semaphores, one for each sw_format plane. + * Synchronization timeline semaphores, one for each VkImage. * Must not be freed manually. Must be waited on at every submission using * the value in sem_value, and must be signalled at every submission, * using an incremented value. @@ -250,6 +304,7 @@ typedef struct AVVkFrame { /** * Up to date semaphore value at which each image becomes accessible. + * One per VkImage. * Clients must wait on this value when submitting a command queue, * and increment it when signalling. */ @@ -261,10 +316,18 @@ typedef struct AVVkFrame { struct AVVkFrameInternal *internal; /** - * Describes the binding offset of each plane to the VkDeviceMemory. + * Describes the binding offset of each image to the VkDeviceMemory. + * One per VkImage. */ ptrdiff_t offset[AV_NUM_DATA_POINTERS]; -} AVVkFrame; + + /** + * Queue family of the images. Must be VK_QUEUE_FAMILY_IGNORED if + * the image was allocated with the CONCURRENT concurrency option. + * One per VkImage. + */ + uint32_t queue_family[AV_NUM_DATA_POINTERS]; +}; /** * Allocates a single AVVkFrame and initializes everything as 0. @@ -273,7 +336,8 @@ typedef struct AVVkFrame { AVVkFrame *av_vk_frame_alloc(void); /** - * Returns the format of each image up to the number of planes for a given sw_format. + * Returns the optimal per-plane Vulkan format for a given sw_format, + * one for each plane. * Returns NULL on unsupported formats. */ const VkFormat *av_vkfmt_from_pixfmt(enum AVPixelFormat p); diff --git a/FFmpeg/include/libavutil/imgutils.h b/FFmpeg/include/libavutil/imgutils.h index e10ac14..fa3bb10 100644 --- a/FFmpeg/include/libavutil/imgutils.h +++ b/FFmpeg/include/libavutil/imgutils.h @@ -170,10 +170,26 @@ void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize, * @param width width of the image in pixels * @param height height of the image in pixels */ -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); +/** + * Wrapper around av_image_copy() to workaround the limitation + * that the conversion from uint8_t * const * to const uint8_t * const * + * is not performed automatically in C. + * @see av_image_copy() + */ +static inline +void av_image_copy2(uint8_t * const dst_data[4], const int dst_linesizes[4], + uint8_t * const src_data[4], const int src_linesizes[4], + enum AVPixelFormat pix_fmt, int width, int height) +{ + av_image_copy(dst_data, dst_linesizes, + (const uint8_t * const *)src_data, src_linesizes, + pix_fmt, width, height); +} + /** * Copy image data located in uncacheable (e.g. GPU mapped) memory. Where * available, this function will use special functionality for reading from such @@ -188,8 +204,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], * @note On x86, the linesizes currently need to be aligned to the cacheline * size (i.e. 64) to get improved performance. */ -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); /** @@ -319,7 +335,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar); * @param height the height of the image in pixels * @return 0 if the image data was cleared, a negative AVERROR code otherwise */ -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height); diff --git a/FFmpeg/include/libavutil/intreadwrite.h b/FFmpeg/include/libavutil/intreadwrite.h index 4c8413a..21df788 100644 --- a/FFmpeg/include/libavutil/intreadwrite.h +++ b/FFmpeg/include/libavutil/intreadwrite.h @@ -72,8 +72,6 @@ typedef union { # include "mips/intreadwrite.h" #elif ARCH_PPC # include "ppc/intreadwrite.h" -#elif ARCH_TOMI -# include "tomi/intreadwrite.h" #elif ARCH_X86 # include "x86/intreadwrite.h" #endif @@ -215,7 +213,7 @@ typedef union { * by per-arch headers. */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; diff --git a/FFmpeg/include/libavutil/mathematics.h b/FFmpeg/include/libavutil/mathematics.h index e4aff1e..e213bab 100644 --- a/FFmpeg/include/libavutil/mathematics.h +++ b/FFmpeg/include/libavutil/mathematics.h @@ -36,30 +36,81 @@ #ifndef M_E #define M_E 2.7182818284590452354 /* e */ #endif +#ifndef M_Ef +#define M_Ef 2.7182818284590452354f /* e */ +#endif #ifndef M_LN2 #define M_LN2 0.69314718055994530942 /* log_e 2 */ #endif +#ifndef M_LN2f +#define M_LN2f 0.69314718055994530942f /* log_e 2 */ +#endif #ifndef M_LN10 #define M_LN10 2.30258509299404568402 /* log_e 10 */ #endif +#ifndef M_LN10f +#define M_LN10f 2.30258509299404568402f /* log_e 10 */ +#endif #ifndef M_LOG2_10 #define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ #endif +#ifndef M_LOG2_10f +#define M_LOG2_10f 3.32192809488736234787f /* log_2 10 */ +#endif #ifndef M_PHI #define M_PHI 1.61803398874989484820 /* phi / golden ratio */ #endif +#ifndef M_PHIf +#define M_PHIf 1.61803398874989484820f /* phi / golden ratio */ +#endif #ifndef M_PI #define M_PI 3.14159265358979323846 /* pi */ #endif +#ifndef M_PIf +#define M_PIf 3.14159265358979323846f /* pi */ +#endif #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923 /* pi/2 */ #endif +#ifndef M_PI_2f +#define M_PI_2f 1.57079632679489661923f /* pi/2 */ +#endif +#ifndef M_PI_4 +#define M_PI_4 0.78539816339744830962 /* pi/4 */ +#endif +#ifndef M_PI_4f +#define M_PI_4f 0.78539816339744830962f /* pi/4 */ +#endif +#ifndef M_1_PI +#define M_1_PI 0.31830988618379067154 /* 1/pi */ +#endif +#ifndef M_1_PIf +#define M_1_PIf 0.31830988618379067154f /* 1/pi */ +#endif +#ifndef M_2_PI +#define M_2_PI 0.63661977236758134308 /* 2/pi */ +#endif +#ifndef M_2_PIf +#define M_2_PIf 0.63661977236758134308f /* 2/pi */ +#endif +#ifndef M_2_SQRTPI +#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ +#endif +#ifndef M_2_SQRTPIf +#define M_2_SQRTPIf 1.12837916709551257390f /* 2/sqrt(pi) */ +#endif #ifndef M_SQRT1_2 #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ #endif +#ifndef M_SQRT1_2f +#define M_SQRT1_2f 0.70710678118654752440f /* 1/sqrt(2) */ +#endif #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ #endif +#ifndef M_SQRT2f +#define M_SQRT2f 1.41421356237309504880f /* sqrt(2) */ +#endif #ifndef NAN #define NAN av_int2float(0x7fc00000) #endif @@ -237,6 +288,10 @@ int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int */ int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc); +/** + * 0th order modified bessel function of the first kind. + */ +double av_bessel_i0(double x); /** * @} diff --git a/FFmpeg/include/libavutil/mem.h b/FFmpeg/include/libavutil/mem.h index 62b4ca6..ab7648a 100644 --- a/FFmpeg/include/libavutil/mem.h +++ b/FFmpeg/include/libavutil/mem.h @@ -27,12 +27,10 @@ #ifndef AVUTIL_MEM_H #define AVUTIL_MEM_H -#include +#include #include #include "attributes.h" -#include "avutil.h" -#include "version.h" /** * @addtogroup lavu_mem diff --git a/FFmpeg/include/libavutil/pixfmt.h b/FFmpeg/include/libavutil/pixfmt.h index 37c2c79..a26c72d 100644 --- a/FFmpeg/include/libavutil/pixfmt.h +++ b/FFmpeg/include/libavutil/pixfmt.h @@ -420,6 +420,15 @@ enum AVPixelFormat { AV_PIX_FMT_RGBAF32BE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian AV_PIX_FMT_RGBAF32LE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian + AV_PIX_FMT_P212BE, ///< interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian + AV_PIX_FMT_P212LE, ///< interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian + + AV_PIX_FMT_P412BE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian + AV_PIX_FMT_P412LE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian + + AV_PIX_FMT_GBRAP14BE, ///< planar GBR 4:4:4:4 56bpp, big-endian + AV_PIX_FMT_GBRAP14LE, ///< planar GBR 4:4:4:4 56bpp, little-endian + AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; @@ -478,6 +487,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) #define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) #define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) +#define AV_PIX_FMT_GBRAP14 AV_PIX_FMT_NE(GBRAP14BE, GBRAP14LE) #define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) #define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) @@ -518,6 +528,8 @@ enum AVPixelFormat { #define AV_PIX_FMT_P210 AV_PIX_FMT_NE(P210BE, P210LE) #define AV_PIX_FMT_P410 AV_PIX_FMT_NE(P410BE, P410LE) +#define AV_PIX_FMT_P212 AV_PIX_FMT_NE(P212BE, P212LE) +#define AV_PIX_FMT_P412 AV_PIX_FMT_NE(P412BE, P412LE) #define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE) #define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE) diff --git a/FFmpeg/include/libavutil/random_seed.h b/FFmpeg/include/libavutil/random_seed.h index 0462a04..8a47be9 100644 --- a/FFmpeg/include/libavutil/random_seed.h +++ b/FFmpeg/include/libavutil/random_seed.h @@ -21,6 +21,7 @@ #ifndef AVUTIL_RANDOM_SEED_H #define AVUTIL_RANDOM_SEED_H +#include #include /** * @addtogroup lavu_crypto @@ -36,6 +37,19 @@ */ uint32_t av_get_random_seed(void); +/** + * Generate cryptographically secure random data, i.e. suitable for use as + * encryption keys and similar. + * + * @param buf buffer into which the random data will be written + * @param len size of buf in bytes + * + * @retval 0 success, len bytes of random data was written + * into buf + * @retval "a negative AVERROR code" random data could not be generated + */ +int av_random_bytes(uint8_t *buf, size_t len); + /** * @} */ diff --git a/FFmpeg/include/libavutil/samplefmt.h b/FFmpeg/include/libavutil/samplefmt.h index 6bad0e2..43a57a4 100644 --- a/FFmpeg/include/libavutil/samplefmt.h +++ b/FFmpeg/include/libavutil/samplefmt.h @@ -246,7 +246,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, +int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); @@ -259,7 +259,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, +int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); /** diff --git a/FFmpeg/include/libavutil/timestamp.h b/FFmpeg/include/libavutil/timestamp.h index e082f01..9ae64da 100644 --- a/FFmpeg/include/libavutil/timestamp.h +++ b/FFmpeg/include/libavutil/timestamp.h @@ -24,7 +24,7 @@ #ifndef AVUTIL_TIMESTAMP_H #define AVUTIL_TIMESTAMP_H -#include "common.h" +#include "avutil.h" #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS diff --git a/FFmpeg/include/libavutil/tx.h b/FFmpeg/include/libavutil/tx.h index 064edbc..4696988 100644 --- a/FFmpeg/include/libavutil/tx.h +++ b/FFmpeg/include/libavutil/tx.h @@ -105,6 +105,30 @@ enum AVTXType { AV_TX_DOUBLE_DCT = 10, AV_TX_INT32_DCT = 11, + /** + * Discrete Cosine Transform I + * + * The forward transform is a DCT-I. + * The inverse transform is a DCT-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DCT_I = 12, + AV_TX_DOUBLE_DCT_I = 13, + AV_TX_INT32_DCT_I = 14, + + /** + * Discrete Sine Transform I + * + * The forward transform is a DST-I. + * The inverse transform is a DST-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DST_I = 15, + AV_TX_DOUBLE_DST_I = 16, + AV_TX_INT32_DST_I = 17, + /* Not part of the API, do not use */ AV_TX_NB, }; @@ -149,6 +173,16 @@ enum AVTXFlags { * Ignored for all transforms but inverse MDCTs. */ AV_TX_FULL_IMDCT = 1ULL << 2, + + /** + * Perform a real to half-complex RDFT. + * Only the real, or imaginary coefficients will + * be output, depending on the flag used. Only available for forward RDFTs. + * Output array must have enough space to hold N complex values + * (regular size for a real to complex transform). + */ + AV_TX_REAL_TO_REAL = 1ULL << 3, + AV_TX_REAL_TO_IMAGINARY = 1ULL << 4, }; /** diff --git a/FFmpeg/include/libavutil/version.h b/FFmpeg/include/libavutil/version.h index e8ec604..7c0600d 100644 --- a/FFmpeg/include/libavutil/version.h +++ b/FFmpeg/include/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 58 -#define LIBAVUTIL_VERSION_MINOR 2 +#define LIBAVUTIL_VERSION_MINOR 29 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -113,6 +113,12 @@ #define FF_API_PKT_DURATION (LIBAVUTIL_VERSION_MAJOR < 59) #define FF_API_REORDERED_OPAQUE (LIBAVUTIL_VERSION_MAJOR < 59) #define FF_API_FRAME_PICTURE_NUMBER (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_HDR_VIVID_THREE_SPLINE (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_FRAME_PKT (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_INTERLACED_FRAME (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_FRAME_KEY (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 59) +#define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 59) /** * @} diff --git a/FFmpeg/include/libavutil/video_enc_params.h b/FFmpeg/include/libavutil/video_enc_params.h index fc0c3bc..62265a5 100644 --- a/FFmpeg/include/libavutil/video_enc_params.h +++ b/FFmpeg/include/libavutil/video_enc_params.h @@ -136,8 +136,8 @@ typedef struct AVVideoBlockParams { int32_t delta_qp; } AVVideoBlockParams; -/* - * Get the block at the specified {@code idx}. Must be between 0 and nb_blocks. +/** + * Get the block at the specified {@code idx}. Must be between 0 and nb_blocks - 1. */ static av_always_inline AVVideoBlockParams* av_video_enc_params_block(AVVideoEncParams *par, unsigned int idx) diff --git a/FFmpeg/include/libavutil/video_hint.h b/FFmpeg/include/libavutil/video_hint.h new file mode 100644 index 0000000..1b21960 --- /dev/null +++ b/FFmpeg/include/libavutil/video_hint.h @@ -0,0 +1,107 @@ +/** + * Copyright 2023 Elias Carotti + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_VIDEO_HINT_H +#define AVUTIL_VIDEO_HINT_H + +#include +#include +#include "libavutil/avassert.h" +#include "libavutil/frame.h" + +typedef struct AVVideoRect { + uint32_t x, y; + uint32_t width, height; +} AVVideoRect; + +typedef enum AVVideoHintType { + /* rectangled delimit the constant areas (unchanged), default is changed */ + AV_VIDEO_HINT_TYPE_CONSTANT, + + /* rectangled delimit the constant areas (changed), default is not changed */ + AV_VIDEO_HINT_TYPE_CHANGED, +} AVVideoHintType; + +typedef struct AVVideoHint { + /** + * Number of AVVideoRect present. + * + * May be 0, in which case no per-rectangle information is present. In this + * case the values of rect_offset / rect_size are unspecified and should + * not be accessed. + */ + size_t nb_rects; + + /** + * Offset in bytes from the beginning of this structure at which the array + * of AVVideoRect starts. + */ + size_t rect_offset; + + /** + * Size in bytes of AVVideoRect. + */ + size_t rect_size; + + AVVideoHintType type; +} AVVideoHint; + +static av_always_inline AVVideoRect * +av_video_hint_rects(const AVVideoHint *hints) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset); +} + +static av_always_inline AVVideoRect * +av_video_hint_get_rect(const AVVideoHint *hints, size_t idx) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset + idx * hints->rect_size); +} + +/** + * Allocate memory for the AVVideoHint struct along with an nb_rects-sized + * arrays of AVVideoRect. + * + * The side data contains a list of rectangles for the portions of the frame + * which changed from the last encoded one (and the remainder are assumed to be + * changed), or, alternately (depending on the type parameter) the unchanged + * ones (and the remanining ones are those which changed). + * Macroblocks will thus be hinted either to be P_SKIP-ped or go through the + * regular encoding procedure. + * + * It's responsibility of the caller to fill the AVRects accordingly, and to set + * the proper AVVideoHintType field. + * + * @param out_size if non-NULL, the size in bytes of the resulting data array is + * written here + * + * @return newly allocated AVVideoHint struct (must be freed by the caller using + * av_free()) on success, NULL on memory allocation failure + */ +AVVideoHint *av_video_hint_alloc(size_t nb_rects, + size_t *out_size); + +/** + * Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached + * as side data of type AV_FRAME_DATA_VIDEO_HINT_INFO to frame. + */ +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, + size_t nb_rects); + + +#endif /* AVUTIL_VIDEO_HINT_H */ diff --git a/FFmpeg/include/libpostproc/version.h b/FFmpeg/include/libpostproc/version.h index 8294f00..e77dff9 100644 --- a/FFmpeg/include/libpostproc/version.h +++ b/FFmpeg/include/libpostproc/version.h @@ -30,7 +30,7 @@ #include "version_major.h" -#define LIBPOSTPROC_VERSION_MINOR 1 +#define LIBPOSTPROC_VERSION_MINOR 3 #define LIBPOSTPROC_VERSION_MICRO 100 #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ diff --git a/FFmpeg/include/libswresample/version.h b/FFmpeg/include/libswresample/version.h index 31ecf6f..a2668b5 100644 --- a/FFmpeg/include/libswresample/version.h +++ b/FFmpeg/include/libswresample/version.h @@ -30,7 +30,7 @@ #include "version_major.h" -#define LIBSWRESAMPLE_VERSION_MINOR 10 +#define LIBSWRESAMPLE_VERSION_MINOR 12 #define LIBSWRESAMPLE_VERSION_MICRO 100 #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ diff --git a/FFmpeg/include/libswscale/version.h b/FFmpeg/include/libswscale/version.h index 4e54701..c13db31 100644 --- a/FFmpeg/include/libswscale/version.h +++ b/FFmpeg/include/libswscale/version.h @@ -28,7 +28,7 @@ #include "version_major.h" -#define LIBSWSCALE_VERSION_MINOR 1 +#define LIBSWSCALE_VERSION_MINOR 5 #define LIBSWSCALE_VERSION_MICRO 100 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ diff --git a/README.md b/README.md index 4c10745..476e1b7 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Normally you need to set static ```ffmpeg.RootPath = ``` with full path to FFmpe The bindings generator uses [CppSharp](https://github.com/mono/CppSharp). Prerequisites: - - Visual Studio 2019 with C# and C++ desktop development workloads and Windows SDK for desktop. + - Visual Studio 2022 with C# and C++ desktop development workloads and Windows SDK for desktop. Steps to generate: - Run ```FFmpeg.AutoGen.CppSharpUnsafeGenerator;```