diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Editor.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Editor.meta new file mode 100644 index 0000000..a648be2 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e9e076a217436a47b4b81811b4505db +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Editor/LeviathanVideoMenu.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Editor/LeviathanVideoMenu.cs new file mode 100644 index 0000000..f39af8e --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Editor/LeviathanVideoMenu.cs @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: Hierarchy 右键菜单创建视频播放器 +//----------------------------------------------------------------*/ + +using UnityEngine; +using UnityEditor; +using UnityEngine.UI; + +public static class LeviathanVideoMenu +{ + /// + /// 创建 UI 视频播放器 (RawImage) + /// + [MenuItem("GameObject/Leviathan Video/Leviathan Video Player (UI)", false, 10)] + private static void CreateUIVideoPlayer(MenuCommand menuCommand) + { + // 创建 GameObject + GameObject go = new GameObject("LeviathanVideoPlayer"); + + // 添加 RectTransform(UI 组件需要) + RectTransform rectTransform = go.AddComponent(); + rectTransform.sizeDelta = new Vector2(400, 300); + + // 添加 RawImage 组件(LeviathanVideoDecoder 需要) + RawImage rawImage = go.AddComponent(); + rawImage.color = Color.white; + + // 添加视频解码器组件 + go.AddComponent(); + + // 设置父物体 + GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject); + + // 如果没有父物体,尝试放到 Canvas 下 + if (go.transform.parent == null) + { + Canvas canvas = Object.FindObjectOfType(); + if (canvas != null) + { + go.transform.SetParent(canvas.transform, false); + } + else + { + // 如果没有 Canvas,创建一个 + GameObject canvasGO = new GameObject("Canvas"); + canvas = canvasGO.AddComponent(); + canvas.renderMode = RenderMode.ScreenSpaceOverlay; + canvasGO.AddComponent(); + canvasGO.AddComponent(); + go.transform.SetParent(canvas.transform, false); + } + } + + // 注册撤销 + Undo.RegisterCreatedObjectUndo(go, "Create Leviathan Video Player (UI)"); + + // 选中创建的对象 + Selection.activeObject = go; + } + + /// + /// 创建 3D 视频播放器 (Cube) + /// + [MenuItem("GameObject/Leviathan Video/Leviathan Video Player (3D Cube)", false, 11)] + private static void Create3DVideoPlayerCube(MenuCommand menuCommand) + { + // 创建 Cube + GameObject go = GameObject.CreatePrimitive(PrimitiveType.Cube); + go.name = "LeviathanVideoPlayer3D"; + + // 添加视频渲染器组件 + go.AddComponent(); + + // 设置父物体 + GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject); + + // 注册撤销 + Undo.RegisterCreatedObjectUndo(go, "Create Leviathan Video Player (3D Cube)"); + + // 选中创建的对象 + Selection.activeObject = go; + } + + /// + /// 创建 3D 视频播放器 (Quad/Plane) + /// + [MenuItem("GameObject/Leviathan Video/Leviathan Video Player (3D Quad)", false, 12)] + private static void Create3DVideoPlayerQuad(MenuCommand menuCommand) + { + // 创建 Quad + GameObject go = GameObject.CreatePrimitive(PrimitiveType.Quad); + go.name = "LeviathanVideoPlayer3D"; + + // 添加视频渲染器组件 + go.AddComponent(); + + // 设置父物体 + GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject); + + // 注册撤销 + Undo.RegisterCreatedObjectUndo(go, "Create Leviathan Video Player (3D Quad)"); + + // 选中创建的对象 + Selection.activeObject = go; + } +} + diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Editor/LeviathanVideoMenu.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Editor/LeviathanVideoMenu.cs.meta new file mode 100644 index 0000000..2849f69 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Editor/LeviathanVideoMenu.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7270087496e8e04a9f7984720cd2362 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Editor/WeChatMiniGameMenu.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Editor/WeChatMiniGameMenu.cs new file mode 100644 index 0000000..4f6c2e7 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Editor/WeChatMiniGameMenu.cs @@ -0,0 +1,125 @@ +#if UNITY_WEBGL +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEditor.PackageManager.Requests; +using UnityEngine; +using System.IO; + +namespace LeviathanVideo.Editor +{ + public static class WeChatMiniGameMenu + { + private const string SourcePath = "Assets/WX-WASM-SDK-V2-v0.1.32~"; + private const string TargetPath = "Assets/WX-WASM-SDK-V2"; + private const string LeviathanWasmPath = "Assets/WX-WASM-SDK-V2/Editor/template/minigame/leviathan.wasm.br"; + private const string WeChatSDKGitUrl = "https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git"; + + private static AddRequest _addRequest; + + // 验证函数:只在 WX-WASM-SDK-V2 文件夹不存在时启用 + [MenuItem("微信小游戏/[LeviathanVideo] 安装微信SDK", true)] + public static bool ValidateInstallWeChatSDK() + { + return !Directory.Exists(TargetPath); + } + + [MenuItem("微信小游戏/[LeviathanVideo] 安装微信SDK", false)] + public static void InstallWeChatSDK() + { + Debug.Log($"[LeviathanVideo] 开始安装微信SDK: {WeChatSDKGitUrl}"); + _addRequest = Client.Add(WeChatSDKGitUrl); + EditorApplication.update += OnInstallProgress; + } + + private static void OnInstallProgress() + { + if (_addRequest == null || !_addRequest.IsCompleted) + return; + + EditorApplication.update -= OnInstallProgress; + + if (_addRequest.Status == StatusCode.Success) + { + Debug.Log($"[LeviathanVideo] 微信SDK安装成功: {_addRequest.Result.packageId}"); + EditorUtility.DisplayDialog("安装成功", + $"微信小游戏SDK安装成功!\n\n包ID: {_addRequest.Result.packageId}\n\n请执行下一步操作:\n微信小游戏 -> [LeviathanVideo] ****首次安装微信SDK后需要执行此操作****", + "确定"); + } + else if (_addRequest.Status >= StatusCode.Failure) + { + Debug.LogError($"[LeviathanVideo] 微信SDK安装失败: {_addRequest.Error.message}"); + EditorUtility.DisplayDialog("安装失败", $"微信小游戏SDK安装失败!\n\n错误: {_addRequest.Error.message}", "确定"); + } + + _addRequest = null; + } + + // 验证函数:只在 leviathan.wasm.br 文件不存在时启用 + [MenuItem("微信小游戏/[LeviathanVideo] ****首次安装微信SDK后需要执行此操作**** ", true)] + public static bool ValidateCopyFiles() + { + // 需要 SDK 已安装 且 leviathan.wasm.br 文件不存在 + return Directory.Exists(TargetPath) && !File.Exists(LeviathanWasmPath); + } + + [MenuItem("微信小游戏/[LeviathanVideo] ****首次安装微信SDK后需要执行此操作**** ", false)] + public static void CopyFiles() + { + string sourcePath = Path.GetFullPath(SourcePath); + string targetPath = Path.GetFullPath(TargetPath); + + if (!Directory.Exists(sourcePath)) + { + EditorUtility.DisplayDialog("错误", $"源路径不存在: {sourcePath}", "确定"); + return; + } + + if (!Directory.Exists(targetPath)) + { + EditorUtility.DisplayDialog("错误", $"目标路径不存在: {targetPath}", "确定"); + return; + } + + try + { + CopyDirectory(sourcePath, targetPath); + AssetDatabase.Refresh(); + EditorUtility.DisplayDialog("完成", $"已将文件从\n{SourcePath}\n复制到\n{TargetPath}", "确定"); + Debug.Log($"[Leviathan] 文件复制完成: {SourcePath} -> {TargetPath}"); + } + catch (System.Exception e) + { + EditorUtility.DisplayDialog("错误", $"复制文件时出错: {e.Message}", "确定"); + Debug.LogError($"[Leviathan] 复制文件失败: {e}"); + } + } + + private static void CopyDirectory(string sourceDir, string targetDir) + { + // 复制所有文件 + foreach (string file in Directory.GetFiles(sourceDir)) + { + string fileName = Path.GetFileName(file); + string destFile = Path.Combine(targetDir, fileName); + File.Copy(file, destFile, true); + Debug.Log($"[Leviathan] 复制文件: {fileName}"); + } + + // 递归复制所有子目录 + foreach (string dir in Directory.GetDirectories(sourceDir)) + { + string dirName = Path.GetFileName(dir); + string destDir = Path.Combine(targetDir, dirName); + + if (!Directory.Exists(destDir)) + { + Directory.CreateDirectory(destDir); + } + + CopyDirectory(dir, destDir); + } + } + } +} + +#endif \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Editor/WeChatMiniGameMenu.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Editor/WeChatMiniGameMenu.cs.meta new file mode 100644 index 0000000..4080eee --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Editor/WeChatMiniGameMenu.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00d9ffb1d338f3a47a581531161a43da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins.meta new file mode 100644 index 0000000..be439cb --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7ba47a303ab5a54aa50ce9e0ef18967 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core.meta new file mode 100644 index 0000000..591ad98 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b493b78c71ed7fe49951c8084f0f8b2a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Arrays.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Arrays.g.cs new file mode 100644 index 0000000..e303794 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Arrays.g.cs @@ -0,0 +1,629 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; + +namespace LeviathanVideo.Abstractions +{ + + public unsafe struct AVRational2 : IFixedArray + { + public static readonly int ArrayLength = 2; + public int Length => 2; + AVRational _0; AVRational _1; + + public AVRational this[uint i] + { + get { if (i >= 2) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 2) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { *(p0 + i) = value; } } + } + public AVRational[] ToArray() + { + fixed (AVRational* p0 = &_0) { var a = new AVRational[2]; for (uint i = 0; i < 2; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVRational[] array) + { + fixed (AVRational* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 2) return; } } + } + public static implicit operator AVRational[](AVRational2 @struct) => @struct.ToArray(); + } + + public unsafe struct short2 : IFixedArray + { + public static readonly int ArrayLength = 2; + public int Length => 2; + fixed short _[2]; + + public short this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public short[] ToArray() + { + var a = new short[2]; for (uint i = 0; i < 2; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(short[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 2) return; } + } + public static implicit operator short[](short2 @struct) => @struct.ToArray(); + } + + public unsafe struct void_ptr2 : IFixedArray + { + public static readonly int ArrayLength = 2; + public int Length => 2; + void* _0; void* _1; + + public void* this[uint i] + { + get { if (i >= 2) throw new ArgumentOutOfRangeException(); fixed (void** p0 = &_0) { return *(p0 + i); } } + set { if (i >= 2) throw new ArgumentOutOfRangeException(); fixed (void** p0 = &_0) { *(p0 + i) = value; } } + } + public void*[] ToArray() + { + fixed (void** p0 = &_0) { var a = new void*[2]; for (uint i = 0; i < 2; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(void*[] array) + { + fixed (void** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 2) return; } } + } + public static implicit operator void*[](void_ptr2 @struct) => @struct.ToArray(); + } + + public unsafe struct AVHDRPlusColorTransformParams3 : IFixedArray + { + public static readonly int ArrayLength = 3; + public int Length => 3; + AVHDRPlusColorTransformParams _0; AVHDRPlusColorTransformParams _1; AVHDRPlusColorTransformParams _2; + + public AVHDRPlusColorTransformParams this[uint i] + { + get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVHDRPlusColorTransformParams* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVHDRPlusColorTransformParams* p0 = &_0) { *(p0 + i) = value; } } + } + public AVHDRPlusColorTransformParams[] ToArray() + { + fixed (AVHDRPlusColorTransformParams* p0 = &_0) { var a = new AVHDRPlusColorTransformParams[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVHDRPlusColorTransformParams[] array) + { + fixed (AVHDRPlusColorTransformParams* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } } + } + public static implicit operator AVHDRPlusColorTransformParams[](AVHDRPlusColorTransformParams3 @struct) => @struct.ToArray(); + } + + public unsafe struct AVRational3 : IFixedArray + { + public static readonly int ArrayLength = 3; + public int Length => 3; + AVRational _0; AVRational _1; AVRational _2; + + public AVRational this[uint i] + { + get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { *(p0 + i) = value; } } + } + public AVRational[] ToArray() + { + fixed (AVRational* p0 = &_0) { var a = new AVRational[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVRational[] array) + { + fixed (AVRational* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } } + } + public static implicit operator AVRational[](AVRational3 @struct) => @struct.ToArray(); + } + + public unsafe struct AVRational3x2 : IFixedArray + { + public static readonly int ArrayLength = 3; + public int Length => 3; + AVRational2 _0; AVRational2 _1; AVRational2 _2; + + public AVRational2 this[uint i] + { + get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVRational2* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (AVRational2* p0 = &_0) { *(p0 + i) = value; } } + } + public AVRational2[] ToArray() + { + fixed (AVRational2* p0 = &_0) { var a = new AVRational2[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVRational2[] array) + { + fixed (AVRational2* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } } + } + public static implicit operator AVRational2[](AVRational3x2 @struct) => @struct.ToArray(); + } + + public unsafe struct byte_ptr3 : IFixedArray + { + public static readonly int ArrayLength = 3; + public int Length => 3; + byte* _0; byte* _1; byte* _2; + + public byte* this[uint i] + { + get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { return *(p0 + i); } } + set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { *(p0 + i) = value; } } + } + public byte*[] ToArray() + { + fixed (byte** p0 = &_0) { var a = new byte*[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(byte*[] array) + { + fixed (byte** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } } + } + public static implicit operator byte*[](byte_ptr3 @struct) => @struct.ToArray(); + } + + public unsafe struct int3 : IFixedArray + { + public static readonly int ArrayLength = 3; + public int Length => 3; + fixed int _[3]; + + public int this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public int[] ToArray() + { + var a = new int[3]; for (uint i = 0; i < 3; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(int[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 3) return; } + } + public static implicit operator int[](int3 @struct) => @struct.ToArray(); + } + + public unsafe struct short3x2 : IFixedArray + { + public static readonly int ArrayLength = 3; + public int Length => 3; + short2 _0; short2 _1; short2 _2; + + public short2 this[uint i] + { + get { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (short2* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 3) throw new ArgumentOutOfRangeException(); fixed (short2* p0 = &_0) { *(p0 + i) = value; } } + } + public short2[] ToArray() + { + fixed (short2* p0 = &_0) { var a = new short2[3]; for (uint i = 0; i < 3; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(short2[] array) + { + fixed (short2* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 3) return; } } + } + public static implicit operator short2[](short3x2 @struct) => @struct.ToArray(); + } + + public unsafe struct AVComponentDescriptor4 : IFixedArray + { + public static readonly int ArrayLength = 4; + public int Length => 4; + AVComponentDescriptor _0; AVComponentDescriptor _1; AVComponentDescriptor _2; AVComponentDescriptor _3; + + public AVComponentDescriptor this[uint i] + { + get { if (i >= 4) throw new ArgumentOutOfRangeException(); fixed (AVComponentDescriptor* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 4) throw new ArgumentOutOfRangeException(); fixed (AVComponentDescriptor* p0 = &_0) { *(p0 + i) = value; } } + } + public AVComponentDescriptor[] ToArray() + { + fixed (AVComponentDescriptor* p0 = &_0) { var a = new AVComponentDescriptor[4]; for (uint i = 0; i < 4; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVComponentDescriptor[] array) + { + fixed (AVComponentDescriptor* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 4) return; } } + } + public static implicit operator AVComponentDescriptor[](AVComponentDescriptor4 @struct) => @struct.ToArray(); + } + + public unsafe struct byte_ptr4 : IFixedArray + { + public static readonly int ArrayLength = 4; + public int Length => 4; + byte* _0; byte* _1; byte* _2; byte* _3; + + public byte* this[uint i] + { + get { if (i >= 4) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { return *(p0 + i); } } + set { if (i >= 4) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { *(p0 + i) = value; } } + } + public byte*[] ToArray() + { + fixed (byte** p0 = &_0) { var a = new byte*[4]; for (uint i = 0; i < 4; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(byte*[] array) + { + fixed (byte** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 4) return; } } + } + public static implicit operator byte*[](byte_ptr4 @struct) => @struct.ToArray(); + } + + public unsafe struct byte4 : IFixedArray + { + public static readonly int ArrayLength = 4; + public int Length => 4; + fixed byte _[4]; + + public byte this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public byte[] ToArray() + { + var a = new byte[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(byte[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; } + } + public static implicit operator byte[](byte4 @struct) => @struct.ToArray(); + } + + public unsafe struct int4 : IFixedArray + { + public static readonly int ArrayLength = 4; + public int Length => 4; + fixed int _[4]; + + public int this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public int[] ToArray() + { + var a = new int[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(int[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; } + } + public static implicit operator int[](int4 @struct) => @struct.ToArray(); + } + + public unsafe struct long4 : IFixedArray + { + public static readonly int ArrayLength = 4; + public int Length => 4; + fixed long _[4]; + + public long this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public long[] ToArray() + { + var a = new long[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(long[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; } + } + public static implicit operator long[](long4 @struct) => @struct.ToArray(); + } + + public unsafe struct uint4 : IFixedArray + { + public static readonly int ArrayLength = 4; + public int Length => 4; + fixed uint _[4]; + + public uint this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public uint[] ToArray() + { + var a = new uint[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(uint[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; } + } + public static implicit operator uint[](uint4 @struct) => @struct.ToArray(); + } + + public unsafe struct ulong4 : IFixedArray + { + public static readonly int ArrayLength = 4; + public int Length => 4; + fixed ulong _[4]; + + public ulong this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public ulong[] ToArray() + { + var a = new ulong[4]; for (uint i = 0; i < 4; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(ulong[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 4) return; } + } + public static implicit operator ulong[](ulong4 @struct) => @struct.ToArray(); + } + + public unsafe struct int7 : IFixedArray + { + public static readonly int ArrayLength = 7; + public int Length => 7; + fixed int _[7]; + + public int this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public int[] ToArray() + { + var a = new int[7]; for (uint i = 0; i < 7; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(int[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 7) return; } + } + public static implicit operator int[](int7 @struct) => @struct.ToArray(); + } + + public unsafe struct AVBufferRef_ptr8 : IFixedArray + { + public static readonly int ArrayLength = 8; + public int Length => 8; + AVBufferRef* _0; AVBufferRef* _1; AVBufferRef* _2; AVBufferRef* _3; AVBufferRef* _4; AVBufferRef* _5; AVBufferRef* _6; AVBufferRef* _7; + + public AVBufferRef* this[uint i] + { + get { if (i >= 8) throw new ArgumentOutOfRangeException(); fixed (AVBufferRef** p0 = &_0) { return *(p0 + i); } } + set { if (i >= 8) throw new ArgumentOutOfRangeException(); fixed (AVBufferRef** p0 = &_0) { *(p0 + i) = value; } } + } + public AVBufferRef*[] ToArray() + { + fixed (AVBufferRef** p0 = &_0) { var a = new AVBufferRef*[8]; for (uint i = 0; i < 8; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVBufferRef*[] array) + { + fixed (AVBufferRef** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 8) return; } } + } + public static implicit operator AVBufferRef*[](AVBufferRef_ptr8 @struct) => @struct.ToArray(); + } + + public unsafe struct byte_ptr8 : IFixedArray + { + public static readonly int ArrayLength = 8; + public int Length => 8; + byte* _0; byte* _1; byte* _2; byte* _3; byte* _4; byte* _5; byte* _6; byte* _7; + + public byte* this[uint i] + { + get { if (i >= 8) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { return *(p0 + i); } } + set { if (i >= 8) throw new ArgumentOutOfRangeException(); fixed (byte** p0 = &_0) { *(p0 + i) = value; } } + } + public byte*[] ToArray() + { + fixed (byte** p0 = &_0) { var a = new byte*[8]; for (uint i = 0; i < 8; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(byte*[] array) + { + fixed (byte** p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 8) return; } } + } + public static implicit operator byte*[](byte_ptr8 @struct) => @struct.ToArray(); + } + + public unsafe struct byte8 : IFixedArray + { + public static readonly int ArrayLength = 8; + public int Length => 8; + fixed byte _[8]; + + public byte this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public byte[] ToArray() + { + var a = new byte[8]; for (uint i = 0; i < 8; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(byte[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 8) return; } + } + public static implicit operator byte[](byte8 @struct) => @struct.ToArray(); + } + + public unsafe struct int8 : IFixedArray + { + public static readonly int ArrayLength = 8; + public int Length => 8; + fixed int _[8]; + + public int this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public int[] ToArray() + { + var a = new int[8]; for (uint i = 0; i < 8; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(int[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 8) return; } + } + public static implicit operator int[](int8 @struct) => @struct.ToArray(); + } + + public unsafe struct ulong8 : IFixedArray + { + public static readonly int ArrayLength = 8; + public int Length => 8; + fixed ulong _[8]; + + public ulong this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public ulong[] ToArray() + { + var a = new ulong[8]; for (uint i = 0; i < 8; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(ulong[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 8) return; } + } + public static implicit operator ulong[](ulong8 @struct) => @struct.ToArray(); + } + + public unsafe struct int9 : IFixedArray + { + public static readonly int ArrayLength = 9; + public int Length => 9; + fixed int _[9]; + + public int this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public int[] ToArray() + { + var a = new int[9]; for (uint i = 0; i < 9; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(int[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 9) return; } + } + public static implicit operator int[](int9 @struct) => @struct.ToArray(); + } + + public unsafe struct AVHDRPlusPercentile15 : IFixedArray + { + public static readonly int ArrayLength = 15; + public int Length => 15; + AVHDRPlusPercentile _0; AVHDRPlusPercentile _1; AVHDRPlusPercentile _2; AVHDRPlusPercentile _3; AVHDRPlusPercentile _4; AVHDRPlusPercentile _5; AVHDRPlusPercentile _6; AVHDRPlusPercentile _7; AVHDRPlusPercentile _8; AVHDRPlusPercentile _9; AVHDRPlusPercentile _10; AVHDRPlusPercentile _11; AVHDRPlusPercentile _12; AVHDRPlusPercentile _13; AVHDRPlusPercentile _14; + + public AVHDRPlusPercentile this[uint i] + { + get { if (i >= 15) throw new ArgumentOutOfRangeException(); fixed (AVHDRPlusPercentile* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 15) throw new ArgumentOutOfRangeException(); fixed (AVHDRPlusPercentile* p0 = &_0) { *(p0 + i) = value; } } + } + public AVHDRPlusPercentile[] ToArray() + { + fixed (AVHDRPlusPercentile* p0 = &_0) { var a = new AVHDRPlusPercentile[15]; for (uint i = 0; i < 15; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVHDRPlusPercentile[] array) + { + fixed (AVHDRPlusPercentile* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 15) return; } } + } + public static implicit operator AVHDRPlusPercentile[](AVHDRPlusPercentile15 @struct) => @struct.ToArray(); + } + + public unsafe struct AVRational15 : IFixedArray + { + public static readonly int ArrayLength = 15; + public int Length => 15; + AVRational _0; AVRational _1; AVRational _2; AVRational _3; AVRational _4; AVRational _5; AVRational _6; AVRational _7; AVRational _8; AVRational _9; AVRational _10; AVRational _11; AVRational _12; AVRational _13; AVRational _14; + + public AVRational this[uint i] + { + get { if (i >= 15) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 15) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { *(p0 + i) = value; } } + } + public AVRational[] ToArray() + { + fixed (AVRational* p0 = &_0) { var a = new AVRational[15]; for (uint i = 0; i < 15; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVRational[] array) + { + fixed (AVRational* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 15) return; } } + } + public static implicit operator AVRational[](AVRational15 @struct) => @struct.ToArray(); + } + + public unsafe struct byte16 : IFixedArray + { + public static readonly int ArrayLength = 16; + public int Length => 16; + fixed byte _[16]; + + public byte this[uint i] + { + get => _[i]; + set => _[i] = value; + } + public byte[] ToArray() + { + var a = new byte[16]; for (uint i = 0; i < 16; i++) a[i] = _[i]; return a; + } + public void UpdateFrom(byte[] array) + { + uint i = 0; foreach (var value in array) { _[i++] = value; if (i >= 16) return; } + } + public static implicit operator byte[](byte16 @struct) => @struct.ToArray(); + } + + public unsafe struct AVRational25 : IFixedArray + { + public static readonly int ArrayLength = 25; + public int Length => 25; + AVRational _0; AVRational _1; AVRational _2; AVRational _3; AVRational _4; AVRational _5; AVRational _6; AVRational _7; AVRational _8; AVRational _9; AVRational _10; AVRational _11; AVRational _12; AVRational _13; AVRational _14; AVRational _15; AVRational _16; AVRational _17; AVRational _18; AVRational _19; AVRational _20; AVRational _21; AVRational _22; AVRational _23; AVRational _24; + + public AVRational this[uint i] + { + get { if (i >= 25) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 25) throw new ArgumentOutOfRangeException(); fixed (AVRational* p0 = &_0) { *(p0 + i) = value; } } + } + public AVRational[] ToArray() + { + fixed (AVRational* p0 = &_0) { var a = new AVRational[25]; for (uint i = 0; i < 25; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVRational[] array) + { + fixed (AVRational* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 25) return; } } + } + public static implicit operator AVRational[](AVRational25 @struct) => @struct.ToArray(); + } + + public unsafe struct AVRational25x25 : IFixedArray + { + public static readonly int ArrayLength = 25; + public int Length => 25; + AVRational25 _0; AVRational25 _1; AVRational25 _2; AVRational25 _3; AVRational25 _4; AVRational25 _5; AVRational25 _6; AVRational25 _7; AVRational25 _8; AVRational25 _9; AVRational25 _10; AVRational25 _11; AVRational25 _12; AVRational25 _13; AVRational25 _14; AVRational25 _15; AVRational25 _16; AVRational25 _17; AVRational25 _18; AVRational25 _19; AVRational25 _20; AVRational25 _21; AVRational25 _22; AVRational25 _23; AVRational25 _24; + + public AVRational25 this[uint i] + { + get { if (i >= 25) throw new ArgumentOutOfRangeException(); fixed (AVRational25* p0 = &_0) { return *(p0 + i); } } + set { if (i >= 25) throw new ArgumentOutOfRangeException(); fixed (AVRational25* p0 = &_0) { *(p0 + i) = value; } } + } + public AVRational25[] ToArray() + { + fixed (AVRational25* p0 = &_0) { var a = new AVRational25[25]; for (uint i = 0; i < 25; i++) a[i] = *(p0 + i); return a; } + } + public void UpdateFrom(AVRational25[] array) + { + fixed (AVRational25* p0 = &_0) { uint i = 0; foreach (var value in array) { *(p0 + i++) = value; if (i >= 25) return; } } + } + public static implicit operator AVRational25[](AVRational25x25 @struct) => @struct.ToArray(); + } + +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Arrays.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Arrays.g.cs.meta new file mode 100644 index 0000000..e4e1728 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Arrays.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8672a701b738a1c409125f98c38b79d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/ConstCharPtrMarshaler.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/ConstCharPtrMarshaler.cs new file mode 100644 index 0000000..8b91576 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/ConstCharPtrMarshaler.cs @@ -0,0 +1,33 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; + +namespace LeviathanVideo.Abstractions +{ + + public class ConstCharPtrMarshaler : ICustomMarshaler + { + private static readonly ConstCharPtrMarshaler Instance = new ConstCharPtrMarshaler(); + public object MarshalNativeToManaged(IntPtr pNativeData) => Marshal.PtrToStringAnsi(pNativeData); + + public IntPtr MarshalManagedToNative(object managedObj) => IntPtr.Zero; + + public void CleanUpNativeData(IntPtr pNativeData) + { + } + + public void CleanUpManagedData(object managedObj) + { + } + + public int GetNativeDataSize() => IntPtr.Size; + + public static ICustomMarshaler GetInstance(string cookie) => Instance; + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/ConstCharPtrMarshaler.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/ConstCharPtrMarshaler.cs.meta new file mode 100644 index 0000000..8347d0d --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/ConstCharPtrMarshaler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6182afb215f53b409c298aeb135d0a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Delegates.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Delegates.g.cs new file mode 100644 index 0000000..b859c3c --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Delegates.g.cs @@ -0,0 +1,460 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; + +namespace LeviathanVideo.Abstractions +{ + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int _query_func(AVFilterContext* @p0); + public unsafe struct _query_func_func + { + public IntPtr Pointer; + public static implicit operator _query_func_func(_query_func func) => new _query_func_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void av_buffer_create_free(void* @opaque, byte* @data); + public unsafe struct av_buffer_create_free_func + { + public IntPtr Pointer; + public static implicit operator av_buffer_create_free_func(av_buffer_create_free func) => new av_buffer_create_free_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate AVBufferRef* av_buffer_pool_init_alloc(ulong @size); + public unsafe struct av_buffer_pool_init_alloc_func + { + public IntPtr Pointer; + public static implicit operator av_buffer_pool_init_alloc_func(av_buffer_pool_init_alloc func) => new av_buffer_pool_init_alloc_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate AVBufferRef* av_buffer_pool_init2_alloc(void* @opaque, ulong @size); + public unsafe struct av_buffer_pool_init2_alloc_func + { + public IntPtr Pointer; + public static implicit operator av_buffer_pool_init2_alloc_func(av_buffer_pool_init2_alloc func) => new av_buffer_pool_init2_alloc_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void av_buffer_pool_init2_pool_free(void* @opaque); + public unsafe struct av_buffer_pool_init2_pool_free_func + { + public IntPtr Pointer; + public static implicit operator av_buffer_pool_init2_pool_free_func(av_buffer_pool_init2_pool_free func) => new av_buffer_pool_init2_pool_free_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void av_log_set_callback_callback(void* @p0, int @p1, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @p2, byte* @p3); + public unsafe struct av_log_set_callback_callback_func + { + public IntPtr Pointer; + public static implicit operator av_log_set_callback_callback_func(av_log_set_callback_callback func) => new av_log_set_callback_callback_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int av_tree_enumerate_cmp(void* @opaque, void* @elem); + public unsafe struct av_tree_enumerate_cmp_func + { + public IntPtr Pointer; + public static implicit operator av_tree_enumerate_cmp_func(av_tree_enumerate_cmp func) => new av_tree_enumerate_cmp_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int av_tree_enumerate_enu(void* @opaque, void* @elem); + public unsafe struct av_tree_enumerate_enu_func + { + public IntPtr Pointer; + public static implicit operator av_tree_enumerate_enu_func(av_tree_enumerate_enu func) => new av_tree_enumerate_enu_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int av_tree_find_cmp(void* @key, void* @b); + public unsafe struct av_tree_find_cmp_func + { + public IntPtr Pointer; + public static implicit operator av_tree_find_cmp_func(av_tree_find_cmp func) => new av_tree_find_cmp_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int av_tree_insert_cmp(void* @key, void* @b); + public unsafe struct av_tree_insert_cmp_func + { + public IntPtr Pointer; + public static implicit operator av_tree_insert_cmp_func(av_tree_insert_cmp func) => new av_tree_insert_cmp_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate AVClass* AVClass_child_class_iterate(void** @iter); + public unsafe struct AVClass_child_class_iterate_func + { + public IntPtr Pointer; + public static implicit operator AVClass_child_class_iterate_func(AVClass_child_class_iterate func) => new AVClass_child_class_iterate_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void* AVClass_child_next(void* @obj, void* @prev); + public unsafe struct AVClass_child_next_func + { + public IntPtr Pointer; + public static implicit operator AVClass_child_next_func(AVClass_child_next func) => new AVClass_child_next_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate AVClassCategory AVClass_get_category(void* @ctx); + public unsafe struct AVClass_get_category_func + { + public IntPtr Pointer; + public static implicit operator AVClass_get_category_func(AVClass_get_category func) => new AVClass_get_category_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate string AVClass_item_name(void* @ctx); + public unsafe struct AVClass_item_name_func + { + public IntPtr Pointer; + public static implicit operator AVClass_item_name_func(AVClass_item_name func) => new AVClass_item_name_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVClass_query_ranges(AVOptionRanges** @p0, void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key, int @flags); + public unsafe struct AVClass_query_ranges_func + { + public IntPtr Pointer; + public static implicit operator AVClass_query_ranges_func(AVClass_query_ranges func) => new AVClass_query_ranges_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int avcodec_default_execute_func(AVCodecContext* @c2, void* @arg2); + public unsafe struct avcodec_default_execute_func_func + { + public IntPtr Pointer; + public static implicit operator avcodec_default_execute_func_func(avcodec_default_execute_func func) => new avcodec_default_execute_func_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int avcodec_default_execute2_func(AVCodecContext* @c2, void* @arg2, int @p2, int @p3); + public unsafe struct avcodec_default_execute2_func_func + { + public IntPtr Pointer; + public static implicit operator avcodec_default_execute2_func_func(avcodec_default_execute2_func func) => new avcodec_default_execute2_func_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void AVCodecContext_draw_horiz_band(AVCodecContext* @s, AVFrame* @src, ref int8 @offset, int @y, int @type, int @height); + public unsafe struct AVCodecContext_draw_horiz_band_func + { + public IntPtr Pointer; + public static implicit operator AVCodecContext_draw_horiz_band_func(AVCodecContext_draw_horiz_band func) => new AVCodecContext_draw_horiz_band_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVCodecContext_execute(AVCodecContext* @c, func_func @func, void* @arg2, int* @ret, int @count, int @size); + public unsafe struct AVCodecContext_execute_func + { + public IntPtr Pointer; + public static implicit operator AVCodecContext_execute_func(AVCodecContext_execute func) => new AVCodecContext_execute_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVCodecContext_execute2(AVCodecContext* @c, func_func @func, void* @arg2, int* @ret, int @count); + public unsafe struct AVCodecContext_execute2_func + { + public IntPtr Pointer; + public static implicit operator AVCodecContext_execute2_func(AVCodecContext_execute2 func) => new AVCodecContext_execute2_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVCodecContext_get_buffer2(AVCodecContext* @s, AVFrame* @frame, int @flags); + public unsafe struct AVCodecContext_get_buffer2_func + { + public IntPtr Pointer; + public static implicit operator AVCodecContext_get_buffer2_func(AVCodecContext_get_buffer2 func) => new AVCodecContext_get_buffer2_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVCodecContext_get_encode_buffer(AVCodecContext* @s, AVPacket* @pkt, int @flags); + public unsafe struct AVCodecContext_get_encode_buffer_func + { + public IntPtr Pointer; + public static implicit operator AVCodecContext_get_encode_buffer_func(AVCodecContext_get_encode_buffer func) => new AVCodecContext_get_encode_buffer_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate AVPixelFormat AVCodecContext_get_format(AVCodecContext* @s, AVPixelFormat* @fmt); + public unsafe struct AVCodecContext_get_format_func + { + public IntPtr Pointer; + public static implicit operator AVCodecContext_get_format_func(AVCodecContext_get_format func) => new AVCodecContext_get_format_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void AVCodecParser_parser_close(AVCodecParserContext* @s); + public unsafe struct AVCodecParser_parser_close_func + { + public IntPtr Pointer; + public static implicit operator AVCodecParser_parser_close_func(AVCodecParser_parser_close func) => new AVCodecParser_parser_close_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVCodecParser_parser_init(AVCodecParserContext* @s); + public unsafe struct AVCodecParser_parser_init_func + { + public IntPtr Pointer; + public static implicit operator AVCodecParser_parser_init_func(AVCodecParser_parser_init func) => new AVCodecParser_parser_init_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVCodecParser_parser_parse(AVCodecParserContext* @s, AVCodecContext* @avctx, byte** @poutbuf, int* @poutbuf_size, byte* @buf, int @buf_size); + public unsafe struct AVCodecParser_parser_parse_func + { + public IntPtr Pointer; + public static implicit operator AVCodecParser_parser_parse_func(AVCodecParser_parser_parse func) => new AVCodecParser_parser_parse_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVCodecParser_split(AVCodecContext* @avctx, byte* @buf, int @buf_size); + public unsafe struct AVCodecParser_split_func + { + public IntPtr Pointer; + public static implicit operator AVCodecParser_split_func(AVCodecParser_split func) => new AVCodecParser_split_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void AVD3D11VADeviceContext_lock(void* @lock_ctx); + public unsafe struct AVD3D11VADeviceContext_lock_func + { + public IntPtr Pointer; + public static implicit operator AVD3D11VADeviceContext_lock_func(AVD3D11VADeviceContext_lock func) => new AVD3D11VADeviceContext_lock_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void AVD3D11VADeviceContext_unlock(void* @lock_ctx); + public unsafe struct AVD3D11VADeviceContext_unlock_func + { + public IntPtr Pointer; + public static implicit operator AVD3D11VADeviceContext_unlock_func(AVD3D11VADeviceContext_unlock func) => new AVD3D11VADeviceContext_unlock_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVFilter_activate(AVFilterContext* @ctx); + public unsafe struct AVFilter_activate_func + { + public IntPtr Pointer; + public static implicit operator AVFilter_activate_func(AVFilter_activate func) => new AVFilter_activate_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVFilter_init(AVFilterContext* @ctx); + public unsafe struct AVFilter_init_func + { + public IntPtr Pointer; + public static implicit operator AVFilter_init_func(AVFilter_init func) => new AVFilter_init_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVFilter_preinit(AVFilterContext* @ctx); + public unsafe struct AVFilter_preinit_func + { + public IntPtr Pointer; + public static implicit operator AVFilter_preinit_func(AVFilter_preinit func) => new AVFilter_preinit_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVFilter_process_command(AVFilterContext* @p0, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @cmd, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @arg, byte* @res, int @res_len, int @flags); + public unsafe struct AVFilter_process_command_func + { + public IntPtr Pointer; + public static implicit operator AVFilter_process_command_func(AVFilter_process_command func) => new AVFilter_process_command_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void AVFilter_uninit(AVFilterContext* @ctx); + public unsafe struct AVFilter_uninit_func + { + public IntPtr Pointer; + public static implicit operator AVFilter_uninit_func(AVFilter_uninit func) => new AVFilter_uninit_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVFilterGraph_execute(AVFilterContext* @ctx, func_func @func, void* @arg, int* @ret, int @nb_jobs); + public unsafe struct AVFilterGraph_execute_func + { + public IntPtr Pointer; + public static implicit operator AVFilterGraph_execute_func(AVFilterGraph_execute func) => new AVFilterGraph_execute_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVFormatContext_control_message_cb(AVFormatContext* @s, int @type, void* @data, ulong @data_size); + public unsafe struct AVFormatContext_control_message_cb_func + { + public IntPtr Pointer; + public static implicit operator AVFormatContext_control_message_cb_func(AVFormatContext_control_message_cb func) => new AVFormatContext_control_message_cb_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVFormatContext_io_close2(AVFormatContext* @s, AVIOContext* @pb); + public unsafe struct AVFormatContext_io_close2_func + { + public IntPtr Pointer; + public static implicit operator AVFormatContext_io_close2_func(AVFormatContext_io_close2 func) => new AVFormatContext_io_close2_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVFormatContext_io_open(AVFormatContext* @s, AVIOContext** @pb, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, int @flags, AVDictionary** @options); + public unsafe struct AVFormatContext_io_open_func + { + public IntPtr Pointer; + 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 void AVHWDeviceContext_free(AVHWDeviceContext* @ctx); + public unsafe struct AVHWDeviceContext_free_func + { + public IntPtr Pointer; + public static implicit operator AVHWDeviceContext_free_func(AVHWDeviceContext_free func) => new AVHWDeviceContext_free_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate void AVHWFramesContext_free(AVHWFramesContext* @ctx); + public unsafe struct AVHWFramesContext_free_func + { + public IntPtr Pointer; + public static implicit operator AVHWFramesContext_free_func(AVHWFramesContext_free func) => new AVHWFramesContext_free_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int avio_alloc_context_read_packet(void* @opaque, byte* @buf, int @buf_size); + public unsafe struct avio_alloc_context_read_packet_func + { + public IntPtr Pointer; + public static implicit operator avio_alloc_context_read_packet_func(avio_alloc_context_read_packet func) => new avio_alloc_context_read_packet_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate long avio_alloc_context_seek(void* @opaque, long @offset, int @whence); + public unsafe struct avio_alloc_context_seek_func + { + public IntPtr Pointer; + public static implicit operator avio_alloc_context_seek_func(avio_alloc_context_seek func) => new avio_alloc_context_seek_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int avio_alloc_context_write_packet(void* @opaque, byte* @buf, int @buf_size); + public unsafe struct avio_alloc_context_write_packet_func + { + public IntPtr Pointer; + public static implicit operator avio_alloc_context_write_packet_func(avio_alloc_context_write_packet func) => new avio_alloc_context_write_packet_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVIOContext_read_packet(void* @opaque, byte* @buf, int @buf_size); + public unsafe struct AVIOContext_read_packet_func + { + public IntPtr Pointer; + public static implicit operator AVIOContext_read_packet_func(AVIOContext_read_packet func) => new AVIOContext_read_packet_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVIOContext_read_pause(void* @opaque, int @pause); + public unsafe struct AVIOContext_read_pause_func + { + public IntPtr Pointer; + public static implicit operator AVIOContext_read_pause_func(AVIOContext_read_pause func) => new AVIOContext_read_pause_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate long AVIOContext_read_seek(void* @opaque, int @stream_index, long @timestamp, int @flags); + public unsafe struct AVIOContext_read_seek_func + { + public IntPtr Pointer; + public static implicit operator AVIOContext_read_seek_func(AVIOContext_read_seek func) => new AVIOContext_read_seek_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate long AVIOContext_seek(void* @opaque, long @offset, int @whence); + public unsafe struct AVIOContext_seek_func + { + public IntPtr Pointer; + public static implicit operator AVIOContext_seek_func(AVIOContext_seek func) => new AVIOContext_seek_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate ulong AVIOContext_update_checksum(ulong @checksum, byte* @buf, uint @size); + public unsafe struct AVIOContext_update_checksum_func + { + public IntPtr Pointer; + public static implicit operator AVIOContext_update_checksum_func(AVIOContext_update_checksum func) => new AVIOContext_update_checksum_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVIOContext_write_data_type(void* @opaque, byte* @buf, int @buf_size, AVIODataMarkerType @type, long @time); + public unsafe struct AVIOContext_write_data_type_func + { + public IntPtr Pointer; + public static implicit operator AVIOContext_write_data_type_func(AVIOContext_write_data_type func) => new AVIOContext_write_data_type_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVIOContext_write_packet(void* @opaque, byte* @buf, int @buf_size); + public unsafe struct AVIOContext_write_packet_func + { + public IntPtr Pointer; + public static implicit operator AVIOContext_write_packet_func(AVIOContext_write_packet func) => new AVIOContext_write_packet_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int AVIOInterruptCB_callback(void* @p0); + public unsafe struct AVIOInterruptCB_callback_func + { + public IntPtr Pointer; + public static implicit operator AVIOInterruptCB_callback_func(AVIOInterruptCB_callback func) => new AVIOInterruptCB_callback_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int func(AVFilterContext* @ctx, void* @arg, int @jobnr, int @nb_jobs); + public unsafe struct func_func + { + public IntPtr Pointer; + public static implicit operator func_func(func func) => new func_func { Pointer = func == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(func) }; + } + +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Delegates.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Delegates.g.cs.meta new file mode 100644 index 0000000..f8e5405 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Delegates.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6494f6467575f8f4686755f1fb403a78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Enums.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Enums.g.cs new file mode 100644 index 0000000..b715f4b --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Enums.g.cs @@ -0,0 +1,1875 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +namespace LeviathanVideo.Abstractions +{ + public enum AVAppToDevMessageType:int{} + public enum AVAudioServiceType:int{} + public enum AVChannel:int{} + public enum AVChannelOrder:int{} + public enum AVChromaLocation:int{} + public enum AVClassCategory:int{} + public enum AVCodecID:int{} + public enum AVColorPrimaries:int{} + public enum AVColorRange:int{} + public enum AVColorSpace:int{} + public enum AVColorTransferCharacteristic:int{} + public enum AVDevToAppMessageType:int{} + public enum AVDiscard:int{} + public enum AVDurationEstimationMethod:int{} + public enum AVFieldOrder:int{} + public enum AVFrameSideDataType:int{} + public enum AVHDRPlusOverlapProcessOption:int{} + public enum AVHWDeviceType:int{} + public enum AVHWFrameTransferDirection:int{} + public enum AVIODataMarkerType:int{} + public enum AVMatrixEncoding:int{} + public enum AVMediaType:int + { + @AVMEDIA_TYPE_VIDEO = 0, + } + public enum AVOptionType:int{} + public enum AVPacketSideDataType:int{} + public enum AVPictureStructure:int{} + public enum AVPictureType:int{} + public enum AVPixelFormat:int + { + /// planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) + @AV_PIX_FMT_YUV420P = 0, + } + public enum AVRounding:int{} + public enum AVSampleFormat:int{} + public enum AVStreamGroupParamsType:int{} + public enum AVSubtitleType:int{} + public enum AVTimebaseSource:int{} + + #region unuse code + /* + public enum AVActiveFormatDescription : int + { + @AV_AFD_SAME = 8, + @AV_AFD_4_3 = 9, + @AV_AFD_16_9 = 10, + @AV_AFD_14_9 = 11, + @AV_AFD_4_3_SP_14_9 = 13, + @AV_AFD_16_9_SP_14_9 = 14, + @AV_AFD_SP_4_3 = 15, + } + + /// Message types used by avdevice_app_to_dev_control_message(). + public enum AVAppToDevMessageType : int + { + /// Dummy message. + @AV_APP_TO_DEV_NONE = 1313820229, + /// Window size change message. + @AV_APP_TO_DEV_WINDOW_SIZE = 1195724621, + /// Repaint request message. + @AV_APP_TO_DEV_WINDOW_REPAINT = 1380274241, + /// Request pause/play. + @AV_APP_TO_DEV_PAUSE = 1346458912, + /// Request pause/play. + @AV_APP_TO_DEV_PLAY = 1347174745, + /// Request pause/play. + @AV_APP_TO_DEV_TOGGLE_PAUSE = 1346458964, + /// Volume control message. + @AV_APP_TO_DEV_SET_VOLUME = 1398165324, + /// Mute control messages. + @AV_APP_TO_DEV_MUTE = 541939028, + /// Mute control messages. + @AV_APP_TO_DEV_UNMUTE = 1431131476, + /// Mute control messages. + @AV_APP_TO_DEV_TOGGLE_MUTE = 1414354260, + /// Get volume/mute messages. + @AV_APP_TO_DEV_GET_VOLUME = 1196838732, + /// Get volume/mute messages. + @AV_APP_TO_DEV_GET_MUTE = 1196250452, + } + + public enum AVAudioServiceType : int + { + @AV_AUDIO_SERVICE_TYPE_MAIN = 0, + @AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, + @AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, + @AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, + @AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, + @AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, + @AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, + @AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, + @AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, + /// Not part of ABI + @AV_AUDIO_SERVICE_TYPE_NB = 9, + } + + /// Audio channel layout utility functions + public enum AVChannel : int + { + @AV_CHAN_NONE = -1, + @AV_CHAN_FRONT_LEFT = 0, + @AV_CHAN_FRONT_RIGHT = 1, + @AV_CHAN_FRONT_CENTER = 2, + @AV_CHAN_LOW_FREQUENCY = 3, + @AV_CHAN_BACK_LEFT = 4, + @AV_CHAN_BACK_RIGHT = 5, + @AV_CHAN_FRONT_LEFT_OF_CENTER = 6, + @AV_CHAN_FRONT_RIGHT_OF_CENTER = 7, + @AV_CHAN_BACK_CENTER = 8, + @AV_CHAN_SIDE_LEFT = 9, + @AV_CHAN_SIDE_RIGHT = 10, + @AV_CHAN_TOP_CENTER = 11, + @AV_CHAN_TOP_FRONT_LEFT = 12, + @AV_CHAN_TOP_FRONT_CENTER = 13, + @AV_CHAN_TOP_FRONT_RIGHT = 14, + @AV_CHAN_TOP_BACK_LEFT = 15, + @AV_CHAN_TOP_BACK_CENTER = 16, + @AV_CHAN_TOP_BACK_RIGHT = 17, + /// Stereo downmix. + @AV_CHAN_STEREO_LEFT = 29, + /// See above. + @AV_CHAN_STEREO_RIGHT = 30, + /// See above. + @AV_CHAN_WIDE_LEFT = 31, + /// See above. + @AV_CHAN_WIDE_RIGHT = 32, + /// See above. + @AV_CHAN_SURROUND_DIRECT_LEFT = 33, + /// See above. + @AV_CHAN_SURROUND_DIRECT_RIGHT = 34, + /// See above. + @AV_CHAN_LOW_FREQUENCY_2 = 35, + /// See above. + @AV_CHAN_TOP_SIDE_LEFT = 36, + /// See above. + @AV_CHAN_TOP_SIDE_RIGHT = 37, + /// See above. + @AV_CHAN_BOTTOM_FRONT_CENTER = 38, + /// See above. + @AV_CHAN_BOTTOM_FRONT_LEFT = 39, + /// See above. + @AV_CHAN_BOTTOM_FRONT_RIGHT = 40, + /// Channel is empty can be safely skipped. + @AV_CHAN_UNUSED = 512, + /// Channel contains data, but its position is unknown. + @AV_CHAN_UNKNOWN = 768, + /// Range of channels between AV_CHAN_AMBISONIC_BASE and AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system. + @AV_CHAN_AMBISONIC_BASE = 1024, + /// Range of channels between AV_CHAN_AMBISONIC_BASE and AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system. + @AV_CHAN_AMBISONIC_END = 2047, + } + + public enum AVChannelOrder : int + { + /// Only the channel count is specified, without any further information about the channel order. + @AV_CHANNEL_ORDER_UNSPEC = 0, + /// The native channel order, i.e. the channels are in the same order in which they are defined in the AVChannel enum. This supports up to 63 different channels. + @AV_CHANNEL_ORDER_NATIVE = 1, + /// The channel order does not correspond to any other predefined order and is stored as an explicit map. For example, this could be used to support layouts with 64 or more channels, or with empty/skipped (AV_CHAN_UNUSED) channels at arbitrary positions. + @AV_CHANNEL_ORDER_CUSTOM = 2, + /// The audio is represented as the decomposition of the sound field into spherical harmonics. Each channel corresponds to a single expansion component. Channels are ordered according to ACN (Ambisonic Channel Number). + @AV_CHANNEL_ORDER_AMBISONIC = 3, + /// Number of channel orders, not part of ABI/API + @FF_CHANNEL_ORDER_NB = 4, + } + + /// Location of chroma samples. + public enum AVChromaLocation : int + { + @AVCHROMA_LOC_UNSPECIFIED = 0, + /// MPEG-2/4 4:2:0, H.264 default for 4:2:0 + @AVCHROMA_LOC_LEFT = 1, + /// MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0 + @AVCHROMA_LOC_CENTER = 2, + /// ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 + @AVCHROMA_LOC_TOPLEFT = 3, + @AVCHROMA_LOC_TOP = 4, + @AVCHROMA_LOC_BOTTOMLEFT = 5, + @AVCHROMA_LOC_BOTTOM = 6, + /// Not part of ABI + @AVCHROMA_LOC_NB = 7, + } + + public enum AVClassCategory : int + { + @AV_CLASS_CATEGORY_NA = 0, + @AV_CLASS_CATEGORY_INPUT = 1, + @AV_CLASS_CATEGORY_OUTPUT = 2, + @AV_CLASS_CATEGORY_MUXER = 3, + @AV_CLASS_CATEGORY_DEMUXER = 4, + @AV_CLASS_CATEGORY_ENCODER = 5, + @AV_CLASS_CATEGORY_DECODER = 6, + @AV_CLASS_CATEGORY_FILTER = 7, + @AV_CLASS_CATEGORY_BITSTREAM_FILTER = 8, + @AV_CLASS_CATEGORY_SWSCALER = 9, + @AV_CLASS_CATEGORY_SWRESAMPLER = 10, + @AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, + @AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT = 41, + @AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT = 42, + @AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT = 43, + @AV_CLASS_CATEGORY_DEVICE_OUTPUT = 44, + @AV_CLASS_CATEGORY_DEVICE_INPUT = 45, + /// not part of ABI/API + @AV_CLASS_CATEGORY_NB = 46, + } + + /// Identify the syntax and semantics of the bitstream. The principle is roughly: Two decoders with the same ID can decode the same streams. Two encoders with the same ID can encode compatible streams. There may be slight deviations from the principle due to implementation details. + public enum AVCodecID : int + { + @AV_CODEC_ID_NONE = 0, + @AV_CODEC_ID_MPEG1VIDEO = 1, + /// preferred ID for MPEG-1/2 video decoding + @AV_CODEC_ID_MPEG2VIDEO = 2, + @AV_CODEC_ID_H261 = 3, + @AV_CODEC_ID_H263 = 4, + @AV_CODEC_ID_RV10 = 5, + @AV_CODEC_ID_RV20 = 6, + @AV_CODEC_ID_MJPEG = 7, + @AV_CODEC_ID_MJPEGB = 8, + @AV_CODEC_ID_LJPEG = 9, + @AV_CODEC_ID_SP5X = 10, + @AV_CODEC_ID_JPEGLS = 11, + @AV_CODEC_ID_MPEG4 = 12, + @AV_CODEC_ID_RAWVIDEO = 13, + @AV_CODEC_ID_MSMPEG4V1 = 14, + @AV_CODEC_ID_MSMPEG4V2 = 15, + @AV_CODEC_ID_MSMPEG4V3 = 16, + @AV_CODEC_ID_WMV1 = 17, + @AV_CODEC_ID_WMV2 = 18, + @AV_CODEC_ID_H263P = 19, + @AV_CODEC_ID_H263I = 20, + @AV_CODEC_ID_FLV1 = 21, + @AV_CODEC_ID_SVQ1 = 22, + @AV_CODEC_ID_SVQ3 = 23, + @AV_CODEC_ID_DVVIDEO = 24, + @AV_CODEC_ID_HUFFYUV = 25, + @AV_CODEC_ID_CYUV = 26, + @AV_CODEC_ID_H264 = 27, + @AV_CODEC_ID_INDEO3 = 28, + @AV_CODEC_ID_VP3 = 29, + @AV_CODEC_ID_THEORA = 30, + @AV_CODEC_ID_ASV1 = 31, + @AV_CODEC_ID_ASV2 = 32, + @AV_CODEC_ID_FFV1 = 33, + @AV_CODEC_ID_4XM = 34, + @AV_CODEC_ID_VCR1 = 35, + @AV_CODEC_ID_CLJR = 36, + @AV_CODEC_ID_MDEC = 37, + @AV_CODEC_ID_ROQ = 38, + @AV_CODEC_ID_INTERPLAY_VIDEO = 39, + @AV_CODEC_ID_XAN_WC3 = 40, + @AV_CODEC_ID_XAN_WC4 = 41, + @AV_CODEC_ID_RPZA = 42, + @AV_CODEC_ID_CINEPAK = 43, + @AV_CODEC_ID_WS_VQA = 44, + @AV_CODEC_ID_MSRLE = 45, + @AV_CODEC_ID_MSVIDEO1 = 46, + @AV_CODEC_ID_IDCIN = 47, + @AV_CODEC_ID_8BPS = 48, + @AV_CODEC_ID_SMC = 49, + @AV_CODEC_ID_FLIC = 50, + @AV_CODEC_ID_TRUEMOTION1 = 51, + @AV_CODEC_ID_VMDVIDEO = 52, + @AV_CODEC_ID_MSZH = 53, + @AV_CODEC_ID_ZLIB = 54, + @AV_CODEC_ID_QTRLE = 55, + @AV_CODEC_ID_TSCC = 56, + @AV_CODEC_ID_ULTI = 57, + @AV_CODEC_ID_QDRAW = 58, + @AV_CODEC_ID_VIXL = 59, + @AV_CODEC_ID_QPEG = 60, + @AV_CODEC_ID_PNG = 61, + @AV_CODEC_ID_PPM = 62, + @AV_CODEC_ID_PBM = 63, + @AV_CODEC_ID_PGM = 64, + @AV_CODEC_ID_PGMYUV = 65, + @AV_CODEC_ID_PAM = 66, + @AV_CODEC_ID_FFVHUFF = 67, + @AV_CODEC_ID_RV30 = 68, + @AV_CODEC_ID_RV40 = 69, + @AV_CODEC_ID_VC1 = 70, + @AV_CODEC_ID_WMV3 = 71, + @AV_CODEC_ID_LOCO = 72, + @AV_CODEC_ID_WNV1 = 73, + @AV_CODEC_ID_AASC = 74, + @AV_CODEC_ID_INDEO2 = 75, + @AV_CODEC_ID_FRAPS = 76, + @AV_CODEC_ID_TRUEMOTION2 = 77, + @AV_CODEC_ID_BMP = 78, + @AV_CODEC_ID_CSCD = 79, + @AV_CODEC_ID_MMVIDEO = 80, + @AV_CODEC_ID_ZMBV = 81, + @AV_CODEC_ID_AVS = 82, + @AV_CODEC_ID_SMACKVIDEO = 83, + @AV_CODEC_ID_NUV = 84, + @AV_CODEC_ID_KMVC = 85, + @AV_CODEC_ID_FLASHSV = 86, + @AV_CODEC_ID_CAVS = 87, + @AV_CODEC_ID_JPEG2000 = 88, + @AV_CODEC_ID_VMNC = 89, + @AV_CODEC_ID_VP5 = 90, + @AV_CODEC_ID_VP6 = 91, + @AV_CODEC_ID_VP6F = 92, + @AV_CODEC_ID_TARGA = 93, + @AV_CODEC_ID_DSICINVIDEO = 94, + @AV_CODEC_ID_TIERTEXSEQVIDEO = 95, + @AV_CODEC_ID_TIFF = 96, + @AV_CODEC_ID_GIF = 97, + @AV_CODEC_ID_DXA = 98, + @AV_CODEC_ID_DNXHD = 99, + @AV_CODEC_ID_THP = 100, + @AV_CODEC_ID_SGI = 101, + @AV_CODEC_ID_C93 = 102, + @AV_CODEC_ID_BETHSOFTVID = 103, + @AV_CODEC_ID_PTX = 104, + @AV_CODEC_ID_TXD = 105, + @AV_CODEC_ID_VP6A = 106, + @AV_CODEC_ID_AMV = 107, + @AV_CODEC_ID_VB = 108, + @AV_CODEC_ID_PCX = 109, + @AV_CODEC_ID_SUNRAST = 110, + @AV_CODEC_ID_INDEO4 = 111, + @AV_CODEC_ID_INDEO5 = 112, + @AV_CODEC_ID_MIMIC = 113, + @AV_CODEC_ID_RL2 = 114, + @AV_CODEC_ID_ESCAPE124 = 115, + @AV_CODEC_ID_DIRAC = 116, + @AV_CODEC_ID_BFI = 117, + @AV_CODEC_ID_CMV = 118, + @AV_CODEC_ID_MOTIONPIXELS = 119, + @AV_CODEC_ID_TGV = 120, + @AV_CODEC_ID_TGQ = 121, + @AV_CODEC_ID_TQI = 122, + @AV_CODEC_ID_AURA = 123, + @AV_CODEC_ID_AURA2 = 124, + @AV_CODEC_ID_V210X = 125, + @AV_CODEC_ID_TMV = 126, + @AV_CODEC_ID_V210 = 127, + @AV_CODEC_ID_DPX = 128, + @AV_CODEC_ID_MAD = 129, + @AV_CODEC_ID_FRWU = 130, + @AV_CODEC_ID_FLASHSV2 = 131, + @AV_CODEC_ID_CDGRAPHICS = 132, + @AV_CODEC_ID_R210 = 133, + @AV_CODEC_ID_ANM = 134, + @AV_CODEC_ID_BINKVIDEO = 135, + @AV_CODEC_ID_IFF_ILBM = 136, + @AV_CODEC_ID_KGV1 = 137, + @AV_CODEC_ID_YOP = 138, + @AV_CODEC_ID_VP8 = 139, + @AV_CODEC_ID_PICTOR = 140, + @AV_CODEC_ID_ANSI = 141, + @AV_CODEC_ID_A64_MULTI = 142, + @AV_CODEC_ID_A64_MULTI5 = 143, + @AV_CODEC_ID_R10K = 144, + @AV_CODEC_ID_MXPEG = 145, + @AV_CODEC_ID_LAGARITH = 146, + @AV_CODEC_ID_PRORES = 147, + @AV_CODEC_ID_JV = 148, + @AV_CODEC_ID_DFA = 149, + @AV_CODEC_ID_WMV3IMAGE = 150, + @AV_CODEC_ID_VC1IMAGE = 151, + @AV_CODEC_ID_UTVIDEO = 152, + @AV_CODEC_ID_BMV_VIDEO = 153, + @AV_CODEC_ID_VBLE = 154, + @AV_CODEC_ID_DXTORY = 155, + @AV_CODEC_ID_V410 = 156, + @AV_CODEC_ID_XWD = 157, + @AV_CODEC_ID_CDXL = 158, + @AV_CODEC_ID_XBM = 159, + @AV_CODEC_ID_ZEROCODEC = 160, + @AV_CODEC_ID_MSS1 = 161, + @AV_CODEC_ID_MSA1 = 162, + @AV_CODEC_ID_TSCC2 = 163, + @AV_CODEC_ID_MTS2 = 164, + @AV_CODEC_ID_CLLC = 165, + @AV_CODEC_ID_MSS2 = 166, + @AV_CODEC_ID_VP9 = 167, + @AV_CODEC_ID_AIC = 168, + @AV_CODEC_ID_ESCAPE130 = 169, + @AV_CODEC_ID_G2M = 170, + @AV_CODEC_ID_WEBP = 171, + @AV_CODEC_ID_HNM4_VIDEO = 172, + @AV_CODEC_ID_HEVC = 173, + @AV_CODEC_ID_FIC = 174, + @AV_CODEC_ID_ALIAS_PIX = 175, + @AV_CODEC_ID_BRENDER_PIX = 176, + @AV_CODEC_ID_PAF_VIDEO = 177, + @AV_CODEC_ID_EXR = 178, + @AV_CODEC_ID_VP7 = 179, + @AV_CODEC_ID_SANM = 180, + @AV_CODEC_ID_SGIRLE = 181, + @AV_CODEC_ID_MVC1 = 182, + @AV_CODEC_ID_MVC2 = 183, + @AV_CODEC_ID_HQX = 184, + @AV_CODEC_ID_TDSC = 185, + @AV_CODEC_ID_HQ_HQA = 186, + @AV_CODEC_ID_HAP = 187, + @AV_CODEC_ID_DDS = 188, + @AV_CODEC_ID_DXV = 189, + @AV_CODEC_ID_SCREENPRESSO = 190, + @AV_CODEC_ID_RSCC = 191, + @AV_CODEC_ID_AVS2 = 192, + @AV_CODEC_ID_PGX = 193, + @AV_CODEC_ID_AVS3 = 194, + @AV_CODEC_ID_MSP2 = 195, + @AV_CODEC_ID_VVC = 196, + @AV_CODEC_ID_Y41P = 197, + @AV_CODEC_ID_AVRP = 198, + @AV_CODEC_ID_012V = 199, + @AV_CODEC_ID_AVUI = 200, + @AV_CODEC_ID_TARGA_Y216 = 201, + @AV_CODEC_ID_V308 = 202, + @AV_CODEC_ID_V408 = 203, + @AV_CODEC_ID_YUV4 = 204, + @AV_CODEC_ID_AVRN = 205, + @AV_CODEC_ID_CPIA = 206, + @AV_CODEC_ID_XFACE = 207, + @AV_CODEC_ID_SNOW = 208, + @AV_CODEC_ID_SMVJPEG = 209, + @AV_CODEC_ID_APNG = 210, + @AV_CODEC_ID_DAALA = 211, + @AV_CODEC_ID_CFHD = 212, + @AV_CODEC_ID_TRUEMOTION2RT = 213, + @AV_CODEC_ID_M101 = 214, + @AV_CODEC_ID_MAGICYUV = 215, + @AV_CODEC_ID_SHEERVIDEO = 216, + @AV_CODEC_ID_YLC = 217, + @AV_CODEC_ID_PSD = 218, + @AV_CODEC_ID_PIXLET = 219, + @AV_CODEC_ID_SPEEDHQ = 220, + @AV_CODEC_ID_FMVC = 221, + @AV_CODEC_ID_SCPR = 222, + @AV_CODEC_ID_CLEARVIDEO = 223, + @AV_CODEC_ID_XPM = 224, + @AV_CODEC_ID_AV1 = 225, + @AV_CODEC_ID_BITPACKED = 226, + @AV_CODEC_ID_MSCC = 227, + @AV_CODEC_ID_SRGC = 228, + @AV_CODEC_ID_SVG = 229, + @AV_CODEC_ID_GDV = 230, + @AV_CODEC_ID_FITS = 231, + @AV_CODEC_ID_IMM4 = 232, + @AV_CODEC_ID_PROSUMER = 233, + @AV_CODEC_ID_MWSC = 234, + @AV_CODEC_ID_WCMV = 235, + @AV_CODEC_ID_RASC = 236, + @AV_CODEC_ID_HYMT = 237, + @AV_CODEC_ID_ARBC = 238, + @AV_CODEC_ID_AGM = 239, + @AV_CODEC_ID_LSCR = 240, + @AV_CODEC_ID_VP4 = 241, + @AV_CODEC_ID_IMM5 = 242, + @AV_CODEC_ID_MVDV = 243, + @AV_CODEC_ID_MVHA = 244, + @AV_CODEC_ID_CDTOONS = 245, + @AV_CODEC_ID_MV30 = 246, + @AV_CODEC_ID_NOTCHLC = 247, + @AV_CODEC_ID_PFM = 248, + @AV_CODEC_ID_MOBICLIP = 249, + @AV_CODEC_ID_PHOTOCD = 250, + @AV_CODEC_ID_IPU = 251, + @AV_CODEC_ID_ARGO = 252, + @AV_CODEC_ID_CRI = 253, + @AV_CODEC_ID_SIMBIOSIS_IMX = 254, + @AV_CODEC_ID_SGA_VIDEO = 255, + @AV_CODEC_ID_GEM = 256, + @AV_CODEC_ID_VBN = 257, + @AV_CODEC_ID_JPEGXL = 258, + @AV_CODEC_ID_QOI = 259, + @AV_CODEC_ID_PHM = 260, + @AV_CODEC_ID_RADIANCE_HDR = 261, + @AV_CODEC_ID_WBMP = 262, + @AV_CODEC_ID_MEDIA100 = 263, + @AV_CODEC_ID_VQC = 264, + @AV_CODEC_ID_PDV = 265, + @AV_CODEC_ID_EVC = 266, + @AV_CODEC_ID_RTV1 = 267, + @AV_CODEC_ID_VMIX = 268, + @AV_CODEC_ID_LEAD = 269, + /// A dummy id pointing at the start of audio codecs + @AV_CODEC_ID_FIRST_AUDIO = 65536, + @AV_CODEC_ID_PCM_S16LE = 65536, + @AV_CODEC_ID_PCM_S16BE = 65537, + @AV_CODEC_ID_PCM_U16LE = 65538, + @AV_CODEC_ID_PCM_U16BE = 65539, + @AV_CODEC_ID_PCM_S8 = 65540, + @AV_CODEC_ID_PCM_U8 = 65541, + @AV_CODEC_ID_PCM_MULAW = 65542, + @AV_CODEC_ID_PCM_ALAW = 65543, + @AV_CODEC_ID_PCM_S32LE = 65544, + @AV_CODEC_ID_PCM_S32BE = 65545, + @AV_CODEC_ID_PCM_U32LE = 65546, + @AV_CODEC_ID_PCM_U32BE = 65547, + @AV_CODEC_ID_PCM_S24LE = 65548, + @AV_CODEC_ID_PCM_S24BE = 65549, + @AV_CODEC_ID_PCM_U24LE = 65550, + @AV_CODEC_ID_PCM_U24BE = 65551, + @AV_CODEC_ID_PCM_S24DAUD = 65552, + @AV_CODEC_ID_PCM_ZORK = 65553, + @AV_CODEC_ID_PCM_S16LE_PLANAR = 65554, + @AV_CODEC_ID_PCM_DVD = 65555, + @AV_CODEC_ID_PCM_F32BE = 65556, + @AV_CODEC_ID_PCM_F32LE = 65557, + @AV_CODEC_ID_PCM_F64BE = 65558, + @AV_CODEC_ID_PCM_F64LE = 65559, + @AV_CODEC_ID_PCM_BLURAY = 65560, + @AV_CODEC_ID_PCM_LXF = 65561, + @AV_CODEC_ID_S302M = 65562, + @AV_CODEC_ID_PCM_S8_PLANAR = 65563, + @AV_CODEC_ID_PCM_S24LE_PLANAR = 65564, + @AV_CODEC_ID_PCM_S32LE_PLANAR = 65565, + @AV_CODEC_ID_PCM_S16BE_PLANAR = 65566, + @AV_CODEC_ID_PCM_S64LE = 65567, + @AV_CODEC_ID_PCM_S64BE = 65568, + @AV_CODEC_ID_PCM_F16LE = 65569, + @AV_CODEC_ID_PCM_F24LE = 65570, + @AV_CODEC_ID_PCM_VIDC = 65571, + @AV_CODEC_ID_PCM_SGA = 65572, + @AV_CODEC_ID_ADPCM_IMA_QT = 69632, + @AV_CODEC_ID_ADPCM_IMA_WAV = 69633, + @AV_CODEC_ID_ADPCM_IMA_DK3 = 69634, + @AV_CODEC_ID_ADPCM_IMA_DK4 = 69635, + @AV_CODEC_ID_ADPCM_IMA_WS = 69636, + @AV_CODEC_ID_ADPCM_IMA_SMJPEG = 69637, + @AV_CODEC_ID_ADPCM_MS = 69638, + @AV_CODEC_ID_ADPCM_4XM = 69639, + @AV_CODEC_ID_ADPCM_XA = 69640, + @AV_CODEC_ID_ADPCM_ADX = 69641, + @AV_CODEC_ID_ADPCM_EA = 69642, + @AV_CODEC_ID_ADPCM_G726 = 69643, + @AV_CODEC_ID_ADPCM_CT = 69644, + @AV_CODEC_ID_ADPCM_SWF = 69645, + @AV_CODEC_ID_ADPCM_YAMAHA = 69646, + @AV_CODEC_ID_ADPCM_SBPRO_4 = 69647, + @AV_CODEC_ID_ADPCM_SBPRO_3 = 69648, + @AV_CODEC_ID_ADPCM_SBPRO_2 = 69649, + @AV_CODEC_ID_ADPCM_THP = 69650, + @AV_CODEC_ID_ADPCM_IMA_AMV = 69651, + @AV_CODEC_ID_ADPCM_EA_R1 = 69652, + @AV_CODEC_ID_ADPCM_EA_R3 = 69653, + @AV_CODEC_ID_ADPCM_EA_R2 = 69654, + @AV_CODEC_ID_ADPCM_IMA_EA_SEAD = 69655, + @AV_CODEC_ID_ADPCM_IMA_EA_EACS = 69656, + @AV_CODEC_ID_ADPCM_EA_XAS = 69657, + @AV_CODEC_ID_ADPCM_EA_MAXIS_XA = 69658, + @AV_CODEC_ID_ADPCM_IMA_ISS = 69659, + @AV_CODEC_ID_ADPCM_G722 = 69660, + @AV_CODEC_ID_ADPCM_IMA_APC = 69661, + @AV_CODEC_ID_ADPCM_VIMA = 69662, + @AV_CODEC_ID_ADPCM_AFC = 69663, + @AV_CODEC_ID_ADPCM_IMA_OKI = 69664, + @AV_CODEC_ID_ADPCM_DTK = 69665, + @AV_CODEC_ID_ADPCM_IMA_RAD = 69666, + @AV_CODEC_ID_ADPCM_G726LE = 69667, + @AV_CODEC_ID_ADPCM_THP_LE = 69668, + @AV_CODEC_ID_ADPCM_PSX = 69669, + @AV_CODEC_ID_ADPCM_AICA = 69670, + @AV_CODEC_ID_ADPCM_IMA_DAT4 = 69671, + @AV_CODEC_ID_ADPCM_MTAF = 69672, + @AV_CODEC_ID_ADPCM_AGM = 69673, + @AV_CODEC_ID_ADPCM_ARGO = 69674, + @AV_CODEC_ID_ADPCM_IMA_SSI = 69675, + @AV_CODEC_ID_ADPCM_ZORK = 69676, + @AV_CODEC_ID_ADPCM_IMA_APM = 69677, + @AV_CODEC_ID_ADPCM_IMA_ALP = 69678, + @AV_CODEC_ID_ADPCM_IMA_MTF = 69679, + @AV_CODEC_ID_ADPCM_IMA_CUNNING = 69680, + @AV_CODEC_ID_ADPCM_IMA_MOFLEX = 69681, + @AV_CODEC_ID_ADPCM_IMA_ACORN = 69682, + @AV_CODEC_ID_ADPCM_XMD = 69683, + @AV_CODEC_ID_AMR_NB = 73728, + @AV_CODEC_ID_AMR_WB = 73729, + @AV_CODEC_ID_RA_144 = 77824, + @AV_CODEC_ID_RA_288 = 77825, + @AV_CODEC_ID_ROQ_DPCM = 81920, + @AV_CODEC_ID_INTERPLAY_DPCM = 81921, + @AV_CODEC_ID_XAN_DPCM = 81922, + @AV_CODEC_ID_SOL_DPCM = 81923, + @AV_CODEC_ID_SDX2_DPCM = 81924, + @AV_CODEC_ID_GREMLIN_DPCM = 81925, + @AV_CODEC_ID_DERF_DPCM = 81926, + @AV_CODEC_ID_WADY_DPCM = 81927, + @AV_CODEC_ID_CBD2_DPCM = 81928, + @AV_CODEC_ID_MP2 = 86016, + /// preferred ID for decoding MPEG audio layer 1, 2 or 3 + @AV_CODEC_ID_MP3 = 86017, + @AV_CODEC_ID_AAC = 86018, + @AV_CODEC_ID_AC3 = 86019, + @AV_CODEC_ID_DTS = 86020, + @AV_CODEC_ID_VORBIS = 86021, + @AV_CODEC_ID_DVAUDIO = 86022, + @AV_CODEC_ID_WMAV1 = 86023, + @AV_CODEC_ID_WMAV2 = 86024, + @AV_CODEC_ID_MACE3 = 86025, + @AV_CODEC_ID_MACE6 = 86026, + @AV_CODEC_ID_VMDAUDIO = 86027, + @AV_CODEC_ID_FLAC = 86028, + @AV_CODEC_ID_MP3ADU = 86029, + @AV_CODEC_ID_MP3ON4 = 86030, + @AV_CODEC_ID_SHORTEN = 86031, + @AV_CODEC_ID_ALAC = 86032, + @AV_CODEC_ID_WESTWOOD_SND1 = 86033, + /// as in Berlin toast format + @AV_CODEC_ID_GSM = 86034, + @AV_CODEC_ID_QDM2 = 86035, + @AV_CODEC_ID_COOK = 86036, + @AV_CODEC_ID_TRUESPEECH = 86037, + @AV_CODEC_ID_TTA = 86038, + @AV_CODEC_ID_SMACKAUDIO = 86039, + @AV_CODEC_ID_QCELP = 86040, + @AV_CODEC_ID_WAVPACK = 86041, + @AV_CODEC_ID_DSICINAUDIO = 86042, + @AV_CODEC_ID_IMC = 86043, + @AV_CODEC_ID_MUSEPACK7 = 86044, + @AV_CODEC_ID_MLP = 86045, + @AV_CODEC_ID_GSM_MS = 86046, + @AV_CODEC_ID_ATRAC3 = 86047, + @AV_CODEC_ID_APE = 86048, + @AV_CODEC_ID_NELLYMOSER = 86049, + @AV_CODEC_ID_MUSEPACK8 = 86050, + @AV_CODEC_ID_SPEEX = 86051, + @AV_CODEC_ID_WMAVOICE = 86052, + @AV_CODEC_ID_WMAPRO = 86053, + @AV_CODEC_ID_WMALOSSLESS = 86054, + @AV_CODEC_ID_ATRAC3P = 86055, + @AV_CODEC_ID_EAC3 = 86056, + @AV_CODEC_ID_SIPR = 86057, + @AV_CODEC_ID_MP1 = 86058, + @AV_CODEC_ID_TWINVQ = 86059, + @AV_CODEC_ID_TRUEHD = 86060, + @AV_CODEC_ID_MP4ALS = 86061, + @AV_CODEC_ID_ATRAC1 = 86062, + @AV_CODEC_ID_BINKAUDIO_RDFT = 86063, + @AV_CODEC_ID_BINKAUDIO_DCT = 86064, + @AV_CODEC_ID_AAC_LATM = 86065, + @AV_CODEC_ID_QDMC = 86066, + @AV_CODEC_ID_CELT = 86067, + @AV_CODEC_ID_G723_1 = 86068, + @AV_CODEC_ID_G729 = 86069, + @AV_CODEC_ID_8SVX_EXP = 86070, + @AV_CODEC_ID_8SVX_FIB = 86071, + @AV_CODEC_ID_BMV_AUDIO = 86072, + @AV_CODEC_ID_RALF = 86073, + @AV_CODEC_ID_IAC = 86074, + @AV_CODEC_ID_ILBC = 86075, + @AV_CODEC_ID_OPUS = 86076, + @AV_CODEC_ID_COMFORT_NOISE = 86077, + @AV_CODEC_ID_TAK = 86078, + @AV_CODEC_ID_METASOUND = 86079, + @AV_CODEC_ID_PAF_AUDIO = 86080, + @AV_CODEC_ID_ON2AVC = 86081, + @AV_CODEC_ID_DSS_SP = 86082, + @AV_CODEC_ID_CODEC2 = 86083, + @AV_CODEC_ID_FFWAVESYNTH = 86084, + @AV_CODEC_ID_SONIC = 86085, + @AV_CODEC_ID_SONIC_LS = 86086, + @AV_CODEC_ID_EVRC = 86087, + @AV_CODEC_ID_SMV = 86088, + @AV_CODEC_ID_DSD_LSBF = 86089, + @AV_CODEC_ID_DSD_MSBF = 86090, + @AV_CODEC_ID_DSD_LSBF_PLANAR = 86091, + @AV_CODEC_ID_DSD_MSBF_PLANAR = 86092, + @AV_CODEC_ID_4GV = 86093, + @AV_CODEC_ID_INTERPLAY_ACM = 86094, + @AV_CODEC_ID_XMA1 = 86095, + @AV_CODEC_ID_XMA2 = 86096, + @AV_CODEC_ID_DST = 86097, + @AV_CODEC_ID_ATRAC3AL = 86098, + @AV_CODEC_ID_ATRAC3PAL = 86099, + @AV_CODEC_ID_DOLBY_E = 86100, + @AV_CODEC_ID_APTX = 86101, + @AV_CODEC_ID_APTX_HD = 86102, + @AV_CODEC_ID_SBC = 86103, + @AV_CODEC_ID_ATRAC9 = 86104, + @AV_CODEC_ID_HCOM = 86105, + @AV_CODEC_ID_ACELP_KELVIN = 86106, + @AV_CODEC_ID_MPEGH_3D_AUDIO = 86107, + @AV_CODEC_ID_SIREN = 86108, + @AV_CODEC_ID_HCA = 86109, + @AV_CODEC_ID_FASTAUDIO = 86110, + @AV_CODEC_ID_MSNSIREN = 86111, + @AV_CODEC_ID_DFPWM = 86112, + @AV_CODEC_ID_BONK = 86113, + @AV_CODEC_ID_MISC4 = 86114, + @AV_CODEC_ID_APAC = 86115, + @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, + @AV_CODEC_ID_QOA = 86121, + /// A dummy ID pointing at the start of subtitle codecs. + @AV_CODEC_ID_FIRST_SUBTITLE = 94208, + @AV_CODEC_ID_DVD_SUBTITLE = 94208, + @AV_CODEC_ID_DVB_SUBTITLE = 94209, + /// raw UTF-8 text + @AV_CODEC_ID_TEXT = 94210, + @AV_CODEC_ID_XSUB = 94211, + @AV_CODEC_ID_SSA = 94212, + @AV_CODEC_ID_MOV_TEXT = 94213, + @AV_CODEC_ID_HDMV_PGS_SUBTITLE = 94214, + @AV_CODEC_ID_DVB_TELETEXT = 94215, + @AV_CODEC_ID_SRT = 94216, + @AV_CODEC_ID_MICRODVD = 94217, + @AV_CODEC_ID_EIA_608 = 94218, + @AV_CODEC_ID_JACOSUB = 94219, + @AV_CODEC_ID_SAMI = 94220, + @AV_CODEC_ID_REALTEXT = 94221, + @AV_CODEC_ID_STL = 94222, + @AV_CODEC_ID_SUBVIEWER1 = 94223, + @AV_CODEC_ID_SUBVIEWER = 94224, + @AV_CODEC_ID_SUBRIP = 94225, + @AV_CODEC_ID_WEBVTT = 94226, + @AV_CODEC_ID_MPL2 = 94227, + @AV_CODEC_ID_VPLAYER = 94228, + @AV_CODEC_ID_PJS = 94229, + @AV_CODEC_ID_ASS = 94230, + @AV_CODEC_ID_HDMV_TEXT_SUBTITLE = 94231, + @AV_CODEC_ID_TTML = 94232, + @AV_CODEC_ID_ARIB_CAPTION = 94233, + /// A dummy ID pointing at the start of various fake codecs. + @AV_CODEC_ID_FIRST_UNKNOWN = 98304, + @AV_CODEC_ID_TTF = 98304, + /// Contain timestamp estimated through PCR of program stream. + @AV_CODEC_ID_SCTE_35 = 98305, + @AV_CODEC_ID_EPG = 98306, + @AV_CODEC_ID_BINTEXT = 98307, + @AV_CODEC_ID_XBIN = 98308, + @AV_CODEC_ID_IDF = 98309, + @AV_CODEC_ID_OTF = 98310, + @AV_CODEC_ID_SMPTE_KLV = 98311, + @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) + @AV_CODEC_ID_MPEG2TS = 131072, + /// _FAKE_ codec to indicate a MPEG-4 Systems stream (only used by libavformat) + @AV_CODEC_ID_MPEG4SYSTEMS = 131073, + /// Dummy codec for streams containing only metadata information. + @AV_CODEC_ID_FFMETADATA = 135168, + /// Passthrough codec, AVFrames wrapped in AVPacket + @AV_CODEC_ID_WRAPPED_AVFRAME = 135169, + /// Dummy null video codec, useful mainly for development and debugging. Null encoder/decoder discard all input and never return any output. + @AV_CODEC_ID_VNULL = 135170, + /// Dummy null audio codec, useful mainly for development and debugging. Null encoder/decoder discard all input and never return any output. + @AV_CODEC_ID_ANULL = 135171, + } + + /// Chromaticity coordinates of the source primaries. These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273. + public enum AVColorPrimaries : int + { + @AVCOL_PRI_RESERVED0 = 0, + /// also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B + @AVCOL_PRI_BT709 = 1, + @AVCOL_PRI_UNSPECIFIED = 2, + @AVCOL_PRI_RESERVED = 3, + /// also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) + @AVCOL_PRI_BT470M = 4, + /// also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM + @AVCOL_PRI_BT470BG = 5, + /// also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC + @AVCOL_PRI_SMPTE170M = 6, + /// identical to above, also called "SMPTE C" even though it uses D65 + @AVCOL_PRI_SMPTE240M = 7, + /// colour filters using Illuminant C + @AVCOL_PRI_FILM = 8, + /// ITU-R BT2020 + @AVCOL_PRI_BT2020 = 9, + /// SMPTE ST 428-1 (CIE 1931 XYZ) + @AVCOL_PRI_SMPTE428 = 10, + @AVCOL_PRI_SMPTEST428_1 = 10, + /// SMPTE ST 431-2 (2011) / DCI P3 + @AVCOL_PRI_SMPTE431 = 11, + /// SMPTE ST 432-1 (2010) / P3 D65 / Display P3 + @AVCOL_PRI_SMPTE432 = 12, + /// EBU Tech. 3213-E (nothing there) / one of JEDEC P22 group phosphors + @AVCOL_PRI_EBU3213 = 22, + @AVCOL_PRI_JEDEC_P22 = 22, + /// Not part of ABI + @AVCOL_PRI_NB = 23, + } + + /// Visual content value range. + public enum AVColorRange : int + { + @AVCOL_RANGE_UNSPECIFIED = 0, + /// Narrow or limited range content. + @AVCOL_RANGE_MPEG = 1, + /// Full range content. + @AVCOL_RANGE_JPEG = 2, + /// Not part of ABI + @AVCOL_RANGE_NB = 3, + } + + /// YUV colorspace type. These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.3. + public enum AVColorSpace : int + { + /// order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1 + @AVCOL_SPC_RGB = 0, + /// also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B + @AVCOL_SPC_BT709 = 1, + @AVCOL_SPC_UNSPECIFIED = 2, + /// reserved for future use by ITU-T and ISO/IEC just like 15-255 are + @AVCOL_SPC_RESERVED = 3, + /// FCC Title 47 Code of Federal Regulations 73.682 (a)(20) + @AVCOL_SPC_FCC = 4, + /// also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 + @AVCOL_SPC_BT470BG = 5, + /// also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above + @AVCOL_SPC_SMPTE170M = 6, + /// derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries + @AVCOL_SPC_SMPTE240M = 7, + /// used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 + @AVCOL_SPC_YCGCO = 8, + @AVCOL_SPC_YCOCG = 8, + /// ITU-R BT2020 non-constant luminance system + @AVCOL_SPC_BT2020_NCL = 9, + /// ITU-R BT2020 constant luminance system + @AVCOL_SPC_BT2020_CL = 10, + /// SMPTE 2085, Y'D'zD'x + @AVCOL_SPC_SMPTE2085 = 11, + /// Chromaticity-derived non-constant luminance system + @AVCOL_SPC_CHROMA_DERIVED_NCL = 12, + /// Chromaticity-derived constant luminance system + @AVCOL_SPC_CHROMA_DERIVED_CL = 13, + /// ITU-R BT.2100-0, ICtCp + @AVCOL_SPC_ICTCP = 14, + /// Not part of ABI + @AVCOL_SPC_NB = 15, + } + + /// Color Transfer Characteristic. These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.2. + public enum AVColorTransferCharacteristic : int + { + @AVCOL_TRC_RESERVED0 = 0, + /// also ITU-R BT1361 + @AVCOL_TRC_BT709 = 1, + @AVCOL_TRC_UNSPECIFIED = 2, + @AVCOL_TRC_RESERVED = 3, + /// also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM + @AVCOL_TRC_GAMMA22 = 4, + /// also ITU-R BT470BG + @AVCOL_TRC_GAMMA28 = 5, + /// also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC + @AVCOL_TRC_SMPTE170M = 6, + @AVCOL_TRC_SMPTE240M = 7, + /// "Linear transfer characteristics" + @AVCOL_TRC_LINEAR = 8, + /// "Logarithmic transfer characteristic (100:1 range)" + @AVCOL_TRC_LOG = 9, + /// "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" + @AVCOL_TRC_LOG_SQRT = 10, + /// IEC 61966-2-4 + @AVCOL_TRC_IEC61966_2_4 = 11, + /// ITU-R BT1361 Extended Colour Gamut + @AVCOL_TRC_BT1361_ECG = 12, + /// IEC 61966-2-1 (sRGB or sYCC) + @AVCOL_TRC_IEC61966_2_1 = 13, + /// ITU-R BT2020 for 10-bit system + @AVCOL_TRC_BT2020_10 = 14, + /// ITU-R BT2020 for 12-bit system + @AVCOL_TRC_BT2020_12 = 15, + /// SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems + @AVCOL_TRC_SMPTE2084 = 16, + @AVCOL_TRC_SMPTEST2084 = 16, + /// SMPTE ST 428-1 + @AVCOL_TRC_SMPTE428 = 17, + @AVCOL_TRC_SMPTEST428_1 = 17, + /// ARIB STD-B67, known as "Hybrid log-gamma" + @AVCOL_TRC_ARIB_STD_B67 = 18, + /// Not part of ABI + @AVCOL_TRC_NB = 19, + } + + /// Message types used by avdevice_dev_to_app_control_message(). + public enum AVDevToAppMessageType : int + { + /// Dummy message. + @AV_DEV_TO_APP_NONE = 1313820229, + /// Create window buffer message. + @AV_DEV_TO_APP_CREATE_WINDOW_BUFFER = 1111708229, + /// Prepare window buffer message. + @AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER = 1112560197, + /// Display window buffer message. + @AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER = 1111771475, + /// Destroy window buffer message. + @AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER = 1111770451, + /// Buffer fullness status messages. + @AV_DEV_TO_APP_BUFFER_OVERFLOW = 1112491596, + /// Buffer fullness status messages. + @AV_DEV_TO_APP_BUFFER_UNDERFLOW = 1112884812, + /// Buffer readable/writable. + @AV_DEV_TO_APP_BUFFER_READABLE = 1112687648, + /// Buffer readable/writable. + @AV_DEV_TO_APP_BUFFER_WRITABLE = 1113018912, + /// Mute state change message. + @AV_DEV_TO_APP_MUTE_STATE_CHANGED = 1129141588, + /// Volume level change message. + @AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED = 1129729868, + } + + public enum AVDiscard : int + { + /// discard nothing + @AVDISCARD_NONE = -16, + /// discard useless packets like 0 size packets in avi + @AVDISCARD_DEFAULT = 0, + /// discard all non reference + @AVDISCARD_NONREF = 8, + /// discard all bidirectional frames + @AVDISCARD_BIDIR = 16, + /// discard all non intra frames + @AVDISCARD_NONINTRA = 24, + /// discard all frames except keyframes + @AVDISCARD_NONKEY = 32, + /// discard all + @AVDISCARD_ALL = 48, + } + + /// The duration of a video can be estimated through various ways, and this enum can be used to know how the duration was estimated. + public enum AVDurationEstimationMethod : int + { + /// Duration accurately estimated from PTSes + @AVFMT_DURATION_FROM_PTS = 0, + /// Duration estimated from a stream with a known duration + @AVFMT_DURATION_FROM_STREAM = 1, + /// Duration estimated from bitrate (less accurate) + @AVFMT_DURATION_FROM_BITRATE = 2, + } + + public enum AVFieldOrder : int + { + @AV_FIELD_UNKNOWN = 0, + @AV_FIELD_PROGRESSIVE = 1, + /// Top coded_first, top displayed first + @AV_FIELD_TT = 2, + /// Bottom coded first, bottom displayed first + @AV_FIELD_BB = 3, + /// Top coded first, bottom displayed first + @AV_FIELD_TB = 4, + /// Bottom coded first, top displayed first + @AV_FIELD_BT = 5, + } + + /// @{ AVFrame is an abstraction for reference-counted raw multimedia data. + public enum AVFrameSideDataType : int + { + /// The data is the AVPanScan struct defined in libavcodec. + @AV_FRAME_DATA_PANSCAN = 0, + /// ATSC A53 Part 4 Closed Captions. A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. The number of bytes of CC data is AVFrameSideData.size. + @AV_FRAME_DATA_A53_CC = 1, + /// Stereoscopic 3d metadata. The data is the AVStereo3D struct defined in libavutil/stereo3d.h. + @AV_FRAME_DATA_STEREO3D = 2, + /// The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h. + @AV_FRAME_DATA_MATRIXENCODING = 3, + /// Metadata relevant to a downmix procedure. The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. + @AV_FRAME_DATA_DOWNMIX_INFO = 4, + /// ReplayGain information in the form of the AVReplayGain struct. + @AV_FRAME_DATA_REPLAYGAIN = 5, + /// This side data contains a 3x3 transformation matrix describing an affine transformation that needs to be applied to the frame for correct presentation. + @AV_FRAME_DATA_DISPLAYMATRIX = 6, + /// Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVActiveFormatDescription enum. + @AV_FRAME_DATA_AFD = 7, + /// Motion vectors exported by some codecs (on demand through the export_mvs flag set in the libavcodec AVCodecContext flags2 option). The data is the AVMotionVector struct defined in libavutil/motion_vector.h. + @AV_FRAME_DATA_MOTION_VECTORS = 8, + /// Recommmends skipping the specified number of samples. This is exported only if the "skip_manual" AVOption is set in libavcodec. This has the same format as AV_PKT_DATA_SKIP_SAMPLES. + @AV_FRAME_DATA_SKIP_SAMPLES = 9, + /// This side data must be associated with an audio frame and corresponds to enum AVAudioServiceType defined in avcodec.h. + @AV_FRAME_DATA_AUDIO_SERVICE_TYPE = 10, + /// Mastering display metadata associated with a video frame. The payload is an AVMasteringDisplayMetadata type and contains information about the mastering display color volume. + @AV_FRAME_DATA_MASTERING_DISPLAY_METADATA = 11, + /// The GOP timecode in 25 bit timecode format. Data format is 64-bit integer. This is set on the first frame of a GOP that has a temporal reference of 0. + @AV_FRAME_DATA_GOP_TIMECODE = 12, + /// The data represents the AVSphericalMapping structure defined in libavutil/spherical.h. + @AV_FRAME_DATA_SPHERICAL = 13, + /// Content light level (based on CTA-861.3). This payload contains data in the form of the AVContentLightMetadata struct. + @AV_FRAME_DATA_CONTENT_LIGHT_LEVEL = 14, + /// The data contains an ICC profile as an opaque octet buffer following the format described by ISO 15076-1 with an optional name defined in the metadata key entry "name". + @AV_FRAME_DATA_ICC_PROFILE = 15, + /// Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 uint32_t where the first uint32_t describes how many (1-3) of the other timecodes are used. The timecode format is described in the documentation of av_timecode_get_smpte_from_framenum() function in libavutil/timecode.h. + @AV_FRAME_DATA_S12M_TIMECODE = 16, + /// HDR dynamic metadata associated with a video frame. The payload is an AVDynamicHDRPlus type and contains information for color volume transform - application 4 of SMPTE 2094-40:2016 standard. + @AV_FRAME_DATA_DYNAMIC_HDR_PLUS = 17, + /// Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is implied by AVFrameSideData.size / AVRegionOfInterest.self_size. + @AV_FRAME_DATA_REGIONS_OF_INTEREST = 18, + /// Encoding parameters for a video frame, as described by AVVideoEncParams. + @AV_FRAME_DATA_VIDEO_ENC_PARAMS = 19, + /// User data unregistered metadata associated with a video frame. This is the H.26[45] UDU SEI message, and shouldn't be used for any other purpose The data is stored as uint8_t in AVFrameSideData.data which is 16 bytes of uuid_iso_iec_11578 followed by AVFrameSideData.size - 16 bytes of user_data_payload_byte. + @AV_FRAME_DATA_SEI_UNREGISTERED = 20, + /// Film grain parameters for a frame, described by AVFilmGrainParams. Must be present for every frame which should have film grain applied. + @AV_FRAME_DATA_FILM_GRAIN_PARAMS = 21, + /// Bounding boxes for object detection and classification, as described by AVDetectionBBoxHeader. + @AV_FRAME_DATA_DETECTION_BBOXES = 22, + /// Dolby Vision RPU raw data, suitable for passing to x265 or other libraries. Array of uint8_t, with NAL emulation bytes intact. + @AV_FRAME_DATA_DOVI_RPU_BUFFER = 23, + /// Parsed Dolby Vision metadata, suitable for passing to a software implementation. The payload is the AVDOVIMetadata struct defined in libavutil/dovi_meta.h. + @AV_FRAME_DATA_DOVI_METADATA = 24, + /// HDR Vivid dynamic metadata associated with a video frame. The payload is an AVDynamicHDRVivid type and contains information for color volume transform - CUVA 005.1-2021. + @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. + public enum AVHDRPlusOverlapProcessOption : int + { + @AV_HDR_PLUS_OVERLAP_PROCESS_WEIGHTED_AVERAGING = 0, + @AV_HDR_PLUS_OVERLAP_PROCESS_LAYERING = 1, + } + + public enum AVHWDeviceType : int + { + @AV_HWDEVICE_TYPE_NONE = 0, + @AV_HWDEVICE_TYPE_VDPAU = 1, + @AV_HWDEVICE_TYPE_CUDA = 2, + @AV_HWDEVICE_TYPE_VAAPI = 3, + @AV_HWDEVICE_TYPE_DXVA2 = 4, + @AV_HWDEVICE_TYPE_QSV = 5, + @AV_HWDEVICE_TYPE_VIDEOTOOLBOX = 6, + @AV_HWDEVICE_TYPE_D3D11VA = 7, + @AV_HWDEVICE_TYPE_DRM = 8, + @AV_HWDEVICE_TYPE_OPENCL = 9, + @AV_HWDEVICE_TYPE_MEDIACODEC = 10, + @AV_HWDEVICE_TYPE_VULKAN = 11, + @AV_HWDEVICE_TYPE_D3D12VA = 12, + } + + public enum AVHWFrameTransferDirection : int + { + /// Transfer the data from the queried hw frame. + @AV_HWFRAME_TRANSFER_DIRECTION_FROM = 0, + /// Transfer the data to the queried hw frame. + @AV_HWFRAME_TRANSFER_DIRECTION_TO = 1, + } + + /// Different data types that can be returned via the AVIO write_data_type callback. + public enum AVIODataMarkerType : int + { + /// Header data; this needs to be present for the stream to be decodeable. + @AVIO_DATA_MARKER_HEADER = 0, + /// A point in the output bytestream where a decoder can start decoding (i.e. a keyframe). A demuxer/decoder given the data flagged with AVIO_DATA_MARKER_HEADER, followed by any AVIO_DATA_MARKER_SYNC_POINT, should give decodeable results. + @AVIO_DATA_MARKER_SYNC_POINT = 1, + /// A point in the output bytestream where a demuxer can start parsing (for non self synchronizing bytestream formats). That is, any non-keyframe packet start point. + @AVIO_DATA_MARKER_BOUNDARY_POINT = 2, + /// This is any, unlabelled data. It can either be a muxer not marking any positions at all, it can be an actual boundary/sync point that the muxer chooses not to mark, or a later part of a packet/fragment that is cut into multiple write callbacks due to limited IO buffer size. + @AVIO_DATA_MARKER_UNKNOWN = 3, + /// Trailer data, which doesn't contain actual content, but only for finalizing the output file. + @AVIO_DATA_MARKER_TRAILER = 4, + /// A point in the output bytestream where the underlying AVIOContext might flush the buffer depending on latency or buffering requirements. Typically means the end of a packet. + @AVIO_DATA_MARKER_FLUSH_POINT = 5, + } + + /// Directory entry types. + public enum AVIODirEntryType : int + { + @AVIO_ENTRY_UNKNOWN = 0, + @AVIO_ENTRY_BLOCK_DEVICE = 1, + @AVIO_ENTRY_CHARACTER_DEVICE = 2, + @AVIO_ENTRY_DIRECTORY = 3, + @AVIO_ENTRY_NAMED_PIPE = 4, + @AVIO_ENTRY_SYMBOLIC_LINK = 5, + @AVIO_ENTRY_SOCKET = 6, + @AVIO_ENTRY_FILE = 7, + @AVIO_ENTRY_SERVER = 8, + @AVIO_ENTRY_SHARE = 9, + @AVIO_ENTRY_WORKGROUP = 10, + } + + public enum AVMatrixEncoding : int + { + @AV_MATRIX_ENCODING_NONE = 0, + @AV_MATRIX_ENCODING_DOLBY = 1, + @AV_MATRIX_ENCODING_DPLII = 2, + @AV_MATRIX_ENCODING_DPLIIX = 3, + @AV_MATRIX_ENCODING_DPLIIZ = 4, + @AV_MATRIX_ENCODING_DOLBYEX = 5, + @AV_MATRIX_ENCODING_DOLBYHEADPHONE = 6, + @AV_MATRIX_ENCODING_NB = 7, + } + + /// Media Type + public enum AVMediaType : int + { + /// Usually treated as AVMEDIA_TYPE_DATA + @AVMEDIA_TYPE_UNKNOWN = -1, + @AVMEDIA_TYPE_VIDEO = 0, + @AVMEDIA_TYPE_AUDIO = 1, + /// Opaque data information usually continuous + @AVMEDIA_TYPE_DATA = 2, + @AVMEDIA_TYPE_SUBTITLE = 3, + /// Opaque data information usually sparse + @AVMEDIA_TYPE_ATTACHMENT = 4, + @AVMEDIA_TYPE_NB = 5, + } + + /// @{ AVOptions provide a generic system to declare options on arbitrary structs ("objects"). An option can have a help text, a type and a range of possible values. Options may then be enumerated, read and written to. + public enum AVOptionType : int + { + @AV_OPT_TYPE_FLAGS = 1, + @AV_OPT_TYPE_INT = 2, + @AV_OPT_TYPE_INT64 = 3, + @AV_OPT_TYPE_DOUBLE = 4, + @AV_OPT_TYPE_FLOAT = 5, + @AV_OPT_TYPE_STRING = 6, + @AV_OPT_TYPE_RATIONAL = 7, + /// offset must point to a pointer immediately followed by an int for the length + @AV_OPT_TYPE_BINARY = 8, + @AV_OPT_TYPE_DICT = 9, + @AV_OPT_TYPE_UINT64 = 10, + @AV_OPT_TYPE_CONST = 11, + /// offset must point to two consecutive integers + @AV_OPT_TYPE_IMAGE_SIZE = 12, + @AV_OPT_TYPE_PIXEL_FMT = 13, + @AV_OPT_TYPE_SAMPLE_FMT = 14, + /// offset must point to AVRational + @AV_OPT_TYPE_VIDEO_RATE = 15, + @AV_OPT_TYPE_DURATION = 16, + @AV_OPT_TYPE_COLOR = 17, + @AV_OPT_TYPE_BOOL = 18, + @AV_OPT_TYPE_CHLAYOUT = 19, + /// May be combined with another regular option type to declare an array option. + @AV_OPT_TYPE_FLAG_ARRAY = 65536, + } + + /// 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. + @AV_PKT_DATA_PALETTE = 0, + /// The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was changed and the receiving side should act upon it appropriately. The new extradata is embedded in the side data buffer and should be immediately used for processing the current frame or packet. + @AV_PKT_DATA_NEW_EXTRADATA = 1, + /// An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: + @AV_PKT_DATA_PARAM_CHANGE = 2, + /// An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblocks relevant to splitting the packet into smaller packets on macroblock edges (e.g. as for RFC 2190). That is, it does not necessarily contain info about all macroblocks, as long as the distance between macroblocks in the info is smaller than the target payload size. Each MB info structure is 12 bytes, and is laid out as follows: + @AV_PKT_DATA_H263_MB_INFO = 3, + /// This side data should be associated with an audio stream and contains ReplayGain information in form of the AVReplayGain struct. + @AV_PKT_DATA_REPLAYGAIN = 4, + /// This side data contains a 3x3 transformation matrix describing an affine transformation that needs to be applied to the decoded video frames for correct presentation. + @AV_PKT_DATA_DISPLAYMATRIX = 5, + /// This side data should be associated with a video stream and contains Stereoscopic 3D information in form of the AVStereo3D struct. + @AV_PKT_DATA_STEREO3D = 6, + /// This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType. + @AV_PKT_DATA_AUDIO_SERVICE_TYPE = 7, + /// This side data contains quality related information from the encoder. + @AV_PKT_DATA_QUALITY_STATS = 8, + /// This side data contains an integer value representing the stream index of a "fallback" track. A fallback track indicates an alternate track to use when the current track can not be decoded for some reason. e.g. no decoder available for codec. + @AV_PKT_DATA_FALLBACK_TRACK = 9, + /// This side data corresponds to the AVCPBProperties struct. + @AV_PKT_DATA_CPB_PROPERTIES = 10, + /// Recommmends skipping the specified number of samples + @AV_PKT_DATA_SKIP_SAMPLES = 11, + /// An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio specific to Japanese DTV and if it is true, recommends only the selected channel to be used. + @AV_PKT_DATA_JP_DUALMONO = 12, + /// A list of zero terminated key/value strings. There is no end marker for the list, so it is required to rely on the side data size to stop. + @AV_PKT_DATA_STRINGS_METADATA = 13, + /// Subtitle event position + @AV_PKT_DATA_SUBTITLE_POSITION = 14, + /// Data found in BlockAdditional element of matroska container. There is no end marker for the data, so it is required to rely on the side data size to recognize the end. 8 byte id (as found in BlockAddId) followed by data. + @AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL = 15, + /// The optional first identifier line of a WebVTT cue. + @AV_PKT_DATA_WEBVTT_IDENTIFIER = 16, + /// The optional settings (rendering instructions) that immediately follow the timestamp specifier of a WebVTT cue. + @AV_PKT_DATA_WEBVTT_SETTINGS = 17, + /// A list of zero terminated key/value strings. There is no end marker for the list, so it is required to rely on the side data size to stop. This side data includes updated metadata which appeared in the stream. + @AV_PKT_DATA_METADATA_UPDATE = 18, + /// MPEGTS stream ID as uint8_t, this is required to pass the stream ID information from the demuxer to the corresponding muxer. + @AV_PKT_DATA_MPEGTS_STREAM_ID = 19, + /// Mastering display metadata (based on SMPTE-2086:2014). This metadata should be associated with a video stream and contains data in the form of the AVMasteringDisplayMetadata struct. + @AV_PKT_DATA_MASTERING_DISPLAY_METADATA = 20, + /// This side data should be associated with a video stream and corresponds to the AVSphericalMapping structure. + @AV_PKT_DATA_SPHERICAL = 21, + /// Content light level (based on CTA-861.3). This metadata should be associated with a video stream and contains data in the form of the AVContentLightMetadata struct. + @AV_PKT_DATA_CONTENT_LIGHT_LEVEL = 22, + /// ATSC A53 Part 4 Closed Captions. This metadata should be associated with a video stream. A53 CC bitstream is stored as uint8_t in AVPacketSideData.data. The number of bytes of CC data is AVPacketSideData.size. + @AV_PKT_DATA_A53_CC = 23, + /// This side data is encryption initialization data. The format is not part of ABI, use av_encryption_init_info_* methods to access. + @AV_PKT_DATA_ENCRYPTION_INIT_INFO = 24, + /// This side data contains encryption info for how to decrypt the packet. The format is not part of ABI, use av_encryption_info_* methods to access. + @AV_PKT_DATA_ENCRYPTION_INFO = 25, + /// Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVActiveFormatDescription enum. + @AV_PKT_DATA_AFD = 26, + /// Producer Reference Time data corresponding to the AVProducerReferenceTime struct, usually exported by some encoders (on demand through the prft flag set in the AVCodecContext export_side_data field). + @AV_PKT_DATA_PRFT = 27, + /// ICC profile data consisting of an opaque octet buffer following the format described by ISO 15076-1. + @AV_PKT_DATA_ICC_PROFILE = 28, + /// DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2, section 2.2 dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2, section 3.3 Tags are stored in struct AVDOVIDecoderConfigurationRecord. + @AV_PKT_DATA_DOVI_CONF = 29, + /// Timecode which conforms to SMPTE ST 12-1:2014. The data is an array of 4 uint32_t where the first uint32_t describes how many (1-3) of the other timecodes are used. The timecode format is described in the documentation of av_timecode_get_smpte_from_framenum() function in libavutil/timecode.h. + @AV_PKT_DATA_S12M_TIMECODE = 30, + /// HDR10+ dynamic metadata associated with a video frame. The metadata is in the form of the AVDynamicHDRPlus struct and contains information for color volume transform - application 4 of SMPTE 2094-40:2016 standard. + @AV_PKT_DATA_DYNAMIC_HDR10_PLUS = 31, + /// IAMF Mix Gain Parameter Data associated with the audio frame. This metadata is in the form of the AVIAMFParamDefinition struct and contains information defined in sections 3.6.1 and 3.8.1 of the Immersive Audio Model and Formats standard. + @AV_PKT_DATA_IAMF_MIX_GAIN_PARAM = 32, + /// IAMF Demixing Info Parameter Data associated with the audio frame. This metadata is in the form of the AVIAMFParamDefinition struct and contains information defined in sections 3.6.1 and 3.8.2 of the Immersive Audio Model and Formats standard. + @AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM = 33, + /// IAMF Recon Gain Info Parameter Data associated with the audio frame. This metadata is in the form of the AVIAMFParamDefinition struct and contains information defined in sections 3.6.1 and 3.8.3 of the Immersive Audio Model and Formats standard. + @AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM = 34, + /// Ambient viewing environment metadata, as defined by H.274. This metadata should be associated with a video stream and contains data in the form of the AVAmbientViewingEnvironment struct. + @AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT = 35, + /// The number of side data types. This is not part of the public API/ABI in the sense that it may change when new side data types are added. This must stay the last enum value. If its value becomes huge, some code using it needs to be updated as it assumes it to be smaller than other limits. + @AV_PKT_DATA_NB = 36, + } + + /// @{ + public enum AVPictureStructure : int + { + /// unknown + @AV_PICTURE_STRUCTURE_UNKNOWN = 0, + /// coded as top field + @AV_PICTURE_STRUCTURE_TOP_FIELD = 1, + /// coded as bottom field + @AV_PICTURE_STRUCTURE_BOTTOM_FIELD = 2, + /// coded as frame + @AV_PICTURE_STRUCTURE_FRAME = 3, + } + + /// @} @} + public enum AVPictureType : int + { + /// Undefined + @AV_PICTURE_TYPE_NONE = 0, + /// Intra + @AV_PICTURE_TYPE_I = 1, + /// Predicted + @AV_PICTURE_TYPE_P = 2, + /// Bi-dir predicted + @AV_PICTURE_TYPE_B = 3, + /// S(GMC)-VOP MPEG-4 + @AV_PICTURE_TYPE_S = 4, + /// Switching Intra + @AV_PICTURE_TYPE_SI = 5, + /// Switching Predicted + @AV_PICTURE_TYPE_SP = 6, + /// BI type + @AV_PICTURE_TYPE_BI = 7, + } + + /// Pixel format. + public enum AVPixelFormat : int + { + @AV_PIX_FMT_NONE = -1, + /// planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) + @AV_PIX_FMT_YUV420P = 0, + /// packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr + @AV_PIX_FMT_YUYV422 = 1, + /// packed RGB 8:8:8, 24bpp, RGBRGB... + @AV_PIX_FMT_RGB24 = 2, + /// packed RGB 8:8:8, 24bpp, BGRBGR... + @AV_PIX_FMT_BGR24 = 3, + /// planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) + @AV_PIX_FMT_YUV422P = 4, + /// planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) + @AV_PIX_FMT_YUV444P = 5, + /// planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) + @AV_PIX_FMT_YUV410P = 6, + /// planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) + @AV_PIX_FMT_YUV411P = 7, + /// Y , 8bpp + @AV_PIX_FMT_GRAY8 = 8, + /// Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb + @AV_PIX_FMT_MONOWHITE = 9, + /// Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb + @AV_PIX_FMT_MONOBLACK = 10, + /// 8 bits with AV_PIX_FMT_RGB32 palette + @AV_PIX_FMT_PAL8 = 11, + /// planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range + @AV_PIX_FMT_YUVJ420P = 12, + /// planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range + @AV_PIX_FMT_YUVJ422P = 13, + /// planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range + @AV_PIX_FMT_YUVJ444P = 14, + /// packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 + @AV_PIX_FMT_UYVY422 = 15, + /// packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 + @AV_PIX_FMT_UYYVYY411 = 16, + /// packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) + @AV_PIX_FMT_BGR8 = 17, + /// packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits + @AV_PIX_FMT_BGR4 = 18, + /// packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) + @AV_PIX_FMT_BGR4_BYTE = 19, + /// packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb) + @AV_PIX_FMT_RGB8 = 20, + /// packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits + @AV_PIX_FMT_RGB4 = 21, + /// packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) + @AV_PIX_FMT_RGB4_BYTE = 22, + /// planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) + @AV_PIX_FMT_NV12 = 23, + /// as above, but U and V bytes are swapped + @AV_PIX_FMT_NV21 = 24, + /// packed ARGB 8:8:8:8, 32bpp, ARGBARGB... + @AV_PIX_FMT_ARGB = 25, + /// packed RGBA 8:8:8:8, 32bpp, RGBARGBA... + @AV_PIX_FMT_RGBA = 26, + /// packed ABGR 8:8:8:8, 32bpp, ABGRABGR... + @AV_PIX_FMT_ABGR = 27, + /// packed BGRA 8:8:8:8, 32bpp, BGRABGRA... + @AV_PIX_FMT_BGRA = 28, + /// Y , 16bpp, big-endian + @AV_PIX_FMT_GRAY16BE = 29, + /// Y , 16bpp, little-endian + @AV_PIX_FMT_GRAY16LE = 30, + /// planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) + @AV_PIX_FMT_YUV440P = 31, + /// planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range + @AV_PIX_FMT_YUVJ440P = 32, + /// planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) + @AV_PIX_FMT_YUVA420P = 33, + /// packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian + @AV_PIX_FMT_RGB48BE = 34, + /// packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian + @AV_PIX_FMT_RGB48LE = 35, + /// packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian + @AV_PIX_FMT_RGB565BE = 36, + /// packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian + @AV_PIX_FMT_RGB565LE = 37, + /// packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined + @AV_PIX_FMT_RGB555BE = 38, + /// packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined + @AV_PIX_FMT_RGB555LE = 39, + /// packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian + @AV_PIX_FMT_BGR565BE = 40, + /// packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian + @AV_PIX_FMT_BGR565LE = 41, + /// packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined + @AV_PIX_FMT_BGR555BE = 42, + /// packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined + @AV_PIX_FMT_BGR555LE = 43, + /// Hardware acceleration through VA-API, data[3] contains a VASurfaceID. + @AV_PIX_FMT_VAAPI = 44, + /// planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + @AV_PIX_FMT_YUV420P16LE = 45, + /// planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + @AV_PIX_FMT_YUV420P16BE = 46, + /// planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + @AV_PIX_FMT_YUV422P16LE = 47, + /// planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + @AV_PIX_FMT_YUV422P16BE = 48, + /// planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + @AV_PIX_FMT_YUV444P16LE = 49, + /// planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + @AV_PIX_FMT_YUV444P16BE = 50, + /// HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer + @AV_PIX_FMT_DXVA2_VLD = 51, + /// packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined + @AV_PIX_FMT_RGB444LE = 52, + /// packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian, X=unused/undefined + @AV_PIX_FMT_RGB444BE = 53, + /// packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined + @AV_PIX_FMT_BGR444LE = 54, + /// packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian, X=unused/undefined + @AV_PIX_FMT_BGR444BE = 55, + /// 8 bits gray, 8 bits alpha + @AV_PIX_FMT_YA8 = 56, + /// alias for AV_PIX_FMT_YA8 + @AV_PIX_FMT_Y400A = 56, + /// alias for AV_PIX_FMT_YA8 + @AV_PIX_FMT_GRAY8A = 56, + /// packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian + @AV_PIX_FMT_BGR48BE = 57, + /// packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian + @AV_PIX_FMT_BGR48LE = 58, + /// planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + @AV_PIX_FMT_YUV420P9BE = 59, + /// planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + @AV_PIX_FMT_YUV420P9LE = 60, + /// planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + @AV_PIX_FMT_YUV420P10BE = 61, + /// planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + @AV_PIX_FMT_YUV420P10LE = 62, + /// planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + @AV_PIX_FMT_YUV422P10BE = 63, + /// planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + @AV_PIX_FMT_YUV422P10LE = 64, + /// planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + @AV_PIX_FMT_YUV444P9BE = 65, + /// planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + @AV_PIX_FMT_YUV444P9LE = 66, + /// planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + @AV_PIX_FMT_YUV444P10BE = 67, + /// planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + @AV_PIX_FMT_YUV444P10LE = 68, + /// planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + @AV_PIX_FMT_YUV422P9BE = 69, + /// planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + @AV_PIX_FMT_YUV422P9LE = 70, + /// planar GBR 4:4:4 24bpp + @AV_PIX_FMT_GBRP = 71, + @AV_PIX_FMT_GBR24P = 71, + /// planar GBR 4:4:4 27bpp, big-endian + @AV_PIX_FMT_GBRP9BE = 72, + /// planar GBR 4:4:4 27bpp, little-endian + @AV_PIX_FMT_GBRP9LE = 73, + /// planar GBR 4:4:4 30bpp, big-endian + @AV_PIX_FMT_GBRP10BE = 74, + /// planar GBR 4:4:4 30bpp, little-endian + @AV_PIX_FMT_GBRP10LE = 75, + /// planar GBR 4:4:4 48bpp, big-endian + @AV_PIX_FMT_GBRP16BE = 76, + /// planar GBR 4:4:4 48bpp, little-endian + @AV_PIX_FMT_GBRP16LE = 77, + /// planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) + @AV_PIX_FMT_YUVA422P = 78, + /// planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) + @AV_PIX_FMT_YUVA444P = 79, + /// planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian + @AV_PIX_FMT_YUVA420P9BE = 80, + /// planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian + @AV_PIX_FMT_YUVA420P9LE = 81, + /// planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian + @AV_PIX_FMT_YUVA422P9BE = 82, + /// planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian + @AV_PIX_FMT_YUVA422P9LE = 83, + /// planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian + @AV_PIX_FMT_YUVA444P9BE = 84, + /// planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian + @AV_PIX_FMT_YUVA444P9LE = 85, + /// planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) + @AV_PIX_FMT_YUVA420P10BE = 86, + /// planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) + @AV_PIX_FMT_YUVA420P10LE = 87, + /// planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) + @AV_PIX_FMT_YUVA422P10BE = 88, + /// planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) + @AV_PIX_FMT_YUVA422P10LE = 89, + /// planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) + @AV_PIX_FMT_YUVA444P10BE = 90, + /// planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) + @AV_PIX_FMT_YUVA444P10LE = 91, + /// planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian) + @AV_PIX_FMT_YUVA420P16BE = 92, + /// planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian) + @AV_PIX_FMT_YUVA420P16LE = 93, + /// planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian) + @AV_PIX_FMT_YUVA422P16BE = 94, + /// planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian) + @AV_PIX_FMT_YUVA422P16LE = 95, + /// planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian) + @AV_PIX_FMT_YUVA444P16BE = 96, + /// planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian) + @AV_PIX_FMT_YUVA444P16LE = 97, + /// HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface + @AV_PIX_FMT_VDPAU = 98, + /// packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0 + @AV_PIX_FMT_XYZ12LE = 99, + /// packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0 + @AV_PIX_FMT_XYZ12BE = 100, + /// interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) + @AV_PIX_FMT_NV16 = 101, + /// interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + @AV_PIX_FMT_NV20LE = 102, + /// interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + @AV_PIX_FMT_NV20BE = 103, + /// packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian + @AV_PIX_FMT_RGBA64BE = 104, + /// packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian + @AV_PIX_FMT_RGBA64LE = 105, + /// packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian + @AV_PIX_FMT_BGRA64BE = 106, + /// packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian + @AV_PIX_FMT_BGRA64LE = 107, + /// packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb + @AV_PIX_FMT_YVYU422 = 108, + /// 16 bits gray, 16 bits alpha (big-endian) + @AV_PIX_FMT_YA16BE = 109, + /// 16 bits gray, 16 bits alpha (little-endian) + @AV_PIX_FMT_YA16LE = 110, + /// planar GBRA 4:4:4:4 32bpp + @AV_PIX_FMT_GBRAP = 111, + /// planar GBRA 4:4:4:4 64bpp, big-endian + @AV_PIX_FMT_GBRAP16BE = 112, + /// planar GBRA 4:4:4:4 64bpp, little-endian + @AV_PIX_FMT_GBRAP16LE = 113, + /// HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure. + @AV_PIX_FMT_QSV = 114, + /// HW acceleration though MMAL, data[3] contains a pointer to the MMAL_BUFFER_HEADER_T structure. + @AV_PIX_FMT_MMAL = 115, + /// HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer + @AV_PIX_FMT_D3D11VA_VLD = 116, + /// HW acceleration through CUDA. data[i] contain CUdeviceptr pointers exactly as for system memory frames. + @AV_PIX_FMT_CUDA = 117, + /// packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined + @AV_PIX_FMT_0RGB = 118, + /// packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined + @AV_PIX_FMT_RGB0 = 119, + /// packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined + @AV_PIX_FMT_0BGR = 120, + /// packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined + @AV_PIX_FMT_BGR0 = 121, + /// planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + @AV_PIX_FMT_YUV420P12BE = 122, + /// planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + @AV_PIX_FMT_YUV420P12LE = 123, + /// planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + @AV_PIX_FMT_YUV420P14BE = 124, + /// planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + @AV_PIX_FMT_YUV420P14LE = 125, + /// planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + @AV_PIX_FMT_YUV422P12BE = 126, + /// planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + @AV_PIX_FMT_YUV422P12LE = 127, + /// planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + @AV_PIX_FMT_YUV422P14BE = 128, + /// planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + @AV_PIX_FMT_YUV422P14LE = 129, + /// planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + @AV_PIX_FMT_YUV444P12BE = 130, + /// planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + @AV_PIX_FMT_YUV444P12LE = 131, + /// planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + @AV_PIX_FMT_YUV444P14BE = 132, + /// planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + @AV_PIX_FMT_YUV444P14LE = 133, + /// planar GBR 4:4:4 36bpp, big-endian + @AV_PIX_FMT_GBRP12BE = 134, + /// planar GBR 4:4:4 36bpp, little-endian + @AV_PIX_FMT_GBRP12LE = 135, + /// planar GBR 4:4:4 42bpp, big-endian + @AV_PIX_FMT_GBRP14BE = 136, + /// planar GBR 4:4:4 42bpp, little-endian + @AV_PIX_FMT_GBRP14LE = 137, + /// planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range + @AV_PIX_FMT_YUVJ411P = 138, + /// bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples + @AV_PIX_FMT_BAYER_BGGR8 = 139, + /// bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples + @AV_PIX_FMT_BAYER_RGGB8 = 140, + /// bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples + @AV_PIX_FMT_BAYER_GBRG8 = 141, + /// bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples + @AV_PIX_FMT_BAYER_GRBG8 = 142, + /// bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian + @AV_PIX_FMT_BAYER_BGGR16LE = 143, + /// bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian + @AV_PIX_FMT_BAYER_BGGR16BE = 144, + /// bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian + @AV_PIX_FMT_BAYER_RGGB16LE = 145, + /// bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian + @AV_PIX_FMT_BAYER_RGGB16BE = 146, + /// bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian + @AV_PIX_FMT_BAYER_GBRG16LE = 147, + /// bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian + @AV_PIX_FMT_BAYER_GBRG16BE = 148, + /// bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian + @AV_PIX_FMT_BAYER_GRBG16LE = 149, + /// bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian + @AV_PIX_FMT_BAYER_GRBG16BE = 150, + /// planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian + @AV_PIX_FMT_YUV440P10LE = 151, + /// planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian + @AV_PIX_FMT_YUV440P10BE = 152, + /// planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian + @AV_PIX_FMT_YUV440P12LE = 153, + /// planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian + @AV_PIX_FMT_YUV440P12BE = 154, + /// packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian + @AV_PIX_FMT_AYUV64LE = 155, + /// packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian + @AV_PIX_FMT_AYUV64BE = 156, + /// hardware decoding through Videotoolbox + @AV_PIX_FMT_VIDEOTOOLBOX = 157, + /// like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian + @AV_PIX_FMT_P010LE = 158, + /// like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian + @AV_PIX_FMT_P010BE = 159, + /// planar GBR 4:4:4:4 48bpp, big-endian + @AV_PIX_FMT_GBRAP12BE = 160, + /// planar GBR 4:4:4:4 48bpp, little-endian + @AV_PIX_FMT_GBRAP12LE = 161, + /// planar GBR 4:4:4:4 40bpp, big-endian + @AV_PIX_FMT_GBRAP10BE = 162, + /// planar GBR 4:4:4:4 40bpp, little-endian + @AV_PIX_FMT_GBRAP10LE = 163, + /// hardware decoding through MediaCodec + @AV_PIX_FMT_MEDIACODEC = 164, + /// Y , 12bpp, big-endian + @AV_PIX_FMT_GRAY12BE = 165, + /// Y , 12bpp, little-endian + @AV_PIX_FMT_GRAY12LE = 166, + /// Y , 10bpp, big-endian + @AV_PIX_FMT_GRAY10BE = 167, + /// Y , 10bpp, little-endian + @AV_PIX_FMT_GRAY10LE = 168, + /// like NV12, with 16bpp per component, little-endian + @AV_PIX_FMT_P016LE = 169, + /// like NV12, with 16bpp per component, big-endian + @AV_PIX_FMT_P016BE = 170, + /// Hardware surfaces for Direct3D11. + @AV_PIX_FMT_D3D11 = 171, + /// Y , 9bpp, big-endian + @AV_PIX_FMT_GRAY9BE = 172, + /// Y , 9bpp, little-endian + @AV_PIX_FMT_GRAY9LE = 173, + /// IEEE-754 single precision planar GBR 4:4:4, 96bpp, big-endian + @AV_PIX_FMT_GBRPF32BE = 174, + /// IEEE-754 single precision planar GBR 4:4:4, 96bpp, little-endian + @AV_PIX_FMT_GBRPF32LE = 175, + /// IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian + @AV_PIX_FMT_GBRAPF32BE = 176, + /// IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian + @AV_PIX_FMT_GBRAPF32LE = 177, + /// DRM-managed buffers exposed through PRIME buffer sharing. + @AV_PIX_FMT_DRM_PRIME = 178, + /// Hardware surfaces for OpenCL. + @AV_PIX_FMT_OPENCL = 179, + /// Y , 14bpp, big-endian + @AV_PIX_FMT_GRAY14BE = 180, + /// Y , 14bpp, little-endian + @AV_PIX_FMT_GRAY14LE = 181, + /// IEEE-754 single precision Y, 32bpp, big-endian + @AV_PIX_FMT_GRAYF32BE = 182, + /// IEEE-754 single precision Y, 32bpp, little-endian + @AV_PIX_FMT_GRAYF32LE = 183, + /// planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, big-endian + @AV_PIX_FMT_YUVA422P12BE = 184, + /// planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, little-endian + @AV_PIX_FMT_YUVA422P12LE = 185, + /// planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian + @AV_PIX_FMT_YUVA444P12BE = 186, + /// planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian + @AV_PIX_FMT_YUVA444P12LE = 187, + /// planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) + @AV_PIX_FMT_NV24 = 188, + /// as above, but U and V bytes are swapped + @AV_PIX_FMT_NV42 = 189, + /// Vulkan hardware images. + @AV_PIX_FMT_VULKAN = 190, + /// packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, big-endian + @AV_PIX_FMT_Y210BE = 191, + /// packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian + @AV_PIX_FMT_Y210LE = 192, + /// packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined + @AV_PIX_FMT_X2RGB10LE = 193, + /// packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined + @AV_PIX_FMT_X2RGB10BE = 194, + /// packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined + @AV_PIX_FMT_X2BGR10LE = 195, + /// packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), big-endian, X=unused/undefined + @AV_PIX_FMT_X2BGR10BE = 196, + /// interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian + @AV_PIX_FMT_P210BE = 197, + /// interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, little-endian + @AV_PIX_FMT_P210LE = 198, + /// interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian + @AV_PIX_FMT_P410BE = 199, + /// interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, little-endian + @AV_PIX_FMT_P410LE = 200, + /// interleaved chroma YUV 4:2:2, 32bpp, big-endian + @AV_PIX_FMT_P216BE = 201, + /// interleaved chroma YUV 4:2:2, 32bpp, little-endian + @AV_PIX_FMT_P216LE = 202, + /// interleaved chroma YUV 4:4:4, 48bpp, big-endian + @AV_PIX_FMT_P416BE = 203, + /// interleaved chroma YUV 4:4:4, 48bpp, little-endian + @AV_PIX_FMT_P416LE = 204, + /// packed VUYA 4:4:4, 32bpp, VUYAVUYA... + @AV_PIX_FMT_VUYA = 205, + /// IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian + @AV_PIX_FMT_RGBAF16BE = 206, + /// IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian + @AV_PIX_FMT_RGBAF16LE = 207, + /// packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined + @AV_PIX_FMT_VUYX = 208, + /// like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, little-endian + @AV_PIX_FMT_P012LE = 209, + /// like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, big-endian + @AV_PIX_FMT_P012BE = 210, + /// packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, big-endian + @AV_PIX_FMT_Y212BE = 211, + /// packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, little-endian + @AV_PIX_FMT_Y212LE = 212, + /// packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), big-endian, variant of Y410 where alpha channel is left undefined + @AV_PIX_FMT_XV30BE = 213, + /// packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channel is left undefined + @AV_PIX_FMT_XV30LE = 214, + /// packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian, variant of Y412 where alpha channel is left undefined + @AV_PIX_FMT_XV36BE = 215, + /// packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian, variant of Y412 where alpha channel is left undefined + @AV_PIX_FMT_XV36LE = 216, + /// IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian + @AV_PIX_FMT_RGBF32BE = 217, + /// IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian + @AV_PIX_FMT_RGBF32LE = 218, + /// IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian + @AV_PIX_FMT_RGBAF32BE = 219, + /// IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian + @AV_PIX_FMT_RGBAF32LE = 220, + /// interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian + @AV_PIX_FMT_P212BE = 221, + /// interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian + @AV_PIX_FMT_P212LE = 222, + /// interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian + @AV_PIX_FMT_P412BE = 223, + /// interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian + @AV_PIX_FMT_P412LE = 224, + /// planar GBR 4:4:4:4 56bpp, big-endian + @AV_PIX_FMT_GBRAP14BE = 225, + /// planar GBR 4:4:4:4 56bpp, little-endian + @AV_PIX_FMT_GBRAP14LE = 226, + /// Hardware surfaces for Direct3D 12. + @AV_PIX_FMT_D3D12 = 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 = 228, + } + + /// Rounding methods. + public enum AVRounding : int + { + /// Round toward zero. + @AV_ROUND_ZERO = 0, + /// Round away from zero. + @AV_ROUND_INF = 1, + /// Round toward -infinity. + @AV_ROUND_DOWN = 2, + /// Round toward +infinity. + @AV_ROUND_UP = 3, + /// Round to nearest and halfway cases away from zero. + @AV_ROUND_NEAR_INF = 5, + /// Flag telling rescaling functions to pass `INT64_MIN`/`MAX` through unchanged, avoiding special cases for #AV_NOPTS_VALUE. + @AV_ROUND_PASS_MINMAX = 8192, + } + + /// Audio sample formats + public enum AVSampleFormat : int + { + @AV_SAMPLE_FMT_NONE = -1, + /// unsigned 8 bits + @AV_SAMPLE_FMT_U8 = 0, + /// signed 16 bits + @AV_SAMPLE_FMT_S16 = 1, + /// signed 32 bits + @AV_SAMPLE_FMT_S32 = 2, + /// float + @AV_SAMPLE_FMT_FLT = 3, + /// double + @AV_SAMPLE_FMT_DBL = 4, + /// unsigned 8 bits, planar + @AV_SAMPLE_FMT_U8P = 5, + /// signed 16 bits, planar + @AV_SAMPLE_FMT_S16P = 6, + /// signed 32 bits, planar + @AV_SAMPLE_FMT_S32P = 7, + /// float, planar + @AV_SAMPLE_FMT_FLTP = 8, + /// double, planar + @AV_SAMPLE_FMT_DBLP = 9, + /// signed 64 bits + @AV_SAMPLE_FMT_S64 = 10, + /// signed 64 bits, planar + @AV_SAMPLE_FMT_S64P = 11, + /// Number of sample formats. DO NOT USE if linking dynamically + @AV_SAMPLE_FMT_NB = 12, + } + + public enum AVSideDataParamChangeFlags : int + { + @AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 4, + @AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 8, + } + + public enum AVStreamGroupParamsType : int + { + @AV_STREAM_GROUP_PARAMS_NONE = 0, + @AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT = 1, + @AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION = 2, + @AV_STREAM_GROUP_PARAMS_TILE_GRID = 3, + } + + /// @} + public enum AVStreamParseType : int + { + @AVSTREAM_PARSE_NONE = 0, + /// full parsing and repack + @AVSTREAM_PARSE_FULL = 1, + /// Only parse headers, do not repack. + @AVSTREAM_PARSE_HEADERS = 2, + /// full parsing and interpolation of timestamps for frames not starting on a packet boundary + @AVSTREAM_PARSE_TIMESTAMPS = 3, + /// full parsing and repack of the first frame only, only implemented for H.264 currently + @AVSTREAM_PARSE_FULL_ONCE = 4, + /// full parsing and repack with timestamp and position generation by parser for raw this assumes that each packet in the file contains no demuxer level headers and just codec level data, otherwise position generation would fail + @AVSTREAM_PARSE_FULL_RAW = 5, + } + + /// @} + public enum AVSubtitleType : int + { + @SUBTITLE_NONE = 0, + /// A bitmap, pict will be set + @SUBTITLE_BITMAP = 1, + /// Plain text, the text field must be set by the decoder and is authoritative. ass and pict fields may contain approximations. + @SUBTITLE_TEXT = 2, + /// Formatted text, the ass field must be set by the decoder and is authoritative. pict and text fields may contain approximations. + @SUBTITLE_ASS = 3, + } + + public enum AVTimebaseSource : int + { + @AVFMT_TBCF_AUTO = -1, + @AVFMT_TBCF_DECODER = 0, + @AVFMT_TBCF_DEMUXER = 1, + @AVFMT_TBCF_R_FRAMERATE = 2, + } + + public enum AVTimecodeFlag : int + { + /// timecode is drop frame + @AV_TIMECODE_FLAG_DROPFRAME = 1, + /// timecode wraps after 24 hours + @AV_TIMECODE_FLAG_24HOURSMAX = 2, + /// negative time values are allowed + @AV_TIMECODE_FLAG_ALLOWNEGATIVE = 4, + } + + /// Dithering algorithms + public enum SwrDitherType : int + { + @SWR_DITHER_NONE = 0, + @SWR_DITHER_RECTANGULAR = 1, + @SWR_DITHER_TRIANGULAR = 2, + @SWR_DITHER_TRIANGULAR_HIGHPASS = 3, + /// not part of API/ABI + @SWR_DITHER_NS = 64, + @SWR_DITHER_NS_LIPSHITZ = 65, + @SWR_DITHER_NS_F_WEIGHTED = 66, + @SWR_DITHER_NS_MODIFIED_E_WEIGHTED = 67, + @SWR_DITHER_NS_IMPROVED_E_WEIGHTED = 68, + @SWR_DITHER_NS_SHIBATA = 69, + @SWR_DITHER_NS_LOW_SHIBATA = 70, + @SWR_DITHER_NS_HIGH_SHIBATA = 71, + /// not part of API/ABI + @SWR_DITHER_NB = 72, + } + + /// Resampling Engines + public enum SwrEngine : int + { + /// SW Resampler + @SWR_ENGINE_SWR = 0, + /// SoX Resampler + @SWR_ENGINE_SOXR = 1, + /// not part of API/ABI + @SWR_ENGINE_NB = 2, + } + + /// Resampling Filter Types + public enum SwrFilterType : int + { + /// Cubic + @SWR_FILTER_TYPE_CUBIC = 0, + /// Blackman Nuttall windowed sinc + @SWR_FILTER_TYPE_BLACKMAN_NUTTALL = 1, + /// Kaiser windowed sinc + @SWR_FILTER_TYPE_KAISER = 2, + } + */ +#endregion +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Enums.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Enums.g.cs.meta new file mode 100644 index 0000000..f2c037f --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Enums.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c64159813b5056848bf146c573693369 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/IFixedArray.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/IFixedArray.cs new file mode 100644 index 0000000..290bdd4 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/IFixedArray.cs @@ -0,0 +1,21 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +namespace LeviathanVideo.Abstractions +{ + public interface IFixedArray + { + int Length { get; } + } + + internal interface IFixedArray : IFixedArray + { + T this[uint index] { get; set; } + T[] ToArray(); + void UpdateFrom(T[] array); + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/IFixedArray.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/IFixedArray.cs.meta new file mode 100644 index 0000000..ef84932 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/IFixedArray.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 831fd920f1934bd46a5a38037ddf74b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.Core.asmdef b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.Core.asmdef new file mode 100644 index 0000000..45f2015 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.Core.asmdef @@ -0,0 +1,14 @@ +{ + "name": "Leviathan.Core", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.Core.asmdef.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.Core.asmdef.meta new file mode 100644 index 0000000..efb4bfa --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.Core.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f1d67e105160e074c99d37c9215900e1 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.cs new file mode 100644 index 0000000..4d3d421 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.cs @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; +using Unity.Collections.LowLevel.Unsafe; + +namespace LeviathanVideo.Abstractions +{ + + public static partial class leviathan + { +#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IOS + public static readonly int EAGAIN = 35; + public static readonly int ENOMEM = 12; + public static readonly int EINVAL = 22; +#elif UNITY_WEBGL && !UNITY_EDITOR + public static readonly int EAGAIN = 6; + public static readonly int ENOMEM = 48; + public static readonly int EINVAL = 28; +#else + public static readonly int EAGAIN = 11; + public static readonly int ENOMEM = 12; + public static readonly int EINVAL = 22; +#endif + + // public static readonly int EPIPE = 32; + + public static ulong UINT64_C(T a) + => Convert.ToUInt64(a); + + public static int AVERROR_Enum(T1 a) where T1 : struct, IConvertible => -UnsafeUtility.EnumToInt(a); + + public static int AVERROR(T1 a) + => -Convert.ToInt32(a); + + public static int MKTAG(T1 a, T2 b, T3 c, T4 d) + => (int)(Convert.ToUInt32(a) | (Convert.ToUInt32(b) << 8) | (Convert.ToUInt32(c) << 16) | + (Convert.ToUInt32(d) << 24)); + + public static int FFERRTAG(T1 a, T2 b, T3 c, T4 d) + => -MKTAG(a, b, c, d); + + public static int AV_VERSION_INT(T1 a, T2 b, T3 c) => + (Convert.ToInt32(a) << 16) | (Convert.ToInt32(b) << 8) | Convert.ToInt32(c); + + public static string AV_VERSION_DOT(T1 a, T2 b, T3 c) + => $"{a}.{b}.{c}"; + + public static string AV_VERSION(T1 a, T2 b, T3 c) + => AV_VERSION_DOT(a, b, c); + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.cs.meta new file mode 100644 index 0000000..851b77d --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Leviathan.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebc87a006120f7d4e8ac1faf1284562e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/LinkedBindings.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/LinkedBindings.g.cs new file mode 100644 index 0000000..663a8d2 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/LinkedBindings.g.cs @@ -0,0 +1,5894 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; +using LeviathanVideo.Abstractions; + +namespace LeviathanVideo.Bindings.Linked +{ + public static unsafe partial class LinkedBindings + { + // 7.0.2 +#if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR + const string avformat_DLL = "__Internal"; + const string avutil_DLL = "__Internal"; + const string avcodec_DLL = "__Internal"; +#elif UNITY_ANDROID && !UNITY_EDITOR + const string avformat_DLL = "libavformat"; + const string avutil_DLL = "libavutil"; + const string avcodec_DLL = "libavcodec"; +#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX + const string avformat_DLL = "/opt/homebrew/lib/libavformat"; + const string avutil_DLL = "/opt/homebrew/lib/libavutil"; + const string avcodec_DLL = "/opt/homebrew/lib/libavcodec"; +#else + const string avformat_DLL = "avformat-61"; + const string avutil_DLL = "avutil-59"; + const string avcodec_DLL = "avcodec-61"; +#endif + + /// Find the "best" stream in the file. The best stream is determined according to various heuristics as the most likely to be what the user expects. If the decoder parameter is non-NULL, av_find_best_stream will find the default decoder for the stream's codec; streams for which no decoder can be found are ignored. + /// media file handle + /// stream type: video, audio, subtitles, etc. + /// user-requested stream number, or -1 for automatic selection + /// try to find a stream related (eg. in the same program) to this one, or -1 if none + /// if non-NULL, returns the decoder for the selected stream + /// flags; none are currently defined + /// the non-negative stream number in case of success, AVERROR_STREAM_NOT_FOUND if no stream with the requested type could be found, AVERROR_DECODER_NOT_FOUND if streams were found but no decoder + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_find_best_stream(AVFormatContext* @ic, AVMediaType @type, int @wanted_stream_nb, int @related_stream, AVCodec** @decoder_ret, int @flags); + + /// Allocate an AVFrame and set its fields to default values. The resulting struct must be freed using av_frame_free(). + /// An AVFrame filled with default values or NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVFrame* av_frame_alloc(); + + /// Free the frame and any dynamically allocated objects in it, e.g. extended_data. If the frame is reference counted, it will be unreferenced first. + /// frame to be freed. The pointer will be set to NULL. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_frame_free(AVFrame** @frame); + + /// Return the size in bytes of the amount of data required to store an image with the given parameters. + /// the pixel format of the image + /// the width of the image in pixels + /// the height of the image in pixels + /// the assumed linesize alignment + /// the buffer size in bytes, a negative error code in case of failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_get_buffer_size(AVPixelFormat @pix_fmt, int @width, int @height, int @align); + + /// Allocate an AVPacket and set its fields to default values. The resulting struct must be freed using av_packet_free(). + /// An AVPacket filled with default values or NULL on failure. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacket* av_packet_alloc(); + + + /// Free the packet, if the packet is reference counted, it will be unreferenced first. + /// packet to be freed. The pointer will be set to NULL. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_free(AVPacket** @pkt); + + /// Wipe the packet. + /// The packet to be unreferenced. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_unref(AVPacket* @pkt); + + /// Return the next frame of a stream. This function returns what is stored in the file, and does not validate that what is there are valid frames for the decoder. It will split what is stored in the file into frames and return one for each call. It will not omit invalid data between valid frames so as to give the decoder the maximum information possible for decoding. + /// 0 if OK, < 0 on error or end of file. On error, pkt will be blank (as if it came from av_packet_alloc()). + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_read_frame(AVFormatContext* @s, AVPacket* @pkt); + + /// Allocate an AVCodecContext and set its fields to default values. The resulting struct should be freed with avcodec_free_context(). + /// if non-NULL, allocate private data and initialize defaults for the given codec. It is illegal to then call avcodec_open2() with a different codec. If NULL, then the codec-specific defaults won't be initialized, which may result in suboptimal default settings (this is important mainly for encoders, e.g. libx264). + /// An AVCodecContext filled with default values or NULL on failure. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecContext* avcodec_alloc_context3(AVCodec* @codec); + + /// Reset the internal codec state / flush internal buffers. Should be called e.g. when seeking or when switching to a different stream. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avcodec_flush_buffers(AVCodecContext* @avctx); + + /// Free the codec context and everything associated with it and write NULL to the provided pointer. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avcodec_free_context(AVCodecContext** @avctx); + + /// Get the name of a codec. + /// a static string identifying the codec; never NULL + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avcodec_get_name(AVCodecID @id); + + /// Initialize the AVCodecContext to use the given AVCodec. Prior to using this function the context has to be allocated with avcodec_alloc_context3(). + /// The context to initialize. + /// The codec to open this context for. If a non-NULL codec has been previously passed to avcodec_alloc_context3() or for this context, then this parameter MUST be either NULL or equal to the previously passed codec. + /// A dictionary filled with AVCodecContext and codec-private options, which are set on top of the options already set in avctx, can be NULL. On return this object will be filled with options that were not found in the avctx codec context. + /// zero on success, a negative value on error + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_open2(AVCodecContext* @avctx, AVCodec* @codec, AVDictionary** @options); + + /// Return decoded output data from a decoder or encoder (when the AV_CODEC_FLAG_RECON_FRAME flag is used). + /// codec context + /// This will be set to a reference-counted video or audio frame (depending on the decoder type) allocated by the codec. Note that the function will always call av_frame_unref(frame) before doing anything else. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_receive_frame(AVCodecContext* @avctx, AVFrame* @frame); + + /// Supply raw packet data as input to a decoder. + /// codec context + /// The input AVPacket. Usually, this will be a single video frame, or several complete audio frames. Ownership of the packet remains with the caller, and the decoder will not write to the packet. The decoder may create a reference to the packet data (or copy it if the packet is not reference-counted). Unlike with older APIs, the packet is always fully consumed, and if it contains multiple frames (e.g. some audio codecs), will require you to call avcodec_receive_frame() multiple times afterwards before you can send a new packet. It can be NULL (or an AVPacket with data set to NULL and size set to 0); in this case, it is considered a flush packet, which signals the end of the stream. Sending the first flush packet will return success. Subsequent ones are unnecessary and will return AVERROR_EOF. If the decoder still has frames buffered, it will return them after sending a flush packet. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_send_packet(AVCodecContext* @avctx, AVPacket* @avpkt); + + /// Allocate an AVFormatContext. avformat_free_context() can be used to free the context and everything allocated by the framework within it. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVFormatContext* avformat_alloc_context(); + + /// Close an opened input AVFormatContext. Free it and all its contents and set *s to NULL. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avformat_close_input(AVFormatContext** @s); + + /// Read packets of a media file to get stream information. This is useful for file formats with no headers such as MPEG. This function also computes the real framerate in case of MPEG-2 repeat frame mode. The logical file position is not changed by this function; examined packets may be buffered for later processing. + /// media file handle + /// If non-NULL, an ic.nb_streams long array of pointers to dictionaries, where i-th member contains options for codec corresponding to i-th stream. On return each dictionary will be filled with options that were not found. + /// >=0 if OK, AVERROR_xxx on error + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_find_stream_info(AVFormatContext* @ic, AVDictionary** @options); + + /// Open an input stream and read the header. The codecs are not opened. The stream must be closed with avformat_close_input(). + /// Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). May be a pointer to NULL, in which case an AVFormatContext is allocated by this function and written into ps. Note that a user-supplied AVFormatContext will be freed on failure. + /// URL of the stream to open. + /// If non-NULL, this parameter forces a specific input format. Otherwise the format is autodetected. + /// A dictionary filled with AVFormatContext and demuxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. + /// 0 on success, a negative AVERROR on failure. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_open_input(AVFormatContext** @ps, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url, AVInputFormat* @fmt, AVDictionary** @options); + + /// Seek to timestamp ts. Seeking will be done so that the point from which all active streams can be presented successfully will be closest to ts and within min/max_ts. Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + /// media file handle + /// index of the stream which is used as time base reference + /// smallest acceptable timestamp + /// target timestamp + /// largest acceptable timestamp + /// flags + /// >=0 on success, error code otherwise + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_seek_file(AVFormatContext* @s, int @stream_index, long @min_ts, long @ts, long @max_ts, int @flags); + + /// Allocate and initialize an AVIOContext for buffered I/O. It must be later freed with avio_context_free(). + /// Memory block for input/output operations via AVIOContext. The buffer must be allocated with av_malloc() and friends. It may be freed and replaced with a new buffer by libavformat. AVIOContext.buffer holds the buffer currently in use, which must be later freed with av_free(). + /// The buffer size is very important for performance. For protocols with fixed blocksize it should be set to this blocksize. For others a typical size is a cache page, e.g. 4kb. + /// Set to 1 if the buffer should be writable, 0 otherwise. + /// An opaque pointer to user-specific data. + /// A function for refilling the buffer, may be NULL. For stream protocols, must never return 0 but rather a proper AVERROR code. + /// A function for writing the buffer contents, may be NULL. The function may not change the input buffers content. + /// A function for seeking to specified byte position, may be NULL. + /// Allocated AVIOContext or NULL on failure. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVIOContext* avio_alloc_context(byte* @buffer, int @buffer_size, int @write_flag, void* @opaque, avio_alloc_context_read_packet_func @read_packet, avio_alloc_context_write_packet_func @write_packet, avio_alloc_context_seek_func @seek); + + /// Free the supplied IO context and everything associated with it. + /// Double pointer to the IO context. This function will write NULL into s. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_context_free(AVIOContext** @s); + + /// Allocate a memory block with alignment suitable for all memory accesses (including vectors if available on the CPU). + /// Size in bytes for the memory block to be allocated + /// Pointer to the allocated block, or `NULL` if the block cannot be allocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_malloc(ulong @size); + + + /// Free a memory block which has been allocated with a function of av_malloc() or av_realloc() family. + /// Pointer to the memory block which should be freed. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_free(void* @ptr); + + #region unuse code1 + /* + /// Add an index entry into a sorted list. Update the entry if the list already contains it. + /// timestamp in the time base of the given stream + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_add_index_entry(AVStream* @st, long @pos, long @timestamp, int @size, int @distance, int @flags); + + /// Add two rationals. + /// First rational + /// Second rational + /// b+c + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_add_q(AVRational @b, AVRational @c); + + /// Add a value to a timestamp. + /// Input timestamp time base + /// Input timestamp + /// Time base of `inc` + /// Value to be added + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_add_stable(AVRational @ts_tb, long @ts, AVRational @inc_tb, long @inc); + + /// Read data and append it to the current content of the AVPacket. If pkt->size is 0 this is identical to av_get_packet. Note that this uses av_grow_packet and thus involves a realloc which is inefficient. Thus this function should only be used when there is no reasonable way to know (an upper bound of) the final size. + /// associated IO context + /// packet + /// amount of data to read + /// >0 (read size) if OK, AVERROR_xxx otherwise, previous data will not be lost even if an error occurs. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_append_packet(AVIOContext* @s, AVPacket* @pkt, int @size); + + /// Allocate an AVAudioFifo. + /// sample format + /// number of channels + /// initial allocation size, in samples + /// newly allocated AVAudioFifo, or NULL on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVAudioFifo* av_audio_fifo_alloc(AVSampleFormat @sample_fmt, int @channels, int @nb_samples); + + /// Drain data from an AVAudioFifo. + /// AVAudioFifo to drain + /// number of samples to drain + /// 0 if OK, or negative AVERROR code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_audio_fifo_drain(AVAudioFifo* @af, int @nb_samples); + + /// Free an AVAudioFifo. + /// AVAudioFifo to free + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_audio_fifo_free(AVAudioFifo* @af); + + /// Peek data from an AVAudioFifo. + /// AVAudioFifo to read from + /// audio data plane pointers + /// number of samples to peek + /// number of samples actually peek, or negative AVERROR code on failure. The number of samples actually peek will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_audio_fifo_peek(AVAudioFifo* @af, void** @data, int @nb_samples); + + /// Peek data from an AVAudioFifo. + /// AVAudioFifo to read from + /// audio data plane pointers + /// number of samples to peek + /// offset from current read position + /// number of samples actually peek, or negative AVERROR code on failure. The number of samples actually peek will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_audio_fifo_peek_at(AVAudioFifo* @af, void** @data, int @nb_samples, int @offset); + + /// Read data from an AVAudioFifo. + /// AVAudioFifo to read from + /// audio data plane pointers + /// number of samples to read + /// number of samples actually read, or negative AVERROR code on failure. The number of samples actually read will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_audio_fifo_read(AVAudioFifo* @af, void** @data, int @nb_samples); + + /// Reallocate an AVAudioFifo. + /// AVAudioFifo to reallocate + /// new allocation size, in samples + /// 0 if OK, or negative AVERROR code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_audio_fifo_realloc(AVAudioFifo* @af, int @nb_samples); + + /// Reset the AVAudioFifo buffer. + /// AVAudioFifo to reset + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_audio_fifo_reset(AVAudioFifo* @af); + + /// Get the current number of samples in the AVAudioFifo available for reading. + /// the AVAudioFifo to query + /// number of samples available for reading + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_audio_fifo_size(AVAudioFifo* @af); + + /// Get the current number of samples in the AVAudioFifo available for writing. + /// the AVAudioFifo to query + /// number of samples available for writing + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_audio_fifo_space(AVAudioFifo* @af); + + /// Write data to an AVAudioFifo. + /// AVAudioFifo to write to + /// audio data plane pointers + /// number of samples to write + /// number of samples actually written, or negative AVERROR code on failure. If successful, the number of samples actually written will always be nb_samples. + [DllImport(avutil_DLL, 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_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern double av_bessel_i0(double @x); + + /// Allocate a context for a given bitstream filter. The caller must fill in the context parameters as described in the documentation and then call av_bsf_init() before sending any data to the filter. + /// the filter for which to allocate an instance. + /// a pointer into which the pointer to the newly-allocated context will be written. It must be freed with av_bsf_free() after the filtering is done. + /// 0 on success, a negative AVERROR code on failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_alloc(AVBitStreamFilter* @filter, AVBSFContext** @ctx); + + /// Reset the internal bitstream filter state. Should be called e.g. when seeking. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_bsf_flush(AVBSFContext* @ctx); + + /// Free a bitstream filter context and everything associated with it; write NULL into the supplied pointer. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_bsf_free(AVBSFContext** @ctx); + + /// Returns a bitstream filter with the specified name or NULL if no such bitstream filter exists. + /// a bitstream filter with the specified name or NULL if no such bitstream filter exists. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBitStreamFilter* av_bsf_get_by_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Get the AVClass for AVBSFContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* av_bsf_get_class(); + + /// Get null/pass-through bitstream filter. + /// Pointer to be set to new instance of pass-through bitstream filter + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_get_null_filter(AVBSFContext** @bsf); + + /// Prepare the filter for use, after all the parameters and options have been set. + /// a AVBSFContext previously allocated with av_bsf_alloc() + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_init(AVBSFContext* @ctx); + + /// Iterate over all registered bitstream filters. + /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. + /// the next registered bitstream filter or NULL when the iteration is finished + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBitStreamFilter* av_bsf_iterate(void** @opaque); + + /// Allocate empty list of bitstream filters. The list must be later freed by av_bsf_list_free() or finalized by av_bsf_list_finalize(). + /// Pointer to on success, NULL in case of failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBSFList* av_bsf_list_alloc(); + + /// Append bitstream filter to the list of bitstream filters. + /// List to append to + /// Filter context to be appended + /// >=0 on success, negative AVERROR in case of failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_list_append(AVBSFList* @lst, AVBSFContext* @bsf); + + /// Construct new bitstream filter context given it's name and options and append it to the list of bitstream filters. + /// List to append to + /// Name of the bitstream filter + /// Options for the bitstream filter, can be set to NULL + /// >=0 on success, negative AVERROR in case of failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_list_append2(AVBSFList* @lst, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @bsf_name, AVDictionary** @options); + + /// Finalize list of bitstream filters. + /// Filter list structure to be transformed + /// Pointer to be set to newly created structure representing the chain of bitstream filters + /// >=0 on success, negative AVERROR in case of failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_list_finalize(AVBSFList** @lst, AVBSFContext** @bsf); + + /// Free list of bitstream filters. + /// Pointer to pointer returned by av_bsf_list_alloc() + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_bsf_list_free(AVBSFList** @lst); + + /// Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters. Resulting AVBSFContext can be treated as any other AVBSFContext freshly allocated by av_bsf_alloc(). + /// String describing chain of bitstream filters in format `bsf1[=opt1=val1:opt2=val2][,bsf2]` + /// Pointer to be set to newly created structure representing the chain of bitstream filters + /// >=0 on success, negative AVERROR in case of failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_list_parse_str( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @str, AVBSFContext** @bsf); + + /// Retrieve a filtered packet. + /// an initialized AVBSFContext + /// this struct will be filled with the contents of the filtered packet. It is owned by the caller and must be freed using av_packet_unref() when it is no longer needed. This parameter should be "clean" (i.e. freshly allocated with av_packet_alloc() or unreffed with av_packet_unref()) when this function is called. If this function returns successfully, the contents of pkt will be completely overwritten by the returned data. On failure, pkt is not touched. + /// - 0 on success. - AVERROR(EAGAIN) if more packets need to be sent to the filter (using av_bsf_send_packet()) to get more output. - AVERROR_EOF if there will be no further output from the filter. - Another negative AVERROR value if an error occurs. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_receive_packet(AVBSFContext* @ctx, AVPacket* @pkt); + + /// Submit a packet for filtering. + /// an initialized AVBSFContext + /// the packet to filter. The bitstream filter will take ownership of the packet and reset the contents of pkt. pkt is not touched if an error occurs. If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero), it signals the end of the stream (i.e. no more non-empty packets will be sent; sending more empty packets does nothing) and will cause the filter to output any packets it may have buffered internally. + /// - 0 on success. - AVERROR(EAGAIN) if packets need to be retrieved from the filter (using av_bsf_receive_packet()) before new input can be consumed. - Another negative AVERROR value if an error occurs. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_bsf_send_packet(AVBSFContext* @ctx, AVPacket* @pkt); + + /// Allocate an AVBuffer of the given size using av_malloc(). + /// an AVBufferRef of given size or NULL when out of memory + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferRef* av_buffer_alloc(ulong @size); + + /// Same as av_buffer_alloc(), except the returned buffer will be initialized to zero. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferRef* av_buffer_allocz(ulong @size); + + /// Create an AVBuffer from an existing array. + /// data array + /// size of data in bytes + /// a callback for freeing this buffer's data + /// parameter to be got for processing or passed to free + /// a combination of AV_BUFFER_FLAG_* + /// an AVBufferRef referring to data on success, NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferRef* av_buffer_create(byte* @data, ulong @size, av_buffer_create_free_func @free, void* @opaque, int @flags); + + /// Default free callback, which calls av_free() on the buffer data. This function is meant to be passed to av_buffer_create(), not called directly. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_buffer_default_free(void* @opaque, byte* @data); + + /// Returns the opaque parameter set by av_buffer_create. + /// the opaque parameter set by av_buffer_create. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_buffer_get_opaque(AVBufferRef* @buf); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_buffer_get_ref_count(AVBufferRef* @buf); + + /// Returns 1 if the caller may write to the data referred to by buf (which is true if and only if buf is the only reference to the underlying AVBuffer). Return 0 otherwise. A positive answer is valid until av_buffer_ref() is called on buf. + /// 1 if the caller may write to the data referred to by buf (which is true if and only if buf is the only reference to the underlying AVBuffer). Return 0 otherwise. A positive answer is valid until av_buffer_ref() is called on buf. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_buffer_is_writable(AVBufferRef* @buf); + + /// Create a writable reference from a given buffer reference, avoiding data copy if possible. + /// buffer reference to make writable. On success, buf is either left untouched, or it is unreferenced and a new writable AVBufferRef is written in its place. On failure, buf is left untouched. + /// 0 on success, a negative AVERROR on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_buffer_make_writable(AVBufferRef** @buf); + + /// Query the original opaque parameter of an allocated buffer in the pool. + /// a buffer reference to a buffer returned by av_buffer_pool_get. + /// the opaque parameter set by the buffer allocator function of the buffer pool. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_buffer_pool_buffer_get_opaque(AVBufferRef* @ref); + + /// Allocate a new AVBuffer, reusing an old buffer from the pool when available. This function may be called simultaneously from multiple threads. + /// a reference to the new buffer on success, NULL on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferRef* av_buffer_pool_get(AVBufferPool* @pool); + + /// Allocate and initialize a buffer pool. + /// size of each buffer in this pool + /// a function that will be used to allocate new buffers when the pool is empty. May be NULL, then the default allocator will be used (av_buffer_alloc()). + /// newly created buffer pool on success, NULL on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferPool* av_buffer_pool_init(ulong @size, av_buffer_pool_init_alloc_func @alloc); + + /// Allocate and initialize a buffer pool with a more complex allocator. + /// size of each buffer in this pool + /// arbitrary user data used by the allocator + /// a function that will be used to allocate new buffers when the pool is empty. May be NULL, then the default allocator will be used (av_buffer_alloc()). + /// a function that will be called immediately before the pool is freed. I.e. after av_buffer_pool_uninit() is called by the caller and all the frames are returned to the pool and freed. It is intended to uninitialize the user opaque data. May be NULL. + /// newly created buffer pool on success, NULL on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferPool* av_buffer_pool_init2(ulong @size, void* @opaque, av_buffer_pool_init2_alloc_func @alloc, av_buffer_pool_init2_pool_free_func @pool_free); + + /// Mark the pool as being available for freeing. It will actually be freed only once all the allocated buffers associated with the pool are released. Thus it is safe to call this function while some of the allocated buffers are still in use. + /// pointer to the pool to be freed. It will be set to NULL. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_buffer_pool_uninit(AVBufferPool** @pool); + + /// Reallocate a given buffer. + /// a buffer reference to reallocate. On success, buf will be unreferenced and a new reference with the required size will be written in its place. On failure buf will be left untouched. *buf may be NULL, then a new buffer is allocated. + /// required new buffer size. + /// 0 on success, a negative AVERROR on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_buffer_realloc(AVBufferRef** @buf, ulong @size); + + /// Create a new reference to an AVBuffer. + /// a new AVBufferRef referring to the same AVBuffer as buf or NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferRef* av_buffer_ref(AVBufferRef* @buf); + + /// Ensure dst refers to the same data as src. + /// Pointer to either a valid buffer reference or NULL. On success, this will point to a buffer reference equivalent to src. On failure, dst will be left untouched. + /// A buffer reference to replace dst with. May be NULL, then this function is equivalent to av_buffer_unref(dst). + /// 0 on success AVERROR(ENOMEM) on memory allocation failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_buffer_replace(AVBufferRef** @dst, AVBufferRef* @src); + + /// Free a given reference and automatically free the buffer if there are no more references to it. + /// the reference to be freed. The pointer is set to NULL on return. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_buffer_unref(AVBufferRef** @buf); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_ch_layout(AVFilterContext* @ctx, AVChannelLayout* @ch_layout); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_channels(AVFilterContext* @ctx); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVColorRange av_buffersink_get_color_range(AVFilterContext* @ctx); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVColorSpace av_buffersink_get_colorspace(AVFilterContext* @ctx); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_format(AVFilterContext* @ctx); + + // /// Get a frame with filtered data from sink and put it in frame. + // /// pointer to a context of a buffersink or abuffersink AVFilter. + // /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() + // /// - >= 0 if a frame was successfully returned. - AVERROR(EAGAIN) if no frames are available at this point; more input frames must be added to the filtergraph to get more output. - AVERROR_EOF if there will be no more output frames on this sink. - A different negative AVERROR code in other failure cases. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_frame(AVFilterContext* @ctx, AVFrame* @frame); + + // /// Get a frame with filtered data from sink and put it in frame. + // /// pointer to a buffersink or abuffersink filter context. + // /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() + // /// a combination of AV_BUFFERSINK_FLAG_* flags + // /// >= 0 in for success, a negative AVERROR code for failure. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_frame_flags(AVFilterContext* @ctx, AVFrame* @frame, int @flags); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVRational av_buffersink_get_frame_rate(AVFilterContext* @ctx); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_h(AVFilterContext* @ctx); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVBufferRef* av_buffersink_get_hw_frames_ctx(AVFilterContext* @ctx); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVRational av_buffersink_get_sample_aspect_ratio(AVFilterContext* @ctx); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_sample_rate(AVFilterContext* @ctx); + + // /// Same as av_buffersink_get_frame(), but with the ability to specify the number of samples read. This function is less efficient than av_buffersink_get_frame(), because it copies the data around. + // /// pointer to a context of the abuffersink AVFilter. + // /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() frame will contain exactly nb_samples audio samples, except at the end of stream, when it can contain less than nb_samples. + // /// The return codes have the same meaning as for av_buffersink_get_frame(). + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_samples(AVFilterContext* @ctx, AVFrame* @frame, int @nb_samples); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVRational av_buffersink_get_time_base(AVFilterContext* @ctx); + + // /// Get the properties of the stream @{ + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVMediaType av_buffersink_get_type(AVFilterContext* @ctx); + + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersink_get_w(AVFilterContext* @ctx); + + // /// Set the frame size for an audio buffer sink. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern void av_buffersink_set_frame_size(AVFilterContext* @ctx, uint @frame_size); + + // /// Add a frame to the buffer source. + // /// an instance of the buffersrc filter + // /// frame to be added. If the frame is reference counted, this function will take ownership of the reference(s) and reset the frame. Otherwise the frame data will be copied. If this function returns an error, the input frame is not touched. + // /// 0 on success, a negative AVERROR on error. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersrc_add_frame(AVFilterContext* @ctx, AVFrame* @frame); + + // /// Add a frame to the buffer source. + // /// pointer to a buffer source context + // /// a frame, or NULL to mark EOF + // /// a combination of AV_BUFFERSRC_FLAG_* + // /// >= 0 in case of success, a negative AVERROR code in case of failure + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersrc_add_frame_flags(AVFilterContext* @buffer_src, AVFrame* @frame, int @flags); + + // /// Close the buffer source after EOF. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersrc_close(AVFilterContext* @ctx, long @pts, uint @flags); + + // /// Get the number of failed requests. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern uint av_buffersrc_get_nb_failed_requests(AVFilterContext* @buffer_src); + + // /// Allocate a new AVBufferSrcParameters instance. It should be freed by the caller with av_free(). + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVBufferSrcParameters* av_buffersrc_parameters_alloc(); + + // /// Initialize the buffersrc or abuffersrc filter with the provided parameters. This function may be called multiple times, the later calls override the previous ones. Some of the parameters may also be set through AVOptions, then whatever method is used last takes precedence. + // /// an instance of the buffersrc or abuffersrc filter + // /// the stream parameters. The frames later passed to this filter must conform to those parameters. All the allocated fields in param remain owned by the caller, libavfilter will make internal copies or references when necessary. + // /// 0 on success, a negative AVERROR code on failure. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersrc_parameters_set(AVFilterContext* @ctx, AVBufferSrcParameters* @param); + + // /// Add a frame to the buffer source. + // /// an instance of the buffersrc filter + // /// frame to be added. If the frame is reference counted, this function will make a new reference to it. Otherwise the frame data will be copied. + // /// 0 on success, a negative AVERROR on error + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int av_buffersrc_write_frame(AVFilterContext* @ctx, AVFrame* @frame); + + /// Allocate a memory block for an array with av_mallocz(). + /// Number of elements + /// Size of the single element + /// Pointer to the allocated block, or `NULL` if the block cannot be allocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_calloc(ulong @nmemb, ulong @size); + + /// Get a human readable string describing a given channel. + /// pre-allocated buffer where to put the generated string + /// size in bytes of the buffer. + /// the AVChannel whose description to get + /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_description(byte* @buf, ulong @buf_size, AVChannel @channel); + + /// bprint variant of av_channel_description(). + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_channel_description_bprint(AVBPrint* @bp, AVChannel @channel_id); + + /// This is the inverse function of av_channel_name(). + /// the channel with the given name AV_CHAN_NONE when name does not identify a known channel + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVChannel av_channel_from_string( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Get the channel with the given index in a channel layout. + /// input channel layout + /// index of the channel + /// channel with the index idx in channel_layout on success or AV_CHAN_NONE on failure (if idx is not valid or the channel order is unspecified) + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVChannel av_channel_layout_channel_from_index(AVChannelLayout* @channel_layout, uint @idx); + + /// Get a channel described by the given string. + /// input channel layout + /// string describing the channel to obtain + /// a channel described by the given string in channel_layout on success or AV_CHAN_NONE on failure (if the string is not valid or the channel order is unspecified) + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVChannel av_channel_layout_channel_from_string(AVChannelLayout* @channel_layout, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Check whether a channel layout is valid, i.e. can possibly describe audio data. + /// input channel layout + /// 1 if channel_layout is valid, 0 otherwise. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_check(AVChannelLayout* @channel_layout); + + /// Check whether two channel layouts are semantically the same, i.e. the same channels are present on the same positions in both. + /// input channel layout + /// input channel layout + /// 0 if chl and chl1 are equal, 1 if they are not equal. A negative AVERROR code if one or both are invalid. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_compare(AVChannelLayout* @chl, AVChannelLayout* @chl1); + + /// Make a copy of a channel layout. This differs from just assigning src to dst in that it allocates and copies the map for AV_CHANNEL_ORDER_CUSTOM. + /// destination channel layout + /// source channel layout + /// 0 on success, a negative AVERROR on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_copy(AVChannelLayout* @dst, AVChannelLayout* @src); + + /// Initialize a custom channel layout with the specified number of channels. The channel map will be allocated and the designation of all channels will be set to AV_CHAN_UNKNOWN. + /// the layout structure to be initialized + /// the number of channels + /// 0 on success AVERROR(EINVAL) if the number of channels < = 0 AVERROR(ENOMEM) if the channel map could not be allocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_custom_init(AVChannelLayout* @channel_layout, int @nb_channels); + + /// Get the default channel layout for a given number of channels. + /// the layout structure to be initialized + /// number of channels + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_channel_layout_default(AVChannelLayout* @ch_layout, int @nb_channels); + + /// Get a human-readable string describing the channel layout properties. The string will be in the same format that is accepted by av_channel_layout_from_string(), allowing to rebuild the same channel layout, except for opaque pointers. + /// channel layout to be described + /// pre-allocated buffer where to put the generated string + /// size in bytes of the buffer. + /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_describe(AVChannelLayout* @channel_layout, byte* @buf, ulong @buf_size); + + /// bprint variant of av_channel_layout_describe(). + /// 0 on success, or a negative AVERROR value on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_describe_bprint(AVChannelLayout* @channel_layout, AVBPrint* @bp); + + /// Initialize a native channel layout from a bitmask indicating which channels are present. + /// the layout structure to be initialized + /// bitmask describing the channel layout + /// 0 on success AVERROR(EINVAL) for invalid mask values + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_from_mask(AVChannelLayout* @channel_layout, ulong @mask); + + /// Initialize a channel layout from a given string description. The input string can be represented by: - the formal channel layout name (returned by av_channel_layout_describe()) - single or multiple channel names (returned by av_channel_name(), eg. "FL", or concatenated with "+", each optionally containing a custom name after a "", eg. "FL+FR+LFE") - a decimal or hexadecimal value of a native channel layout (eg. "4" or "0x4") - the number of channels with default layout (eg. "4c") - the number of unordered channels (eg. "4C" or "4 channels") - the ambisonic order followed by optional non-diegetic channels (eg. "ambisonic 2+stereo") On error, the channel layout will remain uninitialized, but not necessarily untouched. + /// uninitialized channel layout for the result + /// string describing the channel layout + /// 0 on success parsing the channel layout AVERROR(EINVAL) if an invalid channel layout string was provided AVERROR(ENOMEM) if there was not enough memory + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_from_string(AVChannelLayout* @channel_layout, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @str); + + /// Get the index of a given channel in a channel layout. In case multiple channels are found, only the first match will be returned. + /// input channel layout + /// the channel whose index to obtain + /// index of channel in channel_layout on success or a negative number if channel is not present in channel_layout. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_index_from_channel(AVChannelLayout* @channel_layout, AVChannel @channel); + + /// Get the index in a channel layout of a channel described by the given string. In case multiple channels are found, only the first match will be returned. + /// input channel layout + /// string describing the channel whose index to obtain + /// a channel index described by the given string, or a negative AVERROR value. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_index_from_string(AVChannelLayout* @channel_layout, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Change the AVChannelOrder of a channel layout. + /// channel layout which will be changed + /// the desired channel layout order + /// a combination of AV_CHANNEL_LAYOUT_RETYPE_FLAG_* constants + /// 0 if the conversion was successful and lossless or if the channel layout was already in the desired order >0 if the conversion was successful but lossy AVERROR(ENOSYS) if the conversion was not possible (or would be lossy and AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS was specified) AVERROR(EINVAL), AVERROR(ENOMEM) on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_layout_retype(AVChannelLayout* @channel_layout, AVChannelOrder @order, int @flags); + + /// Iterate over all standard channel layouts. + /// a pointer where libavutil will store the iteration state. Must point to NULL to start the iteration. + /// the standard channel layout or NULL when the iteration is finished + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVChannelLayout* av_channel_layout_standard(void** @opaque); + + /// Find out what channels from a given set are present in a channel layout, without regard for their positions. + /// input channel layout + /// a combination of AV_CH_* representing a set of channels + /// a bitfield representing all the channels from mask that are present in channel_layout + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong av_channel_layout_subset(AVChannelLayout* @channel_layout, ulong @mask); + + /// Free any allocated data in the channel layout and reset the channel count to 0. + /// the layout structure to be uninitialized + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_channel_layout_uninit(AVChannelLayout* @channel_layout); + + /// Get a human readable string in an abbreviated form describing a given channel. This is the inverse function of av_channel_from_string(). + /// pre-allocated buffer where to put the generated string + /// size in bytes of the buffer. + /// the AVChannel whose name to get + /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_channel_name(byte* @buf, ulong @buf_size, AVChannel @channel); + + /// bprint variant of av_channel_name(). + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_channel_name_bprint(AVBPrint* @bp, AVChannel @channel_id); + + /// Converts AVChromaLocation to swscale x/y chroma position. + /// horizontal chroma sample position + /// vertical chroma sample position + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_chroma_location_enum_to_pos(int* @xpos, int* @ypos, AVChromaLocation @pos); + + /// Returns the AVChromaLocation value for name or an AVError if not found. + /// the AVChromaLocation value for name or an AVError if not found. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_chroma_location_from_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Returns the name for provided chroma location or NULL if unknown. + /// the name for provided chroma location or NULL if unknown. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_chroma_location_name(AVChromaLocation @location); + + /// Converts swscale x/y chroma position to AVChromaLocation. + /// horizontal chroma sample position + /// vertical chroma sample position + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVChromaLocation av_chroma_location_pos_to_enum(int @xpos, int @ypos); + + /// Get the AVCodecID for the given codec tag tag. If no codec id is found returns AV_CODEC_ID_NONE. + /// list of supported codec_id-codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + /// codec tag to match to a codec ID + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecID av_codec_get_id(AVCodecTag** @tags, uint @tag); + + /// Get the codec tag for the given codec id id. If no codec tag is found returns 0. + /// list of supported codec_id-codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + /// codec ID to match to a codec tag + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint av_codec_get_tag(AVCodecTag** @tags, AVCodecID @id); + + /// Get the codec tag for the given codec id. + /// list of supported codec_id - codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + /// codec id that should be searched for in the list + /// A pointer to the found tag + /// 0 if id was not found in tags, > 0 if it was found + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_codec_get_tag2(AVCodecTag** @tags, AVCodecID @id, uint* @tag); + + /// Returns a non-zero number if codec is a decoder, zero otherwise + /// a non-zero number if codec is a decoder, zero otherwise + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_codec_is_decoder(AVCodec* @codec); + + /// Returns a non-zero number if codec is an encoder, zero otherwise + /// a non-zero number if codec is an encoder, zero otherwise + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_codec_is_encoder(AVCodec* @codec); + + /// Iterate over all registered codecs. + /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. + /// the next registered codec or NULL when the iteration is finished + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodec* av_codec_iterate(void** @opaque); + + /// Returns the AVColorPrimaries value for name or an AVError if not found. + /// the AVColorPrimaries value for name or an AVError if not found. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_color_primaries_from_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Returns the name for provided color primaries or NULL if unknown. + /// the name for provided color primaries or NULL if unknown. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_color_primaries_name(AVColorPrimaries @primaries); + + /// Returns the AVColorRange value for name or an AVError if not found. + /// the AVColorRange value for name or an AVError if not found. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_color_range_from_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Returns the name for provided color range or NULL if unknown. + /// the name for provided color range or NULL if unknown. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_color_range_name(AVColorRange @range); + + /// Returns the AVColorSpace value for name or an AVError if not found. + /// the AVColorSpace value for name or an AVError if not found. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_color_space_from_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Returns the name for provided color space or NULL if unknown. + /// the name for provided color space or NULL if unknown. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_color_space_name(AVColorSpace @space); + + /// Returns the AVColorTransferCharacteristic value for name or an AVError if not found. + /// the AVColorTransferCharacteristic value for name or an AVError if not found. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_color_transfer_from_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Returns the name for provided color transfer or NULL if unknown. + /// the name for provided color transfer or NULL if unknown. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_color_transfer_name(AVColorTransferCharacteristic @transfer); + + /// Compare the remainders of two integer operands divided by a common divisor. + /// Operand + /// Operand + /// Divisor; must be a power of 2 + /// - a negative value if `a % mod < b % mod` - a positive value if `a % mod > b % mod` - zero if `a % mod == b % mod` + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_compare_mod(ulong @a, ulong @b, ulong @mod); + + /// Compare two timestamps each in its own time base. + /// One of the following values: - -1 if `ts_a` is before `ts_b` - 1 if `ts_a` is after `ts_b` - 0 if they represent the same position + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_compare_ts(long @ts_a, AVRational @tb_a, long @ts_b, AVRational @tb_b); + + /// Allocate an AVContentLightMetadata structure and set its fields to default values. The resulting struct can be freed using av_freep(). + /// An AVContentLightMetadata filled with default values or NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVContentLightMetadata* av_content_light_metadata_alloc(ulong* @size); + + /// Allocate a complete AVContentLightMetadata and add it to the frame. + /// The frame which side data is added to. + /// The AVContentLightMetadata structure to be filled by caller. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVContentLightMetadata* av_content_light_metadata_create_side_data(AVFrame* @frame); + + /// Allocate a CPB properties structure and initialize its fields to default values. + /// if non-NULL, the size of the allocated struct will be written here. This is useful for embedding it in side data. + /// the newly allocated struct or NULL on failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCPBProperties* av_cpb_properties_alloc(ulong* @size); + + /// Returns the number of logical CPU cores present. + /// the number of logical CPU cores present. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_cpu_count(); + + /// Overrides cpu count detection and forces the specified count. Count < 1 disables forcing of specific count. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_cpu_force_count(int @count); + + /// Get the maximum data alignment that may be required by leviathan. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong av_cpu_max_align(); + + /// Convert a double precision floating point number to a rational. + /// `double` to convert + /// Maximum allowed numerator and denominator + /// `d` in AVRational form + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_d2q(double @d, int @max); + + /// Allocate an AVD3D11VAContext. + /// Newly-allocated AVD3D11VAContext or NULL on failure. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVD3D11VAContext* av_d3d11va_alloc_context(); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClassCategory av_default_get_category(void* @ptr); + + /// Return the context name + /// The AVClass context + /// The AVClass class_name + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_default_item_name(void* @ctx); + + /// Iterate over all registered demuxers. + /// a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. + /// the next registered demuxer or NULL when the iteration is finished + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVInputFormat* av_demuxer_iterate(void** @opaque); + + /// Copy entries from one AVDictionary struct into another. + /// Pointer to a pointer to a AVDictionary struct to copy into. If *dst is NULL, this function will allocate a struct for you and put it in *dst + /// Pointer to the source AVDictionary struct to copy items from. + /// Flags to use when setting entries in *dst + /// 0 on success, negative AVERROR code on failure. If dst was allocated by this function, callers should free the associated memory. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dict_copy(AVDictionary** @dst, AVDictionary* @src, int @flags); + + /// Get number of entries in dictionary. + /// dictionary + /// number of entries in dictionary + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dict_count(AVDictionary* @m); + + /// Free all the memory allocated for an AVDictionary struct and all keys and values. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_dict_free(AVDictionary** @m); + + /// Get a dictionary entry with matching key. + /// Matching key + /// Set to the previous matching element to find the next. If set to NULL the first matching element is returned. + /// A collection of AV_DICT_* flags controlling how the entry is retrieved + /// Found entry or NULL in case no matching entry was found in the dictionary + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVDictionaryEntry* av_dict_get(AVDictionary* @m, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key, AVDictionaryEntry* @prev, int @flags); + + /// Get dictionary entries as a string. + /// The dictionary + /// Pointer to buffer that will be allocated with string containg entries. Buffer must be freed by the caller when is no longer needed. + /// Character used to separate key from value + /// Character used to separate two pairs from each other + /// >= 0 on success, negative on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dict_get_string(AVDictionary* @m, byte** @buffer, byte @key_val_sep, byte @pairs_sep); + + /// Iterate over a dictionary + /// The dictionary to iterate over + /// Pointer to the previous AVDictionaryEntry, NULL initially + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVDictionaryEntry* av_dict_iterate(AVDictionary* @m, AVDictionaryEntry* @prev); + + /// Parse the key/value pairs list and add the parsed entries to a dictionary. + /// A 0-terminated list of characters used to separate key from value + /// A 0-terminated list of characters used to separate two pairs from each other + /// Flags to use when adding to the dictionary. ::AV_DICT_DONT_STRDUP_KEY and ::AV_DICT_DONT_STRDUP_VAL are ignored since the key/value tokens will always be duplicated. + /// 0 on success, negative AVERROR code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dict_parse_string(AVDictionary** @pm, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @str, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key_val_sep, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @pairs_sep, int @flags); + + /// Set the given entry in *pm, overwriting an existing entry. + /// Pointer to a pointer to a dictionary struct. If *pm is NULL a dictionary struct is allocated and put in *pm. + /// Entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) + /// Entry value to add to *pm (will be av_strduped or added as a new key depending on flags). Passing a NULL value will cause an existing entry to be deleted. + /// >= 0 on success otherwise an error code < 0 + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dict_set(AVDictionary** @pm, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @value, int @flags); + + /// Convenience wrapper for av_dict_set() that converts the value to a string and stores it. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dict_set_int(AVDictionary** @pm, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key, long @value, int @flags); + + /// Flip the input matrix horizontally and/or vertically. + /// a transformation matrix + /// whether the matrix should be flipped horizontally + /// whether the matrix should be flipped vertically + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_display_matrix_flip(ref int9 @matrix, int @hflip, int @vflip); + + /// Extract the rotation component of the transformation matrix. + /// the transformation matrix + /// the angle (in degrees) by which the transformation rotates the frame counterclockwise. The angle will be in range [-180.0, 180.0], or NaN if the matrix is singular. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern double av_display_rotation_get(in int9 @matrix); + + /// Initialize a transformation matrix describing a pure clockwise rotation by the specified angle (in degrees). + /// a transformation matrix (will be fully overwritten by this function) + /// rotation angle in degrees. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_display_rotation_set(ref int9 @matrix, double @angle); + + /// Returns The AV_DISPOSITION_* flag corresponding to disp or a negative error code if disp does not correspond to a known stream disposition. + /// The AV_DISPOSITION_* flag corresponding to disp or a negative error code if disp does not correspond to a known stream disposition. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_disposition_from_string( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @disp); + + /// Returns The string description corresponding to the lowest set bit in disposition. NULL when the lowest set bit does not correspond to a known disposition or when disposition is 0. + /// a combination of AV_DISPOSITION_* values + /// The string description corresponding to the lowest set bit in disposition. NULL when the lowest set bit does not correspond to a known disposition or when disposition is 0. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_disposition_to_string(int @disposition); + + /// Divide one rational by another. + /// First rational + /// Second rational + /// b/c + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_div_q(AVRational @b, AVRational @c); + + /// Print detailed information about the input or output format, such as duration, bitrate, streams, container, programs, metadata, side data, codec and time base. + /// the context to analyze + /// index of the stream to dump information about + /// the URL to print, such as source or destination file + /// Select whether the specified context is an input(0) or output(1) + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_dump_format(AVFormatContext* @ic, int @index, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url, int @is_output); + + /// Allocate an AVDynamicHDRPlus structure and set its fields to default values. The resulting struct can be freed using av_freep(). + /// An AVDynamicHDRPlus filled with default values or NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVDynamicHDRPlus* av_dynamic_hdr_plus_alloc(ulong* @size); + + /// Allocate a complete AVDynamicHDRPlus and add it to the frame. + /// The frame which side data is added to. + /// The AVDynamicHDRPlus structure to be filled by caller or NULL on failure. + [DllImport(avutil_DLL, 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_DLL, 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. + /// A pointer to pointer to a byte buffer to be filled with the serialized metadata. If *data is NULL, a buffer be will be allocated and a pointer to it stored in its place. The caller assumes ownership of the buffer. May be NULL, in which case the function will only store the required buffer size in *size. + /// A pointer to a size to be set to the returned buffer's size. If *data is not NULL, *size must contain the size of the input buffer. May be NULL only if *data is NULL. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + [DllImport(avutil_DLL, 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 + /// Element to add + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_dynarray_add(void* @tab_ptr, int* @nb_ptr, void* @elem); + + /// Add an element to a dynamic array. + /// >=0 on success, negative otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_dynarray_add_nofree(void* @tab_ptr, int* @nb_ptr, void* @elem); + + /// Add an element of size `elem_size` to a dynamic array. + /// Pointer to the array to grow + /// Pointer to the number of elements in the array + /// Size in bytes of an element in the array + /// Pointer to the data of the element to add. If `NULL`, the space of the newly added element is allocated but left uninitialized. + /// Pointer to the data of the element to copy in the newly allocated space + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_dynarray2_add(void** @tab_ptr, int* @nb_ptr, ulong @elem_size, byte* @elem_data); + + /// Allocate a buffer, reusing the given one if large enough. + /// Pointer to pointer to an already allocated buffer. `*ptr` will be overwritten with pointer to new buffer on success or `NULL` on failure + /// Pointer to the size of buffer `*ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. + /// Desired minimal size of buffer `*ptr` + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_fast_malloc(void* @ptr, uint* @size, ulong @min_size); + + /// Allocate and clear a buffer, reusing the given one if large enough. + /// Pointer to pointer to an already allocated buffer. `*ptr` will be overwritten with pointer to new buffer on success or `NULL` on failure + /// Pointer to the size of buffer `*ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. + /// Desired minimal size of buffer `*ptr` + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_fast_mallocz(void* @ptr, uint* @size, ulong @min_size); + + /// Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_fast_padded_malloc(void* @ptr, uint* @size, ulong @min_size); + + /// Same behaviour av_fast_padded_malloc except that buffer will always be 0-initialized after call. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_fast_padded_mallocz(void* @ptr, uint* @size, ulong @min_size); + + /// Reallocate the given buffer if it is not large enough, otherwise do nothing. + /// Already allocated buffer, or `NULL` + /// Pointer to the size of buffer `ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. + /// Desired minimal size of buffer `ptr` + /// `ptr` if the buffer is large enough, a pointer to newly reallocated buffer if the buffer was not large enough, or `NULL` in case of error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_fast_realloc(void* @ptr, uint* @size, ulong @min_size); + + /// Read the file with name filename, and put its content in a newly allocated buffer or map it with mmap() when available. In case of success set *bufptr to the read or mmapped buffer, and *size to the size in bytes of the buffer in *bufptr. Unlike mmap this function succeeds with zero sized files, in this case *bufptr will be set to NULL and *size will be set to 0. The returned buffer must be released with av_file_unmap(). + /// path to the file + /// pointee is set to the mapped or allocated buffer + /// pointee is set to the size in bytes of the buffer + /// loglevel offset used for logging + /// context used for logging + /// a non negative number in case of success, a negative value corresponding to an AVERROR error code in case of failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_file_map( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @filename, byte** @bufptr, ulong* @size, int @log_offset, void* @log_ctx); + + /// Unmap or free the buffer bufptr created by av_file_map(). + /// the buffer previously created with av_file_map() + /// size in bytes of bufptr, must be the same as returned by av_file_map() + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_file_unmap(byte* @bufptr, ulong @size); + + /// Check whether filename actually is a numbered sequence generator. + /// possible numbered sequence string + /// 1 if a valid numbered sequence string, 0 otherwise + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_filename_number_test( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @filename); + + // /// Iterate over all registered filters. + // /// a pointer where libavfilter will store the iteration state. Must point to NULL to start the iteration. + // /// the next registered filter or NULL when the iteration is finished + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVFilter* av_filter_iterate(void** @opaque); + + /// Compute what kind of losses will occur when converting from one specific pixel format to another. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. av_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another. + /// source pixel format + /// Whether the source pixel format alpha channel is used. + /// Combination of flags informing you what kind of losses will occur (maximum loss for an invalid dst_pix_fmt). + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPixelFormat av_find_best_pix_fmt_of_2(AVPixelFormat @dst_pix_fmt1, AVPixelFormat @dst_pix_fmt2, AVPixelFormat @src_pix_fmt, int @has_alpha, int* @loss_ptr); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_find_default_stream_index(AVFormatContext* @s); + + /// Find AVInputFormat based on the short name of the input format. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVInputFormat* av_find_input_format( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @short_name); + + /// Find the value in a list of rationals nearest a given reference rational. + /// Reference rational + /// Array of rationals terminated by `{0, 0}` + /// Index of the nearest value found in the array + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_find_nearest_q_idx(AVRational @q, AVRational* @q_list); + + /// Find the programs which belong to a given stream. + /// media file handle + /// the last found program, the search will start after this program, or from the beginning if it is NULL + /// stream index + /// the next program which belongs to s, NULL if no program is found or the last program is not among the programs of ic. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVProgram* av_find_program_from_stream(AVFormatContext* @ic, AVProgram* @last, int @s); + + /// Returns the method used to set ctx->duration. + /// AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. + [Obsolete("duration_estimation_method is public and can be read directly.")] + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(AVFormatContext* @ctx); + + /// Disables cpu detection and forces the specified flags. -1 is a special case that disables forcing of specific flags. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_force_cpu_flags(int @flags); + + /// This function will cause global side data to be injected in the next packet of each stream as well as after any subsequent seek. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_format_inject_global_side_data(AVFormatContext* @s); + + /// Fill the provided buffer with a string containing a FourCC (four-character code) representation. + /// a buffer with size in bytes of at least AV_FOURCC_MAX_STRING_SIZE + /// the fourcc to represent + /// the buffer in input + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_fourcc_make_string(byte* @buf, uint @fourcc); + + /// Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ crop_bottom fields. If cropping is successful, the function will adjust the data pointers and the width/height fields, and set the crop fields to 0. + /// the frame which should be cropped + /// Some combination of AV_FRAME_CROP_* flags, or 0. + /// >= 0 on success, a negative AVERROR on error. If the cropping fields were invalid, AVERROR(ERANGE) is returned, and nothing is changed. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_apply_cropping(AVFrame* @frame, int @flags); + + /// Create a new frame that references the same data as src. + /// newly created AVFrame on success, NULL on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVFrame* av_frame_clone(AVFrame* @src); + + /// Copy the frame data from src to dst. + /// >= 0 on success, a negative AVERROR on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_copy(AVFrame* @dst, AVFrame* @src); + + /// Copy only "metadata" fields from src to dst. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_copy_props(AVFrame* @dst, AVFrame* @src); + + /// Allocate new buffer(s) for audio or video data. + /// frame in which to store the new buffers. + /// Required buffer size alignment. If equal to 0, alignment will be chosen automatically for the current CPU. It is highly recommended to pass 0 here unless you know what you are doing. + /// 0 on success, a negative AVERROR on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_get_buffer(AVFrame* @frame, int @align); + + /// Get the buffer reference a given data plane is stored in. + /// the frame to get the plane's buffer from + /// index of the data plane of interest in frame->extended_data. + /// the buffer reference that contains the plane or NULL if the input frame is not valid. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferRef* av_frame_get_plane_buffer(AVFrame* @frame, int @plane); + + /// Returns a pointer to the side data of a given type on success, NULL if there is no side data with such type in this frame. + /// a pointer to the side data of a given type on success, NULL if there is no side data with such type in this frame. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVFrameSideData* av_frame_get_side_data(AVFrame* @frame, AVFrameSideDataType @type); + + /// Check if the frame data is writable. + /// A positive value if the frame data is writable (which is true if and only if each of the underlying buffers has only one reference, namely the one stored in this frame). Return 0 otherwise. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_is_writable(AVFrame* @frame); + + /// Ensure that the frame data is writable, avoiding data copy if possible. + /// 0 on success, a negative AVERROR on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_make_writable(AVFrame* @frame); + + /// Move everything contained in src to dst and reset src. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_frame_move_ref(AVFrame* @dst, AVFrame* @src); + + /// Add a new side data to a frame. + /// a frame to which the side data should be added + /// type of the added side data + /// size of the side data + /// newly added side data on success, NULL on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVFrameSideData* av_frame_new_side_data(AVFrame* @frame, AVFrameSideDataType @type, ulong @size); + + /// Add a new side data to a frame from an existing AVBufferRef + /// a frame to which the side data should be added + /// the type of the added side data + /// an AVBufferRef to add as side data. The ownership of the reference is transferred to the frame. + /// newly added side data on success, NULL on error. On failure the frame is unchanged and the AVBufferRef remains owned by the caller. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVFrameSideData* av_frame_new_side_data_from_buf(AVFrame* @frame, AVFrameSideDataType @type, AVBufferRef* @buf); + + /// Set up a new reference to the data described by the source frame. + /// 0 on success, a negative AVERROR on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_ref(AVFrame* @dst, AVFrame* @src); + + /// Remove and free all side data instances of the given type. + [DllImport(avutil_DLL, 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_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_replace(AVFrame* @dst, AVFrame* @src); + + /// Add a new side data entry to an array based on existing side data, taking a reference towards the contained AVBufferRef. + /// pointer to array of side data to which to add another entry, or to NULL in order to start a new array. + /// pointer to an integer containing the number of entries in the array. + /// side data to be cloned, with a new reference utilized for the buffer. + /// Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. + /// negative error code on failure, >=0 on success. In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of matching AVFrameSideDataType will be removed before the addition is attempted. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_frame_side_data_clone(AVFrameSideData*** @sd, int* @nb_sd, AVFrameSideData* @src, uint @flags); + + /// Free all side data entries and their contents, then zeroes out the values which the pointers are pointing to. + /// pointer to array of side data to free. Will be set to NULL upon return. + /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_frame_side_data_free(AVFrameSideData*** @sd, int* @nb_sd); + + /// Get a side data entry of a specific type from an array. + /// array of side data. + /// integer containing the number of entries in the array. + /// type of side data to be queried + /// a pointer to the side data of a given type on success, NULL if there is no side data with such type in this set. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVFrameSideData* av_frame_side_data_get_c(AVFrameSideData** @sd, int @nb_sd, AVFrameSideDataType @type); + + /// Returns a string identifying the side data type + /// a string identifying the side data type + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_frame_side_data_name(AVFrameSideDataType @type); + + /// Add new side data entry to an array. + /// pointer to array of side data to which to add another entry, or to NULL in order to start a new array. + /// pointer to an integer containing the number of entries in the array. + /// type of the added side data + /// size of the side data + /// Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. + /// newly added side data on success, NULL on error. In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of matching AVFrameSideDataType will be removed before the addition is attempted. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVFrameSideData* av_frame_side_data_new(AVFrameSideData*** @sd, int* @nb_sd, AVFrameSideDataType @type, ulong @size, uint @flags); + + /// Unreference all the buffers referenced by frame and reset the frame fields. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_frame_unref(AVFrame* @frame); + + /// Free a memory block which has been allocated with a function of av_malloc() or av_realloc() family, and set the pointer pointing to it to `NULL`. + /// Pointer to the pointer to the memory block which should be freed + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_freep(void* @ptr); + + /// Compute the greatest common divisor of two integer operands. + /// Operand + /// Operand + /// GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; if a == 0 and b == 0, returns 0. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_gcd(long @a, long @b); + + /// Return the best rational so that a and b are multiple of it. If the resulting denominator is larger than max_den, return def. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_gcd_q(AVRational @a, AVRational @b, int @max_den, AVRational @def); + + /// Return the planar<->packed alternative form of the given sample format, or AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the requested planar/packed format, the format returned is the same as the input. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVSampleFormat av_get_alt_sample_fmt(AVSampleFormat @sample_fmt, int @planar); + + /// Return audio frame duration. + /// codec context + /// size of the frame, or 0 if unknown + /// frame duration, in samples, if known. 0 if not able to determine. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_audio_frame_duration(AVCodecContext* @avctx, int @frame_bytes); + + /// This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters instead of an AVCodecContext. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_audio_frame_duration2(AVCodecParameters* @par, int @frame_bytes); + + /// Return the number of bits per pixel used by the pixel format described by pixdesc. Note that this is not the same as the number of bits per sample. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_bits_per_pixel(AVPixFmtDescriptor* @pixdesc); + + /// Return codec bits per sample. + /// the codec + /// Number of bits per sample or zero if unknown for the given codec. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_bits_per_sample(AVCodecID @codec_id); + + /// Return number of bytes per sample. + /// the sample format + /// number of bytes per sample or zero if unknown for the given sample format + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_bytes_per_sample(AVSampleFormat @sample_fmt); + + /// Return the flags which specify extensions supported by the CPU. The returned value is affected by av_force_cpu_flags() if that was used before. So av_get_cpu_flags() can easily be used in an application to detect the enabled cpu flags. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_cpu_flags(); + + /// Return codec bits per sample. Only return non-zero if the bits per sample is exactly correct, not an approximation. + /// the codec + /// Number of bits per sample or zero if unknown for the given codec. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_exact_bits_per_sample(AVCodecID @codec_id); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_frame_filename(byte* @buf, int @buf_size, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @path, int @number); + + /// Return in 'buf' the path with '%d' replaced by a number. + /// destination buffer + /// destination buffer size + /// numbered sequence string + /// frame number + /// AV_FRAME_FILENAME_FLAGS_* + /// 0 if OK, -1 on format error + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_frame_filename2(byte* @buf, int @buf_size, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @path, int @number, int @flags); + + /// Return a string describing the media_type enum, NULL if media_type is unknown. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_get_media_type_string(AVMediaType @media_type); + + /// Get timing information for the data currently output. The exact meaning of "currently output" depends on the format. It is mostly relevant for devices that have an internal buffer and/or work in real time. + /// media file handle + /// stream in the media file + /// DTS of the last packet output for the stream, in stream time_base units + /// absolute time when that packet whas output, in microsecond + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_output_timestamp(AVFormatContext* @s, int @stream, long* @dts, long* @wall); + + /// Get the packed alternative form of the given sample format. + /// the packed alternative form of the given sample format or AV_SAMPLE_FMT_NONE on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVSampleFormat av_get_packed_sample_fmt(AVSampleFormat @sample_fmt); + + /// Allocate and read the payload of a packet and initialize its fields with default values. + /// associated IO context + /// packet + /// desired payload size + /// >0 (read size) if OK, AVERROR_xxx otherwise + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_packet(AVIOContext* @s, AVPacket* @pkt, int @size); + + /// Return the number of bits per pixel for the pixel format described by pixdesc, including any padding or unused bits. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_padded_bits_per_pixel(AVPixFmtDescriptor* @pixdesc); + + /// Return the PCM codec associated with a sample format. + /// endianness, 0 for little, 1 for big, -1 (or anything else) for native + /// AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecID av_get_pcm_codec(AVSampleFormat @fmt, int @be); + + /// Return a single letter to describe the given picture type pict_type. + /// the picture type + /// a single character representing the picture type, '?' if pict_type is unknown + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte av_get_picture_type_char(AVPictureType @pict_type); + + /// Return the pixel format corresponding to name. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPixelFormat av_get_pix_fmt( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Compute what kind of losses will occur when converting from one specific pixel format to another. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. av_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another. + /// destination pixel format + /// source pixel format + /// Whether the source pixel format alpha channel is used. + /// Combination of flags informing you what kind of losses will occur (maximum loss for an invalid dst_pix_fmt). + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_get_pix_fmt_loss(AVPixelFormat @dst_pix_fmt, AVPixelFormat @src_pix_fmt, int @has_alpha); + + /// Return the short name for a pixel format, NULL in case pix_fmt is unknown. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_get_pix_fmt_name(AVPixelFormat @pix_fmt); + + /// Print in buf the string corresponding to the pixel format with number pix_fmt, or a header if pix_fmt is negative. + /// the buffer where to write the string + /// the size of buf + /// the number of the pixel format to print the corresponding info string, or a negative value to print the corresponding header. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_get_pix_fmt_string(byte* @buf, int @buf_size, AVPixelFormat @pix_fmt); + + /// Get the planar alternative form of the given sample format. + /// the planar alternative form of the given sample format or AV_SAMPLE_FMT_NONE on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVSampleFormat av_get_planar_sample_fmt(AVSampleFormat @sample_fmt); + + /// Return a name for the specified profile, if available. + /// the codec that is searched for the given profile + /// the profile value for which a name is requested + /// A name for the profile if found, NULL otherwise. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_get_profile_name(AVCodec* @codec, int @profile); + + /// Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVSampleFormat av_get_sample_fmt( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Return the name of sample_fmt, or NULL if sample_fmt is not recognized. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_get_sample_fmt_name(AVSampleFormat @sample_fmt); + + /// Generate a string corresponding to the sample format with sample_fmt, or a header if sample_fmt is negative. + /// the buffer where to write the string + /// the size of buf + /// the number of the sample format to print the corresponding info string, or a negative value to print the corresponding header. + /// the pointer to the filled buffer or NULL if sample_fmt is unknown or in case of other errors + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_get_sample_fmt_string(byte* @buf, int @buf_size, AVSampleFormat @sample_fmt); + + /// Return the fractional representation of the internal time base. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_get_time_base_q(); + + /// Get the current time in microseconds. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_gettime(); + + /// Get the current time in microseconds since some unspecified starting point. On platforms that support it, the time comes from a monotonic clock This property makes this time source ideal for measuring relative time. The returned values may not be monotonic on platforms where a monotonic clock is not available. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_gettime_relative(); + + /// Indicates with a boolean result if the av_gettime_relative() time source is monotonic. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_gettime_relative_is_monotonic(); + + /// Increase packet size, correctly zeroing padding + /// packet + /// number of bytes by which to increase the size of the packet + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_grow_packet(AVPacket* @pkt, int @grow_by); + + /// Guess the codec ID based upon muxer and filename. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecID av_guess_codec(AVOutputFormat* @fmt, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @short_name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @filename, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @mime_type, AVMediaType @type); + + /// Return the output format in the list of registered output formats which best matches the provided parameters, or return NULL if there is no match. + /// if non-NULL checks if short_name matches with the names of the registered formats + /// if non-NULL checks if filename terminates with the extensions of the registered formats + /// if non-NULL checks if mime_type matches with the MIME type of the registered formats + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVOutputFormat* av_guess_format( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @short_name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @filename, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @mime_type); + + /// Guess the frame rate, based on both the container and codec information. + /// the format context which the stream is part of + /// the stream which the frame is part of + /// the frame for which the frame rate should be determined, may be NULL + /// the guessed (valid) frame rate, 0/1 if no idea + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_guess_frame_rate(AVFormatContext* @ctx, AVStream* @stream, AVFrame* @frame); + + /// Guess the sample aspect ratio of a frame, based on both the stream and the frame aspect ratio. + /// the format context which the stream is part of + /// the stream which the frame is part of + /// the frame with the aspect ratio to be determined + /// the guessed (valid) sample_aspect_ratio, 0/1 if no idea + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_guess_sample_aspect_ratio(AVFormatContext* @format, AVStream* @stream, AVFrame* @frame); + + /// Send a nice hexadecimal dump of a buffer to the specified file stream. + /// The file stream pointer where the dump should be sent to. + /// buffer + /// buffer size + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_hex_dump(_iobuf* @f, byte* @buf, int @size); + + /// Send a nice hexadecimal dump of a buffer to the log. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. + /// The importance level of the message, lower values signifying higher importance. + /// buffer + /// buffer size + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_hex_dump_log(void* @avcl, int @level, byte* @buf, int @size); + + /// Allocate an AVHWDeviceContext for a given hardware type. + /// the type of the hardware device to allocate. + /// a reference to the newly created AVHWDeviceContext on success or NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferRef* av_hwdevice_ctx_alloc(AVHWDeviceType @type); + + /// Open a device of the specified type and create an AVHWDeviceContext for it. + /// On success, a reference to the newly-created device context will be written here. The reference is owned by the caller and must be released with av_buffer_unref() when no longer needed. On failure, NULL will be written to this pointer. + /// The type of the device to create. + /// A type-specific string identifying the device to open. + /// A dictionary of additional (type-specific) options to use in opening the device. The dictionary remains owned by the caller. + /// currently unused + /// 0 on success, a negative AVERROR code on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwdevice_ctx_create(AVBufferRef** @device_ctx, AVHWDeviceType @type, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @device, AVDictionary* @opts, int @flags); + + /// Create a new device of the specified type from an existing device. + /// On success, a reference to the newly-created AVHWDeviceContext. + /// The type of the new device to create. + /// A reference to an existing AVHWDeviceContext which will be used to create the new device. + /// Currently unused; should be set to zero. + /// Zero on success, a negative AVERROR code on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwdevice_ctx_create_derived(AVBufferRef** @dst_ctx, AVHWDeviceType @type, AVBufferRef* @src_ctx, int @flags); + + /// Create a new device of the specified type from an existing device. + /// On success, a reference to the newly-created AVHWDeviceContext. + /// The type of the new device to create. + /// A reference to an existing AVHWDeviceContext which will be used to create the new device. + /// Options for the new device to create, same format as in av_hwdevice_ctx_create. + /// Currently unused; should be set to zero. + /// Zero on success, a negative AVERROR code on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwdevice_ctx_create_derived_opts(AVBufferRef** @dst_ctx, AVHWDeviceType @type, AVBufferRef* @src_ctx, AVDictionary* @options, int @flags); + + /// Finalize the device context before use. This function must be called after the context is filled with all the required information and before it is used in any way. + /// a reference to the AVHWDeviceContext + /// 0 on success, a negative AVERROR code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwdevice_ctx_init(AVBufferRef* @ref); + + /// Look up an AVHWDeviceType by name. + /// String name of the device type (case-insensitive). + /// The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if not found. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVHWDeviceType av_hwdevice_find_type_by_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Get the constraints on HW frames given a device and the HW-specific configuration to be used with that device. If no HW-specific configuration is provided, returns the maximum possible capabilities of the device. + /// a reference to the associated AVHWDeviceContext. + /// a filled HW-specific configuration structure, or NULL to return the maximum possible capabilities of the device. + /// AVHWFramesConstraints structure describing the constraints on the device, or NULL if not available. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVHWFramesConstraints* av_hwdevice_get_hwframe_constraints(AVBufferRef* @ref, void* @hwconfig); + + /// Get the string name of an AVHWDeviceType. + /// Type from enum AVHWDeviceType. + /// Pointer to a static string containing the name, or NULL if the type is not valid. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_hwdevice_get_type_name(AVHWDeviceType @type); + + /// Allocate a HW-specific configuration structure for a given HW device. After use, the user must free all members as required by the specific hardware structure being used, then free the structure itself with av_free(). + /// a reference to the associated AVHWDeviceContext. + /// The newly created HW-specific configuration structure on success or NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_hwdevice_hwconfig_alloc(AVBufferRef* @device_ctx); + + /// Iterate over supported device types. + /// AV_HWDEVICE_TYPE_NONE initially, then the previous type returned by this function in subsequent iterations. + /// The next usable device type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if there are no more. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVHWDeviceType av_hwdevice_iterate_types(AVHWDeviceType @prev); + + /// Free an AVHWFrameConstraints structure. + /// The (filled or unfilled) AVHWFrameConstraints structure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_hwframe_constraints_free(AVHWFramesConstraints** @constraints); + + /// Allocate an AVHWFramesContext tied to a given device context. + /// a reference to a AVHWDeviceContext. This function will make a new reference for internal use, the one passed to the function remains owned by the caller. + /// a reference to the newly created AVHWFramesContext on success or NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVBufferRef* av_hwframe_ctx_alloc(AVBufferRef* @device_ctx); + + /// Create and initialise an AVHWFramesContext as a mapping of another existing AVHWFramesContext on a different device. + /// On success, a reference to the newly created AVHWFramesContext. + /// The AVPixelFormat for the derived context. + /// A reference to the device to create the new AVHWFramesContext on. + /// A reference to an existing AVHWFramesContext which will be mapped to the derived context. + /// Some combination of AV_HWFRAME_MAP_* flags, defining the mapping parameters to apply to frames which are allocated in the derived device. + /// Zero on success, negative AVERROR code on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwframe_ctx_create_derived(AVBufferRef** @derived_frame_ctx, AVPixelFormat @format, AVBufferRef* @derived_device_ctx, AVBufferRef* @source_frame_ctx, int @flags); + + /// Finalize the context before use. This function must be called after the context is filled with all the required information and before it is attached to any frames. + /// a reference to the AVHWFramesContext + /// 0 on success, a negative AVERROR code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwframe_ctx_init(AVBufferRef* @ref); + + /// Allocate a new frame attached to the given AVHWFramesContext. + /// a reference to an AVHWFramesContext + /// an empty (freshly allocated or unreffed) frame to be filled with newly allocated buffers. + /// currently unused, should be set to zero + /// 0 on success, a negative AVERROR code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwframe_get_buffer(AVBufferRef* @hwframe_ctx, AVFrame* @frame, int @flags); + + /// Map a hardware frame. + /// Destination frame, to contain the mapping. + /// Source frame, to be mapped. + /// Some combination of AV_HWFRAME_MAP_* flags. + /// Zero on success, negative AVERROR code on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwframe_map(AVFrame* @dst, AVFrame* @src, int @flags); + + /// Copy data to or from a hw surface. At least one of dst/src must have an AVHWFramesContext attached. + /// the destination frame. dst is not touched on failure. + /// the source frame. + /// currently unused, should be set to zero + /// 0 on success, a negative AVERROR error code on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwframe_transfer_data(AVFrame* @dst, AVFrame* @src, int @flags); + + /// Get a list of possible source or target formats usable in av_hwframe_transfer_data(). + /// the frame context to obtain the information for + /// the direction of the transfer + /// the pointer to the output format list will be written here. The list is terminated with AV_PIX_FMT_NONE and must be freed by the caller when no longer needed using av_free(). If this function returns successfully, the format list will have at least one item (not counting the terminator). On failure, the contents of this pointer are unspecified. + /// currently unused, should be set to zero + /// 0 on success, a negative AVERROR code on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_hwframe_transfer_get_formats(AVBufferRef* @hwframe_ctx, AVHWFrameTransferDirection @dir, AVPixelFormat** @formats, int @flags); + + /// Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordingly. The allocated image buffer has to be freed by using av_freep(&pointers[0]). + /// array to be filled with the pointer for each image plane + /// the array filled with the linesize for each plane + /// width of the image in pixels + /// height of the image in pixels + /// the AVPixelFormat of the image + /// the value to use for buffer size alignment + /// the size in bytes required for the image buffer, a negative error code in case of failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_alloc(ref byte_ptr4 @pointers, ref int4 @linesizes, int @w, int @h, AVPixelFormat @pix_fmt, int @align); + + /// Check if the given sample aspect ratio of an image is valid. + /// width of the image + /// height of the image + /// sample aspect ratio of the image + /// 0 if valid, a negative AVERROR code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_check_sar(uint @w, uint @h, AVRational @sar); + + /// Check if the given dimension of an image is valid, meaning that all bytes of the image can be addressed with a signed int. + /// the width of the picture + /// the height of the picture + /// the offset to sum to the log level for logging with log_ctx + /// the parent logging context, it may be NULL + /// >= 0 if valid, a negative error code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_check_size(uint @w, uint @h, int @log_offset, void* @log_ctx); + + /// Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with the specified pix_fmt can be addressed with a signed int. + /// the width of the picture + /// the height of the picture + /// the maximum number of pixels the user wants to accept + /// the pixel format, can be AV_PIX_FMT_NONE if unknown. + /// the offset to sum to the log level for logging with log_ctx + /// the parent logging context, it may be NULL + /// >= 0 if valid, a negative error code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_check_size2(uint @w, uint @h, long @max_pixels, AVPixelFormat @pix_fmt, int @log_offset, void* @log_ctx); + + /// Copy image in src_data to dst_data. + /// destination image data buffer to copy to + /// linesizes for the image in dst_data + /// source image data buffer to copy from + /// linesizes for the image in src_data + /// the AVPixelFormat of the image + /// width of the image in pixels + /// height of the image in pixels + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + 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 + /// linesize for the image plane in dst + /// source plane to copy from + /// linesize for the image plane in src + /// height (number of lines) of the plane + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_image_copy_plane(byte* @dst, int @dst_linesize, byte* @src, int @src_linesize, int @bytewidth, int @height); + + /// Copy image data located in uncacheable (e.g. GPU mapped) memory. Where available, this function will use special functionality for reading from such memory, which may result in greatly improved performance compared to plain av_image_copy_plane(). + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_image_copy_plane_uc_from(byte* @dst, long @dst_linesize, byte* @src, long @src_linesize, long @bytewidth, int @height); + + /// Copy image data from an image into a buffer. + /// a buffer into which picture data will be copied + /// the size in bytes of dst + /// pointers containing the source image data + /// linesizes for the image in src_data + /// the pixel format of the source image + /// the width of the source image in pixels + /// the height of the source image in pixels + /// the assumed linesize alignment for dst + /// the number of bytes written to dst, or a negative value (error code) on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_copy_to_buffer(byte* @dst, int @dst_size, in byte_ptr4 @src_data, in int4 @src_linesize, AVPixelFormat @pix_fmt, int @width, int @height, int @align); + + /// Copy image data located in uncacheable (e.g. GPU mapped) memory. Where available, this function will use special functionality for reading from such memory, which may result in greatly improved performance compared to plain av_image_copy(). + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_image_copy_uc_from(ref byte_ptr4 @dst_data, in long4 @dst_linesizes, in byte_ptr4 @src_data, in long4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); + + /// Setup the data pointers and linesizes based on the specified image parameters and the provided array. + /// data pointers to be filled in + /// linesizes for the image in dst_data to be filled in + /// buffer which will contain or contains the actual image data, can be NULL + /// the pixel format of the image + /// the width of the image in pixels + /// the height of the image in pixels + /// the value used in src for linesize alignment + /// the size in bytes required for src, a negative error code in case of failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_fill_arrays(ref byte_ptr4 @dst_data, ref int4 @dst_linesize, byte* @src, AVPixelFormat @pix_fmt, int @width, int @height, int @align); + + /// Overwrite the image data with black. This is suitable for filling a sub-rectangle of an image, meaning the padding between the right most pixel and the left most pixel on the next line will not be overwritten. For some formats, the image size might be rounded up due to inherent alignment. + /// data pointers to destination image + /// linesizes for the destination image + /// the pixel format of the image + /// the color range of the image (important for colorspaces such as YUV) + /// the width of the image in pixels + /// the height of the image in pixels + /// 0 if the image data was cleared, a negative AVERROR code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_fill_black(ref byte_ptr4 @dst_data, in long4 @dst_linesize, AVPixelFormat @pix_fmt, AVColorRange @range, int @width, int @height); + + /// Overwrite the image data with a color. This is suitable for filling a sub-rectangle of an image, meaning the padding between the right most pixel and the left most pixel on the next line will not be overwritten. For some formats, the image size might be rounded up due to inherent alignment. + /// data pointers to destination image + /// linesizes for the destination image + /// the pixel format of the image + /// the color components to be used for the fill + /// the width of the image in pixels + /// the height of the image in pixels + /// currently unused + /// 0 if the image data was filled, a negative AVERROR code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_fill_color(ref byte_ptr4 @dst_data, in long4 @dst_linesize, AVPixelFormat @pix_fmt, in uint4 @color, int @width, int @height, int @flags); + + /// Fill plane linesizes for an image with pixel format pix_fmt and width width. + /// array to be filled with the linesize for each plane + /// the AVPixelFormat of the image + /// width of the image in pixels + /// >= 0 in case of success, a negative error code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_fill_linesizes(ref int4 @linesizes, AVPixelFormat @pix_fmt, int @width); + + /// Compute the max pixel step for each plane of an image with a format described by pixdesc. + /// an array which is filled with the max pixel step for each plane. Since a plane may contain different pixel components, the computed max_pixsteps[plane] is relative to the component in the plane with the max pixel step. + /// an array which is filled with the component for each plane which has the max pixel step. May be NULL. + /// the AVPixFmtDescriptor for the image, describing its format + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_image_fill_max_pixsteps(ref int4 @max_pixsteps, ref int4 @max_pixstep_comps, AVPixFmtDescriptor* @pixdesc); + + /// Fill plane sizes for an image with pixel format pix_fmt and height height. + /// the array to be filled with the size of each image plane + /// the AVPixelFormat of the image + /// height of the image in pixels + /// the array containing the linesize for each plane, should be filled by av_image_fill_linesizes() + /// >= 0 in case of success, a negative error code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_fill_plane_sizes(ref ulong4 @size, AVPixelFormat @pix_fmt, int @height, in long4 @linesizes); + + /// Fill plane data pointers for an image with pixel format pix_fmt and height height. + /// pointers array to be filled with the pointer for each image plane + /// the AVPixelFormat of the image + /// height of the image in pixels + /// the pointer to a buffer which will contain the image + /// the array containing the linesize for each plane, should be filled by av_image_fill_linesizes() + /// the size in bytes required for the image buffer, a negative error code in case of failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_fill_pointers(ref byte_ptr4 @data, AVPixelFormat @pix_fmt, int @height, byte* @ptr, in int4 @linesizes); + + /// Compute the size of an image line with format pix_fmt and width width for the plane plane. + /// the computed size in bytes + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_image_get_linesize(AVPixelFormat @pix_fmt, int @width, int @plane); + + /// Get the index for a specific timestamp. + /// stream that the timestamp belongs to + /// timestamp to retrieve the index for + /// if AVSEEK_FLAG_BACKWARD then the returned index will correspond to the timestamp which is < = the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise + /// < 0 if no such timestamp could be found + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_index_search_timestamp(AVStream* @st, long @timestamp, int @flags); + + /// Initialize optional fields of a packet with default values. + /// packet + [Obsolete("This function is deprecated. Once it's removed, sizeof(AVPacket) will not be a part of the ABI anymore.")] + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_init_packet(AVPacket* @pkt); + + // /// Audio input devices iterator. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVInputFormat* av_input_audio_device_next(AVInputFormat* @d); + + // /// Video input devices iterator. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVInputFormat* av_input_video_device_next(AVInputFormat* @d); + + /// Compute the length of an integer list. + /// size in bytes of each list element (only 1, 2, 4 or 8) + /// pointer to the list + /// list terminator (usually 0 or -1) + /// length of the list, in elements, not counting the terminator + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint av_int_list_length_for_size(uint @elsize, void* @list, ulong @term); + + /// Write a packet to an output media file ensuring correct interleaving. + /// media file handle + /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. + /// 0 on success, a negative AVERROR on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_interleaved_write_frame(AVFormatContext* @s, AVPacket* @pkt); + + /// Write an uncoded frame to an output media file. + /// >=0 for success, a negative code on error + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_interleaved_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame); + + /// Send the specified message to the log if the level is less than or equal to the current av_log_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct or NULL if general log. + /// The importance level of the message expressed using a "Logging Constant". + /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_log(void* @avcl, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @fmt); + + /// Default logging callback + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. + /// The importance level of the message expressed using a "Logging Constant". + /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. + /// The arguments referenced by the format string. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_log_default_callback(void* @avcl, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @fmt, byte* @vl); + + /// Format a line of log the same way as the default callback. + /// buffer to receive the formatted line + /// size of the buffer + /// used to store whether the prefix must be printed; must point to a persistent integer initially set to 1 + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_log_format_line(void* @ptr, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @fmt, byte* @vl, byte* @line, int @line_size, int* @print_prefix); + + /// Format a line of log the same way as the default callback. + /// buffer to receive the formatted line; may be NULL if line_size is 0 + /// size of the buffer; at most line_size-1 characters will be written to the buffer, plus one null terminator + /// used to store whether the prefix must be printed; must point to a persistent integer initially set to 1 + /// Returns a negative value if an error occurred, otherwise returns the number of characters that would have been written for a sufficiently large buffer, not including the terminating null character. If the return value is not less than line_size, it means that the log message was truncated to fit the buffer. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_log_format_line2(void* @ptr, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @fmt, byte* @vl, byte* @line, int @line_size, int* @print_prefix); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_log_get_flags(); + + /// Get the current log level + /// Current log level + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_log_get_level(); + + /// Send the specified message to the log once with the initial_level and then with the subsequent_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct or NULL if general log. + /// importance level of the message expressed using a "Logging Constant" for the first occurance. + /// importance level of the message expressed using a "Logging Constant" after the first occurance. + /// a variable to keep trak of if a message has already been printed this must be initialized to 0 before the first use. The same state must not be accessed by 2 Threads simultaneously. + /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_log_once(void* @avcl, int @initial_level, int @subsequent_level, int* @state, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @fmt); + + /// Set the logging callback + /// A logging function with a compatible signature. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_log_set_callback(av_log_set_callback_callback_func @callback); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_log_set_flags(int @arg); + + /// Set the log level + /// Logging level + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_log_set_level(int @level); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_log2(uint @v); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_log2_16bit(uint @v); + + /// Allocate a memory block for an array with av_malloc(). + /// Number of element + /// Size of a single element + /// Pointer to the allocated block, or `NULL` if the block cannot be allocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_malloc_array(ulong @nmemb, ulong @size); + + /// Allocate a memory block with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block. + /// Size in bytes for the memory block to be allocated + /// Pointer to the allocated block, or `NULL` if it cannot be allocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_mallocz(ulong @size); + + /// Allocate an AVMasteringDisplayMetadata structure and set its fields to default values. The resulting struct can be freed using av_freep(). + /// An AVMasteringDisplayMetadata filled with default values or NULL on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVMasteringDisplayMetadata* av_mastering_display_metadata_alloc(); + + /// Allocate a complete AVMasteringDisplayMetadata and add it to the frame. + /// The frame which side data is added to. + /// The AVMasteringDisplayMetadata structure to be filled by caller. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVMasteringDisplayMetadata* av_mastering_display_metadata_create_side_data(AVFrame* @frame); + + /// Return a positive value if the given filename has one of the given extensions, 0 otherwise. + /// file name to check against the given extensions + /// a comma-separated list of filename extensions + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_match_ext( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @filename, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @extensions); + + /// Set the maximum size that may be allocated in one block. + /// Value to be set as the new maximum size + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_max_alloc(ulong @max); + + /// Overlapping memcpy() implementation. + /// Destination buffer + /// Number of bytes back to start copying (i.e. the initial size of the overlapping window); must be > 0 + /// Number of bytes to copy; must be >= 0 + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_memcpy_backptr(byte* @dst, int @back, int @cnt); + + /// Duplicate a buffer with av_malloc(). + /// Buffer to be duplicated + /// Size in bytes of the buffer copied + /// Pointer to a newly allocated buffer containing a copy of `p` or `NULL` if the buffer cannot be allocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_memdup(void* @p, ulong @size); + + /// Multiply two rationals. + /// First rational + /// Second rational + /// b*c + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_mul_q(AVRational @b, AVRational @c); + + /// Iterate over all registered muxers. + /// a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. + /// the next registered muxer or NULL when the iteration is finished + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVOutputFormat* av_muxer_iterate(void** @opaque); + + /// Find which of the two rationals is closer to another rational. + /// Rational to be compared against + /// Rational to be tested + /// Rational to be tested + /// One of the following values: - 1 if `q1` is nearer to `q` than `q2` - -1 if `q2` is nearer to `q` than `q1` - 0 if they have the same distance + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_nearer_q(AVRational @q, AVRational @q1, AVRational @q2); + + /// Allocate the payload of a packet and initialize its fields with default values. + /// packet + /// wanted payload size + /// 0 if OK, AVERROR_xxx otherwise + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_new_packet(AVPacket* @pkt, int @size); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVProgram* av_new_program(AVFormatContext* @s, int @id); + + /// Iterate over potential AVOptions-enabled children of parent. + /// a pointer where iteration state is stored. + /// AVClass corresponding to next potential child or NULL + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* av_opt_child_class_iterate(AVClass* @parent, void** @iter); + + /// Iterate over AVOptions-enabled children of obj. + /// result of a previous call to this function or NULL + /// next AVOptions-enabled child or NULL + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_opt_child_next(void* @obj, void* @prev); + + /// Copy options from src object into dest object. + /// Object to copy from + /// Object to copy into + /// 0 on success, negative on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_copy(void* @dest, void* @src); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_eval_double(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @val, double* @double_out); + + /// @{ This group of functions can be used to evaluate option strings and get numbers out of them. They do the same thing as av_opt_set(), except the result is written into the caller-supplied pointer. + /// a struct whose first element is a pointer to AVClass. + /// an option for which the string is to be evaluated. + /// string to be evaluated. + /// 0 on success, a negative number on failure. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_eval_flags(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @val, int* @flags_out); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_eval_float(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @val, float* @float_out); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_eval_int(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @val, int* @int_out); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_eval_int64(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @val, long* @int64_out); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_eval_q(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @val, AVRational* @q_out); + + /// Look for an option in an object. Consider only options which have all the specified flags set. + /// A pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set. + /// The name of the option to look for. + /// When searching for named constants, name of the unit it belongs to. + /// Find only options with all the specified flags set (AV_OPT_FLAG). + /// A combination of AV_OPT_SEARCH_*. + /// A pointer to the option found, or NULL if no option was found. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVOption* av_opt_find(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @unit, int @opt_flags, int @search_flags); + + /// Look for an option in an object. Consider only options which have all the specified flags set. + /// A pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set. + /// The name of the option to look for. + /// When searching for named constants, name of the unit it belongs to. + /// Find only options with all the specified flags set (AV_OPT_FLAG). + /// A combination of AV_OPT_SEARCH_*. + /// if non-NULL, an object to which the option belongs will be written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present in search_flags. This parameter is ignored if search_flags contain AV_OPT_SEARCH_FAKE_OBJ. + /// A pointer to the option found, or NULL if no option was found. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVOption* av_opt_find2(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @unit, int @opt_flags, int @search_flags, void** @target_obj); + + /// Check whether a particular flag is set in a flags field. + /// the name of the flag field option + /// the name of the flag to check + /// non-zero if the flag is set, zero if the flag isn't set, isn't of the right type, or the flags field doesn't exist. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_flag_is_set(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @field_name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @flag_name); + + /// Free all allocated objects in obj. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_opt_free(void* @obj); + + /// Free an AVOptionRanges struct and set it to NULL. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_opt_freep_ranges(AVOptionRanges** @ranges); + + /// @{ Those functions get a value of the option with the given name from an object. + /// a struct whose first element is a pointer to an AVClass. + /// name of the option to get. + /// flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be found in a child of obj. + /// value of the option will be written here + /// >=0 on success, a negative error code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, byte** @out_val); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_chlayout(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, AVChannelLayout* @layout); + + /// The returned dictionary is a copy of the actual value and must be freed with av_dict_free() by the caller + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_dict_val(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, AVDictionary** @out_val); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_double(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, double* @out_val); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_image_size(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, int* @w_out, int* @h_out); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_int(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, long* @out_val); + + /// Extract a key-value pair from the beginning of a string. + /// pointer to the options string, will be updated to point to the rest of the string (one of the pairs_sep or the final NUL) + /// a 0-terminated list of characters used to separate key from value, for example '=' + /// a 0-terminated list of characters used to separate two pairs from each other, for example ':' or ',' + /// flags; see the AV_OPT_FLAG_* values below + /// parsed key; must be freed using av_free() + /// parsed value; must be freed using av_free() + /// >=0 for success, or a negative value corresponding to an AVERROR code in case of error; in particular: AVERROR(EINVAL) if no key is present + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_key_value(byte** @ropts, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key_val_sep, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @pairs_sep, uint @flags, byte** @rkey, byte** @rval); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_pixel_fmt(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, AVPixelFormat* @out_fmt); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_q(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, AVRational* @out_val); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_sample_fmt(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, AVSampleFormat* @out_fmt); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_get_video_rate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags, AVRational* @out_val); + + /// Check if given option is set to its default value. + /// AVClass object to check option on + /// option to be checked + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_is_set_to_default(void* @obj, AVOption* @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 + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_is_set_to_default_by_name(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @search_flags); + + /// Iterate over all AVOptions belonging to obj. + /// an AVOptions-enabled struct or a double pointer to an AVClass describing it. + /// result of the previous call to av_opt_next() on this object or NULL + /// next AVOption or NULL + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVOption* av_opt_next(void* @obj, AVOption* @prev); + + /// Gets a pointer to the requested field in a struct. This function allows accessing a struct even when its fields are moved or renamed since the application making the access has been compiled, + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_opt_ptr(AVClass* @avclass, void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Get a list of allowed ranges for the given option. + /// is a bitmask of flags, undefined flags should not be set and should be ignored AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, + /// number of compontents returned on success, a negative errro code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_query_ranges(AVOptionRanges** @p0, void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key, int @flags); + + /// Get a default list of allowed ranges for the given option. + /// is a bitmask of flags, undefined flags should not be set and should be ignored AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, + /// number of compontents returned on success, a negative errro code otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_query_ranges_default(AVOptionRanges** @p0, void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key, int @flags); + + /// Serialize object's options. + /// AVClass object to serialize + /// serialize options with all the specified flags set (AV_OPT_FLAG) + /// combination of AV_OPT_SERIALIZE_* flags + /// Pointer to buffer that will be allocated with string containg serialized options. Buffer must be freed by the caller when is no longer needed. + /// character used to separate key from value + /// character used to separate two pairs from each other + /// >= 0 on success, negative on error + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_serialize(void* @obj, int @opt_flags, int @flags, byte** @buffer, byte @key_val_sep, byte @pairs_sep); + + /// @{ Those functions set the field of obj with the given name to value. + /// A struct whose first element is a pointer to an AVClass. + /// the name of the field to set + /// The value to set. In case of av_opt_set() if the field is not of a string type, then the given string is parsed. SI postfixes and some named scalars are supported. If the field is of a numeric type, it has to be a numeric or named scalar. Behavior with more than one scalar and +- infix operators is undefined. If the field is of a flags type, it has to be a sequence of numeric scalars or named flags separated by '+' or '-'. Prefixing a flag with '+' causes it to be set without affecting the other flags; similarly, '-' unsets a flag. If the field is of a dictionary type, it has to be a ':' separated list of key=value parameters. Values containing ':' special characters must be escaped. + /// flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be set on a child of obj. + /// 0 if the value has been set, or an AVERROR code in case of error: AVERROR_OPTION_NOT_FOUND if no matching option exists AVERROR(ERANGE) if the value is out of range AVERROR(EINVAL) if the value is not valid + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @val, int @search_flags); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_bin(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, byte* @val, int @size, int @search_flags); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_chlayout(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, AVChannelLayout* @layout, int @search_flags); + + /// Set the values of all AVOption fields to their default values. + /// an AVOption-enabled struct (its first member must be a pointer to AVClass) + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_opt_set_defaults(void* @s); + + /// Set the values of all AVOption fields to their default values. Only these AVOption fields for which (opt->flags & mask) == flags will have their default applied to s. + /// an AVOption-enabled struct (its first member must be a pointer to AVClass) + /// combination of AV_OPT_FLAG_* + /// combination of AV_OPT_FLAG_* + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_opt_set_defaults2(void* @s, int @mask, int @flags); + + /// Set all the options from a given dictionary on an object. + /// a struct whose first element is a pointer to AVClass + /// options to process. This dictionary will be freed and replaced by a new one containing all options not found in obj. Of course this new dictionary needs to be freed by caller with av_dict_free(). + /// 0 on success, a negative AVERROR if some option was found in obj, but could not be set. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_dict(void* @obj, AVDictionary** @options); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_dict_val(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, AVDictionary* @val, int @search_flags); + + /// Set all the options from a given dictionary on an object. + /// a struct whose first element is a pointer to AVClass + /// options to process. This dictionary will be freed and replaced by a new one containing all options not found in obj. Of course this new dictionary needs to be freed by caller with av_dict_free(). + /// A combination of AV_OPT_SEARCH_*. + /// 0 on success, a negative AVERROR if some option was found in obj, but could not be set. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_dict2(void* @obj, AVDictionary** @options, int @search_flags); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_double(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, double @val, int @search_flags); + + /// Parse the key-value pairs list in opts. For each key=value pair found, set the value of the corresponding option in ctx. + /// the AVClass object to set options on + /// the options string, key-value pairs separated by a delimiter + /// a NULL-terminated array of options names for shorthand notation: if the first field in opts has no key part, the key is taken from the first element of shorthand; then again for the second, etc., until either opts is finished, shorthand is finished or a named option is found; after that, all options must be named + /// a 0-terminated list of characters used to separate key from value, for example '=' + /// a 0-terminated list of characters used to separate two pairs from each other, for example ':' or ',' + /// the number of successfully set key=value pairs, or a negative value corresponding to an AVERROR code in case of error: AVERROR(EINVAL) if opts cannot be parsed, the error code issued by av_set_string3() if a key/value pair cannot be set + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_from_string(void* @ctx, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @opts, byte** @shorthand, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key_val_sep, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @pairs_sep); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_image_size(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, int @w, int @h, int @search_flags); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_int(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, long @val, int @search_flags); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_pixel_fmt(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, AVPixelFormat @fmt, int @search_flags); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_q(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, AVRational @val, int @search_flags); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_sample_fmt(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, AVSampleFormat @fmt, int @search_flags); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_set_video_rate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name, AVRational @val, int @search_flags); + + /// Show the obj options. + /// log context to use for showing the options + /// requested flags for the options to show. Show only the options for which it is opt->flags & req_flags. + /// rejected flags for the options to show. Show only the options for which it is !(opt->flags & req_flags). + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_opt_show2(void* @obj, void* @av_log_obj, int @req_flags, int @rej_flags); + + // /// Audio output devices iterator. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVOutputFormat* av_output_audio_device_next(AVOutputFormat* @d); + + // /// Video output devices iterator. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVOutputFormat* av_output_video_device_next(AVOutputFormat* @d); + + /// Wrap an existing array as a packet side data. + /// packet + /// side information type + /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to pkt. + /// side information size + /// a non-negative number on success, a negative AVERROR code on failure. On failure, the packet is unchanged and the data remains owned by the caller. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_packet_add_side_data(AVPacket* @pkt, AVPacketSideDataType @type, byte* @data, ulong @size); + + /// Create a new packet that references the same data as src. + /// newly created AVPacket on success, NULL on error. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacket* av_packet_clone(AVPacket* @src); + + /// Copy only "properties" fields from src to dst. + /// Destination packet + /// Source packet + /// 0 on success AVERROR on failure. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_packet_copy_props(AVPacket* @dst, AVPacket* @src); + + /// Convenience function to free all the side data stored. All the other fields stay untouched. + /// packet + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_free_side_data(AVPacket* @pkt); + + /// Initialize a reference-counted packet from av_malloc()ed data. + /// packet to be initialized. This function will set the data, size, and buf fields, all others are left untouched. + /// Data allocated by av_malloc() to be used as packet data. If this function returns successfully, the data is owned by the underlying AVBuffer. The caller may not access the data through other means. + /// size of data in bytes, without the padding. I.e. the full buffer size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. + /// 0 on success, a negative AVERROR on error + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_packet_from_data(AVPacket* @pkt, byte* @data, int @size); + + /// Get side information from packet. + /// packet + /// desired side information type + /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. + /// pointer to data if present or NULL otherwise + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_packet_get_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong* @size); + + /// Ensure the data described by a given packet is reference counted. + /// packet whose data should be made reference counted. + /// 0 on success, a negative AVERROR on error. On failure, the packet is unchanged. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_packet_make_refcounted(AVPacket* @pkt); + + /// Create a writable reference for the data described by a given packet, avoiding data copy if possible. + /// Packet whose data should be made writable. + /// 0 on success, a negative AVERROR on failure. On failure, the packet is unchanged. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_packet_make_writable(AVPacket* @pkt); + + /// Move every field in src to dst and reset src. + /// Destination packet + /// Source packet, will be reset + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_move_ref(AVPacket* @dst, AVPacket* @src); + + /// Allocate new information of a packet. + /// packet + /// side information type + /// side information size + /// pointer to fresh allocated data or NULL otherwise + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_packet_new_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size); + + /// Pack a dictionary for use in side_data. + /// The dictionary to pack. + /// pointer to store the size of the returned data + /// pointer to data if successful, NULL otherwise + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_packet_pack_dictionary(AVDictionary* @dict, ulong* @size); + + /// Setup a new reference to the data described by a given packet + /// Destination packet. Will be completely overwritten. + /// Source packet + /// 0 on success, a negative AVERROR on error. On error, dst will be blank (as if returned by av_packet_alloc()). + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_packet_ref(AVPacket* @dst, AVPacket* @src); + + /// Convert valid timing fields (timestamps / durations) in a packet from one timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be ignored. + /// packet on which the conversion will be performed + /// source timebase, in which the timing fields in pkt are expressed + /// destination timebase, to which the timing fields will be converted + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_packet_rescale_ts(AVPacket* @pkt, AVRational @tb_src, AVRational @tb_dst); + + /// Shrink the already allocated side data buffer + /// packet + /// side information type + /// new side information size + /// 0 on success, < 0 on failure + [DllImport(avcodec_DLL, 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_DLL, 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_DLL, 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_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPacketSideData* av_packet_side_data_get(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type); + + [DllImport(avcodec_DLL, 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_DLL, 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_DLL, 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 + /// the metadata storage dictionary + /// 0 on success, < 0 on failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_packet_unpack_dictionary(byte* @data, ulong @size, AVDictionary** @dict); + + /// Parse CPU caps from a string and update the given AV_CPU_* flags based on that. + /// negative on error. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_parse_cpu_caps(uint* @flags, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @s); + + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_parser_close(AVCodecParserContext* @s); + + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecParserContext* av_parser_init(int @codec_id); + + /// Iterate over all registered codec parsers. + /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. + /// the next registered codec parser or NULL when the iteration is finished + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecParser* av_parser_iterate(void** @opaque); + + /// Parse a packet. + /// parser context. + /// codec context. + /// set to pointer to parsed buffer or NULL if not yet finished. + /// set to size of parsed buffer or zero if not yet finished. + /// input buffer. + /// buffer size in bytes without the padding. I.e. the full buffer size is assumed to be buf_size + AV_INPUT_BUFFER_PADDING_SIZE. To signal EOF, this should be 0 (so that the last frame can be output). + /// input presentation timestamp. + /// input decoding timestamp. + /// input byte position in stream. + /// the number of bytes of the input bitstream used. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_parser_parse2(AVCodecParserContext* @s, AVCodecContext* @avctx, byte** @poutbuf, int* @poutbuf_size, byte* @buf, int @buf_size, long @pts, long @dts, long @pos); + + /// Returns number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a valid pixel format. + /// number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a valid pixel format. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_pix_fmt_count_planes(AVPixelFormat @pix_fmt); + + /// Returns a pixel format descriptor for provided pixel format or NULL if this pixel format is unknown. + /// a pixel format descriptor for provided pixel format or NULL if this pixel format is unknown. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPixFmtDescriptor* av_pix_fmt_desc_get(AVPixelFormat @pix_fmt); + + /// Returns an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc is not a valid pointer to a pixel format descriptor. + /// an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc is not a valid pointer to a pixel format descriptor. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPixelFormat av_pix_fmt_desc_get_id(AVPixFmtDescriptor* @desc); + + /// Iterate over all pixel format descriptors known to libavutil. + /// previous descriptor. NULL to get the first descriptor. + /// next descriptor or NULL after the last descriptor + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPixFmtDescriptor* av_pix_fmt_desc_next(AVPixFmtDescriptor* @prev); + + /// Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor. + /// the pixel format + /// store log2_chroma_w (horizontal/width shift) + /// store log2_chroma_h (vertical/height shift) + /// 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_pix_fmt_get_chroma_sub_sample(AVPixelFormat @pix_fmt, int* @h_shift, int* @v_shift); + + /// Utility function to swap the endianness of a pixel format. + /// the pixel format + /// pixel format with swapped endianness if it exists, otherwise AV_PIX_FMT_NONE + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPixelFormat av_pix_fmt_swap_endianness(AVPixelFormat @pix_fmt); + + /// Send a nice dump of a packet to the log. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. + /// The importance level of the message, lower values signifying higher importance. + /// packet to dump + /// True if the payload must be displayed, too. + /// AVStream that the packet belongs to + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_pkt_dump_log2(void* @avcl, int @level, AVPacket* @pkt, int @dump_payload, AVStream* @st); + + /// Send a nice dump of a packet to the specified file stream. + /// The file stream pointer where the dump should be sent to. + /// packet to dump + /// True if the payload must be displayed, too. + /// AVStream that the packet belongs to + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_pkt_dump2(_iobuf* @f, AVPacket* @pkt, int @dump_payload, AVStream* @st); + + /// Like av_probe_input_buffer2() but returns 0 on success + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_probe_input_buffer(AVIOContext* @pb, AVInputFormat** @fmt, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url, void* @logctx, uint @offset, uint @max_probe_size); + + /// Probe a bytestream to determine the input format. Each time a probe returns with a score that is too low, the probe buffer size is increased and another attempt is made. When the maximum probe size is reached, the input format with the highest score is returned. + /// the bytestream to probe + /// the input format is put here + /// the url of the stream + /// the log context + /// the offset within the bytestream to probe from + /// the maximum probe buffer size (zero for default) + /// the score in case of success, a negative value corresponding to an the maximal score is AVPROBE_SCORE_MAX AVERROR code otherwise + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_probe_input_buffer2(AVIOContext* @pb, AVInputFormat** @fmt, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url, void* @logctx, uint @offset, uint @max_probe_size); + + /// Guess the file format. + /// data to be probed + /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVInputFormat* av_probe_input_format(AVProbeData* @pd, int @is_opened); + + /// Guess the file format. + /// data to be probed + /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. + /// A probe score larger that this is required to accept a detection, the variable is set to the actual detection score afterwards. If the score is < = AVPROBE_SCORE_MAX / 4 it is recommended to retry with a larger probe buffer. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVInputFormat* av_probe_input_format2(AVProbeData* @pd, int @is_opened, int* @score_max); + + /// Guess the file format. + /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. + /// The score of the best detection. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVInputFormat* av_probe_input_format3(AVProbeData* @pd, int @is_opened, int* @score_ret); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_program_add_stream_index(AVFormatContext* @ac, int @progid, uint @idx); + + /// Convert an AVRational to a IEEE 32-bit `float` expressed in fixed-point format. + /// Rational to be converted + /// Equivalent floating-point value, expressed as an unsigned 32-bit integer. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint av_q2intfloat(AVRational @q); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_read_image_line(ushort* @dst, in byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @read_pal_component); + + /// Read a line from an image, and write the values of the pixel format component c to dst. + /// the array containing the pointers to the planes of the image + /// the array containing the linesizes of the image + /// the pixel format descriptor for the image + /// the horizontal coordinate of the first pixel to read + /// the vertical coordinate of the first pixel to read + /// the width of the line to read, that is the number of values to write to dst + /// if not zero and the format is a paletted format writes the values corresponding to the palette component c in data[1] to dst, rather than the palette indexes in data[0]. The behavior is undefined if the format is not paletted. + /// size of elements in dst array (2 or 4 byte) + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_read_image_line2(void* @dst, in byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @read_pal_component, int @dst_element_size); + + /// Pause a network-based stream (e.g. RTSP stream). + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_read_pause(AVFormatContext* @s); + + /// Start playing a network-based stream (e.g. RTSP stream) at the current position. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_read_play(AVFormatContext* @s); + + /// Allocate, reallocate, or free a block of memory. + /// Pointer to a memory block already allocated with av_realloc() or `NULL` + /// Size in bytes of the memory block to be allocated or reallocated + /// Pointer to a newly-reallocated block or `NULL` if the block cannot be reallocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_realloc(void* @ptr, ulong @size); + + /// Allocate, reallocate, or free an array. + /// Pointer to a memory block already allocated with av_realloc() or `NULL` + /// Number of elements in the array + /// Size of the single element of the array + /// Pointer to a newly-reallocated block or NULL if the block cannot be reallocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_realloc_array(void* @ptr, ulong @nmemb, ulong @size); + + /// Allocate, reallocate, or free a block of memory. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_realloc_f(void* @ptr, ulong @nelem, ulong @elsize); + + /// Allocate, reallocate, or free a block of memory through a pointer to a pointer. + /// Pointer to a pointer to a memory block already allocated with av_realloc(), or a pointer to `NULL`. The pointer is updated on success, or freed on failure. + /// Size in bytes for the memory block to be allocated or reallocated + /// Zero on success, an AVERROR error code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_reallocp(void* @ptr, ulong @size); + + /// Allocate, reallocate an array through a pointer to a pointer. + /// Pointer to a pointer to a memory block already allocated with av_realloc(), or a pointer to `NULL`. The pointer is updated on success, or freed on failure. + /// Number of elements + /// Size of the single element + /// Zero on success, an AVERROR error code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_reallocp_array(void* @ptr, ulong @nmemb, ulong @size); + + /// Reduce a fraction. + /// Destination numerator + /// Destination denominator + /// Source numerator + /// Source denominator + /// Maximum allowed values for `dst_num` & `dst_den` + /// 1 if the operation is exact, 0 otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_reduce(int* @dst_num, int* @dst_den, long @num, long @den, long @max); + + /// Rescale a 64-bit integer with rounding to nearest. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_rescale(long @a, long @b, long @c); + + /// Rescale a timestamp while preserving known durations. + /// Input time base + /// Input timestamp + /// Duration time base; typically this is finer-grained (greater) than `in_tb` and `out_tb` + /// Duration till the next call to this function (i.e. duration of the current packet/frame) + /// Pointer to a timestamp expressed in terms of `fs_tb`, acting as a state variable + /// Output timebase + /// Timestamp expressed in terms of `out_tb` + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_rescale_delta(AVRational @in_tb, long @in_ts, AVRational @fs_tb, int @duration, long* @last, AVRational @out_tb); + + /// Rescale a 64-bit integer by 2 rational numbers. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_rescale_q(long @a, AVRational @bq, AVRational @cq); + + /// Rescale a 64-bit integer by 2 rational numbers with specified rounding. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_rescale_q_rnd(long @a, AVRational @bq, AVRational @cq, AVRounding @rnd); + + /// Rescale a 64-bit integer with specified rounding. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long av_rescale_rnd(long @a, long @b, long @c, AVRounding @rnd); + + /// Check if the sample format is planar. + /// the sample format to inspect + /// 1 if the sample format is planar, 0 if it is interleaved + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_sample_fmt_is_planar(AVSampleFormat @sample_fmt); + + /// Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly. The allocated samples buffer can be freed by using av_freep(&audio_data[0]) Allocated data will be initialized to silence. + /// array to be filled with the pointer for each channel + /// aligned size for audio buffer(s), may be NULL + /// number of audio channels + /// number of samples per channel + /// the sample format + /// buffer size alignment (0 = default, 1 = no alignment) + /// >=0 on success or a negative error code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_samples_alloc(byte** @audio_data, int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align); + + /// Allocate a data pointers array, samples buffer for nb_samples samples, and fill data pointers and linesize accordingly. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_samples_alloc_array_and_samples(byte*** @audio_data, int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align); + + /// Copy samples from src to dst. + /// destination array of pointers to data planes + /// source array of pointers to data planes + /// offset in samples at which the data will be written to dst + /// offset in samples at which the data will be read from src + /// number of samples to be copied + /// number of audio channels + /// audio sample format + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_samples_copy(byte** @dst, byte** @src, int @dst_offset, int @src_offset, int @nb_samples, int @nb_channels, AVSampleFormat @sample_fmt); + + /// Fill plane data pointers and linesize for samples with sample format sample_fmt. + /// array to be filled with the pointer for each channel + /// calculated linesize, may be NULL + /// the pointer to a buffer containing the samples + /// the number of channels + /// the number of samples in a single channel + /// the sample format + /// buffer size alignment (0 = default, 1 = no alignment) + /// minimum size in bytes required for the buffer on success, or a negative error code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_samples_fill_arrays(byte** @audio_data, int* @linesize, byte* @buf, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align); + + /// Get the required buffer size for the given audio parameters. + /// calculated linesize, may be NULL + /// the number of channels + /// the number of samples in a single channel + /// the sample format + /// buffer size alignment (0 = default, 1 = no alignment) + /// required buffer size, or negative error code on failure + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_samples_get_buffer_size(int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align); + + /// Fill an audio buffer with silence. + /// array of pointers to data planes + /// offset in samples at which to start filling + /// number of samples to fill + /// number of audio channels + /// audio sample format + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_samples_set_silence(byte** @audio_data, int @offset, int @nb_samples, int @nb_channels, AVSampleFormat @sample_fmt); + + /// Generate an SDP for an RTP session. + /// array of AVFormatContexts describing the RTP streams. If the array is composed by only one context, such context can contain multiple AVStreams (one AVStream per RTP stream). Otherwise, all the contexts in the array (an AVCodecContext per RTP stream) must contain only one AVStream. + /// number of AVCodecContexts contained in ac + /// buffer where the SDP will be stored (must be allocated by the caller) + /// the size of the buffer + /// 0 if OK, AVERROR_xxx on error + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_sdp_create(AVFormatContext** @ac, int @n_files, byte* @buf, int @size); + + /// Seek to the keyframe at timestamp. 'timestamp' in 'stream_index'. + /// media file handle + /// If stream_index is (-1), a default stream is selected, and timestamp is automatically converted from AV_TIME_BASE units to the stream specific time_base. + /// Timestamp in AVStream.time_base units or, if no stream is specified, in AV_TIME_BASE units. + /// flags which select direction and seeking mode + /// >= 0 on success + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_seek_frame(AVFormatContext* @s, int @stream_index, long @timestamp, int @flags); + + /// Parse the key/value pairs list in opts. For each key/value pair found, stores the value in the field in ctx that is named like the key. ctx must be an AVClass context, storing is done using AVOptions. + /// options string to parse, may be NULL + /// a 0-terminated list of characters used to separate key from value + /// a 0-terminated list of characters used to separate two pairs from each other + /// the number of successfully set key/value pairs, or a negative value corresponding to an AVERROR code in case of error: AVERROR(EINVAL) if opts cannot be parsed, the error code issued by av_opt_set() if a key/value pair cannot be set + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_set_options_string(void* @ctx, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @opts, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @key_val_sep, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @pairs_sep); + + /// Reduce packet size, correctly zeroing padding + /// packet + /// new size + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_shrink_packet(AVPacket* @pkt, int @size); + + /// Multiply two `size_t` values checking for overflow. + /// Operand of multiplication + /// Operand of multiplication + /// Pointer to the result of the operation + /// 0 on success, AVERROR(EINVAL) on overflow + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_size_mult(ulong @a, ulong @b, ulong* @r); + + /// Duplicate a string. + /// String to be duplicated + /// Pointer to a newly-allocated string containing a copy of `s` or `NULL` if the string cannot be allocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_strdup( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @s); + + /// Wrap an existing array as stream side data. + /// stream + /// side information type + /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to st. + /// side information size + /// zero on success, a negative AVERROR code on failure. On failure, the stream is unchanged and the data remains owned by the caller. + [Obsolete("use av_packet_side_data_add() with the stream's \"codecpar side data\"")] + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_stream_add_side_data(AVStream* @st, AVPacketSideDataType @type, byte* @data, ulong @size); + + /// Get the AVClass for AVStream. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* av_stream_get_class(); + + /// Get the internal codec timebase from a stream. + /// input stream to extract the timebase from + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_stream_get_codec_timebase(AVStream* @st); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecParserContext* av_stream_get_parser(AVStream* @s); + + /// Get side information from stream. + /// stream + /// desired side information type + /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. + /// pointer to data if present or NULL otherwise + [Obsolete("use av_packet_side_data_get() with the stream's \"codecpar side data\"")] + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_stream_get_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong* @size); + + /// Get the AVClass for AVStreamGroup. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* av_stream_group_get_class(); + + /// Allocate new information from stream. + /// stream + /// desired side information type + /// side information size + /// pointer to fresh allocated data or NULL otherwise + [Obsolete("use av_packet_side_data_new() with the stream's \"codecpar side data\"")] + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_stream_new_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong @size); + + /// Put a description of the AVERROR code errnum in errbuf. In case of failure the global variable errno is set to indicate the error. Even in case of failure av_strerror() will print a generic error message indicating the errnum provided to errbuf. + /// error code to describe + /// buffer to which description is written + /// the size in bytes of errbuf + /// 0 on success, a negative value if a description for errnum cannot be found + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_strerror(int @errnum, byte* @errbuf, ulong @errbuf_size); + + /// Duplicate a substring of a string. + /// String to be duplicated + /// Maximum length of the resulting string (not counting the terminating byte) + /// Pointer to a newly-allocated string containing a substring of `s` or `NULL` if the string cannot be allocated + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_strndup( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @s, ulong @len); + + /// Subtract one rational from another. + /// First rational + /// Second rational + /// b-c + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVRational av_sub_q(AVRational @b, AVRational @c); + + /// Adjust frame number for NTSC drop frame time code. + /// frame number to adjust + /// frame per second, multiples of 30 + /// adjusted frame number + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_timecode_adjust_ntsc_framenum2(int @framenum, int @fps); + + /// Check if the timecode feature is available for the given frame rate + /// 0 if supported, < 0 otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_timecode_check_frame_rate(AVRational @rate); + + /// Convert sei info to SMPTE 12M binary representation. + /// frame rate in rational form + /// drop flag + /// hour + /// minute + /// second + /// frame number + /// the SMPTE binary representation + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint av_timecode_get_smpte(AVRational @rate, int @drop, int @hh, int @mm, int @ss, int @ff); + + /// Convert frame number to SMPTE 12M binary representation. + /// timecode data correctly initialized + /// frame number + /// the SMPTE binary representation + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint av_timecode_get_smpte_from_framenum(AVTimecode* @tc, int @framenum); + + /// Init a timecode struct with the passed parameters. + /// pointer to an allocated AVTimecode + /// frame rate in rational form + /// miscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag) + /// the first frame number + /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) + /// 0 on success, AVERROR otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_timecode_init(AVTimecode* @tc, AVRational @rate, int @flags, int @frame_start, void* @log_ctx); + + /// Init a timecode struct from the passed timecode components. + /// pointer to an allocated AVTimecode + /// frame rate in rational form + /// miscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag) + /// hours + /// minutes + /// seconds + /// frames + /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) + /// 0 on success, AVERROR otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_timecode_init_from_components(AVTimecode* @tc, AVRational @rate, int @flags, int @hh, int @mm, int @ss, int @ff, void* @log_ctx); + + /// Parse timecode representation (hh:mm:ss[:;.]ff). + /// pointer to an allocated AVTimecode + /// frame rate in rational form + /// timecode string which will determine the frame start + /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log). + /// 0 on success, AVERROR otherwise + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_timecode_init_from_string(AVTimecode* @tc, AVRational @rate, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @str, void* @log_ctx); + + /// Get the timecode string from the 25-bit timecode format (MPEG GOP format). + /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long + /// the 25-bits timecode + /// the buf parameter + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_timecode_make_mpeg_tc_string(byte* @buf, uint @tc25bit); + + /// Get the timecode string from the SMPTE timecode format. + /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long + /// the 32-bit SMPTE timecode + /// prevent the use of a drop flag when it is known the DF bit is arbitrary + /// the buf parameter + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_timecode_make_smpte_tc_string(byte* @buf, uint @tcsmpte, int @prevent_df); + + /// Get the timecode string from the SMPTE timecode format. + /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long + /// frame rate of the timecode + /// the 32-bit SMPTE timecode + /// prevent the use of a drop flag when it is known the DF bit is arbitrary + /// prevent the use of a field flag when it is known the field bit is arbitrary (e.g. because it is used as PC flag) + /// the buf parameter + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_timecode_make_smpte_tc_string2(byte* @buf, AVRational @rate, uint @tcsmpte, int @prevent_df, int @skip_field); + + /// Load timecode string in buf. + /// timecode data correctly initialized + /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long + /// frame number + /// the buf parameter + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern byte* av_timecode_make_string(AVTimecode* @tc, byte* @buf, int @framenum); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_tree_destroy(AVTreeNode* @t); + + /// Apply enu(opaque, &elem) to all the elements in the tree in a given range. + /// a comparison function that returns < 0 for an element below the range, > 0 for an element above the range and == 0 for an element inside the range + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_tree_enumerate(AVTreeNode* @t, void* @opaque, av_tree_enumerate_cmp_func @cmp, av_tree_enumerate_enu_func @enu); + + /// Find an element. + /// a pointer to the root node of the tree + /// compare function used to compare elements in the tree, API identical to that of Standard C's qsort It is guaranteed that the first and only the first argument to cmp() will be the key parameter to av_tree_find(), thus it could if the user wants, be a different type (like an opaque context). + /// If next is not NULL, then next[0] will contain the previous element and next[1] the next element. If either does not exist, then the corresponding entry in next is unchanged. + /// An element with cmp(key, elem) == 0 or NULL if no such element exists in the tree. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_tree_find(AVTreeNode* @root, void* @key, av_tree_find_cmp_func @cmp, ref void_ptr2 @next); + + /// Insert or remove an element. + /// A pointer to a pointer to the root node of the tree; note that the root node can change during insertions, this is required to keep the tree balanced. + /// pointer to the element key to insert in the tree + /// compare function used to compare elements in the tree, API identical to that of Standard C's qsort + /// Used to allocate and free AVTreeNodes. For insertion the user must set it to an allocated and zeroed object of at least av_tree_node_size bytes size. av_tree_insert() will set it to NULL if it has been consumed. For deleting elements *next is set to NULL by the user and av_tree_insert() will set it to the AVTreeNode which was used for the removed element. This allows the use of flat arrays, which have lower overhead compared to many malloced elements. You might want to define a function like: + /// If no insertion happened, the found element; if an insertion or removal happened, then either key or NULL will be returned. Which one it is depends on the tree state and the implementation. You should make no assumptions that it's one or the other in the code. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void* av_tree_insert(AVTreeNode** @rootp, void* @key, av_tree_insert_cmp_func @cmp, AVTreeNode** @next); + + /// Allocate an AVTreeNode. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVTreeNode* av_tree_node_alloc(); + + /// Split a URL string into components. + /// the buffer for the protocol + /// the size of the proto buffer + /// the buffer for the authorization + /// the size of the authorization buffer + /// the buffer for the host name + /// the size of the hostname buffer + /// a pointer to store the port number in + /// the buffer for the path + /// the size of the path buffer + /// the URL to split + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_url_split(byte* @proto, int @proto_size, byte* @authorization, int @authorization_size, byte* @hostname, int @hostname_size, int* @port_ptr, byte* @path, int @path_size, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url); + + /// Sleep for a period of time. Although the duration is expressed in microseconds, the actual delay may be rounded to the precision of the system timer. + /// Number of microseconds to sleep. + /// zero on success or (negative) error code. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_usleep(uint @usec); + + /// Return an informative version string. This usually is the actual release version number or a git commit description. This string has no fixed format and can change any time. It should never be parsed by code. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string av_version_info(); + + /// Send the specified message to the log if the level is less than or equal to the current av_log_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. + /// The importance level of the message expressed using a "Logging Constant". + /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. + /// The arguments referenced by the format string. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_vlog(void* @avcl, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @fmt, byte* @vl); + + /// Write a packet to an output media file. + /// media file handle + /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. + /// < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_write_frame(AVFormatContext* @s, AVPacket* @pkt); + + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_write_image_line(ushort* @src, ref byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w); + + /// Write the values from src to the pixel format component c of an image line. + /// array containing the values to write + /// the array containing the pointers to the planes of the image to write into. It is supposed to be zeroed. + /// the array containing the linesizes of the image + /// the pixel format descriptor for the image + /// the horizontal coordinate of the first pixel to write + /// the vertical coordinate of the first pixel to write + /// the width of the line to write, that is the number of values to write to the image line + /// size of elements in src array (2 or 4 byte) + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void av_write_image_line2(void* @src, ref byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @src_element_size); + + /// Write the stream trailer to an output media file and free the file private data. + /// media file handle + /// 0 if OK, AVERROR_xxx on error + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_write_trailer(AVFormatContext* @s); + + /// Write an uncoded frame to an output media file. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + 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 + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int av_write_uncoded_frame_query(AVFormatContext* @s, int @stream_index); + + /// Encode extradata length to a buffer. Used by xiph codecs. + /// buffer to write to; must be at least (v/255+1) bytes long + /// size of extradata in bytes + /// number of bytes written to the buffer. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint av_xiphlacing(byte* @s, uint @v); + + /// Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you do not use any horizontal padding. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avcodec_align_dimensions(AVCodecContext* @s, int* @width, int* @height); + + /// Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you also ensure that all line sizes are a multiple of the respective linesize_align[i]. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avcodec_align_dimensions2(AVCodecContext* @s, int* @width, int* @height, ref int8 @linesize_align); + + /// Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext itself). + [Obsolete("Do not use this function. Use avcodec_free_context() to destroy a codec context (either open or closed). Opening and closing a codec context multiple times is not supported anymore -- use multiple codec contexts instead.")] + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_close(AVCodecContext* @avctx); + + /// Return the libavcodec build-time configuration. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avcodec_configuration(); + + /// Decode a subtitle message. Return a negative value on error, otherwise return the number of bytes used. If no subtitle could be decompressed, got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for simplicity, because the performance difference is expected to be negligible and reusing a get_buffer written for video codecs would probably perform badly due to a potentially very different allocation pattern. + /// the codec context + /// The preallocated AVSubtitle in which the decoded subtitle will be stored, must be freed with avsubtitle_free if *got_sub_ptr is set. + /// Zero if no subtitle could be decompressed, otherwise, it is nonzero. + /// The input AVPacket containing the input buffer. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_decode_subtitle2(AVCodecContext* @avctx, AVSubtitle* @sub, int* @got_sub_ptr, AVPacket* @avpkt); + + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_default_execute(AVCodecContext* @c, avcodec_default_execute_func_func @func, void* @arg, int* @ret, int @count, int @size); + + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_default_execute2(AVCodecContext* @c, avcodec_default_execute2_func_func @func, void* @arg, int* @ret, int @count); + + /// The default callback for AVCodecContext.get_buffer2(). It is made public so it can be called by custom get_buffer2() implementations for decoders without AV_CODEC_CAP_DR1 set. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_default_get_buffer2(AVCodecContext* @s, AVFrame* @frame, int @flags); + + /// The default callback for AVCodecContext.get_encode_buffer(). It is made public so it can be called by custom get_encode_buffer() implementations for encoders without AV_CODEC_CAP_DR1 set. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_default_get_encode_buffer(AVCodecContext* @s, AVPacket* @pkt, int @flags); + + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPixelFormat avcodec_default_get_format(AVCodecContext* @s, AVPixelFormat* @fmt); + + /// Returns descriptor for given codec ID or NULL if no descriptor exists. + /// descriptor for given codec ID or NULL if no descriptor exists. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecDescriptor* avcodec_descriptor_get(AVCodecID @id); + + /// Returns codec descriptor with the given name or NULL if no such descriptor exists. + /// codec descriptor with the given name or NULL if no such descriptor exists. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecDescriptor* avcodec_descriptor_get_by_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Iterate over all codec descriptors known to libavcodec. + /// previous descriptor. NULL to get the first descriptor. + /// next descriptor or NULL after the last descriptor + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecDescriptor* avcodec_descriptor_next(AVCodecDescriptor* @prev); + + /// @{ + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_encode_subtitle(AVCodecContext* @avctx, byte* @buf, int @buf_size, AVSubtitle* @sub); + + /// Fill AVFrame audio data and linesize pointers. + /// the AVFrame frame->nb_samples must be set prior to calling the function. This function fills in frame->data, frame->extended_data, frame->linesize[0]. + /// channel count + /// sample format + /// buffer to use for frame data + /// size of buffer + /// plane size sample alignment (0 = default) + /// >=0 on success, negative error code on failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_fill_audio_frame(AVFrame* @frame, int @nb_channels, AVSampleFormat @sample_fmt, byte* @buf, int @buf_size, int @align); + + /// Find the best pixel format to convert to given a certain source pixel format. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of the given pixel formats should be used to suffer the least amount of loss. The pixel formats from which it chooses one, are determined by the pix_fmt_list parameter. + /// AV_PIX_FMT_NONE terminated array of pixel formats to choose from + /// source pixel format + /// Whether the source pixel format alpha channel is used. + /// Combination of flags informing you what kind of losses will occur. + /// The best pixel format to convert to or -1 if none was found. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVPixelFormat avcodec_find_best_pix_fmt_of_list(AVPixelFormat* @pix_fmt_list, AVPixelFormat @src_pix_fmt, int @has_alpha, int* @loss_ptr); + + /// Find a registered decoder with a matching codec ID. + /// AVCodecID of the requested decoder + /// A decoder if one was found, NULL otherwise. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodec* avcodec_find_decoder(AVCodecID @id); + + /// Find a registered decoder with the specified name. + /// name of the requested decoder + /// A decoder if one was found, NULL otherwise. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodec* avcodec_find_decoder_by_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Find a registered encoder with a matching codec ID. + /// AVCodecID of the requested encoder + /// An encoder if one was found, NULL otherwise. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodec* avcodec_find_encoder(AVCodecID @id); + + /// Find a registered encoder with the specified name. + /// name of the requested encoder + /// An encoder if one was found, NULL otherwise. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodec* avcodec_find_encoder_by_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Get the AVClass for AVCodecContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* avcodec_get_class(); + + /// Retrieve supported hardware configurations for a codec. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecHWConfig* avcodec_get_hw_config(AVCodec* @codec, int @index); + + /// Create and return a AVHWFramesContext with values adequate for hardware decoding. This is meant to get called from the get_format callback, and is a helper for preparing a AVHWFramesContext for AVCodecContext.hw_frames_ctx. This API is for decoding with certain hardware acceleration modes/APIs only. + /// The context which is currently calling get_format, and which implicitly contains all state needed for filling the returned AVHWFramesContext properly. + /// A reference to the AVHWDeviceContext describing the device which will be used by the hardware decoder. + /// The hwaccel format you are going to return from get_format. + /// On success, set to a reference to an _uninitialized_ AVHWFramesContext, created from the given device_ref. Fields will be set to values required for decoding. Not changed if an error is returned. + /// zero on success, a negative value on error. The following error codes have special semantics: AVERROR(ENOENT): the decoder does not support this functionality. Setup is always manual, or it is a decoder which does not support setting AVCodecContext.hw_frames_ctx at all, or it is a software format. AVERROR(EINVAL): it is known that hardware decoding is not supported for this configuration, or the device_ref is not supported for the hwaccel referenced by hw_pix_fmt. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_get_hw_frames_parameters(AVCodecContext* @avctx, AVBufferRef* @device_ref, AVPixelFormat @hw_pix_fmt, AVBufferRef** @out_frames_ref); + + /// Get the AVClass for AVSubtitleRect. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* avcodec_get_subtitle_rect_class(); + + /// Get the type of the given codec. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVMediaType avcodec_get_type(AVCodecID @codec_id); + + /// Returns a positive value if s is open (i.e. avcodec_open2() was called on it with no corresponding avcodec_close()), 0 otherwise. + /// a positive value if s is open (i.e. avcodec_open2() was called on it with no corresponding avcodec_close()), 0 otherwise. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_is_open(AVCodecContext* @s); + + /// Return the libavcodec license. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avcodec_license(); + + /// Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0). The returned struct must be freed with avcodec_parameters_free(). + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecParameters* avcodec_parameters_alloc(); + + /// Copy the contents of src to dst. Any allocated fields in dst are freed and replaced with newly allocated duplicates of the corresponding fields in src. + /// >= 0 on success, a negative AVERROR code on failure. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_parameters_copy(AVCodecParameters* @dst, AVCodecParameters* @src); + + /// Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied pointer. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avcodec_parameters_free(AVCodecParameters** @par); + + /// Fill the parameters struct based on the values from the supplied codec context. Any allocated fields in par are freed and replaced with duplicates of the corresponding fields in codec. + /// >= 0 on success, a negative AVERROR code on failure + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_parameters_from_context(AVCodecParameters* @par, AVCodecContext* @codec); + + /// Fill the codec context based on the values from the supplied codec parameters. Any allocated fields in codec that have a corresponding field in par are freed and replaced with duplicates of the corresponding field in par. Fields in codec that do not have a counterpart in par are not touched. + /// >= 0 on success, a negative AVERROR code on failure. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_parameters_to_context(AVCodecContext* @codec, AVCodecParameters* @par); + + /// Return a value representing the fourCC code associated to the pixel format pix_fmt, or 0 if no associated fourCC code can be found. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avcodec_pix_fmt_to_codec_tag(AVPixelFormat @pix_fmt); + + /// Return a name for the specified profile, if available. + /// the ID of the codec to which the requested profile belongs + /// the profile value for which a name is requested + /// A name for the profile if found, NULL otherwise. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avcodec_profile_name(AVCodecID @codec_id, int @profile); + + /// Read encoded data from the encoder. + /// codec context + /// This will be set to a reference-counted packet allocated by the encoder. Note that the function will always call av_packet_unref(avpkt) before doing anything else. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_receive_packet(AVCodecContext* @avctx, AVPacket* @avpkt); + + /// Supply a raw video or audio frame to the encoder. Use avcodec_receive_packet() to retrieve buffered output packets. + /// codec context + /// AVFrame containing the raw audio or video frame to be encoded. Ownership of the frame remains with the caller, and the encoder will not write to the frame. The encoder may create a reference to the frame data (or copy it if the frame is not reference-counted). It can be NULL, in which case it is considered a flush packet. This signals the end of the stream. If the encoder still has packets buffered, it will return them after this call. Once flushing mode has been entered, additional flush packets are ignored, and sending frames will return AVERROR_EOF. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avcodec_send_frame(AVCodecContext* @avctx, AVFrame* @frame); + + /// @} + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avcodec_string(byte* @buf, int @buf_size, AVCodecContext* @enc, int @encode); + + /// Return the LIBAVCODEC_VERSION_INT constant. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avcodec_version(); + + // /// Send control message from application to device. + // /// device context. + // /// message type. + // /// message data. Exact type depends on message type. + // /// size of message data. + // /// >= 0 on success, negative on error. AVERROR(ENOSYS) when device doesn't implement handler of the message. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avdevice_app_to_dev_control_message(AVFormatContext* @s, AVAppToDevMessageType @type, void* @data, ulong @data_size); + + // /// Return the libavdevice build-time configuration. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string avdevice_configuration(); + + // /// Send control message from device to application. + // /// device context. + // /// message type. + // /// message data. Can be NULL. + // /// size of message data. + // /// >= 0 on success, negative on error. AVERROR(ENOSYS) when application doesn't implement handler of the message. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avdevice_dev_to_app_control_message(AVFormatContext* @s, AVDevToAppMessageType @type, void* @data, ulong @data_size); + + // /// Convenient function to free result of avdevice_list_devices(). + // /// device list to be freed. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern void avdevice_free_list_devices(AVDeviceInfoList** @device_list); + + // /// Return the libavdevice license. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string avdevice_license(); + + // /// List devices. + // /// device context. + // /// list of autodetected devices. + // /// count of autodetected devices, negative on error. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avdevice_list_devices(AVFormatContext* @s, AVDeviceInfoList** @device_list); + + // /// List devices. + // /// device format. May be NULL if device name is set. + // /// device name. May be NULL if device format is set. + // /// An AVDictionary filled with device-private options. May be NULL. The same options must be passed later to avformat_write_header() for output devices or avformat_open_input() for input devices, or at any other place that affects device-private options. + // /// list of autodetected devices + // /// count of autodetected devices, negative on error. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avdevice_list_input_sources(AVInputFormat* @device, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @device_name, AVDictionary* @device_options, AVDeviceInfoList** @device_list); + + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avdevice_list_output_sinks(AVOutputFormat* @device, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @device_name, AVDictionary* @device_options, AVDeviceInfoList** @device_list); + + // /// Initialize libavdevice and register all the input and output devices. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern void avdevice_register_all(); + + // /// Return the LIBAVDEVICE_VERSION_INT constant. + // [DllImport("avdevice-61", CallingConvention = CallingConvention.Cdecl)] + // public static extern uint avdevice_version(); + + // [Obsolete("this function should never be called by users")] + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_config_links(AVFilterContext* @filter); + + // /// Return the libavfilter build-time configuration. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string avfilter_configuration(); + + // /// Get the number of elements in an AVFilter's inputs or outputs array. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern uint avfilter_filter_pad_count(AVFilter* @filter, int @is_output); + + // /// Free a filter context. This will also remove the filter from its filtergraph's list of filters. + // /// the filter to free + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern void avfilter_free(AVFilterContext* @filter); + + // /// Get a filter definition matching the given name. + // /// the filter name to find + // /// the filter definition, if any matching one is registered. NULL if none found. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVFilter* avfilter_get_by_name( + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @name); + + // /// Returns AVClass for AVFilterContext. + // /// AVClass for AVFilterContext. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVClass* avfilter_get_class(); + + // /// Allocate a filter graph. + // /// the allocated filter graph on success or NULL. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVFilterGraph* avfilter_graph_alloc(); + + // /// Create a new filter instance in a filter graph. + // /// graph in which the new filter will be used + // /// the filter to create an instance of + // /// Name to give to the new instance (will be copied to AVFilterContext.name). This may be used by the caller to identify different filters, libavfilter itself assigns no semantics to this parameter. May be NULL. + // /// the context of the newly created filter instance (note that it is also retrievable directly through AVFilterGraph.filters or with avfilter_graph_get_filter()) on success or NULL on failure. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVFilterContext* avfilter_graph_alloc_filter(AVFilterGraph* @graph, AVFilter* @filter, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @name); + + // /// Check validity and configure all the links and formats in the graph. + // /// the filter graph + // /// context used for logging + // /// >= 0 in case of success, a negative AVERROR code otherwise + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_config(AVFilterGraph* @graphctx, void* @log_ctx); + + // /// Create and add a filter instance into an existing graph. The filter instance is created from the filter filt and inited with the parameter args. opaque is currently ignored. + // /// the instance name to give to the created filter instance + // /// the filter graph + // /// a negative AVERROR error code in case of failure, a non negative value otherwise + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_create_filter(AVFilterContext** @filt_ctx, AVFilter* @filt, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @name, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @args, void* @opaque, AVFilterGraph* @graph_ctx); + + // /// Dump a graph into a human-readable string representation. + // /// the graph to dump + // /// formatting options; currently ignored + // /// a string, or NULL in case of memory allocation failure; the string must be freed using av_free + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern byte* avfilter_graph_dump(AVFilterGraph* @graph, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @options); + + // /// Free a graph, destroy its links, and set *graph to NULL. If *graph is NULL, do nothing. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern void avfilter_graph_free(AVFilterGraph** @graph); + + // /// Get a filter instance identified by instance name from graph. + // /// filter graph to search through. + // /// filter instance name (should be unique in the graph). + // /// the pointer to the found filter instance or NULL if it cannot be found. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVFilterContext* avfilter_graph_get_filter(AVFilterGraph* @graph, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @name); + + // /// Add a graph described by a string to a graph. + // /// the filter graph where to link the parsed graph context + // /// string to be parsed + // /// linked list to the inputs of the graph + // /// linked list to the outputs of the graph + // /// zero on success, a negative AVERROR code on error + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_parse(AVFilterGraph* @graph, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @filters, AVFilterInOut* @inputs, AVFilterInOut* @outputs, void* @log_ctx); + + // /// Add a graph described by a string to a graph. + // /// the filter graph where to link the parsed graph context + // /// string to be parsed + // /// pointer to a linked list to the inputs of the graph, may be NULL. If non-NULL, *inputs is updated to contain the list of open inputs after the parsing, should be freed with avfilter_inout_free(). + // /// pointer to a linked list to the outputs of the graph, may be NULL. If non-NULL, *outputs is updated to contain the list of open outputs after the parsing, should be freed with avfilter_inout_free(). + // /// non negative on success, a negative AVERROR code on error + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_parse_ptr(AVFilterGraph* @graph, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @filters, AVFilterInOut** @inputs, AVFilterInOut** @outputs, void* @log_ctx); + + // /// Add a graph described by a string to a graph. + // /// the filter graph where to link the parsed graph context + // /// string to be parsed + // /// a linked list of all free (unlinked) inputs of the parsed graph will be returned here. It is to be freed by the caller using avfilter_inout_free(). + // /// a linked list of all free (unlinked) outputs of the parsed graph will be returned here. It is to be freed by the caller using avfilter_inout_free(). + // /// zero on success, a negative AVERROR code on error + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_parse2(AVFilterGraph* @graph, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @filters, AVFilterInOut** @inputs, AVFilterInOut** @outputs); + + // /// Queue a command for one or more filter instances. + // /// the filter graph + // /// the filter(s) to which the command should be sent "all" sends to all filters otherwise it can be a filter or filter instance name which will send the command to all matching filters. + // /// the command to sent, for handling simplicity all commands must be alphanumeric only + // /// the argument for the command + // /// time at which the command should be sent to the filter + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_queue_command(AVFilterGraph* @graph, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @target, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @cmd, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @arg, int @flags, double @ts); + + // /// Request a frame on the oldest sink link. + // /// the return value of ff_request_frame(), or AVERROR_EOF if all links returned AVERROR_EOF + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_request_oldest(AVFilterGraph* @graph); + + // /// Apply all filter/link descriptions from a graph segment to the associated filtergraph. + // /// the filtergraph segment to process + // /// reserved for future use, caller must set to 0 for now + // /// passed to avfilter_graph_segment_link() + // /// passed to avfilter_graph_segment_link() + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_segment_apply(AVFilterGraphSegment* @seg, int @flags, AVFilterInOut** @inputs, AVFilterInOut** @outputs); + + // /// Apply parsed options to filter instances in a graph segment. + // /// the filtergraph segment to process + // /// reserved for future use, caller must set to 0 for now + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_segment_apply_opts(AVFilterGraphSegment* @seg, int @flags); + + // /// Create filters specified in a graph segment. + // /// the filtergraph segment to process + // /// reserved for future use, caller must set to 0 for now + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_segment_create_filters(AVFilterGraphSegment* @seg, int @flags); + + // /// Free the provided AVFilterGraphSegment and everything associated with it. + // /// double pointer to the AVFilterGraphSegment to be freed. NULL will be written to this pointer on exit from this function. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern void avfilter_graph_segment_free(AVFilterGraphSegment** @seg); + + // /// Initialize all filter instances in a graph segment. + // /// the filtergraph segment to process + // /// reserved for future use, caller must set to 0 for now + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_segment_init(AVFilterGraphSegment* @seg, int @flags); + + // /// Link filters in a graph segment. + // /// the filtergraph segment to process + // /// reserved for future use, caller must set to 0 for now + // /// a linked list of all free (unlinked) inputs of the filters in this graph segment will be returned here. It is to be freed by the caller using avfilter_inout_free(). + // /// a linked list of all free (unlinked) outputs of the filters in this graph segment will be returned here. It is to be freed by the caller using avfilter_inout_free(). + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_segment_link(AVFilterGraphSegment* @seg, int @flags, AVFilterInOut** @inputs, AVFilterInOut** @outputs); + + // /// Parse a textual filtergraph description into an intermediate form. + // /// Filter graph the parsed segment is associated with. Will only be used for logging and similar auxiliary purposes. The graph will not be actually modified by this function - the parsing results are instead stored in seg for further processing. + // /// a string describing the filtergraph segment + // /// reserved for future use, caller must set to 0 for now + // /// A pointer to the newly-created AVFilterGraphSegment is written here on success. The graph segment is owned by the caller and must be freed with avfilter_graph_segment_free() before graph itself is freed. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_segment_parse(AVFilterGraph* @graph, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @graph_str, int @flags, AVFilterGraphSegment** @seg); + + // /// Send a command to one or more filter instances. + // /// the filter graph + // /// the filter(s) to which the command should be sent "all" sends to all filters otherwise it can be a filter or filter instance name which will send the command to all matching filters. + // /// the command to send, for handling simplicity all commands must be alphanumeric only + // /// the argument for the command + // /// a buffer with size res_size where the filter(s) can return a response. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_graph_send_command(AVFilterGraph* @graph, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @target, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @cmd, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @arg, byte* @res, int @res_len, int @flags); + + // /// Enable or disable automatic format conversion inside the graph. + // /// any of the AVFILTER_AUTO_CONVERT_* constants + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern void avfilter_graph_set_auto_convert(AVFilterGraph* @graph, uint @flags); + + // /// Initialize a filter with the supplied dictionary of options. + // /// uninitialized filter context to initialize + // /// An AVDictionary filled with options for this filter. On return this parameter will be destroyed and replaced with a dict containing options that were not found. This dictionary must be freed by the caller. May be NULL, then this function is equivalent to avfilter_init_str() with the second parameter set to NULL. + // /// 0 on success, a negative AVERROR on failure + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_init_dict(AVFilterContext* @ctx, AVDictionary** @options); + + // /// Initialize a filter with the supplied parameters. + // /// uninitialized filter context to initialize + // /// Options to initialize the filter with. This must be a ':'-separated list of options in the 'key=value' form. May be NULL if the options have been set directly using the AVOptions API or there are no options that need to be set. + // /// 0 on success, a negative AVERROR on failure + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_init_str(AVFilterContext* @ctx, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @args); + + // /// Allocate a single AVFilterInOut entry. Must be freed with avfilter_inout_free(). + // /// allocated AVFilterInOut on success, NULL on failure. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVFilterInOut* avfilter_inout_alloc(); + + // /// Free the supplied list of AVFilterInOut and set *inout to NULL. If *inout is NULL, do nothing. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern void avfilter_inout_free(AVFilterInOut** @inout); + + // /// Insert a filter in the middle of an existing link. + // /// the link into which the filter should be inserted + // /// the filter to be inserted + // /// the input pad on the filter to connect + // /// the output pad on the filter to connect + // /// zero on success + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_insert_filter(AVFilterLink* @link, AVFilterContext* @filt, uint @filt_srcpad_idx, uint @filt_dstpad_idx); + + // /// Return the libavfilter license. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string avfilter_license(); + + // /// Link two filters together. + // /// the source filter + // /// index of the output pad on the source filter + // /// the destination filter + // /// index of the input pad on the destination filter + // /// zero on success + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_link(AVFilterContext* @src, uint @srcpad, AVFilterContext* @dst, uint @dstpad); + + // [Obsolete("this function should never be called by users")] + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern void avfilter_link_free(AVFilterLink** @link); + + // /// Get the name of an AVFilterPad. + // /// an array of AVFilterPads + // /// index of the pad in the array; it is the caller's responsibility to ensure the index is valid + // /// name of the pad_idx'th pad in pads + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string avfilter_pad_get_name(AVFilterPad* @pads, int @pad_idx); + + // /// Get the type of an AVFilterPad. + // /// an array of AVFilterPads + // /// index of the pad in the array; it is the caller's responsibility to ensure the index is valid + // /// type of the pad_idx'th pad in pads + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVMediaType avfilter_pad_get_type(AVFilterPad* @pads, int @pad_idx); + + // /// Make the filter instance process a command. It is recommended to use avfilter_graph_send_command(). + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern int avfilter_process_command(AVFilterContext* @filter, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @cmd, + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @arg, byte* @res, int @res_len, int @flags); + + // /// Return the LIBAVFILTER_VERSION_INT constant. + // [DllImport("avfilter-10", CallingConvention = CallingConvention.Cdecl)] + // public static extern uint avfilter_version(); + + + /// Allocate an AVFormatContext for an output format. avformat_free_context() can be used to free the context and everything allocated by the framework within it. + /// pointee is set to the created format context, or to NULL in case of failure + /// format to use for allocating the context, if NULL format_name and filename are used instead + /// the name of output format to use for allocating the context, if NULL filename is used instead + /// the name of the filename to use for allocating the context, may be NULL + /// >= 0 in case of success, a negative AVERROR code in case of failure + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_alloc_output_context2(AVFormatContext** @ctx, AVOutputFormat* @oformat, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @format_name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @filename); + + /// Return the libavformat build-time configuration. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avformat_configuration(); + + /// Discard all internally buffered data. This can be useful when dealing with discontinuities in the byte stream. Generally works only with formats that can resync. This includes headerless formats like MPEG-TS/TS but should also work with NUT, Ogg and in a limited way AVI for example. + /// media file handle + /// >=0 on success, error code otherwise + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_flush(AVFormatContext* @s); + + /// Free an AVFormatContext and all its streams. + /// context to free + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avformat_free_context(AVFormatContext* @s); + + /// Get the AVClass for AVFormatContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* avformat_get_class(); + + /// Returns the table mapping MOV FourCCs for audio to AVCodecID. + /// the table mapping MOV FourCCs for audio to AVCodecID. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecTag* avformat_get_mov_audio_tags(); + + /// Returns the table mapping MOV FourCCs for video to libavcodec AVCodecID. + /// the table mapping MOV FourCCs for video to libavcodec AVCodecID. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecTag* avformat_get_mov_video_tags(); + + /// Returns the table mapping RIFF FourCCs for audio to AVCodecID. + /// the table mapping RIFF FourCCs for audio to AVCodecID. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecTag* avformat_get_riff_audio_tags(); + + /// @{ Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the following code: + /// the table mapping RIFF FourCCs for video to libavcodec AVCodecID. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVCodecTag* avformat_get_riff_video_tags(); + + /// Get the index entry count for the given AVStream. + /// stream + /// the number of index entries in the stream + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_index_get_entries_count(AVStream* @st); + + /// Get the AVIndexEntry corresponding to the given index. + /// Stream containing the requested AVIndexEntry. + /// The desired index. + /// A pointer to the requested AVIndexEntry if it exists, NULL otherwise. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVIndexEntry* avformat_index_get_entry(AVStream* @st, int @idx); + + /// Get the AVIndexEntry corresponding to the given timestamp. + /// Stream containing the requested AVIndexEntry. + /// Timestamp to retrieve the index entry for. + /// If AVSEEK_FLAG_BACKWARD then the returned entry will correspond to the timestamp which is < = the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise. + /// A pointer to the requested AVIndexEntry if it exists, NULL otherwise. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVIndexEntry* avformat_index_get_entry_from_timestamp(AVStream* @st, long @wanted_timestamp, int @flags); + + /// Allocate the stream private data and initialize the codec, but do not write the header. May optionally be used before avformat_write_header() to initialize stream parameters before actually writing the header. If using this function, do not pass the same options to avformat_write_header(). + /// Media file handle, must be allocated with avformat_alloc_context(). Its "oformat" field must be set to the desired output format; Its "pb" field must be set to an already opened ::AVIOContext. + /// An ::AVDictionary filled with AVFormatContext and muxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_init_output(AVFormatContext* @s, AVDictionary** @options); + + /// Return the libavformat license. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avformat_license(); + + /// Check if the stream st contained in s is matched by the stream specifier spec. + /// >0 if st is matched by spec; 0 if st is not matched by spec; AVERROR code if spec is invalid + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_match_stream_specifier(AVFormatContext* @s, AVStream* @st, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @spec); + + /// Undo the initialization done by avformat_network_init. Call it only once for each time you called avformat_network_init. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_network_deinit(); + + /// Do global initialization of network libraries. This is optional, and not recommended anymore. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_network_init(); + + /// Add a new stream to a media file. + /// media file handle + /// unused, does nothing + /// newly created stream or NULL on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVStream* avformat_new_stream(AVFormatContext* @s, AVCodec* @c); + + /// Test if the given container can store a codec. + /// container to check for compatibility + /// codec to potentially store in container + /// standards compliance level, one of FF_COMPLIANCE_* + /// 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. A negative number if this information is not available. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_query_codec(AVOutputFormat* @ofmt, AVCodecID @codec_id, int @std_compliance); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_queue_attached_pictures(AVFormatContext* @s); + + /// Add an already allocated stream to a stream group. + /// stream group belonging to a media file. + /// stream in the media file to add to the group. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_stream_group_add_stream(AVStreamGroup* @stg, AVStream* @st); + + /// Add a new empty stream group to a media file. + /// media file handle + /// newly created group or NULL on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVStreamGroup* avformat_stream_group_create(AVFormatContext* @s, AVStreamGroupParamsType @type, AVDictionary** @options); + + /// Returns a string identifying the stream group type, or NULL if unknown + /// a string identifying the stream group type, or NULL if unknown + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avformat_stream_group_name(AVStreamGroupParamsType @type); + + /// Transfer internal timing information from one stream to another. + /// target output format for ost + /// output stream which needs timings copy and adjustments + /// reference input stream to copy timings from + /// define from where the stream codec timebase needs to be imported + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_transfer_internal_stream_timing_info(AVOutputFormat* @ofmt, AVStream* @ost, AVStream* @ist, AVTimebaseSource @copy_tb); + + /// Return the LIBAVFORMAT_VERSION_INT constant. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avformat_version(); + + /// Allocate the stream private data and write the stream header to an output media file. + /// Media file handle, must be allocated with avformat_alloc_context(). Its "oformat" field must be set to the desired output format; Its "pb" field must be set to an already opened ::AVIOContext. + /// An ::AVDictionary filled with AVFormatContext and muxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avformat_write_header(AVFormatContext* @s, AVDictionary** @options); + + /// Accept and allocate a client context on a server context. + /// the server context + /// the client context, must be unallocated + /// >= 0 on success or a negative value corresponding to an AVERROR on failure + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_accept(AVIOContext* @s, AVIOContext** @c); + + /// Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url, or a negative value corresponding to an AVERROR code in case of failure. The returned access flags are masked by the value in flags. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_check( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url, int @flags); + + /// Close the resource accessed by the AVIOContext s and free it. This function can only be used if s was opened by avio_open(). + /// 0 on success, an AVERROR < 0 on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_close(AVIOContext* @s); + + /// Close directory. + /// directory read context. + /// >=0 on success or negative on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_close_dir(AVIODirContext** @s); + + /// Return the written size and a pointer to the buffer. The buffer must be freed with av_free(). Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. + /// IO context + /// pointer to a byte buffer + /// the length of the byte buffer + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_close_dyn_buf(AVIOContext* @s, byte** @pbuffer); + + /// Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL. This function can only be used if s was opened by avio_open(). + /// 0 on success, an AVERROR < 0 on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_closep(AVIOContext** @s); + + /// Iterate through names of available protocols. + /// A private pointer representing current protocol. It must be a pointer to NULL on first iteration and will be updated by successive calls to avio_enum_protocols. + /// If set to 1, iterate over output protocols, otherwise over input protocols. + /// A static string containing the name of current protocol or NULL + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avio_enum_protocols(void** @opaque, int @output); + + /// Similar to feof() but also returns nonzero on read errors. + /// non zero if and only if at end of file or a read error happened when reading. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_feof(AVIOContext* @s); + + /// Return the name of the protocol that will handle the passed URL. + /// Name of the protocol or NULL. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avio_find_protocol_name( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url); + + /// Force flushing of buffered data. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_flush(AVIOContext* @s); + + /// Free entry allocated by avio_read_dir(). + /// entry to be freed. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_free_directory_entry(AVIODirEntry** @entry); + + /// Return the written size and a pointer to the buffer. The AVIOContext stream is left intact. The buffer must NOT be freed. No padding is added to the buffer. + /// IO context + /// pointer to a byte buffer + /// the length of the byte buffer + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_get_dyn_buf(AVIOContext* @s, byte** @pbuffer); + + /// Read a string from pb into buf. The reading will terminate when either a NULL character was encountered, maxlen bytes have been read, or nothing more can be read from pb. The result is guaranteed to be NULL-terminated, it will be truncated if buf is too small. Note that the string is not interpreted or validated in any way, it might get truncated in the middle of a sequence for multi-byte encodings. + /// number of bytes read (is always < = maxlen). If reading ends on EOF or error, the return value will be one more than bytes actually read. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_get_str(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_get_str16be(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen); + + /// Read a UTF-16 string from pb and convert it to UTF-8. The reading will terminate when either a null or invalid character was encountered or maxlen bytes have been read. + /// number of bytes read (is always < = maxlen) + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_get_str16le(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen); + + /// Perform one step of the protocol handshake to accept a new client. This function must be called on a client returned by avio_accept() before using it as a read/write context. It is separate from avio_accept() because it may block. A step of the handshake is defined by places where the application may decide to change the proceedings. For example, on a protocol with a request header and a reply header, each one can constitute a step because the application may use the parameters from the request to change parameters in the reply; or each individual chunk of the request can constitute a step. If the handshake is already finished, avio_handshake() does nothing and returns 0 immediately. + /// the client context to perform the handshake on + /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_handshake(AVIOContext* @c); + + /// Create and initialize a AVIOContext for accessing the resource indicated by url. + /// Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL. + /// resource to access + /// flags which control how the resource indicated by url is to be opened + /// >= 0 in case of success, a negative value corresponding to an AVERROR code in case of failure + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_open(AVIOContext** @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url, int @flags); + + /// Open directory for reading. + /// directory read context. Pointer to a NULL pointer must be passed. + /// directory to be listed. + /// A dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dictionary containing options that were not found. May be NULL. + /// >=0 on success or negative on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_open_dir(AVIODirContext** @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url, AVDictionary** @options); + + /// Open a write only memory stream. + /// new IO context + /// zero if no error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_open_dyn_buf(AVIOContext** @s); + + /// Create and initialize a AVIOContext for accessing the resource indicated by url. + /// Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL. + /// resource to access + /// flags which control how the resource indicated by url is to be opened + /// an interrupt callback to be used at the protocols level + /// A dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. + /// >= 0 in case of success, a negative value corresponding to an AVERROR code in case of failure + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_open2(AVIOContext** @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @url, int @flags, AVIOInterruptCB* @int_cb, AVDictionary** @options); + + /// Pause and resume playing - only meaningful if using a network streaming protocol (e.g. MMS). + /// IO context from which to call the read_pause function pointer + /// 1 for pause, 0 for resume + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_pause(AVIOContext* @h, int @pause); + + /// Write a NULL terminated array of strings to the context. Usually you don't need to use this function directly but its macro wrapper, avio_print. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_print_string_array(AVIOContext* @s, byte*[] @strings); + + /// Writes a formatted string to the context. + /// number of bytes written, < 0 on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_printf(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @fmt); + + /// Get AVClass by names of available protocols. + /// A AVClass of input protocol name or NULL + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* avio_protocol_get_class( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @name); + + /// Write a NULL-terminated string. + /// number of bytes written. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_put_str(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @str); + + /// Convert an UTF-8 string to UTF-16BE and write it. + /// the AVIOContext + /// NULL-terminated UTF-8 string + /// number of bytes written. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_put_str16be(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @str); + + /// Convert an UTF-8 string to UTF-16LE and write it. + /// the AVIOContext + /// NULL-terminated UTF-8 string + /// number of bytes written. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_put_str16le(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @str); + + /// @{ + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_r8(AVIOContext* @s); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avio_rb16(AVIOContext* @s); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avio_rb24(AVIOContext* @s); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avio_rb32(AVIOContext* @s); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong avio_rb64(AVIOContext* @s); + + /// Read size bytes from AVIOContext into buf. + /// number of bytes read or AVERROR + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_read(AVIOContext* @s, byte* @buf, int @size); + + /// Get next directory entry. + /// directory read context. + /// next entry or NULL when no more entries. + /// >=0 on success or negative on error. End of list is not considered an error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_read_dir(AVIODirContext* @s, AVIODirEntry** @next); + + /// Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed to read fewer bytes than requested. The missing bytes can be read in the next call. This always tries to read at least 1 byte. Useful to reduce latency in certain cases. + /// number of bytes read or AVERROR + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_read_partial(AVIOContext* @s, byte* @buf, int @size); + + /// Read contents of h into print buffer, up to max_size bytes, or up to EOF. + /// 0 for success (max_size bytes read or EOF reached), negative error code otherwise + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_read_to_bprint(AVIOContext* @h, AVBPrint* @pb, ulong @max_size); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avio_rl16(AVIOContext* @s); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avio_rl24(AVIOContext* @s); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avio_rl32(AVIOContext* @s); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern ulong avio_rl64(AVIOContext* @s); + + /// fseek() equivalent for AVIOContext. + /// new position or AVERROR. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long avio_seek(AVIOContext* @s, long @offset, int @whence); + + /// Seek to a given timestamp relative to some component stream. Only meaningful if using a network streaming protocol (e.g. MMS.). + /// IO context from which to call the seek function pointers + /// The stream index that the timestamp is relative to. If stream_index is (-1) the timestamp should be in AV_TIME_BASE units from the beginning of the presentation. If a stream_index >= 0 is used and the protocol does not support seeking based on component streams, the call will fail. + /// timestamp in AVStream.time_base units or if there is no stream specified then in AV_TIME_BASE units. + /// Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE and AVSEEK_FLAG_ANY. The protocol may silently ignore AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will fail if used and not supported. + /// >= 0 on success + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long avio_seek_time(AVIOContext* @h, int @stream_index, long @timestamp, int @flags); + + /// Get the filesize. + /// filesize or AVERROR + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long avio_size(AVIOContext* @s); + + /// Skip given number of bytes forward + /// new position or AVERROR. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long avio_skip(AVIOContext* @s, long @offset); + + /// Writes a formatted string to the context taking a va_list. + /// number of bytes written, < 0 on error. + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int avio_vprintf(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] +#else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] +#endif + string @fmt, byte* @ap); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_w8(AVIOContext* @s, int @b); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_wb16(AVIOContext* @s, uint @val); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_wb24(AVIOContext* @s, uint @val); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_wb32(AVIOContext* @s, uint @val); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_wb64(AVIOContext* @s, ulong @val); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_wl16(AVIOContext* @s, uint @val); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_wl24(AVIOContext* @s, uint @val); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_wl32(AVIOContext* @s, uint @val); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_wl64(AVIOContext* @s, ulong @val); + + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_write(AVIOContext* @s, byte* @buf, int @size); + + /// Mark the written bytestream as a specific type. + /// the AVIOContext + /// the stream time the current bytestream pos corresponds to (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not applicable + /// the kind of data written starting at the current pos + [DllImport(avformat_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avio_write_marker(AVIOContext* @s, long @time, AVIODataMarkerType @type); + + /// Free all allocated data in the given subtitle struct. + /// AVSubtitle to free. + [DllImport(avcodec_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void avsubtitle_free(AVSubtitle* @sub); + + /// Return the libavutil build-time configuration. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avutil_configuration(); + + /// Return the libavutil license. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string avutil_license(); + + /// Return the LIBAVUTIL_VERSION_INT constant. + [DllImport(avutil_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint avutil_version(); + + // /// Return the libpostproc build-time configuration. + // [DllImport("postproc-58", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string postproc_configuration(); + + // /// Return the libpostproc license. + // [DllImport("postproc-58", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string postproc_license(); + + // /// Return the LIBPOSTPROC_VERSION_INT constant. + // [DllImport("postproc-58", CallingConvention = CallingConvention.Cdecl)] + // public static extern uint postproc_version(); + + // [DllImport("postproc-58", CallingConvention = CallingConvention.Cdecl)] + // public static extern void pp_free_context(void* @ppContext); + + // [DllImport("postproc-58", CallingConvention = CallingConvention.Cdecl)] + // public static extern void pp_free_mode(void* @mode); + + // [DllImport("postproc-58", CallingConvention = CallingConvention.Cdecl)] + // public static extern void* pp_get_context(int @width, int @height, int @flags); + + // /// Return a pp_mode or NULL if an error occurred. + // /// the string after "-pp" on the command line + // /// a number from 0 to PP_QUALITY_MAX + // [DllImport("postproc-58", CallingConvention = CallingConvention.Cdecl)] + // public static extern void* pp_get_mode_by_name_and_quality( + // #if NETSTANDARD2_1_OR_GREATER + // [MarshalAs(UnmanagedType.LPUTF8Str)] + // #else + // [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + // #endif + // string @name, int @quality); + + // [DllImport("postproc-58", CallingConvention = CallingConvention.Cdecl)] + // public static extern void pp_postprocess(in byte_ptr3 @src, in int3 @srcStride, ref byte_ptr3 @dst, in int3 @dstStride, int @horizontalSize, int @verticalSize, sbyte* @QP_store, int @QP_stride, void* @mode, void* @ppContext, int @pict_type); + + /// Allocate SwrContext. + /// NULL on error, allocated context otherwise + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern SwrContext* swr_alloc(); + + /// Allocate SwrContext if needed and set/reset common parameters. + /// Pointer to an existing Swr context if available, or to NULL if not. On success, *ps will be set to the allocated context. + /// output channel layout (e.g. AV_CHANNEL_LAYOUT_*) + /// output sample format (AV_SAMPLE_FMT_*). + /// output sample rate (frequency in Hz) + /// input channel layout (e.g. AV_CHANNEL_LAYOUT_*) + /// input sample format (AV_SAMPLE_FMT_*). + /// input sample rate (frequency in Hz) + /// logging level offset + /// parent logging context, can be NULL + /// 0 on success, a negative AVERROR code on error. On error, the Swr context is freed and *ps set to NULL. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_alloc_set_opts2(SwrContext** @ps, AVChannelLayout* @out_ch_layout, AVSampleFormat @out_sample_fmt, int @out_sample_rate, AVChannelLayout* @in_ch_layout, AVSampleFormat @in_sample_fmt, int @in_sample_rate, int @log_offset, void* @log_ctx); + + /// Generate a channel mixing matrix. + /// input channel layout + /// output channel layout + /// mix level for the center channel + /// mix level for the surround channel(s) + /// mix level for the low-frequency effects channel + /// mixing coefficients; matrix[i + stride * o] is the weight of input channel i in output channel o. + /// distance between adjacent input channels in the matrix array + /// matrixed stereo downmix mode (e.g. dplii) + /// 0 on success, negative AVERROR code on failure + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_build_matrix2(AVChannelLayout* @in_layout, AVChannelLayout* @out_layout, double @center_mix_level, double @surround_mix_level, double @lfe_mix_level, double @maxval, double @rematrix_volume, double* @matrix, long @stride, AVMatrixEncoding @matrix_encoding, void* @log_context); + + /// Closes the context so that swr_is_initialized() returns 0. + /// Swr context to be closed + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void swr_close(SwrContext* @s); + + /// Configure or reconfigure the SwrContext using the information provided by the AVFrames. + /// audio resample context + /// output AVFrame + /// input AVFrame + /// 0 on success, AVERROR on failure. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_config_frame(SwrContext* @swr, AVFrame* @out, AVFrame* @in); + + /// Convert audio. + /// allocated Swr context, with parameters set + /// output buffers, only the first one need be set in case of packed audio + /// amount of space available for output in samples per channel + /// input buffers, only the first one need to be set in case of packed audio + /// number of input samples available in one channel + /// number of samples output per channel, negative value on error + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_convert(SwrContext* @s, byte** @out, int @out_count, byte** @in, int @in_count); + + /// Convert the samples in the input AVFrame and write them to the output AVFrame. + /// audio resample context + /// output AVFrame + /// input AVFrame + /// 0 on success, AVERROR on failure or nonmatching configuration. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_convert_frame(SwrContext* @swr, AVFrame* @output, AVFrame* @input); + + /// Drops the specified number of output samples. + /// allocated Swr context + /// number of samples to be dropped + /// >= 0 on success, or a negative AVERROR code on failure + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_drop_output(SwrContext* @s, int @count); + + /// Free the given SwrContext and set the pointer to NULL. + /// a pointer to a pointer to Swr context + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern void swr_free(SwrContext** @s); + + /// Get the AVClass for SwrContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + /// the AVClass of SwrContext + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern AVClass* swr_get_class(); + + /// Gets the delay the next input sample will experience relative to the next output sample. + /// swr context + /// timebase in which the returned delay will be: + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long swr_get_delay(SwrContext* @s, long @base); + + /// Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples. This depends on the internal state, and anything changing the internal state (like further swr_convert() calls) will may change the number of samples swr_get_out_samples() returns for the same number of input samples. + /// number of input samples. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_get_out_samples(SwrContext* @s, int @in_samples); + + /// Initialize context after user parameters have been set. + /// Swr context to initialize + /// AVERROR error code in case of failure. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_init(SwrContext* @s); + + /// Injects the specified number of silence samples. + /// allocated Swr context + /// number of samples to be dropped + /// >= 0 on success, or a negative AVERROR code on failure + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_inject_silence(SwrContext* @s, int @count); + + /// Check whether an swr context has been initialized or not. + /// Swr context to check + /// positive if it has been initialized, 0 if not initialized + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_is_initialized(SwrContext* @s); + + /// Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate) units. + /// initialized Swr context + /// timestamp for the next input sample, INT64_MIN if unknown + /// the output timestamp for the next output sample + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern long swr_next_pts(SwrContext* @s, long @pts); + + /// Set a customized input channel mapping. + /// allocated Swr context, not yet initialized + /// customized input channel mapping (array of channel indexes, -1 for a muted channel) + /// >= 0 on success, or AVERROR error code in case of failure. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_set_channel_mapping(SwrContext* @s, int* @channel_map); + + /// Activate resampling compensation ("soft" compensation). This function is internally called when needed in swr_next_pts(). + /// allocated Swr context. If it is not initialized, or SWR_FLAG_RESAMPLE is not set, swr_init() is called with the flag set. + /// delta in PTS per sample + /// number of samples to compensate for + /// >= 0 on success, AVERROR error codes if: + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_set_compensation(SwrContext* @s, int @sample_delta, int @compensation_distance); + + /// Set a customized remix matrix. + /// allocated Swr context, not yet initialized + /// remix coefficients; matrix[i + stride * o] is the weight of input channel i in output channel o + /// offset between lines of the matrix + /// >= 0 on success, or AVERROR error code in case of failure. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern int swr_set_matrix(SwrContext* @s, double* @matrix, int @stride); + + /// Return the swr build-time configuration. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string swresample_configuration(); + + /// Return the swr license. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public static extern string swresample_license(); + + /// Return the LIBSWRESAMPLE_VERSION_INT constant. + [DllImport(swresample_DLL, CallingConvention = CallingConvention.Cdecl)] + public static extern uint swresample_version(); + + // /// Allocate an empty SwsContext. This must be filled and passed to sws_init_context(). For filling see AVOptions, options.c and sws_setColorspaceDetails(). + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern SwsContext* sws_alloc_context(); + + // /// Allocate and return an uninitialized vector with length coefficients. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern SwsVector* sws_allocVec(int @length); + + // /// Convert an 8-bit paletted frame into a frame with a color depth of 24 bits. + // /// source frame buffer + // /// destination frame buffer + // /// number of pixels to convert + // /// array with [256] entries, which must match color arrangement (RGB or BGR) of src + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern void sws_convertPalette8ToPacked24(byte* @src, byte* @dst, int @num_pixels, byte* @palette); + + // /// Convert an 8-bit paletted frame into a frame with a color depth of 32 bits. + // /// source frame buffer + // /// destination frame buffer + // /// number of pixels to convert + // /// array with [256] entries, which must match color arrangement (RGB or BGR) of src + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern void sws_convertPalette8ToPacked32(byte* @src, byte* @dst, int @num_pixels, byte* @palette); + + // /// Finish the scaling process for a pair of source/destination frames previously submitted with sws_frame_start(). Must be called after all sws_send_slice() and sws_receive_slice() calls are done, before any new sws_frame_start() calls. + // /// The scaling context + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern void sws_frame_end(SwsContext* @c); + + // /// Initialize the scaling process for a given pair of source/destination frames. Must be called before any calls to sws_send_slice() and sws_receive_slice(). + // /// The scaling context + // /// The destination frame. + // /// The source frame. The data buffers must be allocated, but the frame data does not have to be ready at this point. Data availability is then signalled by sws_send_slice(). + // /// 0 on success, a negative AVERROR code on failure + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_frame_start(SwsContext* @c, AVFrame* @dst, AVFrame* @src); + + // /// Free the swscaler context swsContext. If swsContext is NULL, then does nothing. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern void sws_freeContext(SwsContext* @swsContext); + + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern void sws_freeFilter(SwsFilter* @filter); + + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern void sws_freeVec(SwsVector* @a); + + // /// Get the AVClass for swsContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern AVClass* sws_get_class(); + + // /// Check if context can be reused, otherwise reallocate a new one. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern SwsContext* sws_getCachedContext(SwsContext* @context, int @srcW, int @srcH, AVPixelFormat @srcFormat, int @dstW, int @dstH, AVPixelFormat @dstFormat, int @flags, SwsFilter* @srcFilter, SwsFilter* @dstFilter, double* @param); + + // /// Return a pointer to yuv<->rgb coefficients for the given colorspace suitable for sws_setColorspaceDetails(). + // /// One of the SWS_CS_* macros. If invalid, SWS_CS_DEFAULT is used. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int* sws_getCoefficients(int @colorspace); + + // /// Returns A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. + // /// A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_getColorspaceDetails(SwsContext* @c, int** @inv_table, int* @srcRange, int** @table, int* @dstRange, int* @brightness, int* @contrast, int* @saturation); + + // /// Allocate and return an SwsContext. You need it to perform scaling/conversion operations using sws_scale(). + // /// the width of the source image + // /// the height of the source image + // /// the source image format + // /// the width of the destination image + // /// the height of the destination image + // /// the destination image format + // /// specify which algorithm and options to use for rescaling + // /// extra parameters to tune the used scaler For SWS_BICUBIC param[0] and [1] tune the shape of the basis function, param[0] tunes f(1) and param[1] f´(1) For SWS_GAUSS param[0] tunes the exponent and thus cutoff frequency For SWS_LANCZOS param[0] tunes the width of the window function + // /// a pointer to an allocated context, or NULL in case of error + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern SwsContext* sws_getContext(int @srcW, int @srcH, AVPixelFormat @srcFormat, int @dstW, int @dstH, AVPixelFormat @dstFormat, int @flags, SwsFilter* @srcFilter, SwsFilter* @dstFilter, double* @param); + + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern SwsFilter* sws_getDefaultFilter(float @lumaGBlur, float @chromaGBlur, float @lumaSharpen, float @chromaSharpen, float @chromaHShift, float @chromaVShift, int @verbose); + + // /// Return a normalized Gaussian curve used to filter stuff quality = 3 is high quality, lower is lower quality. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern SwsVector* sws_getGaussianVec(double @variance, double @quality); + + // /// Initialize the swscaler context sws_context. + // /// zero or positive value on success, a negative value on error + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_init_context(SwsContext* @sws_context, SwsFilter* @srcFilter, SwsFilter* @dstFilter); + + // /// Returns a positive value if an endianness conversion for pix_fmt is supported, 0 otherwise. + // /// the pixel format + // /// a positive value if an endianness conversion for pix_fmt is supported, 0 otherwise. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_isSupportedEndiannessConversion(AVPixelFormat @pix_fmt); + + // /// Return a positive value if pix_fmt is a supported input format, 0 otherwise. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_isSupportedInput(AVPixelFormat @pix_fmt); + + // /// Return a positive value if pix_fmt is a supported output format, 0 otherwise. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_isSupportedOutput(AVPixelFormat @pix_fmt); + + // /// Scale all the coefficients of a so that their sum equals height. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern void sws_normalizeVec(SwsVector* @a, double @height); + + // /// Request a horizontal slice of the output data to be written into the frame previously provided to sws_frame_start(). + // /// The scaling context + // /// first row of the slice; must be a multiple of sws_receive_slice_alignment() + // /// number of rows in the slice; must be a multiple of sws_receive_slice_alignment(), except for the last slice (i.e. when slice_start+slice_height is equal to output frame height) + // /// a non-negative number if the data was successfully written into the output AVERROR(EAGAIN) if more input data needs to be provided before the output can be produced another negative AVERROR code on other kinds of scaling failure + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_receive_slice(SwsContext* @c, uint @slice_start, uint @slice_height); + + // /// Get the alignment required for slices + // /// The scaling context + // /// alignment required for output slices requested with sws_receive_slice(). Slice offsets and sizes passed to sws_receive_slice() must be multiples of the value returned from this function. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern uint sws_receive_slice_alignment(SwsContext* @c); + + // /// Scale the image slice in srcSlice and put the resulting scaled slice in the image in dst. A slice is a sequence of consecutive rows in an image. + // /// the scaling context previously created with sws_getContext() + // /// the array containing the pointers to the planes of the source slice + // /// the array containing the strides for each plane of the source image + // /// the position in the source image of the slice to process, that is the number (counted starting from zero) in the image of the first row of the slice + // /// the height of the source slice, that is the number of rows in the slice + // /// the array containing the pointers to the planes of the destination image + // /// the array containing the strides for each plane of the destination image + // /// the height of the output slice + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_scale(SwsContext* @c, byte*[] @srcSlice, int[] @srcStride, int @srcSliceY, int @srcSliceH, byte*[] @dst, int[] @dstStride); + + // /// Scale source data from src and write the output to dst. + // /// The scaling context + // /// The destination frame. See documentation for sws_frame_start() for more details. + // /// The source frame. + // /// 0 on success, a negative AVERROR code on failure + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_scale_frame(SwsContext* @c, AVFrame* @dst, AVFrame* @src); + + // /// Scale all the coefficients of a by the scalar value. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern void sws_scaleVec(SwsVector* @a, double @scalar); + + // /// Indicate that a horizontal slice of input data is available in the source frame previously provided to sws_frame_start(). The slices may be provided in any order, but may not overlap. For vertically subsampled pixel formats, the slices must be aligned according to subsampling. + // /// The scaling context + // /// first row of the slice + // /// number of rows in the slice + // /// a non-negative number on success, a negative AVERROR code on failure. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_send_slice(SwsContext* @c, uint @slice_start, uint @slice_height); + + // /// Returns A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. + // /// the scaling context + // /// the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] + // /// flag indicating the while-black range of the input (1=jpeg / 0=mpeg) + // /// the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] + // /// flag indicating the while-black range of the output (1=jpeg / 0=mpeg) + // /// 16.16 fixed point brightness correction + // /// 16.16 fixed point contrast correction + // /// 16.16 fixed point saturation correction + // /// A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern int sws_setColorspaceDetails(SwsContext* @c, in int4 @inv_table, int @srcRange, in int4 @table, int @dstRange, int @brightness, int @contrast, int @saturation); + + // /// Return the libswscale build-time configuration. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string swscale_configuration(); + + // /// Return the libswscale license. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + // public static extern string swscale_license(); + + // /// Color conversion and scaling library. + // [DllImport("swscale-8", CallingConvention = CallingConvention.Cdecl)] + // public static extern uint swscale_version(); + + */ + #endregion + private static bool isInitialized = false; + + public unsafe static void Initialize() + { + if (isInitialized) return; + isInitialized = true; + + vectors.av_find_best_stream = av_find_best_stream; + vectors.av_frame_alloc = av_frame_alloc; + vectors.av_frame_free = av_frame_free; + vectors.av_image_get_buffer_size = av_image_get_buffer_size; + vectors.av_packet_alloc = av_packet_alloc; + vectors.av_packet_free = av_packet_free; + vectors.av_packet_unref = av_packet_unref; + vectors.av_read_frame = av_read_frame; + vectors.avcodec_alloc_context3 = avcodec_alloc_context3; + vectors.avcodec_flush_buffers = avcodec_flush_buffers; + vectors.avcodec_free_context = avcodec_free_context; + vectors.avcodec_get_name = avcodec_get_name; + vectors.avcodec_open2 = avcodec_open2; + vectors.avcodec_receive_frame = avcodec_receive_frame; + vectors.avcodec_send_packet = avcodec_send_packet; + vectors.avformat_alloc_context = avformat_alloc_context; + vectors.avformat_close_input = avformat_close_input; + vectors.avformat_find_stream_info = avformat_find_stream_info; + vectors.avformat_open_input = avformat_open_input; + vectors.avformat_seek_file = avformat_seek_file; + vectors.avio_alloc_context = avio_alloc_context; + vectors.avio_context_free = avio_context_free; + vectors.av_malloc = av_malloc; + vectors.av_free = av_free; + #region unuse code2 + /* + vectors.av_add_index_entry = av_add_index_entry; + vectors.av_add_q = av_add_q; + vectors.av_add_stable = av_add_stable; + vectors.av_append_packet = av_append_packet; + vectors.av_audio_fifo_alloc = av_audio_fifo_alloc; + vectors.av_audio_fifo_drain = av_audio_fifo_drain; + vectors.av_audio_fifo_free = av_audio_fifo_free; + vectors.av_audio_fifo_peek = av_audio_fifo_peek; + vectors.av_audio_fifo_peek_at = av_audio_fifo_peek_at; + vectors.av_audio_fifo_read = av_audio_fifo_read; + vectors.av_audio_fifo_realloc = av_audio_fifo_realloc; + vectors.av_audio_fifo_reset = av_audio_fifo_reset; + 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_bsf_alloc = av_bsf_alloc; + vectors.av_bsf_flush = av_bsf_flush; + vectors.av_bsf_free = av_bsf_free; + vectors.av_bsf_get_by_name = av_bsf_get_by_name; + vectors.av_bsf_get_class = av_bsf_get_class; + vectors.av_bsf_get_null_filter = av_bsf_get_null_filter; + vectors.av_bsf_init = av_bsf_init; + vectors.av_bsf_iterate = av_bsf_iterate; + vectors.av_bsf_list_alloc = av_bsf_list_alloc; + vectors.av_bsf_list_append = av_bsf_list_append; + vectors.av_bsf_list_append2 = av_bsf_list_append2; + vectors.av_bsf_list_finalize = av_bsf_list_finalize; + vectors.av_bsf_list_free = av_bsf_list_free; + vectors.av_bsf_list_parse_str = av_bsf_list_parse_str; + vectors.av_bsf_receive_packet = av_bsf_receive_packet; + vectors.av_bsf_send_packet = av_bsf_send_packet; + vectors.av_buffer_alloc = av_buffer_alloc; + vectors.av_buffer_allocz = av_buffer_allocz; + vectors.av_buffer_create = av_buffer_create; + vectors.av_buffer_default_free = av_buffer_default_free; + vectors.av_buffer_get_opaque = av_buffer_get_opaque; + vectors.av_buffer_get_ref_count = av_buffer_get_ref_count; + vectors.av_buffer_is_writable = av_buffer_is_writable; + vectors.av_buffer_make_writable = av_buffer_make_writable; + vectors.av_buffer_pool_buffer_get_opaque = av_buffer_pool_buffer_get_opaque; + vectors.av_buffer_pool_get = av_buffer_pool_get; + vectors.av_buffer_pool_init = av_buffer_pool_init; + vectors.av_buffer_pool_init2 = av_buffer_pool_init2; + vectors.av_buffer_pool_uninit = av_buffer_pool_uninit; + vectors.av_buffer_realloc = av_buffer_realloc; + vectors.av_buffer_ref = av_buffer_ref; + vectors.av_buffer_replace = av_buffer_replace; + vectors.av_buffer_unref = av_buffer_unref; + // vectors.av_buffersink_get_ch_layout = av_buffersink_get_ch_layout; + // vectors.av_buffersink_get_channels = av_buffersink_get_channels; + // vectors.av_buffersink_get_color_range = av_buffersink_get_color_range; + // vectors.av_buffersink_get_colorspace = av_buffersink_get_colorspace; + // vectors.av_buffersink_get_format = av_buffersink_get_format; + // vectors.av_buffersink_get_frame = av_buffersink_get_frame; + // vectors.av_buffersink_get_frame_flags = av_buffersink_get_frame_flags; + // vectors.av_buffersink_get_frame_rate = av_buffersink_get_frame_rate; + // vectors.av_buffersink_get_h = av_buffersink_get_h; + // vectors.av_buffersink_get_hw_frames_ctx = av_buffersink_get_hw_frames_ctx; + // vectors.av_buffersink_get_sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio; + // vectors.av_buffersink_get_sample_rate = av_buffersink_get_sample_rate; + // vectors.av_buffersink_get_samples = av_buffersink_get_samples; + // vectors.av_buffersink_get_time_base = av_buffersink_get_time_base; + // vectors.av_buffersink_get_type = av_buffersink_get_type; + // vectors.av_buffersink_get_w = av_buffersink_get_w; + // vectors.av_buffersink_set_frame_size = av_buffersink_set_frame_size; + // vectors.av_buffersrc_add_frame = av_buffersrc_add_frame; + // vectors.av_buffersrc_add_frame_flags = av_buffersrc_add_frame_flags; + // vectors.av_buffersrc_close = av_buffersrc_close; + // vectors.av_buffersrc_get_nb_failed_requests = av_buffersrc_get_nb_failed_requests; + // vectors.av_buffersrc_parameters_alloc = av_buffersrc_parameters_alloc; + // vectors.av_buffersrc_parameters_set = av_buffersrc_parameters_set; + // vectors.av_buffersrc_write_frame = av_buffersrc_write_frame; + vectors.av_calloc = av_calloc; + vectors.av_channel_description = av_channel_description; + vectors.av_channel_description_bprint = av_channel_description_bprint; + vectors.av_channel_from_string = av_channel_from_string; + vectors.av_channel_layout_channel_from_index = av_channel_layout_channel_from_index; + vectors.av_channel_layout_channel_from_string = av_channel_layout_channel_from_string; + vectors.av_channel_layout_check = av_channel_layout_check; + vectors.av_channel_layout_compare = av_channel_layout_compare; + vectors.av_channel_layout_copy = av_channel_layout_copy; + vectors.av_channel_layout_custom_init = av_channel_layout_custom_init; + vectors.av_channel_layout_default = av_channel_layout_default; + vectors.av_channel_layout_describe = av_channel_layout_describe; + vectors.av_channel_layout_describe_bprint = av_channel_layout_describe_bprint; + vectors.av_channel_layout_from_mask = av_channel_layout_from_mask; + vectors.av_channel_layout_from_string = av_channel_layout_from_string; + vectors.av_channel_layout_index_from_channel = av_channel_layout_index_from_channel; + vectors.av_channel_layout_index_from_string = av_channel_layout_index_from_string; + vectors.av_channel_layout_retype = av_channel_layout_retype; + vectors.av_channel_layout_standard = av_channel_layout_standard; + vectors.av_channel_layout_subset = av_channel_layout_subset; + vectors.av_channel_layout_uninit = av_channel_layout_uninit; + vectors.av_channel_name = av_channel_name; + vectors.av_channel_name_bprint = av_channel_name_bprint; + vectors.av_chroma_location_enum_to_pos = av_chroma_location_enum_to_pos; + vectors.av_chroma_location_from_name = av_chroma_location_from_name; + vectors.av_chroma_location_name = av_chroma_location_name; + vectors.av_chroma_location_pos_to_enum = av_chroma_location_pos_to_enum; + vectors.av_codec_get_id = av_codec_get_id; + vectors.av_codec_get_tag = av_codec_get_tag; + vectors.av_codec_get_tag2 = av_codec_get_tag2; + vectors.av_codec_is_decoder = av_codec_is_decoder; + vectors.av_codec_is_encoder = av_codec_is_encoder; + vectors.av_codec_iterate = av_codec_iterate; + vectors.av_color_primaries_from_name = av_color_primaries_from_name; + vectors.av_color_primaries_name = av_color_primaries_name; + vectors.av_color_range_from_name = av_color_range_from_name; + vectors.av_color_range_name = av_color_range_name; + vectors.av_color_space_from_name = av_color_space_from_name; + vectors.av_color_space_name = av_color_space_name; + vectors.av_color_transfer_from_name = av_color_transfer_from_name; + vectors.av_color_transfer_name = av_color_transfer_name; + vectors.av_compare_mod = av_compare_mod; + vectors.av_compare_ts = av_compare_ts; + vectors.av_content_light_metadata_alloc = av_content_light_metadata_alloc; + vectors.av_content_light_metadata_create_side_data = av_content_light_metadata_create_side_data; + vectors.av_cpb_properties_alloc = av_cpb_properties_alloc; + vectors.av_cpu_count = av_cpu_count; + vectors.av_cpu_force_count = av_cpu_force_count; + vectors.av_cpu_max_align = av_cpu_max_align; + vectors.av_d2q = av_d2q; + vectors.av_d3d11va_alloc_context = av_d3d11va_alloc_context; + vectors.av_default_get_category = av_default_get_category; + vectors.av_default_item_name = av_default_item_name; + vectors.av_demuxer_iterate = av_demuxer_iterate; + vectors.av_dict_copy = av_dict_copy; + vectors.av_dict_count = av_dict_count; + vectors.av_dict_free = av_dict_free; + vectors.av_dict_get = av_dict_get; + vectors.av_dict_get_string = av_dict_get_string; + vectors.av_dict_iterate = av_dict_iterate; + vectors.av_dict_parse_string = av_dict_parse_string; + vectors.av_dict_set = av_dict_set; + vectors.av_dict_set_int = av_dict_set_int; + vectors.av_display_matrix_flip = av_display_matrix_flip; + vectors.av_display_rotation_get = av_display_rotation_get; + vectors.av_display_rotation_set = av_display_rotation_set; + vectors.av_disposition_from_string = av_disposition_from_string; + vectors.av_disposition_to_string = av_disposition_to_string; + vectors.av_div_q = av_div_q; + 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; + vectors.av_fast_malloc = av_fast_malloc; + vectors.av_fast_mallocz = av_fast_mallocz; + vectors.av_fast_padded_malloc = av_fast_padded_malloc; + vectors.av_fast_padded_mallocz = av_fast_padded_mallocz; + vectors.av_fast_realloc = av_fast_realloc; + vectors.av_file_map = av_file_map; + vectors.av_file_unmap = av_file_unmap; + vectors.av_filename_number_test = av_filename_number_test; + // vectors.av_filter_iterate = av_filter_iterate; + vectors.av_find_best_pix_fmt_of_2 = av_find_best_pix_fmt_of_2; + vectors.av_find_default_stream_index = av_find_default_stream_index; + vectors.av_find_input_format = av_find_input_format; + vectors.av_find_nearest_q_idx = av_find_nearest_q_idx; + vectors.av_find_program_from_stream = av_find_program_from_stream; + vectors.av_fmt_ctx_get_duration_estimation_method = av_fmt_ctx_get_duration_estimation_method; + vectors.av_force_cpu_flags = av_force_cpu_flags; + vectors.av_format_inject_global_side_data = av_format_inject_global_side_data; + vectors.av_fourcc_make_string = av_fourcc_make_string; + vectors.av_frame_apply_cropping = av_frame_apply_cropping; + vectors.av_frame_clone = av_frame_clone; + vectors.av_frame_copy = av_frame_copy; + vectors.av_frame_copy_props = av_frame_copy_props; + vectors.av_frame_get_buffer = av_frame_get_buffer; + vectors.av_frame_get_plane_buffer = av_frame_get_plane_buffer; + vectors.av_frame_get_side_data = av_frame_get_side_data; + vectors.av_frame_is_writable = av_frame_is_writable; + vectors.av_frame_make_writable = av_frame_make_writable; + vectors.av_frame_move_ref = av_frame_move_ref; + vectors.av_frame_new_side_data = av_frame_new_side_data; + 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_clone = av_frame_side_data_clone; + vectors.av_frame_side_data_free = av_frame_side_data_free; + vectors.av_frame_side_data_get_c = av_frame_side_data_get_c; + vectors.av_frame_side_data_name = av_frame_side_data_name; + vectors.av_frame_side_data_new = av_frame_side_data_new; + vectors.av_frame_unref = av_frame_unref; + vectors.av_freep = av_freep; + vectors.av_gcd = av_gcd; + vectors.av_gcd_q = av_gcd_q; + vectors.av_get_alt_sample_fmt = av_get_alt_sample_fmt; + vectors.av_get_audio_frame_duration = av_get_audio_frame_duration; + vectors.av_get_audio_frame_duration2 = av_get_audio_frame_duration2; + vectors.av_get_bits_per_pixel = av_get_bits_per_pixel; + vectors.av_get_bits_per_sample = av_get_bits_per_sample; + vectors.av_get_bytes_per_sample = av_get_bytes_per_sample; + vectors.av_get_cpu_flags = av_get_cpu_flags; + vectors.av_get_exact_bits_per_sample = av_get_exact_bits_per_sample; + vectors.av_get_frame_filename = av_get_frame_filename; + vectors.av_get_frame_filename2 = av_get_frame_filename2; + vectors.av_get_media_type_string = av_get_media_type_string; + vectors.av_get_output_timestamp = av_get_output_timestamp; + vectors.av_get_packed_sample_fmt = av_get_packed_sample_fmt; + vectors.av_get_packet = av_get_packet; + vectors.av_get_padded_bits_per_pixel = av_get_padded_bits_per_pixel; + vectors.av_get_pcm_codec = av_get_pcm_codec; + vectors.av_get_picture_type_char = av_get_picture_type_char; + vectors.av_get_pix_fmt = av_get_pix_fmt; + vectors.av_get_pix_fmt_loss = av_get_pix_fmt_loss; + vectors.av_get_pix_fmt_name = av_get_pix_fmt_name; + vectors.av_get_pix_fmt_string = av_get_pix_fmt_string; + vectors.av_get_planar_sample_fmt = av_get_planar_sample_fmt; + vectors.av_get_profile_name = av_get_profile_name; + vectors.av_get_sample_fmt = av_get_sample_fmt; + vectors.av_get_sample_fmt_name = av_get_sample_fmt_name; + vectors.av_get_sample_fmt_string = av_get_sample_fmt_string; + vectors.av_get_time_base_q = av_get_time_base_q; + vectors.av_gettime = av_gettime; + vectors.av_gettime_relative = av_gettime_relative; + vectors.av_gettime_relative_is_monotonic = av_gettime_relative_is_monotonic; + vectors.av_grow_packet = av_grow_packet; + vectors.av_guess_codec = av_guess_codec; + vectors.av_guess_format = av_guess_format; + vectors.av_guess_frame_rate = av_guess_frame_rate; + vectors.av_guess_sample_aspect_ratio = av_guess_sample_aspect_ratio; + vectors.av_hex_dump = av_hex_dump; + vectors.av_hex_dump_log = av_hex_dump_log; + vectors.av_hwdevice_ctx_alloc = av_hwdevice_ctx_alloc; + vectors.av_hwdevice_ctx_create = av_hwdevice_ctx_create; + vectors.av_hwdevice_ctx_create_derived = av_hwdevice_ctx_create_derived; + vectors.av_hwdevice_ctx_create_derived_opts = av_hwdevice_ctx_create_derived_opts; + vectors.av_hwdevice_ctx_init = av_hwdevice_ctx_init; + vectors.av_hwdevice_find_type_by_name = av_hwdevice_find_type_by_name; + vectors.av_hwdevice_get_hwframe_constraints = av_hwdevice_get_hwframe_constraints; + vectors.av_hwdevice_get_type_name = av_hwdevice_get_type_name; + vectors.av_hwdevice_hwconfig_alloc = av_hwdevice_hwconfig_alloc; + vectors.av_hwdevice_iterate_types = av_hwdevice_iterate_types; + vectors.av_hwframe_constraints_free = av_hwframe_constraints_free; + vectors.av_hwframe_ctx_alloc = av_hwframe_ctx_alloc; + vectors.av_hwframe_ctx_create_derived = av_hwframe_ctx_create_derived; + vectors.av_hwframe_ctx_init = av_hwframe_ctx_init; + vectors.av_hwframe_get_buffer = av_hwframe_get_buffer; + vectors.av_hwframe_map = av_hwframe_map; + vectors.av_hwframe_transfer_data = av_hwframe_transfer_data; + vectors.av_hwframe_transfer_get_formats = av_hwframe_transfer_get_formats; + vectors.av_image_alloc = av_image_alloc; + vectors.av_image_check_sar = av_image_check_sar; + vectors.av_image_check_size = av_image_check_size; + vectors.av_image_check_size2 = av_image_check_size2; + vectors.av_image_copy = av_image_copy; + vectors.av_image_copy_plane = av_image_copy_plane; + vectors.av_image_copy_plane_uc_from = av_image_copy_plane_uc_from; + vectors.av_image_copy_to_buffer = av_image_copy_to_buffer; + vectors.av_image_copy_uc_from = av_image_copy_uc_from; + vectors.av_image_fill_arrays = av_image_fill_arrays; + vectors.av_image_fill_black = av_image_fill_black; + vectors.av_image_fill_color = av_image_fill_color; + vectors.av_image_fill_linesizes = av_image_fill_linesizes; + vectors.av_image_fill_max_pixsteps = av_image_fill_max_pixsteps; + vectors.av_image_fill_plane_sizes = av_image_fill_plane_sizes; + vectors.av_image_fill_pointers = av_image_fill_pointers; + vectors.av_image_get_linesize = av_image_get_linesize; + vectors.av_index_search_timestamp = av_index_search_timestamp; + vectors.av_init_packet = av_init_packet; + // vectors.av_input_audio_device_next = av_input_audio_device_next; + // vectors.av_input_video_device_next = av_input_video_device_next; + vectors.av_int_list_length_for_size = av_int_list_length_for_size; + vectors.av_interleaved_write_frame = av_interleaved_write_frame; + vectors.av_interleaved_write_uncoded_frame = av_interleaved_write_uncoded_frame; + vectors.av_log = av_log; + vectors.av_log_default_callback = av_log_default_callback; + vectors.av_log_format_line = av_log_format_line; + vectors.av_log_format_line2 = av_log_format_line2; + vectors.av_log_get_flags = av_log_get_flags; + vectors.av_log_get_level = av_log_get_level; + vectors.av_log_once = av_log_once; + vectors.av_log_set_callback = av_log_set_callback; + vectors.av_log_set_flags = av_log_set_flags; + vectors.av_log_set_level = av_log_set_level; + vectors.av_log2 = av_log2; + vectors.av_log2_16bit = av_log2_16bit; + vectors.av_malloc_array = av_malloc_array; + vectors.av_mallocz = av_mallocz; + vectors.av_mastering_display_metadata_alloc = av_mastering_display_metadata_alloc; + vectors.av_mastering_display_metadata_create_side_data = av_mastering_display_metadata_create_side_data; + vectors.av_match_ext = av_match_ext; + vectors.av_max_alloc = av_max_alloc; + vectors.av_memcpy_backptr = av_memcpy_backptr; + vectors.av_memdup = av_memdup; + vectors.av_mul_q = av_mul_q; + vectors.av_muxer_iterate = av_muxer_iterate; + vectors.av_nearer_q = av_nearer_q; + vectors.av_new_packet = av_new_packet; + vectors.av_new_program = av_new_program; + vectors.av_opt_child_class_iterate = av_opt_child_class_iterate; + vectors.av_opt_child_next = av_opt_child_next; + vectors.av_opt_copy = av_opt_copy; + vectors.av_opt_eval_double = av_opt_eval_double; + vectors.av_opt_eval_flags = av_opt_eval_flags; + vectors.av_opt_eval_float = av_opt_eval_float; + vectors.av_opt_eval_int = av_opt_eval_int; + vectors.av_opt_eval_int64 = av_opt_eval_int64; + vectors.av_opt_eval_q = av_opt_eval_q; + vectors.av_opt_find = av_opt_find; + vectors.av_opt_find2 = av_opt_find2; + vectors.av_opt_flag_is_set = av_opt_flag_is_set; + vectors.av_opt_free = av_opt_free; + vectors.av_opt_freep_ranges = av_opt_freep_ranges; + vectors.av_opt_get = av_opt_get; + vectors.av_opt_get_chlayout = av_opt_get_chlayout; + vectors.av_opt_get_dict_val = av_opt_get_dict_val; + vectors.av_opt_get_double = av_opt_get_double; + vectors.av_opt_get_image_size = av_opt_get_image_size; + vectors.av_opt_get_int = av_opt_get_int; + vectors.av_opt_get_key_value = av_opt_get_key_value; + vectors.av_opt_get_pixel_fmt = av_opt_get_pixel_fmt; + vectors.av_opt_get_q = av_opt_get_q; + vectors.av_opt_get_sample_fmt = av_opt_get_sample_fmt; + vectors.av_opt_get_video_rate = av_opt_get_video_rate; + vectors.av_opt_is_set_to_default = av_opt_is_set_to_default; + vectors.av_opt_is_set_to_default_by_name = av_opt_is_set_to_default_by_name; + vectors.av_opt_next = av_opt_next; + vectors.av_opt_ptr = av_opt_ptr; + vectors.av_opt_query_ranges = av_opt_query_ranges; + vectors.av_opt_query_ranges_default = av_opt_query_ranges_default; + vectors.av_opt_serialize = av_opt_serialize; + vectors.av_opt_set = av_opt_set; + vectors.av_opt_set_bin = av_opt_set_bin; + vectors.av_opt_set_chlayout = av_opt_set_chlayout; + vectors.av_opt_set_defaults = av_opt_set_defaults; + vectors.av_opt_set_defaults2 = av_opt_set_defaults2; + vectors.av_opt_set_dict = av_opt_set_dict; + vectors.av_opt_set_dict_val = av_opt_set_dict_val; + vectors.av_opt_set_dict2 = av_opt_set_dict2; + vectors.av_opt_set_double = av_opt_set_double; + vectors.av_opt_set_from_string = av_opt_set_from_string; + vectors.av_opt_set_image_size = av_opt_set_image_size; + vectors.av_opt_set_int = av_opt_set_int; + vectors.av_opt_set_pixel_fmt = av_opt_set_pixel_fmt; + vectors.av_opt_set_q = av_opt_set_q; + vectors.av_opt_set_sample_fmt = av_opt_set_sample_fmt; + vectors.av_opt_set_video_rate = av_opt_set_video_rate; + vectors.av_opt_show2 = av_opt_show2; + // vectors.av_output_audio_device_next = av_output_audio_device_next; + // vectors.av_output_video_device_next = av_output_video_device_next; + vectors.av_packet_add_side_data = av_packet_add_side_data; + vectors.av_packet_clone = av_packet_clone; + vectors.av_packet_copy_props = av_packet_copy_props; + vectors.av_packet_free_side_data = av_packet_free_side_data; + vectors.av_packet_from_data = av_packet_from_data; + vectors.av_packet_get_side_data = av_packet_get_side_data; + vectors.av_packet_make_refcounted = av_packet_make_refcounted; + vectors.av_packet_make_writable = av_packet_make_writable; + vectors.av_packet_move_ref = av_packet_move_ref; + vectors.av_packet_new_side_data = av_packet_new_side_data; + vectors.av_packet_pack_dictionary = av_packet_pack_dictionary; + 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_parse_cpu_caps = av_parse_cpu_caps; + vectors.av_parser_close = av_parser_close; + vectors.av_parser_init = av_parser_init; + vectors.av_parser_iterate = av_parser_iterate; + vectors.av_parser_parse2 = av_parser_parse2; + vectors.av_pix_fmt_count_planes = av_pix_fmt_count_planes; + vectors.av_pix_fmt_desc_get = av_pix_fmt_desc_get; + vectors.av_pix_fmt_desc_get_id = av_pix_fmt_desc_get_id; + vectors.av_pix_fmt_desc_next = av_pix_fmt_desc_next; + vectors.av_pix_fmt_get_chroma_sub_sample = av_pix_fmt_get_chroma_sub_sample; + vectors.av_pix_fmt_swap_endianness = av_pix_fmt_swap_endianness; + vectors.av_pkt_dump_log2 = av_pkt_dump_log2; + vectors.av_pkt_dump2 = av_pkt_dump2; + vectors.av_probe_input_buffer = av_probe_input_buffer; + vectors.av_probe_input_buffer2 = av_probe_input_buffer2; + vectors.av_probe_input_format = av_probe_input_format; + vectors.av_probe_input_format2 = av_probe_input_format2; + vectors.av_probe_input_format3 = av_probe_input_format3; + vectors.av_program_add_stream_index = av_program_add_stream_index; + vectors.av_q2intfloat = av_q2intfloat; + vectors.av_read_image_line = av_read_image_line; + vectors.av_read_image_line2 = av_read_image_line2; + vectors.av_read_pause = av_read_pause; + vectors.av_read_play = av_read_play; + vectors.av_realloc = av_realloc; + vectors.av_realloc_array = av_realloc_array; + vectors.av_realloc_f = av_realloc_f; + vectors.av_reallocp = av_reallocp; + vectors.av_reallocp_array = av_reallocp_array; + vectors.av_reduce = av_reduce; + vectors.av_rescale = av_rescale; + vectors.av_rescale_delta = av_rescale_delta; + vectors.av_rescale_q = av_rescale_q; + vectors.av_rescale_q_rnd = av_rescale_q_rnd; + vectors.av_rescale_rnd = av_rescale_rnd; + vectors.av_sample_fmt_is_planar = av_sample_fmt_is_planar; + vectors.av_samples_alloc = av_samples_alloc; + vectors.av_samples_alloc_array_and_samples = av_samples_alloc_array_and_samples; + vectors.av_samples_copy = av_samples_copy; + vectors.av_samples_fill_arrays = av_samples_fill_arrays; + vectors.av_samples_get_buffer_size = av_samples_get_buffer_size; + vectors.av_samples_set_silence = av_samples_set_silence; + vectors.av_sdp_create = av_sdp_create; + vectors.av_seek_frame = av_seek_frame; + vectors.av_set_options_string = av_set_options_string; + vectors.av_shrink_packet = av_shrink_packet; + vectors.av_size_mult = av_size_mult; + vectors.av_strdup = av_strdup; + vectors.av_stream_add_side_data = av_stream_add_side_data; + vectors.av_stream_get_class = av_stream_get_class; + vectors.av_stream_get_codec_timebase = av_stream_get_codec_timebase; + vectors.av_stream_get_parser = av_stream_get_parser; + vectors.av_stream_get_side_data = av_stream_get_side_data; + vectors.av_stream_group_get_class = av_stream_group_get_class; + vectors.av_stream_new_side_data = av_stream_new_side_data; + vectors.av_strerror = av_strerror; + vectors.av_strndup = av_strndup; + vectors.av_sub_q = av_sub_q; + vectors.av_timecode_adjust_ntsc_framenum2 = av_timecode_adjust_ntsc_framenum2; + vectors.av_timecode_check_frame_rate = av_timecode_check_frame_rate; + vectors.av_timecode_get_smpte = av_timecode_get_smpte; + vectors.av_timecode_get_smpte_from_framenum = av_timecode_get_smpte_from_framenum; + vectors.av_timecode_init = av_timecode_init; + vectors.av_timecode_init_from_components = av_timecode_init_from_components; + vectors.av_timecode_init_from_string = av_timecode_init_from_string; + vectors.av_timecode_make_mpeg_tc_string = av_timecode_make_mpeg_tc_string; + vectors.av_timecode_make_smpte_tc_string = av_timecode_make_smpte_tc_string; + vectors.av_timecode_make_smpte_tc_string2 = av_timecode_make_smpte_tc_string2; + vectors.av_timecode_make_string = av_timecode_make_string; + vectors.av_tree_destroy = av_tree_destroy; + vectors.av_tree_enumerate = av_tree_enumerate; + vectors.av_tree_find = av_tree_find; + vectors.av_tree_insert = av_tree_insert; + vectors.av_tree_node_alloc = av_tree_node_alloc; + vectors.av_url_split = av_url_split; + vectors.av_usleep = av_usleep; + vectors.av_version_info = av_version_info; + vectors.av_vlog = av_vlog; + vectors.av_write_frame = av_write_frame; + vectors.av_write_image_line = av_write_image_line; + vectors.av_write_image_line2 = av_write_image_line2; + vectors.av_write_trailer = av_write_trailer; + vectors.av_write_uncoded_frame = av_write_uncoded_frame; + vectors.av_write_uncoded_frame_query = av_write_uncoded_frame_query; + vectors.av_xiphlacing = av_xiphlacing; + vectors.avcodec_align_dimensions = avcodec_align_dimensions; + vectors.avcodec_align_dimensions2 = avcodec_align_dimensions2; + vectors.avcodec_close = avcodec_close; + vectors.avcodec_configuration = avcodec_configuration; + vectors.avcodec_decode_subtitle2 = avcodec_decode_subtitle2; + vectors.avcodec_default_execute = avcodec_default_execute; + vectors.avcodec_default_execute2 = avcodec_default_execute2; + vectors.avcodec_default_get_buffer2 = avcodec_default_get_buffer2; + vectors.avcodec_default_get_encode_buffer = avcodec_default_get_encode_buffer; + vectors.avcodec_default_get_format = avcodec_default_get_format; + vectors.avcodec_descriptor_get = avcodec_descriptor_get; + vectors.avcodec_descriptor_get_by_name = avcodec_descriptor_get_by_name; + vectors.avcodec_descriptor_next = avcodec_descriptor_next; + vectors.avcodec_encode_subtitle = avcodec_encode_subtitle; + vectors.avcodec_fill_audio_frame = avcodec_fill_audio_frame; + vectors.avcodec_find_best_pix_fmt_of_list = avcodec_find_best_pix_fmt_of_list; + vectors.avcodec_find_decoder = avcodec_find_decoder; + vectors.avcodec_find_decoder_by_name = avcodec_find_decoder_by_name; + vectors.avcodec_find_encoder = avcodec_find_encoder; + vectors.avcodec_find_encoder_by_name = avcodec_find_encoder_by_name; + vectors.avcodec_get_class = avcodec_get_class; + vectors.avcodec_get_hw_config = avcodec_get_hw_config; + vectors.avcodec_get_hw_frames_parameters = avcodec_get_hw_frames_parameters; + vectors.avcodec_get_subtitle_rect_class = avcodec_get_subtitle_rect_class; + vectors.avcodec_get_type = avcodec_get_type; + vectors.avcodec_is_open = avcodec_is_open; + vectors.avcodec_license = avcodec_license; + vectors.avcodec_parameters_alloc = avcodec_parameters_alloc; + vectors.avcodec_parameters_copy = avcodec_parameters_copy; + vectors.avcodec_parameters_free = avcodec_parameters_free; + vectors.avcodec_parameters_from_context = avcodec_parameters_from_context; + vectors.avcodec_parameters_to_context = avcodec_parameters_to_context; + vectors.avcodec_pix_fmt_to_codec_tag = avcodec_pix_fmt_to_codec_tag; + vectors.avcodec_profile_name = avcodec_profile_name; + vectors.avcodec_receive_packet = avcodec_receive_packet; + vectors.avcodec_send_frame = avcodec_send_frame; + vectors.avcodec_string = avcodec_string; + vectors.avcodec_version = avcodec_version; + // vectors.avdevice_app_to_dev_control_message = avdevice_app_to_dev_control_message; + // vectors.avdevice_configuration = avdevice_configuration; + // vectors.avdevice_dev_to_app_control_message = avdevice_dev_to_app_control_message; + // vectors.avdevice_free_list_devices = avdevice_free_list_devices; + // vectors.avdevice_license = avdevice_license; + // vectors.avdevice_list_devices = avdevice_list_devices; + // vectors.avdevice_list_input_sources = avdevice_list_input_sources; + // vectors.avdevice_list_output_sinks = avdevice_list_output_sinks; + // vectors.avdevice_register_all = avdevice_register_all; + // vectors.avdevice_version = avdevice_version; + // vectors.avfilter_config_links = avfilter_config_links; + // vectors.avfilter_configuration = avfilter_configuration; + // vectors.avfilter_filter_pad_count = avfilter_filter_pad_count; + // vectors.avfilter_free = avfilter_free; + // vectors.avfilter_get_by_name = avfilter_get_by_name; + // vectors.avfilter_get_class = avfilter_get_class; + // vectors.avfilter_graph_alloc = avfilter_graph_alloc; + // vectors.avfilter_graph_alloc_filter = avfilter_graph_alloc_filter; + // vectors.avfilter_graph_config = avfilter_graph_config; + // vectors.avfilter_graph_create_filter = avfilter_graph_create_filter; + // vectors.avfilter_graph_dump = avfilter_graph_dump; + // vectors.avfilter_graph_free = avfilter_graph_free; + // vectors.avfilter_graph_get_filter = avfilter_graph_get_filter; + // vectors.avfilter_graph_parse = avfilter_graph_parse; + // vectors.avfilter_graph_parse_ptr = avfilter_graph_parse_ptr; + // vectors.avfilter_graph_parse2 = avfilter_graph_parse2; + // vectors.avfilter_graph_queue_command = avfilter_graph_queue_command; + // vectors.avfilter_graph_request_oldest = avfilter_graph_request_oldest; + // vectors.avfilter_graph_segment_apply = avfilter_graph_segment_apply; + // vectors.avfilter_graph_segment_apply_opts = avfilter_graph_segment_apply_opts; + // vectors.avfilter_graph_segment_create_filters = avfilter_graph_segment_create_filters; + // vectors.avfilter_graph_segment_free = avfilter_graph_segment_free; + // vectors.avfilter_graph_segment_init = avfilter_graph_segment_init; + // vectors.avfilter_graph_segment_link = avfilter_graph_segment_link; + // vectors.avfilter_graph_segment_parse = avfilter_graph_segment_parse; + // vectors.avfilter_graph_send_command = avfilter_graph_send_command; + // vectors.avfilter_graph_set_auto_convert = avfilter_graph_set_auto_convert; + // vectors.avfilter_init_dict = avfilter_init_dict; + // vectors.avfilter_init_str = avfilter_init_str; + // vectors.avfilter_inout_alloc = avfilter_inout_alloc; + // vectors.avfilter_inout_free = avfilter_inout_free; + // vectors.avfilter_insert_filter = avfilter_insert_filter; + // vectors.avfilter_license = avfilter_license; + // vectors.avfilter_link = avfilter_link; + // vectors.avfilter_link_free = avfilter_link_free; + // vectors.avfilter_pad_get_name = avfilter_pad_get_name; + // vectors.avfilter_pad_get_type = avfilter_pad_get_type; + // vectors.avfilter_process_command = avfilter_process_command; + // vectors.avfilter_version = avfilter_version; + vectors.avformat_alloc_output_context2 = avformat_alloc_output_context2; + vectors.avformat_configuration = avformat_configuration; + vectors.avformat_flush = avformat_flush; + vectors.avformat_free_context = avformat_free_context; + vectors.avformat_get_class = avformat_get_class; + vectors.avformat_get_mov_audio_tags = avformat_get_mov_audio_tags; + vectors.avformat_get_mov_video_tags = avformat_get_mov_video_tags; + vectors.avformat_get_riff_audio_tags = avformat_get_riff_audio_tags; + vectors.avformat_get_riff_video_tags = avformat_get_riff_video_tags; + vectors.avformat_index_get_entries_count = avformat_index_get_entries_count; + vectors.avformat_index_get_entry = avformat_index_get_entry; + vectors.avformat_index_get_entry_from_timestamp = avformat_index_get_entry_from_timestamp; + vectors.avformat_init_output = avformat_init_output; + vectors.avformat_license = avformat_license; + vectors.avformat_match_stream_specifier = avformat_match_stream_specifier; + vectors.avformat_network_deinit = avformat_network_deinit; + vectors.avformat_network_init = avformat_network_init; + vectors.avformat_new_stream = avformat_new_stream; + vectors.avformat_query_codec = avformat_query_codec; + vectors.avformat_queue_attached_pictures = avformat_queue_attached_pictures; + vectors.avformat_stream_group_add_stream = avformat_stream_group_add_stream; + vectors.avformat_stream_group_create = avformat_stream_group_create; + vectors.avformat_stream_group_name = avformat_stream_group_name; + vectors.avformat_transfer_internal_stream_timing_info = avformat_transfer_internal_stream_timing_info; + vectors.avformat_version = avformat_version; + vectors.avformat_write_header = avformat_write_header; + vectors.avio_accept = avio_accept; + vectors.avio_check = avio_check; + vectors.avio_close = avio_close; + vectors.avio_close_dir = avio_close_dir; + vectors.avio_close_dyn_buf = avio_close_dyn_buf; + vectors.avio_closep = avio_closep; + vectors.avio_enum_protocols = avio_enum_protocols; + vectors.avio_feof = avio_feof; + vectors.avio_find_protocol_name = avio_find_protocol_name; + vectors.avio_flush = avio_flush; + vectors.avio_free_directory_entry = avio_free_directory_entry; + vectors.avio_get_dyn_buf = avio_get_dyn_buf; + vectors.avio_get_str = avio_get_str; + vectors.avio_get_str16be = avio_get_str16be; + vectors.avio_get_str16le = avio_get_str16le; + vectors.avio_handshake = avio_handshake; + vectors.avio_open = avio_open; + vectors.avio_open_dir = avio_open_dir; + vectors.avio_open_dyn_buf = avio_open_dyn_buf; + vectors.avio_open2 = avio_open2; + vectors.avio_pause = avio_pause; + vectors.avio_print_string_array = avio_print_string_array; + vectors.avio_printf = avio_printf; + vectors.avio_protocol_get_class = avio_protocol_get_class; + vectors.avio_put_str = avio_put_str; + vectors.avio_put_str16be = avio_put_str16be; + vectors.avio_put_str16le = avio_put_str16le; + vectors.avio_r8 = avio_r8; + vectors.avio_rb16 = avio_rb16; + vectors.avio_rb24 = avio_rb24; + vectors.avio_rb32 = avio_rb32; + vectors.avio_rb64 = avio_rb64; + vectors.avio_read = avio_read; + vectors.avio_read_dir = avio_read_dir; + vectors.avio_read_partial = avio_read_partial; + vectors.avio_read_to_bprint = avio_read_to_bprint; + vectors.avio_rl16 = avio_rl16; + vectors.avio_rl24 = avio_rl24; + vectors.avio_rl32 = avio_rl32; + vectors.avio_rl64 = avio_rl64; + vectors.avio_seek = avio_seek; + vectors.avio_seek_time = avio_seek_time; + vectors.avio_size = avio_size; + vectors.avio_skip = avio_skip; + vectors.avio_vprintf = avio_vprintf; + vectors.avio_w8 = avio_w8; + vectors.avio_wb16 = avio_wb16; + vectors.avio_wb24 = avio_wb24; + vectors.avio_wb32 = avio_wb32; + vectors.avio_wb64 = avio_wb64; + vectors.avio_wl16 = avio_wl16; + vectors.avio_wl24 = avio_wl24; + vectors.avio_wl32 = avio_wl32; + vectors.avio_wl64 = avio_wl64; + vectors.avio_write = avio_write; + vectors.avio_write_marker = avio_write_marker; + vectors.avsubtitle_free = avsubtitle_free; + vectors.avutil_configuration = avutil_configuration; + vectors.avutil_license = avutil_license; + vectors.avutil_version = avutil_version; + // vectors.postproc_configuration = postproc_configuration; + // vectors.postproc_license = postproc_license; + // vectors.postproc_version = postproc_version; + // vectors.pp_free_context = pp_free_context; + // vectors.pp_free_mode = pp_free_mode; + // vectors.pp_get_context = pp_get_context; + // vectors.pp_get_mode_by_name_and_quality = pp_get_mode_by_name_and_quality; + // vectors.pp_postprocess = pp_postprocess; + vectors.swr_alloc = swr_alloc; + vectors.swr_alloc_set_opts2 = swr_alloc_set_opts2; + vectors.swr_build_matrix2 = swr_build_matrix2; + vectors.swr_close = swr_close; + vectors.swr_config_frame = swr_config_frame; + vectors.swr_convert = swr_convert; + vectors.swr_convert_frame = swr_convert_frame; + vectors.swr_drop_output = swr_drop_output; + vectors.swr_free = swr_free; + vectors.swr_get_class = swr_get_class; + vectors.swr_get_delay = swr_get_delay; + vectors.swr_get_out_samples = swr_get_out_samples; + vectors.swr_init = swr_init; + vectors.swr_inject_silence = swr_inject_silence; + vectors.swr_is_initialized = swr_is_initialized; + vectors.swr_next_pts = swr_next_pts; + vectors.swr_set_channel_mapping = swr_set_channel_mapping; + vectors.swr_set_compensation = swr_set_compensation; + vectors.swr_set_matrix = swr_set_matrix; + vectors.swresample_configuration = swresample_configuration; + vectors.swresample_license = swresample_license; + vectors.swresample_version = swresample_version; + // vectors.sws_alloc_context = sws_alloc_context; + // vectors.sws_allocVec = sws_allocVec; + // vectors.sws_convertPalette8ToPacked24 = sws_convertPalette8ToPacked24; + // vectors.sws_convertPalette8ToPacked32 = sws_convertPalette8ToPacked32; + // vectors.sws_frame_end = sws_frame_end; + // vectors.sws_frame_start = sws_frame_start; + // vectors.sws_freeContext = sws_freeContext; + // vectors.sws_freeFilter = sws_freeFilter; + // vectors.sws_freeVec = sws_freeVec; + // vectors.sws_get_class = sws_get_class; + // vectors.sws_getCachedContext = sws_getCachedContext; + // vectors.sws_getCoefficients = sws_getCoefficients; + // vectors.sws_getColorspaceDetails = sws_getColorspaceDetails; + // vectors.sws_getContext = sws_getContext; + // vectors.sws_getDefaultFilter = sws_getDefaultFilter; + // vectors.sws_getGaussianVec = sws_getGaussianVec; + // vectors.sws_init_context = sws_init_context; + // vectors.sws_isSupportedEndiannessConversion = sws_isSupportedEndiannessConversion; + // vectors.sws_isSupportedInput = sws_isSupportedInput; + // vectors.sws_isSupportedOutput = sws_isSupportedOutput; + // vectors.sws_normalizeVec = sws_normalizeVec; + // vectors.sws_receive_slice = sws_receive_slice; + // vectors.sws_receive_slice_alignment = sws_receive_slice_alignment; + // vectors.sws_scale = sws_scale; + // vectors.sws_scale_frame = sws_scale_frame; + // vectors.sws_scaleVec = sws_scaleVec; + // vectors.sws_send_slice = sws_send_slice; + // vectors.sws_setColorspaceDetails = sws_setColorspaceDetails; + // vectors.swscale_configuration = swscale_configuration; + // vectors.swscale_license = swscale_license; + // vectors.swscale_version = swscale_version; + + */ + #endregion + } + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/LinkedBindings.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/LinkedBindings.g.cs.meta new file mode 100644 index 0000000..0ce7419 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/LinkedBindings.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac98c4f0ef273194db7db58423be559f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Structs.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Structs.g.cs new file mode 100644 index 0000000..de0a905 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Structs.g.cs @@ -0,0 +1,2553 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; + +namespace LeviathanVideo.Abstractions +{ + + // public unsafe partial struct _GUID + // { + // public ulong @Data1; + // public ushort @Data2; + // public ushort @Data3; + // public byte8 @Data4; + // } + + // public unsafe partial struct _iobuf + // { + // public void* @_Placeholder; + // } + + // public unsafe partial struct AVBitStreamFilter + // { + // public byte* @name; + // /// A list of codec ids supported by the filter, terminated by AV_CODEC_ID_NONE. May be NULL, in that case the bitstream filter works with any codec id. + // public AVCodecID* @codec_ids; + // /// A class for the private data, used to declare bitstream filter private AVOptions. This field is NULL for bitstream filters that do not declare any options. + // public AVClass* @priv_class; + // } + + // /// The bitstream filter state. + // public unsafe partial struct AVBSFContext + // { + // /// A class for logging and AVOptions + // public AVClass* @av_class; + // /// The bitstream filter this context is an instance of. + // public AVBitStreamFilter* @filter; + // /// Opaque filter-specific private data. If filter->priv_class is non-NULL, this is an AVOptions-enabled struct. + // public void* @priv_data; + // /// Parameters of the input stream. This field is allocated in av_bsf_alloc(), it needs to be filled by the caller before av_bsf_init(). + // public AVCodecParameters* @par_in; + // /// Parameters of the output stream. This field is allocated in av_bsf_alloc(), it is set by the filter in av_bsf_init(). + // public AVCodecParameters* @par_out; + // /// The timebase used for the timestamps of the input packets. Set by the caller before av_bsf_init(). + // public AVRational @time_base_in; + // /// The timebase used for the timestamps of the output packets. Set by the filter in av_bsf_init(). + // public AVRational @time_base_out; + // } + + /// A reference to a data buffer. + public unsafe partial struct AVBufferRef + { + public AVBuffer* @buffer; + /// The data buffer. It is considered writable if and only if this is the only reference to the buffer, in which case av_buffer_is_writable() returns 1. + public byte* @data; + /// Size of data in bytes. + public ulong @size; + } + + // /// This structure contains the parameters describing the frames that will be passed to this filter. + // public unsafe partial struct AVBufferSrcParameters + // { + // /// video: the pixel format, value corresponds to enum AVPixelFormat audio: the sample format, value corresponds to enum AVSampleFormat + // public int @format; + // /// The timebase to be used for the timestamps on the input frames. + // public AVRational @time_base; + // /// Video only, the display dimensions of the input frames. + // public int @width; + // /// Video only, the display dimensions of the input frames. + // public int @height; + // /// Video only, the sample (pixel) aspect ratio. + // public AVRational @sample_aspect_ratio; + // /// Video only, the frame rate of the input video. This field must only be set to a non-zero value if input stream has a known constant framerate and should be left at its initial value if the framerate is variable or unknown. + // public AVRational @frame_rate; + // /// Video with a hwaccel pixel format only. This should be a reference to an AVHWFramesContext instance describing the input frames. + // public AVBufferRef* @hw_frames_ctx; + // /// Audio only, the audio sampling rate in samples per second. + // public int @sample_rate; + // /// Audio only, the audio channel layout + // public AVChannelLayout @ch_layout; + // /// Video only, the YUV colorspace and range. + // public AVColorSpace @color_space; + // public AVColorRange @color_range; + // } + + /// An AVChannelCustom defines a single channel within a custom order layout + public unsafe partial struct AVChannelCustom + { + public AVChannel @id; + public byte16 @name; + public void* @opaque; + } + + /// An AVChannelLayout holds information about the channel layout of audio data. + public unsafe partial struct AVChannelLayout + { + /// Channel order used in this layout. This is a mandatory field. + public AVChannelOrder @order; + /// Number of channels in this layout. Mandatory field. + public int @nb_channels; + public AVChannelLayout_u @u; + /// For some private data of the user. + public void* @opaque; + } + + /// Details about which channels are present in this layout. For AV_CHANNEL_ORDER_UNSPEC, this field is undefined and must not be used. + [StructLayout(LayoutKind.Explicit)] + public unsafe partial struct AVChannelLayout_u + { + /// This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels. It is a bitmask, where the position of each set bit means that the AVChannel with the corresponding value is present. + [FieldOffset(0)] + public ulong @mask; + /// This member must be used when the channel order is AV_CHANNEL_ORDER_CUSTOM. It is a nb_channels-sized array, with each element signalling the presence of the AVChannel with the corresponding value in map[i].id. + [FieldOffset(0)] + public AVChannelCustom* @map; + } + + public unsafe partial struct AVChapter + { + /// unique ID to identify the chapter + public long @id; + /// time base in which the start/end timestamps are specified + public AVRational @time_base; + /// chapter start/end time in time_base units + public long @start; + /// chapter start/end time in time_base units + public long @end; + public AVDictionary* @metadata; + } + + /// Describe the class of an AVClass context structure. That is an arbitrary struct of which the first field is a pointer to an AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). + public unsafe partial struct AVClass + { + /// The name of the class; usually it is the same name as the context structure type to which the AVClass is associated. + public byte* @class_name; + /// A pointer to a function which returns the name of a context instance ctx associated with the class. + public AVClass_item_name_func @item_name; + /// a pointer to the first option specified in the class if any or NULL + public AVOption* @option; + /// LIBAVUTIL_VERSION with which this structure was created. This is used to allow fields to be added without requiring major version bumps everywhere. + public int @version; + /// Offset in the structure where log_level_offset is stored. 0 means there is no such variable + public int @log_level_offset_offset; + /// Offset in the structure where a pointer to the parent context for logging is stored. For example a decoder could pass its AVCodecContext to eval as such a parent context, which an av_log() implementation could then leverage to display the parent context. The offset can be NULL. + public int @parent_log_context_offset; + /// Category used for visualization (like color) This is only set if the category is equal for all objects using this class. available since version (51 << 16 | 56 << 8 | 100) + public AVClassCategory @category; + /// Callback to return the category. available since version (51 << 16 | 59 << 8 | 100) + public AVClass_get_category_func @get_category; + /// Callback to return the supported/allowed ranges. available since version (52.12) + public AVClass_query_ranges_func @query_ranges; + /// Return next AVOptions-enabled child or NULL + public AVClass_child_next_func @child_next; + /// Iterate over the AVClasses corresponding to potential AVOptions-enabled children. + public AVClass_child_class_iterate_func @child_class_iterate; + } + + /// AVCodec. + public unsafe partial struct AVCodec + { + /// Name of the codec implementation. The name is globally unique among encoders and among decoders (but an encoder and a decoder can share the same name). This is the primary way to find a codec from the user perspective. + public byte* @name; + /// Descriptive name for the codec, meant to be more human readable than name. You should use the NULL_IF_CONFIG_SMALL() macro to define it. + public byte* @long_name; + public AVMediaType @type; + public AVCodecID @id; + /// Codec capabilities. see AV_CODEC_CAP_* + public int @capabilities; + /// maximum value for lowres supported by the decoder + public byte @max_lowres; + /// array of supported framerates, or NULL if any, array is terminated by {0,0} + public AVRational* @supported_framerates; + /// array of supported pixel formats, or NULL if unknown, array is terminated by -1 + public AVPixelFormat* @pix_fmts; + /// array of supported audio samplerates, or NULL if unknown, array is terminated by 0 + public int* @supported_samplerates; + /// array of supported sample formats, or NULL if unknown, array is terminated by -1 + public AVSampleFormat* @sample_fmts; + /// AVClass for the private context + public AVClass* @priv_class; + /// array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN} + public AVProfile* @profiles; + /// Group name of the codec implementation. This is a short symbolic name of the wrapper backing this codec. A wrapper uses some kind of external implementation for the codec, such as an external library, or a codec implementation provided by the OS or the hardware. If this field is NULL, this is a builtin, libavcodec native codec. If non-NULL, this will be the suffix in AVCodec.name in most cases (usually AVCodec.name will be of the form "<codec_name>_<wrapper_name>"). + public byte* @wrapper_name; + /// Array of supported channel layouts, terminated with a zeroed layout. + public AVChannelLayout* @ch_layouts; + } + + /// main external API structure. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. You can use AVOptions (av_opt* / av_set/get*()) to access these fields from user applications. The name string for AVOptions options matches the associated command line parameter name and can be found in libavcodec/options_table.h The AVOption/command line parameter names differ in some cases from the C structure field names for historic reasons or brevity. sizeof(AVCodecContext) must not be used outside libav*. + public unsafe partial struct AVCodecContext + { + /// information on struct for av_log - set by avcodec_alloc_context3 + public AVClass* @av_class; + public int @log_level_offset; + public AVMediaType @codec_type; + public AVCodec* @codec; + public AVCodecID @codec_id; + /// fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). This is used to work around some encoder bugs. A demuxer should set this to what is stored in the field used to identify the codec. If there are multiple such fields in a container then the demuxer should choose the one which maximizes the information about the used codec. If the codec tag field in a container is larger than 32 bits then the demuxer should remap the longer ID to 32 bits with a table or other structure. Alternatively a new extra_codec_tag + size could be added but for this a clear advantage must be demonstrated first. - encoding: Set by user, if not then the default based on codec_id will be used. - decoding: Set by user, will be converted to uppercase by libavcodec during init. + public uint @codec_tag; + public void* @priv_data; + /// Private context used for internal data. + public AVCodecInternal* @internal; + /// Private data of the user, can be used to carry app specific stuff. - encoding: Set by user. - decoding: Set by user. + public void* @opaque; + /// the average bitrate - encoding: Set by user; unused for constant quantizer encoding. - decoding: Set by user, may be overwritten by libavcodec if this info is available in the stream + public long @bit_rate; + /// AV_CODEC_FLAG_*. - encoding: Set by user. - decoding: Set by user. + public int @flags; + /// AV_CODEC_FLAG2_* - encoding: Set by user. - decoding: Set by user. + public int @flags2; + /// some codecs need / can use extradata like Huffman tables. MJPEG: Huffman tables rv10: additional flags MPEG-4: global headers (they can be in the bitstream or here) The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger than extradata_size to avoid problems if it is read with the bitstream reader. The bytewise contents of extradata must not depend on the architecture or CPU endianness. Must be allocated with the av_malloc() family of functions. - encoding: Set/allocated/freed by libavcodec. - decoding: Set/allocated/freed by user. + public byte* @extradata; + public int @extradata_size; + /// This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented. For fixed-fps content, timebase should be 1/framerate and timestamp increments should be identically 1. This often, but not always is the inverse of the frame rate or field rate for video. 1/time_base is not the average frame rate if the frame rate is not constant. + public AVRational @time_base; + /// Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. - encoding: unused. - decoding: set by user. + public AVRational @pkt_timebase; + /// - decoding: For codecs that store a framerate value in the compressed bitstream, the decoder may export it here. { 0, 1} when unknown. - encoding: May be used to signal the framerate of CFR content to an encoder. + public AVRational @framerate; + /// For some codecs, the time base is closer to the field rate than the frame rate. Most notably, H.264 and MPEG-2 specify time_base as half of frame duration if no telecine is used ... + [Obsolete("- decoding: Use AVCodecDescriptor.props & AV_CODEC_PROP_FIELDS - encoding: Set AVCodecContext.framerate instead")] + public int @ticks_per_frame; + /// Codec delay. + public int @delay; + /// picture width / height. + public int @width; + /// picture width / height. + public int @height; + /// Bitstream width / height, may be different from width/height e.g. when the decoded frame is cropped before being output or lowres is enabled. + public int @coded_width; + /// Bitstream width / height, may be different from width/height e.g. when the decoded frame is cropped before being output or lowres is enabled. + public int @coded_height; + /// sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel. Numerator and denominator must be relatively prime and smaller than 256 for some video standards. - encoding: Set by user. - decoding: Set by libavcodec. + public AVRational @sample_aspect_ratio; + /// Pixel format, see AV_PIX_FMT_xxx. May be set by the demuxer if known from headers. May be overridden by the decoder if it knows better. + public AVPixelFormat @pix_fmt; + /// Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - encoding: unused. - decoding: Set by libavcodec before calling get_format() + public AVPixelFormat @sw_pix_fmt; + /// Chromaticity coordinates of the source primaries. - encoding: Set by user - decoding: Set by libavcodec + public AVColorPrimaries @color_primaries; + /// Color Transfer Characteristic. - encoding: Set by user - decoding: Set by libavcodec + public AVColorTransferCharacteristic @color_trc; + /// YUV colorspace type. - encoding: Set by user - decoding: Set by libavcodec + public AVColorSpace @colorspace; + /// MPEG vs JPEG YUV range. - encoding: Set by user to override the default output color range value, If not specified, libavcodec sets the color range depending on the output format. - decoding: Set by libavcodec, can be set by the user to propagate the color range to components reading from the decoder context. + public AVColorRange @color_range; + /// This defines the location of chroma samples. - encoding: Set by user - decoding: Set by libavcodec + public AVChromaLocation @chroma_sample_location; + /// Field order - encoding: set by libavcodec - decoding: Set by user. + public AVFieldOrder @field_order; + /// number of reference frames - encoding: Set by user. - decoding: Set by lavc. + public int @refs; + /// Size of the frame reordering buffer in the decoder. For MPEG-2 it is 1 IPB or 0 low delay IP. - encoding: Set by libavcodec. - decoding: Set by libavcodec. + public int @has_b_frames; + /// slice flags - encoding: unused - decoding: Set by user. + public int @slice_flags; + /// If non NULL, 'draw_horiz_band' is called by the libavcodec decoder to draw a horizontal band. It improves cache usage. Not all codecs can do that. You must check the codec capabilities beforehand. When multithreading is used, it may be called from multiple threads at the same time; threads might draw different parts of the same AVFrame, or multiple AVFrames, and there is no guarantee that slices will be drawn in order. The function is also used by hardware acceleration APIs. It is called at least once during frame decoding to pass the data needed for hardware render. In that mode instead of pixel data, AVFrame points to a structure specific to the acceleration API. The application reads the structure and can change some fields to indicate progress or mark state. - encoding: unused - decoding: Set by user. + public AVCodecContext_draw_horiz_band_func @draw_horiz_band; + /// Callback to negotiate the pixel format. Decoding only, may be set by the caller before avcodec_open2(). + public AVCodecContext_get_format_func @get_format; + /// maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 relative to the input. - encoding: Set by user. - decoding: unused + public int @max_b_frames; + /// qscale factor between IP and B-frames If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - encoding: Set by user. - decoding: unused + public float @b_quant_factor; + /// qscale offset between IP and B-frames - encoding: Set by user. - decoding: unused + public float @b_quant_offset; + /// qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + offset). If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). - encoding: Set by user. - decoding: unused + public float @i_quant_factor; + /// qscale offset between P and I-frames - encoding: Set by user. - decoding: unused + public float @i_quant_offset; + /// luminance masking (0-> disabled) - encoding: Set by user. - decoding: unused + public float @lumi_masking; + /// temporary complexity masking (0-> disabled) - encoding: Set by user. - decoding: unused + public float @temporal_cplx_masking; + /// spatial complexity masking (0-> disabled) - encoding: Set by user. - decoding: unused + public float @spatial_cplx_masking; + /// p block masking (0-> disabled) - encoding: Set by user. - decoding: unused + public float @p_masking; + /// darkness masking (0-> disabled) - encoding: Set by user. - decoding: unused + public float @dark_masking; + /// noise vs. sse weight for the nsse comparison function - encoding: Set by user. - decoding: unused + public int @nsse_weight; + /// motion estimation comparison function - encoding: Set by user. - decoding: unused + public int @me_cmp; + /// subpixel motion estimation comparison function - encoding: Set by user. - decoding: unused + public int @me_sub_cmp; + /// macroblock comparison function (not supported yet) - encoding: Set by user. - decoding: unused + public int @mb_cmp; + /// interlaced DCT comparison function - encoding: Set by user. - decoding: unused + public int @ildct_cmp; + /// ME diamond size & shape - encoding: Set by user. - decoding: unused + public int @dia_size; + /// amount of previous MV predictors (2a+1 x 2a+1 square) - encoding: Set by user. - decoding: unused + public int @last_predictor_count; + /// motion estimation prepass comparison function - encoding: Set by user. - decoding: unused + public int @me_pre_cmp; + /// ME prepass diamond size & shape - encoding: Set by user. - decoding: unused + public int @pre_dia_size; + /// subpel ME quality - encoding: Set by user. - decoding: unused + public int @me_subpel_quality; + /// maximum motion estimation search range in subpel units If 0 then no limit. + public int @me_range; + /// macroblock decision mode - encoding: Set by user. - decoding: unused + public int @mb_decision; + /// custom intra quantization matrix Must be allocated with the av_malloc() family of functions, and will be freed in avcodec_free_context(). - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. - decoding: Set/allocated/freed by libavcodec. + public ushort* @intra_matrix; + /// custom inter quantization matrix Must be allocated with the av_malloc() family of functions, and will be freed in avcodec_free_context(). - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. - decoding: Set/allocated/freed by libavcodec. + public ushort* @inter_matrix; + /// custom intra quantization matrix - encoding: Set by user, can be NULL. - decoding: unused. + public ushort* @chroma_intra_matrix; + /// precision of the intra DC coefficient - 8 - encoding: Set by user. - decoding: Set by libavcodec + public int @intra_dc_precision; + /// minimum MB Lagrange multiplier - encoding: Set by user. - decoding: unused + public int @mb_lmin; + /// maximum MB Lagrange multiplier - encoding: Set by user. - decoding: unused + public int @mb_lmax; + /// - encoding: Set by user. - decoding: unused + public int @bidir_refine; + /// minimum GOP size - encoding: Set by user. - decoding: unused + public int @keyint_min; + /// the number of pictures in a group of pictures, or 0 for intra_only - encoding: Set by user. - decoding: unused + public int @gop_size; + /// Note: Value depends upon the compare function used for fullpel ME. - encoding: Set by user. - decoding: unused + public int @mv0_threshold; + /// Number of slices. Indicates number of picture subdivisions. Used for parallelized decoding. - encoding: Set by user - decoding: unused + public int @slices; + /// samples per second + public int @sample_rate; + /// sample format + public AVSampleFormat @sample_fmt; + /// Audio channel layout. - encoding: must be set by the caller, to one of AVCodec.ch_layouts. - decoding: may be set by the caller if known e.g. from the container. The decoder can then override during decoding as needed. + public AVChannelLayout @ch_layout; + /// Number of samples per channel in an audio frame. + public int @frame_size; + /// number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs. + public int @block_align; + /// Audio cutoff bandwidth (0 means "automatic") - encoding: Set by user. - decoding: unused + public int @cutoff; + /// Type of service that the audio stream conveys. - encoding: Set by user. - decoding: Set by libavcodec. + public AVAudioServiceType @audio_service_type; + /// desired sample format - encoding: Not used. - decoding: Set by user. Decoder will decode to this format if it can. + public AVSampleFormat @request_sample_fmt; + /// Audio only. The number of "priming" samples (padding) inserted by the encoder at the beginning of the audio. I.e. this number of leading decoded samples must be discarded by the caller to get the original audio without leading padding. + public int @initial_padding; + /// Audio only. The amount of padding (in samples) appended by the encoder to the end of the audio. I.e. this number of decoded samples must be discarded by the caller from the end of the stream to get the original audio without any trailing padding. + public int @trailing_padding; + /// Number of samples to skip after a discontinuity - decoding: unused - encoding: set by libavcodec + public int @seek_preroll; + /// This callback is called at the beginning of each frame to get data buffer(s) for it. There may be one contiguous buffer for all the data or there may be a buffer per each data plane or anything in between. What this means is, you may set however many entries in buf[] you feel necessary. Each buffer must be reference-counted using the AVBuffer API (see description of buf[] below). + public AVCodecContext_get_buffer2_func @get_buffer2; + /// number of bits the bitstream is allowed to diverge from the reference. the reference can be CBR (for CBR pass1) or VBR (for pass2) - encoding: Set by user; unused for constant quantizer encoding. - decoding: unused + public int @bit_rate_tolerance; + /// Global quality for codecs which cannot change it per frame. This should be proportional to MPEG-1/2/4 qscale. - encoding: Set by user. - decoding: unused + public int @global_quality; + /// - encoding: Set by user. - decoding: unused + public int @compression_level; + /// amount of qscale change between easy & hard scenes (0.0-1.0) + public float @qcompress; + /// amount of qscale smoothing over time (0.0-1.0) + public float @qblur; + /// minimum quantizer - encoding: Set by user. - decoding: unused + public int @qmin; + /// maximum quantizer - encoding: Set by user. - decoding: unused + public int @qmax; + /// maximum quantizer difference between frames - encoding: Set by user. - decoding: unused + public int @max_qdiff; + /// decoder bitstream buffer size - encoding: Set by user. - decoding: May be set by libavcodec. + public int @rc_buffer_size; + /// ratecontrol override, see RcOverride - encoding: Allocated/set/freed by user. - decoding: unused + public int @rc_override_count; + public RcOverride* @rc_override; + /// maximum bitrate - encoding: Set by user. - decoding: Set by user, may be overwritten by libavcodec. + public long @rc_max_rate; + /// minimum bitrate - encoding: Set by user. - decoding: unused + public long @rc_min_rate; + /// Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow. - encoding: Set by user. - decoding: unused. + public float @rc_max_available_vbv_use; + /// Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow. - encoding: Set by user. - decoding: unused. + public float @rc_min_vbv_overflow_use; + /// Number of bits which should be loaded into the rc buffer before decoding starts. - encoding: Set by user. - decoding: unused + public int @rc_initial_buffer_occupancy; + /// trellis RD quantization - encoding: Set by user. - decoding: unused + public int @trellis; + /// pass1 encoding statistics output buffer - encoding: Set by libavcodec. - decoding: unused + public byte* @stats_out; + /// pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed here. - encoding: Allocated/set/freed by user. - decoding: unused + public byte* @stats_in; + /// Work around bugs in encoders which sometimes cannot be detected automatically. - encoding: Set by user - decoding: Set by user + public int @workaround_bugs; + /// strictly follow the standard (MPEG-4, ...). - encoding: Set by user. - decoding: Set by user. Setting this to STRICT or higher means the encoder and decoder will generally do stupid things, whereas setting it to unofficial or lower will mean the encoder might produce output that is not supported by all spec-compliant decoders. Decoders don't differentiate between normal, unofficial and experimental (that is, they always try to decode things when they can) unless they are explicitly asked to behave stupidly (=strictly conform to the specs) This may only be set to one of the FF_COMPLIANCE_* values in defs.h. + public int @strict_std_compliance; + /// error concealment flags - encoding: unused - decoding: Set by user. + public int @error_concealment; + /// debug - encoding: Set by user. - decoding: Set by user. + public int @debug; + /// Error recognition; may misdetect some more or less valid parts as errors. This is a bitfield of the AV_EF_* values defined in defs.h. + public int @err_recognition; + /// Hardware accelerator in use - encoding: unused. - decoding: Set by libavcodec + public AVHWAccel* @hwaccel; + /// Legacy hardware accelerator context. + public void* @hwaccel_context; + /// A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames. The reference is set by the caller and afterwards owned (and freed) by libavcodec - it should never be read by the caller after being set. + public AVBufferRef* @hw_frames_ctx; + /// A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/decoder. The reference is set by the caller and afterwards owned (and freed) by libavcodec. + public AVBufferRef* @hw_device_ctx; + /// Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated decoding (if active). - encoding: unused - decoding: Set by user (either before avcodec_open2(), or in the AVCodecContext.get_format callback) + public int @hwaccel_flags; + /// Video decoding only. Sets the number of extra hardware frames which the decoder will allocate for use by the caller. This must be set before avcodec_open2() is called. + public int @extra_hw_frames; + /// error - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. - decoding: unused + public ulong8 @error; + /// DCT algorithm, see FF_DCT_* below - encoding: Set by user. - decoding: unused + public int @dct_algo; + /// IDCT algorithm, see FF_IDCT_* below. - encoding: Set by user. - decoding: Set by user. + public int @idct_algo; + /// bits per sample/pixel from the demuxer (needed for huffyuv). - encoding: Set by libavcodec. - decoding: Set by user. + public int @bits_per_coded_sample; + /// Bits per sample/pixel of internal libavcodec pixel/sample format. - encoding: set by user. - decoding: set by libavcodec. + public int @bits_per_raw_sample; + /// thread count is used to decide how many independent tasks should be passed to execute() - encoding: Set by user. - decoding: Set by user. + public int @thread_count; + /// Which multithreading methods to use. Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, so clients which cannot provide future frames should not use it. + public int @thread_type; + /// Which multithreading methods are in use by the codec. - encoding: Set by libavcodec. - decoding: Set by libavcodec. + public int @active_thread_type; + /// The codec may call this to execute several independent things. It will return only after finishing all tasks. The user may replace this with some multithreaded implementation, the default implementation will execute the parts serially. + public AVCodecContext_execute_func @execute; + /// The codec may call this to execute several independent things. It will return only after finishing all tasks. The user may replace this with some multithreaded implementation, the default implementation will execute the parts serially. + public AVCodecContext_execute2_func @execute2; + /// profile - encoding: Set by user. - decoding: Set by libavcodec. See the AV_PROFILE_* defines in defs.h. + public int @profile; + /// Encoding level descriptor. - encoding: Set by user, corresponds to a specific level defined by the codec, usually corresponding to the profile level, if not specified it is set to FF_LEVEL_UNKNOWN. - decoding: Set by libavcodec. See AV_LEVEL_* in defs.h. + public int @level; + /// Properties of the stream that gets decoded - encoding: unused - decoding: set by libavcodec + public uint @properties; + /// Skip loop filtering for selected frames. - encoding: unused - decoding: Set by user. + public AVDiscard @skip_loop_filter; + /// Skip IDCT/dequantization for selected frames. - encoding: unused - decoding: Set by user. + public AVDiscard @skip_idct; + /// Skip decoding for selected frames. - encoding: unused - decoding: Set by user. + public AVDiscard @skip_frame; + /// Skip processing alpha if supported by codec. Note that if the format uses pre-multiplied alpha (common with VP6, and recommended due to better video quality/compression) the image will look as if alpha-blended onto a black background. However for formats that do not use pre-multiplied alpha there might be serious artefacts (though e.g. libswscale currently assumes pre-multiplied alpha anyway). + public int @skip_alpha; + /// Number of macroblock rows at the top which are skipped. - encoding: unused - decoding: Set by user. + public int @skip_top; + /// Number of macroblock rows at the bottom which are skipped. - encoding: unused - decoding: Set by user. + public int @skip_bottom; + /// low resolution decoding, 1-> 1/2 size, 2->1/4 size - encoding: unused - decoding: Set by user. + public int @lowres; + /// AVCodecDescriptor - encoding: unused. - decoding: set by libavcodec. + public AVCodecDescriptor* @codec_descriptor; + /// Character encoding of the input subtitles file. - decoding: set by user - encoding: unused + public byte* @sub_charenc; + /// Subtitles character encoding mode. Formats or codecs might be adjusting this setting (if they are doing the conversion themselves for instance). - decoding: set by libavcodec - encoding: unused + public int @sub_charenc_mode; + /// Header containing style information for text subtitles. For SUBTITLE_ASS subtitle type, it should contain the whole ASS [Script Info] and [V4+ Styles] section, plus the [Events] line and the Format line following. It shouldn't include any Dialogue line. - encoding: Set/allocated/freed by user (before avcodec_open2()) - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) + public int @subtitle_header_size; + public byte* @subtitle_header; + /// dump format separator. can be ", " or " " or anything else - encoding: Set by user. - decoding: Set by user. + public byte* @dump_separator; + /// ',' separated list of allowed decoders. If NULL then all are allowed - encoding: unused - decoding: set by user + public byte* @codec_whitelist; + /// Additional data associated with the entire coded stream. + public AVPacketSideData* @coded_side_data; + public int @nb_coded_side_data; + /// Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame, packet, or coded stream side data by decoders and encoders. + public int @export_side_data; + /// The number of pixels per image to maximally accept. + public long @max_pixels; + /// Video decoding only. Certain video codecs support cropping, meaning that only a sub-rectangle of the decoded frame is intended for display. This option controls how cropping is handled by libavcodec. + public int @apply_cropping; + /// The percentage of damaged samples to discard a frame. + public int @discard_damaged_percentage; + /// The number of samples per frame to maximally accept. + public long @max_samples; + /// This callback is called at the beginning of each packet to get a data buffer for it. + public AVCodecContext_get_encode_buffer_func @get_encode_buffer; + /// Frame counter, set by libavcodec. + public long @frame_num; + /// Decoding only. May be set by the caller before avcodec_open2() to an av_malloc()'ed array (or via AVOptions). Owned and freed by the decoder afterwards. + public int* @side_data_prefer_packet; + /// Number of entries in side_data_prefer_packet. + public uint @nb_side_data_prefer_packet; + /// Array containing static side data, such as HDR10 CLL / MDCV structures. Side data entries should be allocated by usage of helpers defined in libavutil/frame.h. + public AVFrameSideData** @decoded_side_data; + public int @nb_decoded_side_data; + } + + /// This struct describes the properties of a single codec described by an AVCodecID. + public unsafe partial struct AVCodecDescriptor + { + public AVCodecID @id; + public AVMediaType @type; + /// Name of the codec described by this descriptor. It is non-empty and unique for each codec descriptor. It should contain alphanumeric characters and '_' only. + public byte* @name; + /// A more descriptive name for this codec. May be NULL. + public byte* @long_name; + /// Codec properties, a combination of AV_CODEC_PROP_* flags. + public int @props; + /// MIME type(s) associated with the codec. May be NULL; if not, a NULL-terminated array of MIME types. The first item is always non-NULL and is the preferred MIME type. + public byte** @mime_types; + /// If non-NULL, an array of profiles recognized for this codec. Terminated with AV_PROFILE_UNKNOWN. + public AVProfile* @profiles; + } + + // public unsafe partial struct AVCodecHWConfig + // { + // /// For decoders, a hardware pixel format which that decoder may be able to decode to if suitable hardware is available. + // public AVPixelFormat @pix_fmt; + // /// Bit set of AV_CODEC_HW_CONFIG_METHOD_* flags, describing the possible setup methods which can be used with this configuration. + // public int @methods; + // /// The device type associated with the configuration. + // public AVHWDeviceType @device_type; + // } + + /// This struct describes the properties of an encoded stream. + public unsafe partial struct AVCodecParameters + { + /// General type of the encoded data. + public AVMediaType @codec_type; + /// Specific type of the encoded data (the codec used). + public AVCodecID @codec_id; + /// Additional information about the codec (corresponds to the AVI FOURCC). + public uint @codec_tag; + /// Extra binary data needed for initializing the decoder, codec-dependent. + public byte* @extradata; + /// Size of the extradata content in bytes. + public int @extradata_size; + /// Additional data associated with the entire stream. + public AVPacketSideData* @coded_side_data; + /// Amount of entries in coded_side_data. + public int @nb_coded_side_data; + /// - video: the pixel format, the value corresponds to enum AVPixelFormat. - audio: the sample format, the value corresponds to enum AVSampleFormat. + public int @format; + /// The average bitrate of the encoded data (in bits per second). + public long @bit_rate; + /// The number of bits per sample in the codedwords. + public int @bits_per_coded_sample; + /// This is the number of valid bits in each output sample. If the sample format has more bits, the least significant bits are additional padding bits, which are always 0. Use right shifts to reduce the sample to its actual size. For example, audio formats with 24 bit samples will have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. To get the original sample use "(int32_t)sample >> 8"." + public int @bits_per_raw_sample; + /// Codec-specific bitstream restrictions that the stream conforms to. + public int @profile; + public int @level; + /// Video only. The dimensions of the video frame in pixels. + public int @width; + public int @height; + /// Video only. The aspect ratio (width / height) which a single pixel should have when displayed. + public AVRational @sample_aspect_ratio; + /// Video only. Number of frames per second, for streams with constant frame durations. Should be set to { 0, 1 } when some frames have differing durations or if the value is not known. + public AVRational @framerate; + /// Video only. The order of the fields in interlaced video. + public AVFieldOrder @field_order; + /// Video only. Additional colorspace characteristics. + public AVColorRange @color_range; + public AVColorPrimaries @color_primaries; + public AVColorTransferCharacteristic @color_trc; + public AVColorSpace @color_space; + public AVChromaLocation @chroma_location; + /// Video only. Number of delayed frames. + public int @video_delay; + /// Audio only. The channel layout and number of channels. + public AVChannelLayout @ch_layout; + /// Audio only. The number of audio samples per second. + public int @sample_rate; + /// Audio only. The number of bytes per coded audio frame, required by some formats. + public int @block_align; + /// Audio only. Audio frame size, if known. Required by some formats to be static. + public int @frame_size; + /// Audio only. The amount of padding (in samples) inserted by the encoder at the beginning of the audio. I.e. this number of leading decoded samples must be discarded by the caller to get the original audio without leading padding. + public int @initial_padding; + /// Audio only. The amount of padding (in samples) appended by the encoder to the end of the audio. I.e. this number of decoded samples must be discarded by the caller from the end of the stream to get the original audio without any trailing padding. + public int @trailing_padding; + /// Audio only. Number of samples to skip after a discontinuity. + public int @seek_preroll; + } + + public unsafe partial struct AVCodecParser + { + public int7 @codec_ids; + public int @priv_data_size; + public AVCodecParser_parser_init_func @parser_init; + public AVCodecParser_parser_parse_func @parser_parse; + public AVCodecParser_parser_close_func @parser_close; + public AVCodecParser_split_func @split; + } + + public unsafe partial struct AVCodecParserContext + { + public void* @priv_data; + public AVCodecParser* @parser; + public long @frame_offset; + public long @cur_offset; + public long @next_frame_offset; + public int @pict_type; + /// This field is used for proper frame duration computation in lavf. It signals, how much longer the frame duration of the current frame is compared to normal frame duration. + public int @repeat_pict; + public long @pts; + public long @dts; + public long @last_pts; + public long @last_dts; + public int @fetch_timestamp; + public int @cur_frame_start_index; + public long4 @cur_frame_offset; + public long4 @cur_frame_pts; + public long4 @cur_frame_dts; + public int @flags; + /// byte offset from starting packet start + public long @offset; + public long4 @cur_frame_end; + /// Set by parser to 1 for key frames and 0 for non-key frames. It is initialized to -1, so if the parser doesn't set this flag, old-style fallback using AV_PICTURE_TYPE_I picture type as key frames will be used. + public int @key_frame; + /// Synchronization point for start of timestamp generation. + public int @dts_sync_point; + /// Offset of the current timestamp against last timestamp sync point in units of AVCodecContext.time_base. + public int @dts_ref_dts_delta; + /// Presentation delay of current frame in units of AVCodecContext.time_base. + public int @pts_dts_delta; + /// Position of the packet in file. + public long4 @cur_frame_pos; + /// Byte position of currently parsed frame in stream. + public long @pos; + /// Previous frame byte position. + public long @last_pos; + /// Duration of the current frame. For audio, this is in units of 1 / AVCodecContext.sample_rate. For all other types, this is in units of AVCodecContext.time_base. + public int @duration; + public AVFieldOrder @field_order; + /// Indicate whether a picture is coded as a frame, top field or bottom field. + public AVPictureStructure @picture_structure; + /// Picture number incremented in presentation or output order. This field may be reinitialized at the first picture of a new sequence. + public int @output_picture_number; + /// Dimensions of the decoded video intended for presentation. + public int @width; + public int @height; + /// Dimensions of the coded video. + public int @coded_width; + public int @coded_height; + /// The format of the coded data, corresponds to enum AVPixelFormat for video and for enum AVSampleFormat for audio. + public int @format; + } + + public unsafe partial struct AVComponentDescriptor + { + /// Which of the 4 planes contains the component. + public int @plane; + /// Number of elements between 2 horizontally consecutive pixels. Elements are bits for bitstream formats, bytes otherwise. + public int @step; + /// Number of elements before the component of the first pixel. Elements are bits for bitstream formats, bytes otherwise. + public int @offset; + /// Number of least significant bits that must be shifted away to get the value. + public int @shift; + /// Number of bits in the component. + public int @depth; + } + + // /// Content light level needed by to transmit HDR over HDMI (CTA-861.3). + // public unsafe partial struct AVContentLightMetadata + // { + // /// Max content light level (cd/m^2). + // public uint @MaxCLL; + // /// Max average light level per frame (cd/m^2). + // public uint @MaxFALL; + // } + + // /// This structure describes the bitrate properties of an encoded bitstream. It roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD parameters for H.264/HEVC. + // public unsafe partial struct AVCPBProperties + // { + // /// Maximum bitrate of the stream, in bits per second. Zero if unknown or unspecified. + // public long @max_bitrate; + // /// Minimum bitrate of the stream, in bits per second. Zero if unknown or unspecified. + // public long @min_bitrate; + // /// Average bitrate of the stream, in bits per second. Zero if unknown or unspecified. + // public long @avg_bitrate; + // /// The size of the buffer to which the ratecontrol is applied, in bits. Zero if unknown or unspecified. + // public long @buffer_size; + // /// The delay between the time the packet this structure is associated with is received and the time when it should be decoded, in periods of a 27MHz clock. + // public ulong @vbv_delay; + // } + + // /// D3D11 frame descriptor for pool allocation. + // public unsafe partial struct AVD3D11FrameDescriptor + // { + // /// The texture in which the frame is located. The reference count is managed by the AVBufferRef, and destroying the reference will release the interface. + // public ID3D11Texture2D* @texture; + // /// The index into the array texture element representing the frame, or 0 if the texture is not an array texture. + // public long @index; + // } + + // /// This structure is used to provides the necessary configurations and data to the Direct3D11 leviathan HWAccel implementation. + // public unsafe partial struct AVD3D11VAContext + // { + // /// D3D11 decoder object + // public ID3D11VideoDecoder* @decoder; + // /// D3D11 VideoContext + // public ID3D11VideoContext* @video_context; + // /// D3D11 configuration used to create the decoder + // public D3D11_VIDEO_DECODER_CONFIG* @cfg; + // /// The number of surface in the surface array + // public uint @surface_count; + // /// The array of Direct3D surfaces used to create the decoder + // public ID3D11VideoDecoderOutputView** @surface; + // /// A bit field configuring the workarounds needed for using the decoder + // public ulong @workaround; + // /// Private to the leviathan AVHWAccel implementation + // public uint @report_id; + // /// Mutex to access video_context + // public void* @context_mutex; + // } + + // /// This struct is allocated as AVHWDeviceContext.hwctx + // public unsafe partial struct AVD3D11VADeviceContext + // { + // /// Device used for texture creation and access. This can also be used to set the libavcodec decoding device. + // public ID3D11Device* @device; + // /// If unset, this will be set from the device field on init. + // public ID3D11DeviceContext* @device_context; + // /// If unset, this will be set from the device field on init. + // public ID3D11VideoDevice* @video_device; + // /// If unset, this will be set from the device_context field on init. + // public ID3D11VideoContext* @video_context; + // /// Callbacks for locking. They protect accesses to device_context and video_context calls. They also protect access to the internal staging texture (for av_hwframe_transfer_data() calls). They do NOT protect access to hwcontext or decoder state in general. + // public AVD3D11VADeviceContext_lock_func @lock; + // public AVD3D11VADeviceContext_unlock_func @unlock; + // public void* @lock_ctx; + // } + + // /// This struct is allocated as AVHWFramesContext.hwctx + // public unsafe partial struct AVD3D11VAFramesContext + // { + // /// The canonical texture used for pool allocation. If this is set to NULL on init, the hwframes implementation will allocate and set an array texture if initial_pool_size > 0. + // public ID3D11Texture2D* @texture; + // /// D3D11_TEXTURE2D_DESC.BindFlags used for texture creation. The user must at least set D3D11_BIND_DECODER if the frames context is to be used for video decoding. This field is ignored/invalid if a user-allocated texture is provided. + // public uint @BindFlags; + // /// D3D11_TEXTURE2D_DESC.MiscFlags used for texture creation. This field is ignored/invalid if a user-allocated texture is provided. + // public uint @MiscFlags; + // /// In case if texture structure member above is not NULL contains the same texture pointer for all elements and different indexes into the array texture. In case if texture structure member above is NULL, all elements contains pointers to separate non-array textures and 0 indexes. This field is ignored/invalid if a user-allocated texture is provided. + // public AVD3D11FrameDescriptor* @texture_infos; + // } + + // /// Structure describes basic parameters of the device. + // public unsafe partial struct AVDeviceInfo + // { + // /// device name, format depends on device + // public byte* @device_name; + // /// human friendly name + // public byte* @device_description; + // /// array indicating what media types(s), if any, a device can provide. If null, cannot provide any + // public AVMediaType* @media_types; + // /// length of media_types array, 0 if device cannot provide any media types + // public int @nb_media_types; + // } + + // /// List of devices. + // public unsafe partial struct AVDeviceInfoList + // { + // /// list of autodetected devices + // public AVDeviceInfo** @devices; + // /// number of autodetected devices + // public int @nb_devices; + // /// index of default device or -1 if no default + // public int @default_device; + // } + + // public unsafe partial struct AVDeviceRect + // { + // /// x coordinate of top left corner + // public int @x; + // /// y coordinate of top left corner + // public int @y; + // /// width + // public int @width; + // /// height + // public int @height; + // } + + // /// @} + // public unsafe partial struct AVDictionaryEntry + // { + // public byte* @key; + // public byte* @value; + // } + + // /// This struct is allocated as AVHWDeviceContext.hwctx + // public unsafe partial struct AVDXVA2DeviceContext + // { + // public IDirect3DDeviceManager9* @devmgr; + // } + + // /// This struct is allocated as AVHWFramesContext.hwctx + // public unsafe partial struct AVDXVA2FramesContext + // { + // /// The surface type (e.g. DXVA2_VideoProcessorRenderTarget or DXVA2_VideoDecoderRenderTarget). Must be set by the caller. + // public ulong @surface_type; + // /// The surface pool. When an external pool is not provided by the caller, this will be managed (allocated and filled on init, freed on uninit) by libavutil. + // public IDirect3DSurface9** @surfaces; + // public int @nb_surfaces; + // /// Certain drivers require the decoder to be destroyed before the surfaces. To allow internally managed pools to work properly in such cases, this field is provided. + // public IDirectXVideoDecoder* @decoder_to_release; + // } + + /// This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2016 standard. + // public unsafe partial struct AVDynamicHDRPlus + // { + // /// Country code by Rec. ITU-T T.35 Annex A. The value shall be 0xB5. + // public byte @itu_t_t35_country_code; + // /// Application version in the application defining document in ST-2094 suite. The value shall be set to 0. + // public byte @application_version; + // /// The number of processing windows. The value shall be in the range of 1 to 3, inclusive. + // public byte @num_windows; + // /// The color transform parameters for every processing window. + // public AVHDRPlusColorTransformParams3 @params; + // /// The nominal maximum display luminance of the targeted system display, in units of 0.0001 candelas per square metre. The value shall be in the range of 0 to 10000, inclusive. + // public AVRational @targeted_system_display_maximum_luminance; + // /// This flag shall be equal to 0 in bit streams conforming to this version of this Specification. The value 1 is reserved for future use. + // public byte @targeted_system_display_actual_peak_luminance_flag; + // /// The number of rows in the targeted system_display_actual_peak_luminance array. The value shall be in the range of 2 to 25, inclusive. + // public byte @num_rows_targeted_system_display_actual_peak_luminance; + // /// The number of columns in the targeted_system_display_actual_peak_luminance array. The value shall be in the range of 2 to 25, inclusive. + // public byte @num_cols_targeted_system_display_actual_peak_luminance; + // /// The normalized actual peak luminance of the targeted system display. The values should be in the range of 0 to 1, inclusive and in multiples of 1/15. + // public AVRational25x25 @targeted_system_display_actual_peak_luminance; + // /// This flag shall be equal to 0 in bitstreams conforming to this version of this Specification. The value 1 is reserved for future use. + // public byte @mastering_display_actual_peak_luminance_flag; + // /// The number of rows in the mastering_display_actual_peak_luminance array. The value shall be in the range of 2 to 25, inclusive. + // public byte @num_rows_mastering_display_actual_peak_luminance; + // /// The number of columns in the mastering_display_actual_peak_luminance array. The value shall be in the range of 2 to 25, inclusive. + // public byte @num_cols_mastering_display_actual_peak_luminance; + // /// The normalized actual peak luminance of the mastering display used for mastering the image essence. The values should be in the range of 0 to 1, inclusive and in multiples of 1/15. + // public AVRational25x25 @mastering_display_actual_peak_luminance; + // } + + /// Filter definition. This defines the pads a filter contains, and all the callback functions used to interact with the filter. + public unsafe partial struct AVFilter + { + /// Filter name. Must be non-NULL and unique among filters. + public byte* @name; + /// A description of the filter. May be NULL. + public byte* @description; + /// List of static inputs. + public AVFilterPad* @inputs; + /// List of static outputs. + public AVFilterPad* @outputs; + /// A class for the private data, used to declare filter private AVOptions. This field is NULL for filters that do not declare any options. + public AVClass* @priv_class; + /// A combination of AVFILTER_FLAG_* + public int @flags; + /// The number of entries in the list of inputs. + public byte @nb_inputs; + /// The number of entries in the list of outputs. + public byte @nb_outputs; + /// This field determines the state of the formats union. It is an enum FilterFormatsState value. + public byte @formats_state; + /// Filter pre-initialization function + public AVFilter_preinit_func @preinit; + /// Filter initialization function. + public AVFilter_init_func @init; + /// Filter uninitialization function. + public AVFilter_uninit_func @uninit; + public AVFilter_formats @formats; + /// size of private data to allocate for the filter + public int @priv_size; + /// Additional flags for avfilter internal use only. + public int @flags_internal; + /// Make the filter instance process a command. + public AVFilter_process_command_func @process_command; + /// Filter activation function. + public AVFilter_activate_func @activate; + } + + /// The state of the following union is determined by formats_state. See the documentation of enum FilterFormatsState in internal.h. + [StructLayout(LayoutKind.Explicit)] + public unsafe partial struct AVFilter_formats + { + /// Query formats supported by the filter on its inputs and outputs. + [FieldOffset(0)] + public _query_func_func @query_func; + /// A pointer to an array of admissible pixel formats delimited by AV_PIX_FMT_NONE. The generic code will use this list to indicate that this filter supports each of these pixel formats, provided that all inputs and outputs use the same pixel format. + [FieldOffset(0)] + public AVPixelFormat* @pixels_list; + /// Analogous to pixels, but delimited by AV_SAMPLE_FMT_NONE and restricted to filters that only have AVMEDIA_TYPE_AUDIO inputs and outputs. + [FieldOffset(0)] + public AVSampleFormat* @samples_list; + /// Equivalent to { pix_fmt, AV_PIX_FMT_NONE } as pixels_list. + [FieldOffset(0)] + public AVPixelFormat @pix_fmt; + /// Equivalent to { sample_fmt, AV_SAMPLE_FMT_NONE } as samples_list. + [FieldOffset(0)] + public AVSampleFormat @sample_fmt; + } + + // /// A filterchain is a list of filter specifications. + // public unsafe partial struct AVFilterChain + // { + // public AVFilterParams** @filters; + // public ulong @nb_filters; + // } + + /// An instance of a filter + public unsafe partial struct AVFilterContext + { + /// needed for av_log() and filters common options + public AVClass* @av_class; + /// the AVFilter of which this is an instance + public AVFilter* @filter; + /// name of this filter instance + public byte* @name; + /// array of input pads + public AVFilterPad* @input_pads; + /// array of pointers to input links + public AVFilterLink** @inputs; + /// number of input pads + public uint @nb_inputs; + /// array of output pads + public AVFilterPad* @output_pads; + /// array of pointers to output links + public AVFilterLink** @outputs; + /// number of output pads + public uint @nb_outputs; + /// private data for use by the filter + public void* @priv; + /// filtergraph this filter belongs to + public AVFilterGraph* @graph; + /// Type of multithreading being allowed/used. A combination of AVFILTER_THREAD_* flags. + public int @thread_type; + /// Max number of threads allowed in this filter instance. If <= 0, its value is ignored. Overrides global number of threads set per filter graph. + public int @nb_threads; + public AVFilterCommand* @command_queue; + /// enable expression string + public byte* @enable_str; + /// parsed expression (AVExpr*) + public void* @enable; + /// variable values for the enable expression + public double* @var_values; + /// the enabled state from the last expression evaluation + public int @is_disabled; + /// For filters which will create hardware frames, sets the device the filter should create them in. All other filters will ignore this field: in particular, a filter which consumes or processes hardware frames will instead use the hw_frames_ctx field in AVFilterLink to carry the hardware context information. + public AVBufferRef* @hw_device_ctx; + /// Ready status of the filter. A non-0 value means that the filter needs activating; a higher value suggests a more urgent activation. + public uint @ready; + /// Sets the number of extra hardware frames which the filter will allocate on its output links for use in following filters or by the caller. + public int @extra_hw_frames; + } + + /// Lists of formats / etc. supported by an end of a link. + public unsafe partial struct AVFilterFormatsConfig + { + /// List of supported formats (pixel or sample). + public AVFilterFormats* @formats; + /// Lists of supported sample rates, only for audio. + public AVFilterFormats* @samplerates; + /// Lists of supported channel layouts, only for audio. + public AVFilterChannelLayouts* @channel_layouts; + /// AVColorSpace + public AVFilterFormats* @color_spaces; + /// AVColorRange + public AVFilterFormats* @color_ranges; + } + + public unsafe partial struct AVFilterGraph + { + public AVClass* @av_class; + public AVFilterContext** @filters; + public uint @nb_filters; + /// sws options to use for the auto-inserted scale filters + public byte* @scale_sws_opts; + /// Type of multithreading allowed for filters in this graph. A combination of AVFILTER_THREAD_* flags. + public int @thread_type; + /// Maximum number of threads used by filters in this graph. May be set by the caller before adding any filters to the filtergraph. Zero (the default) means that the number of threads is determined automatically. + public int @nb_threads; + /// Opaque user data. May be set by the caller to an arbitrary value, e.g. to be used from callbacks like AVFilterGraph.execute. Libavfilter will not touch this field in any way. + public void* @opaque; + /// This callback may be set by the caller immediately after allocating the graph and before adding any filters to it, to provide a custom multithreading implementation. + public AVFilterGraph_execute_func @execute; + /// swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions + public byte* @aresample_swr_opts; + } + + // /// A parsed representation of a filtergraph segment. + // public unsafe partial struct AVFilterGraphSegment + // { + // /// The filtergraph this segment is associated with. Set by avfilter_graph_segment_parse(). + // public AVFilterGraph* @graph; + // /// A list of filter chain contained in this segment. Set in avfilter_graph_segment_parse(). + // public AVFilterChain** @chains; + // public ulong @nb_chains; + // /// A string containing a colon-separated list of key=value options applied to all scale filters in this segment. + // public byte* @scale_sws_opts; + // } + + /// A linked-list of the inputs/outputs of the filter chain. + public unsafe partial struct AVFilterInOut + { + /// unique name for this input/output in the list + public byte* @name; + /// filter context associated to this input/output + public AVFilterContext* @filter_ctx; + /// index of the filt_ctx pad to use for linking + public int @pad_idx; + /// next input/input in the list, NULL if this is the last + public AVFilterInOut* @next; + } + + /// A link between two filters. This contains pointers to the source and destination filters between which this link exists, and the indexes of the pads involved. In addition, this link also contains the parameters which have been negotiated and agreed upon between the filter, such as image dimensions, format, etc. + public unsafe partial struct AVFilterLink + { + /// source filter + public AVFilterContext* @src; + /// output pad on the source filter + public AVFilterPad* @srcpad; + /// dest filter + public AVFilterContext* @dst; + /// input pad on the dest filter + public AVFilterPad* @dstpad; + /// filter media type + public AVMediaType @type; + /// agreed upon media format + public int @format; + /// agreed upon image width + public int @w; + /// agreed upon image height + public int @h; + /// agreed upon sample aspect ratio + public AVRational @sample_aspect_ratio; + /// agreed upon YUV color space + public AVColorSpace @colorspace; + /// agreed upon YUV color range + public AVColorRange @color_range; + /// samples per second + public int @sample_rate; + /// channel layout of current buffer (see libavutil/channel_layout.h) + public AVChannelLayout @ch_layout; + /// Define the time base used by the PTS of the frames/samples which will pass through this link. During the configuration stage, each filter is supposed to change only the output timebase, while the timebase of the input link is assumed to be an unchangeable property. + public AVRational @time_base; + /// Lists of supported formats / etc. supported by the input filter. + public AVFilterFormatsConfig @incfg; + /// Lists of supported formats / etc. supported by the output filter. + public AVFilterFormatsConfig @outcfg; + /// Graph the filter belongs to. + public AVFilterGraph* @graph; + /// Current timestamp of the link, as defined by the most recent frame(s), in link time_base units. + public long @current_pts; + /// Current timestamp of the link, as defined by the most recent frame(s), in AV_TIME_BASE units. + public long @current_pts_us; + /// Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists. + public AVRational @frame_rate; + /// Minimum number of samples to filter at once. If filter_frame() is called with fewer samples, it will accumulate them in fifo. This field and the related ones must not be changed after filtering has started. If 0, all related fields are ignored. + public int @min_samples; + /// Maximum number of samples to filter at once. If filter_frame() is called with more samples, it will split them. + public int @max_samples; + /// Number of past frames sent through the link. + public long @frame_count_in; + /// Number of past frames sent through the link. + public long @frame_count_out; + /// Number of past samples sent through the link. + public long @sample_count_in; + /// Number of past samples sent through the link. + public long @sample_count_out; + /// True if a frame is currently wanted on the output of this filter. Set when ff_request_frame() is called by the output, cleared when a frame is filtered. + public int @frame_wanted_out; + /// For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames. + public AVBufferRef* @hw_frames_ctx; + } + + // /// Parameters of a filter's input or output pad. + // public unsafe partial struct AVFilterPadParams + // { + // /// An av_malloc()'ed string containing the pad label. + // public byte* @label; + // } + + // /// Parameters describing a filter to be created in a filtergraph. + // public unsafe partial struct AVFilterParams + // { + // /// The filter context. + // public AVFilterContext* @filter; + // /// Name of the AVFilter to be used. + // public byte* @filter_name; + // /// Name to be used for this filter instance. + // public byte* @instance_name; + // /// Options to be apllied to the filter. + // public AVDictionary* @opts; + // public AVFilterPadParams** @inputs; + // public uint @nb_inputs; + // public AVFilterPadParams** @outputs; + // public uint @nb_outputs; + // } + + /// Format I/O context. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVFormatContext) must not be used outside libav*, use avformat_alloc_context() to create an AVFormatContext. + public unsafe partial struct AVFormatContext + { + /// A class for logging and avoptions. Set by avformat_alloc_context(). Exports (de)muxer private options if they exist. + public AVClass* @av_class; + /// The input container format. + public AVInputFormat* @iformat; + /// The output container format. + public AVOutputFormat* @oformat; + /// Format private data. This is an AVOptions-enabled struct if and only if iformat/oformat.priv_class is not NULL. + public void* @priv_data; + /// I/O context. + public AVIOContext* @pb; + /// Flags signalling stream properties. A combination of AVFMTCTX_*. Set by libavformat. + public int @ctx_flags; + /// Number of elements in AVFormatContext.streams. + public uint @nb_streams; + /// A list of all streams in the file. New streams are created with avformat_new_stream(). + public AVStream** @streams; + /// Number of elements in AVFormatContext.stream_groups. + public uint @nb_stream_groups; + /// A list of all stream groups in the file. New groups are created with avformat_stream_group_create(), and filled with avformat_stream_group_add_stream(). + public AVStreamGroup** @stream_groups; + /// Number of chapters in AVChapter array. When muxing, chapters are normally written in the file header, so nb_chapters should normally be initialized before write_header is called. Some muxers (e.g. mov and mkv) can also write chapters in the trailer. To write chapters in the trailer, nb_chapters must be zero when write_header is called and non-zero when write_trailer is called. - muxing: set by user - demuxing: set by libavformat + public uint @nb_chapters; + public AVChapter** @chapters; + /// input or output URL. Unlike the old filename field, this field has no length restriction. + public byte* @url; + /// Position of the first frame of the component, in AV_TIME_BASE fractional seconds. NEVER set this value directly: It is deduced from the AVStream values. + public long @start_time; + /// Duration of the stream, in AV_TIME_BASE fractional seconds. Only set this value if you know none of the individual stream durations and also do not set any of them. This is deduced from the AVStream values if not set. + public long @duration; + /// Total stream bitrate in bit/s, 0 if not available. Never set it directly if the file_size and the duration are known as leviathan can compute it automatically. + public long @bit_rate; + public uint @packet_size; + public int @max_delay; + /// Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. Set by the user before avformat_open_input() / avformat_write_header(). + public int @flags; + /// Maximum number of bytes read from input in order to determine stream properties. Used when reading the global header and in avformat_find_stream_info(). + public long @probesize; + /// Maximum duration (in AV_TIME_BASE units) of the data read from input in avformat_find_stream_info(). Demuxing only, set by the caller before avformat_find_stream_info(). Can be set to 0 to let avformat choose using a heuristic. + public long @max_analyze_duration; + public byte* @key; + public int @keylen; + public uint @nb_programs; + public AVProgram** @programs; + /// Forced video codec_id. Demuxing: Set by user. + public AVCodecID @video_codec_id; + /// Forced audio codec_id. Demuxing: Set by user. + public AVCodecID @audio_codec_id; + /// Forced subtitle codec_id. Demuxing: Set by user. + public AVCodecID @subtitle_codec_id; + /// Forced Data codec_id. Demuxing: Set by user. + public AVCodecID @data_codec_id; + /// Metadata that applies to the whole file. + public AVDictionary* @metadata; + /// Start time of the stream in real world time, in microseconds since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the stream was captured at this real world time. - muxing: Set by the caller before avformat_write_header(). If set to either 0 or AV_NOPTS_VALUE, then the current wall-time will be used. - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that the value may become known after some number of frames have been received. + public long @start_time_realtime; + /// The number of frames used for determining the framerate in avformat_find_stream_info(). Demuxing only, set by the caller before avformat_find_stream_info(). + public int @fps_probe_size; + /// Error recognition; higher values will detect more errors but may misdetect some more or less valid parts as errors. Demuxing only, set by the caller before avformat_open_input(). + public int @error_recognition; + /// Custom interrupt callbacks for the I/O layer. + public AVIOInterruptCB @interrupt_callback; + /// Flags to enable debugging. + public int @debug; + /// The maximum number of streams. - encoding: unused - decoding: set by user + public int @max_streams; + /// Maximum amount of memory in bytes to use for the index of each stream. If the index exceeds this size, entries will be discarded as needed to maintain a smaller size. This can lead to slower or less accurate seeking (depends on demuxer). Demuxers for which a full in-memory index is mandatory will ignore this. - muxing: unused - demuxing: set by user + public uint @max_index_size; + /// Maximum amount of memory in bytes to use for buffering frames obtained from realtime capture devices. + public uint @max_picture_buffer; + /// Maximum buffering duration for interleaving. + public long @max_interleave_delta; + /// Maximum number of packets to read while waiting for the first timestamp. Decoding only. + public int @max_ts_probe; + /// Max chunk time in microseconds. Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user - decoding: unused + public int @max_chunk_duration; + /// Max chunk size in bytes Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user - decoding: unused + public int @max_chunk_size; + /// Maximum number of packets that can be probed - encoding: unused - decoding: set by user + public int @max_probe_packets; + /// Allow non-standard and experimental extension + public int @strict_std_compliance; + /// Flags indicating events happening on the file, a combination of AVFMT_EVENT_FLAG_*. + public int @event_flags; + /// Avoid negative timestamps during muxing. Any value of the AVFMT_AVOID_NEG_TS_* constants. Note, this works better when using av_interleaved_write_frame(). - muxing: Set by user - demuxing: unused + public int @avoid_negative_ts; + /// Audio preload in microseconds. Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user - decoding: unused + public int @audio_preload; + /// forces the use of wallclock timestamps as pts/dts of packets This has undefined results in the presence of B frames. - encoding: unused - decoding: Set by user + public int @use_wallclock_as_timestamps; + /// Skip duration calcuation in estimate_timings_from_pts. - encoding: unused - decoding: set by user + public int @skip_estimate_duration_from_pts; + /// avio flags, used to force AVIO_FLAG_DIRECT. - encoding: unused - decoding: Set by user + public int @avio_flags; + /// The duration field can be estimated through various ways, and this field can be used to know how the duration was estimated. - encoding: unused - decoding: Read by user + public AVDurationEstimationMethod @duration_estimation_method; + /// Skip initial bytes when opening stream - encoding: unused - decoding: Set by user + public long @skip_initial_bytes; + /// Correct single timestamp overflows - encoding: unused - decoding: Set by user + public uint @correct_ts_overflow; + /// Force seeking to any (also non key) frames. - encoding: unused - decoding: Set by user + public int @seek2any; + /// Flush the I/O context after each packet. - encoding: Set by user - decoding: unused + public int @flush_packets; + /// format probing score. The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes the format. - encoding: unused - decoding: set by avformat, read by user + public int @probe_score; + /// Maximum number of bytes read from input in order to identify the AVInputFormat "input format". Only used when the format is not set explicitly by the caller. + public int @format_probesize; + /// ',' separated list of allowed decoders. If NULL then all are allowed - encoding: unused - decoding: set by user + public byte* @codec_whitelist; + /// ',' separated list of allowed demuxers. If NULL then all are allowed - encoding: unused - decoding: set by user + public byte* @format_whitelist; + /// ',' separated list of allowed protocols. - encoding: unused - decoding: set by user + public byte* @protocol_whitelist; + /// ',' separated list of disallowed protocols. - encoding: unused - decoding: set by user + public byte* @protocol_blacklist; + /// IO repositioned flag. This is set by avformat when the underlaying IO context read pointer is repositioned, for example when doing byte based seeking. Demuxers can use the flag to detect such changes. + public int @io_repositioned; + /// Forced video codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user + public AVCodec* @video_codec; + /// Forced audio codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user + public AVCodec* @audio_codec; + /// Forced subtitle codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user + public AVCodec* @subtitle_codec; + /// Forced data codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user + public AVCodec* @data_codec; + /// Number of bytes to be written as padding in a metadata header. Demuxing: Unused. Muxing: Set by user. + public int @metadata_header_padding; + /// User data. This is a place for some private data of the user. + public void* @opaque; + /// Callback used by devices to communicate with application. + public AVFormatContext_control_message_cb_func @control_message_cb; + /// Output timestamp offset, in microseconds. Muxing: set by user + public long @output_ts_offset; + /// dump format separator. can be ", " or " " or anything else - muxing: Set by user. - demuxing: Set by user. + public byte* @dump_separator; + /// A callback for opening new IO streams. + public AVFormatContext_io_open_func @io_open; + /// A callback for closing the streams opened with AVFormatContext.io_open(). + public AVFormatContext_io_close2_func @io_close2; + } + + /// This structure describes decoded (raw) audio or video data. + public unsafe partial struct AVFrame + { + /// pointer to the picture/channel planes. This might be different from the first allocated byte. For video, it could even point to the end of the image data. + public byte_ptr8 @data; + /// For video, a positive or negative value, which is typically indicating the size in bytes of each picture line, but it can also be: - the negative byte size of lines for vertical flipping (with data[n] pointing to the end of the data - a positive or negative multiple of the byte size as for accessing even and odd fields of a frame (possibly flipped) + public int8 @linesize; + /// pointers to the data planes/channels. + public byte** @extended_data; + /// Video frames only. The coded dimensions (in pixels) of the video frame, i.e. the size of the rectangle that contains some well-defined values. + public int @width; + /// Video frames only. The coded dimensions (in pixels) of the video frame, i.e. the size of the rectangle that contains some well-defined values. + public int @height; + /// number of audio samples (per channel) described by this frame + public int @nb_samples; + /// format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames, enum AVSampleFormat for audio) + public int @format; + /// 1 -> keyframe, 0-> not + [Obsolete("Use AV_FRAME_FLAG_KEY instead")] + public int @key_frame; + /// Picture type of the frame. + public AVPictureType @pict_type; + /// Sample aspect ratio for the video frame, 0/1 if unknown/unspecified. + public AVRational @sample_aspect_ratio; + /// Presentation timestamp in time_base units (time when frame should be shown to user). + public long @pts; + /// DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used) This is also the Presentation time of this AVFrame calculated from only AVPacket.dts values without pts values. + public long @pkt_dts; + /// Time base for the timestamps in this frame. In the future, this field may be set on frames output by decoders or filters, but its value will be by default ignored on input to encoders or filters. + public AVRational @time_base; + /// quality (between 1 (good) and FF_LAMBDA_MAX (bad)) + public int @quality; + /// Frame owner's private data. + public void* @opaque; + /// Number of fields in this frame which should be repeated, i.e. the total duration of this frame should be repeat_pict + 2 normal field durations. + public int @repeat_pict; + /// The content of the picture is interlaced. + [Obsolete("Use AV_FRAME_FLAG_INTERLACED instead")] + public int @interlaced_frame; + /// If the content is interlaced, is top field displayed first. + [Obsolete("Use AV_FRAME_FLAG_TOP_FIELD_FIRST instead")] + public int @top_field_first; + /// Tell user application that palette has changed from previous frame. + public int @palette_has_changed; + /// Sample rate of the audio data. + public int @sample_rate; + /// AVBuffer references backing the data for this frame. All the pointers in data and extended_data must point inside one of the buffers in buf or extended_buf. This array must be filled contiguously -- if buf[i] is non-NULL then buf[j] must also be non-NULL for all j < i. + public AVBufferRef_ptr8 @buf; + /// For planar audio which requires more than AV_NUM_DATA_POINTERS AVBufferRef pointers, this array will hold all the references which cannot fit into AVFrame.buf. + public AVBufferRef** @extended_buf; + /// Number of elements in extended_buf. + public int @nb_extended_buf; + public AVFrameSideData** @side_data; + public int @nb_side_data; + /// Frame flags, a combination of lavu_frame_flags + public int @flags; + /// MPEG vs JPEG YUV range. - encoding: Set by user - decoding: Set by libavcodec + public AVColorRange @color_range; + public AVColorPrimaries @color_primaries; + public AVColorTransferCharacteristic @color_trc; + /// YUV colorspace type. - encoding: Set by user - decoding: Set by libavcodec + public AVColorSpace @colorspace; + public AVChromaLocation @chroma_location; + /// frame timestamp estimated using various heuristics, in stream time base - encoding: unused - decoding: set by libavcodec, read by user. + public long @best_effort_timestamp; + /// reordered pos from the last AVPacket that has been input into the decoder - encoding: unused - decoding: Read by user. + [Obsolete("use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user data from packets to frames")] + public long @pkt_pos; + /// metadata. - encoding: Set by user. - decoding: Set by libavcodec. + public AVDictionary* @metadata; + /// decode error flags of the frame, set to a combination of FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there were errors during the decoding. - encoding: unused - decoding: set by libavcodec, read by user. + public int @decode_error_flags; + /// size of the corresponding packet containing the compressed frame. It is set to a negative value if unknown. - encoding: unused - decoding: set by libavcodec, read by user. + [Obsolete("use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user data from packets to frames")] + public int @pkt_size; + /// For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame. + public AVBufferRef* @hw_frames_ctx; + /// Frame owner's private data. + public AVBufferRef* @opaque_ref; + /// cropping Video frames only. The number of pixels to discard from the the top/bottom/left/right border of the frame to obtain the sub-rectangle of the frame intended for presentation. @{ + public ulong @crop_top; + public ulong @crop_bottom; + public ulong @crop_left; + public ulong @crop_right; + /// AVBufferRef for internal use by a single libav* library. Must not be used to transfer data between libraries. Has to be NULL when ownership of the frame leaves the respective library. + public AVBufferRef* @private_ref; + /// Channel layout of the audio data. + public AVChannelLayout @ch_layout; + /// Duration of the frame, in the same units as pts. 0 if unknown. + public long @duration; + } + + /// Structure to hold side data for an AVFrame. + public unsafe partial struct AVFrameSideData + { + public AVFrameSideDataType @type; + public byte* @data; + public ulong @size; + public AVDictionary* @metadata; + public AVBufferRef* @buf; + } + + /// Color transform parameters at a processing window in a dynamic metadata for SMPTE 2094-40. + public unsafe partial struct AVHDRPlusColorTransformParams + { + /// The relative x coordinate of the top left pixel of the processing window. The value shall be in the range of 0 and 1, inclusive and in multiples of 1/(width of Picture - 1). The value 1 corresponds to the absolute coordinate of width of Picture - 1. The value for first processing window shall be 0. + public AVRational @window_upper_left_corner_x; + /// The relative y coordinate of the top left pixel of the processing window. The value shall be in the range of 0 and 1, inclusive and in multiples of 1/(height of Picture - 1). The value 1 corresponds to the absolute coordinate of height of Picture - 1. The value for first processing window shall be 0. + public AVRational @window_upper_left_corner_y; + /// The relative x coordinate of the bottom right pixel of the processing window. The value shall be in the range of 0 and 1, inclusive and in multiples of 1/(width of Picture - 1). The value 1 corresponds to the absolute coordinate of width of Picture - 1. The value for first processing window shall be 1. + public AVRational @window_lower_right_corner_x; + /// The relative y coordinate of the bottom right pixel of the processing window. The value shall be in the range of 0 and 1, inclusive and in multiples of 1/(height of Picture - 1). The value 1 corresponds to the absolute coordinate of height of Picture - 1. The value for first processing window shall be 1. + public AVRational @window_lower_right_corner_y; + /// The x coordinate of the center position of the concentric internal and external ellipses of the elliptical pixel selector in the processing window. The value shall be in the range of 0 to (width of Picture - 1), inclusive and in multiples of 1 pixel. + public ushort @center_of_ellipse_x; + /// The y coordinate of the center position of the concentric internal and external ellipses of the elliptical pixel selector in the processing window. The value shall be in the range of 0 to (height of Picture - 1), inclusive and in multiples of 1 pixel. + public ushort @center_of_ellipse_y; + /// The clockwise rotation angle in degree of arc with respect to the positive direction of the x-axis of the concentric internal and external ellipses of the elliptical pixel selector in the processing window. The value shall be in the range of 0 to 180, inclusive and in multiples of 1. + public byte @rotation_angle; + /// The semi-major axis value of the internal ellipse of the elliptical pixel selector in amount of pixels in the processing window. The value shall be in the range of 1 to 65535, inclusive and in multiples of 1 pixel. + public ushort @semimajor_axis_internal_ellipse; + /// The semi-major axis value of the external ellipse of the elliptical pixel selector in amount of pixels in the processing window. The value shall not be less than semimajor_axis_internal_ellipse of the current processing window. The value shall be in the range of 1 to 65535, inclusive and in multiples of 1 pixel. + public ushort @semimajor_axis_external_ellipse; + /// The semi-minor axis value of the external ellipse of the elliptical pixel selector in amount of pixels in the processing window. The value shall be in the range of 1 to 65535, inclusive and in multiples of 1 pixel. + public ushort @semiminor_axis_external_ellipse; + /// Overlap process option indicates one of the two methods of combining rendered pixels in the processing window in an image with at least one elliptical pixel selector. For overlapping elliptical pixel selectors in an image, overlap_process_option shall have the same value. + public AVHDRPlusOverlapProcessOption @overlap_process_option; + /// The maximum of the color components of linearized RGB values in the processing window in the scene. The values should be in the range of 0 to 1, inclusive and in multiples of 0.00001. maxscl[ 0 ], maxscl[ 1 ], and maxscl[ 2 ] are corresponding to R, G, B color components respectively. + public AVRational3 @maxscl; + /// The average of linearized maxRGB values in the processing window in the scene. The value should be in the range of 0 to 1, inclusive and in multiples of 0.00001. + public AVRational @average_maxrgb; + /// The number of linearized maxRGB values at given percentiles in the processing window in the scene. The maximum value shall be 15. + public byte @num_distribution_maxrgb_percentiles; + /// The linearized maxRGB values at given percentiles in the processing window in the scene. + public AVHDRPlusPercentile15 @distribution_maxrgb; + /// The fraction of selected pixels in the image that contains the brightest pixel in the scene. The value shall be in the range of 0 to 1, inclusive and in multiples of 0.001. + public AVRational @fraction_bright_pixels; + /// This flag indicates that the metadata for the tone mapping function in the processing window is present (for value of 1). + public byte @tone_mapping_flag; + /// The x coordinate of the separation point between the linear part and the curved part of the tone mapping function. The value shall be in the range of 0 to 1, excluding 0 and in multiples of 1/4095. + public AVRational @knee_point_x; + /// The y coordinate of the separation point between the linear part and the curved part of the tone mapping function. The value shall be in the range of 0 to 1, excluding 0 and in multiples of 1/4095. + public AVRational @knee_point_y; + /// The number of the intermediate anchor parameters of the tone mapping function in the processing window. The maximum value shall be 15. + public byte @num_bezier_curve_anchors; + /// The intermediate anchor parameters of the tone mapping function in the processing window in the scene. The values should be in the range of 0 to 1, inclusive and in multiples of 1/1023. + public AVRational15 @bezier_curve_anchors; + /// This flag shall be equal to 0 in bitstreams conforming to this version of this Specification. Other values are reserved for future use. + public byte @color_saturation_mapping_flag; + /// The color saturation gain in the processing window in the scene. The value shall be in the range of 0 to 63/8, inclusive and in multiples of 1/8. The default value shall be 1. + public AVRational @color_saturation_weight; + } + + /// Represents the percentile at a specific percentage in a distribution. + public unsafe partial struct AVHDRPlusPercentile + { + /// The percentage value corresponding to a specific percentile linearized RGB value in the processing window in the scene. The value shall be in the range of 0 to100, inclusive. + public byte @percentage; + /// The linearized maxRGB value at a specific percentile in the processing window in the scene. The value shall be in the range of 0 to 1, inclusive and in multiples of 0.00001. + public AVRational @percentile; + } + + public unsafe partial struct AVHWAccel + { + /// Name of the hardware accelerated codec. The name is globally unique among encoders and among decoders (but an encoder and a decoder can share the same name). + public byte* @name; + /// Type of codec implemented by the hardware accelerator. + public AVMediaType @type; + /// Codec implemented by the hardware accelerator. + public AVCodecID @id; + /// Supported pixel format. + public AVPixelFormat @pix_fmt; + /// Hardware accelerated codec capabilities. see AV_HWACCEL_CODEC_CAP_* + public int @capabilities; + } + + /// This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e. state that is not tied to a concrete processing configuration. E.g., in an API that supports hardware-accelerated encoding and decoding, this struct will (if possible) wrap the state that is common to both encoding and decoding and from which specific instances of encoders or decoders can be derived. + public unsafe partial struct AVHWDeviceContext + { + /// A class for logging. Set by av_hwdevice_ctx_alloc(). + public AVClass* @av_class; + /// This field identifies the underlying API used for hardware access. + public AVHWDeviceType @type; + /// The format-specific data, allocated and freed by libavutil along with this context. + public void* @hwctx; + /// This field may be set by the caller before calling av_hwdevice_ctx_init(). + public AVHWDeviceContext_free_func @free; + /// Arbitrary user data, to be used e.g. by the free() callback. + public void* @user_opaque; + } + + // /// This struct describes the constraints on hardware frames attached to a given device with a hardware-specific configuration. This is returned by av_hwdevice_get_hwframe_constraints() and must be freed by av_hwframe_constraints_free() after use. + // public unsafe partial struct AVHWFramesConstraints + // { + // /// A list of possible values for format in the hw_frames_ctx, terminated by AV_PIX_FMT_NONE. This member will always be filled. + // public AVPixelFormat* @valid_hw_formats; + // /// A list of possible values for sw_format in the hw_frames_ctx, terminated by AV_PIX_FMT_NONE. Can be NULL if this information is not known. + // public AVPixelFormat* @valid_sw_formats; + // /// The minimum size of frames in this hw_frames_ctx. (Zero if not known.) + // public int @min_width; + // public int @min_height; + // /// The maximum size of frames in this hw_frames_ctx. (INT_MAX if not known / no limit.) + // public int @max_width; + // public int @max_height; + // } + + /// This struct describes a set or pool of "hardware" frames (i.e. those with data not located in normal system memory). All the frames in the pool are assumed to be allocated in the same way and interchangeable. + public unsafe partial struct AVHWFramesContext + { + /// A class for logging. + public AVClass* @av_class; + /// A reference to the parent AVHWDeviceContext. This reference is owned and managed by the enclosing AVHWFramesContext, but the caller may derive additional references from it. + public AVBufferRef* @device_ref; + /// The parent AVHWDeviceContext. This is simply a pointer to device_ref->data provided for convenience. + public AVHWDeviceContext* @device_ctx; + /// The format-specific data, allocated and freed automatically along with this context. + public void* @hwctx; + /// This field may be set by the caller before calling av_hwframe_ctx_init(). + public AVHWFramesContext_free_func @free; + /// Arbitrary user data, to be used e.g. by the free() callback. + public void* @user_opaque; + /// A pool from which the frames are allocated by av_hwframe_get_buffer(). This field may be set by the caller before calling av_hwframe_ctx_init(). The buffers returned by calling av_buffer_pool_get() on this pool must have the properties described in the documentation in the corresponding hw type's header (hwcontext_*.h). The pool will be freed strictly before this struct's free() callback is invoked. + public AVBufferPool* @pool; + /// Initial size of the frame pool. If a device type does not support dynamically resizing the pool, then this is also the maximum pool size. + public int @initial_pool_size; + /// The pixel format identifying the underlying HW surface type. + public AVPixelFormat @format; + /// The pixel format identifying the actual data layout of the hardware frames. + public AVPixelFormat @sw_format; + /// The allocated dimensions of the frames in this pool. + public int @width; + /// The allocated dimensions of the frames in this pool. + public int @height; + } + + // public unsafe partial struct AVIndexEntry + // { + // public long @pos; + // /// Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are available when seeking to this entry. That means preferable PTS on keyframe based formats. But demuxers can choose to store a different timestamp, if it is more convenient for the implementation or nothing better is known + // public long @timestamp; + // /// Flag is used to indicate which frame should be discarded after decoding. + // public int @flags2_size30; + // /// Minimum distance between this and the previous keyframe, used to avoid unneeded searching. + // public int @min_distance; + // } + + /// @{ + public unsafe partial struct AVInputFormat + { + /// A comma separated list of short names for the format. New names may be appended with a minor bump. + public byte* @name; + /// Descriptive name for the format, meant to be more human-readable than name. You should use the NULL_IF_CONFIG_SMALL() macro to define it. + public byte* @long_name; + /// Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, AVFMT_NOTIMESTAMPS, AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. + public int @flags; + /// If extensions are defined, then no probe is done. You should usually not use extension format guessing because it is not reliable enough + public byte* @extensions; + public AVCodecTag** @codec_tag; + /// AVClass for the private context + public AVClass* @priv_class; + /// Comma-separated list of mime types. It is used check for matching mime types while probing. + public byte* @mime_type; + } + + /// Bytestream IO Context. New public fields can be added with minor version bumps. Removal, reordering and changes to existing public fields require a major version bump. sizeof(AVIOContext) must not be used outside libav*. + public unsafe partial struct AVIOContext + { + /// A class for private options. + public AVClass* @av_class; + /// Start of the buffer. + public byte* @buffer; + /// Maximum buffer size + public int @buffer_size; + /// Current position in the buffer + public byte* @buf_ptr; + /// End of the data, may be less than buffer+buffer_size if the read function returned less data than requested, e.g. for streams where no more data has been received yet. + public byte* @buf_end; + /// A private pointer, passed to the read/write/seek/... functions. + public void* @opaque; + public AVIOContext_read_packet_func @read_packet; + public AVIOContext_write_packet_func @write_packet; + public AVIOContext_seek_func @seek; + /// position in the file of the current buffer + public long @pos; + /// true if was unable to read due to error or eof + public int @eof_reached; + /// contains the error code or 0 if no error happened + public int @error; + /// true if open for writing + public int @write_flag; + public int @max_packet_size; + /// Try to buffer at least this amount of data before flushing it. + public int @min_packet_size; + public ulong @checksum; + public byte* @checksum_ptr; + public AVIOContext_update_checksum_func @update_checksum; + /// Pause or resume playback for network streaming protocols - e.g. MMS. + public AVIOContext_read_pause_func @read_pause; + /// Seek to a given timestamp in stream with the specified stream_index. Needed for some network streaming protocols which don't support seeking to byte position. + public AVIOContext_read_seek_func @read_seek; + /// A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. + public int @seekable; + /// avio_read and avio_write should if possible be satisfied directly instead of going through a buffer, and avio_seek will always call the underlying seek function directly. + public int @direct; + /// ',' separated list of allowed protocols. + public byte* @protocol_whitelist; + /// ',' separated list of disallowed protocols. + public byte* @protocol_blacklist; + /// A callback that is used instead of write_packet. + public AVIOContext_write_data_type_func @write_data_type; + /// If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly small chunks of data returned from the callback). + public int @ignore_boundary_point; + /// Maximum reached position before a backward seek in the write buffer, used keeping track of already written data for a later flush. + public byte* @buf_ptr_max; + /// Read-only statistic of bytes read for this AVIOContext. + public long @bytes_read; + /// Read-only statistic of bytes written for this AVIOContext. + public long @bytes_written; + } + + // /// Describes single entry of the directory. + // public unsafe partial struct AVIODirEntry + // { + // /// Filename + // public byte* @name; + // /// Type of the entry + // public int @type; + // /// Set to 1 when name is encoded with UTF-8, 0 otherwise. Name can be encoded with UTF-8 even though 0 is set. + // public int @utf8; + // /// File size in bytes, -1 if unknown. + // public long @size; + // /// Time of last modification in microseconds since unix epoch, -1 if unknown. + // public long @modification_timestamp; + // /// Time of last access in microseconds since unix epoch, -1 if unknown. + // public long @access_timestamp; + // /// Time of last status change in microseconds since unix epoch, -1 if unknown. + // public long @status_change_timestamp; + // /// User ID of owner, -1 if unknown. + // public long @user_id; + // /// Group ID of owner, -1 if unknown. + // public long @group_id; + // /// Unix file mode, -1 if unknown. + // public long @filemode; + // } + + /// Callback for checking whether to abort blocking functions. AVERROR_EXIT is returned in this case by the interrupted function. During blocking operations, callback is called with opaque as parameter. If the callback returns 1, the blocking operation will be aborted. + public unsafe partial struct AVIOInterruptCB + { + public AVIOInterruptCB_callback_func @callback; + public void* @opaque; + } + + // /// Mastering display metadata capable of representing the color volume of the display used to master the content (SMPTE 2086:2014). + // public unsafe partial struct AVMasteringDisplayMetadata + // { + // /// CIE 1931 xy chromaticity coords of color primaries (r, g, b order). + // public AVRational3x2 @display_primaries; + // /// CIE 1931 xy chromaticity coords of white point. + // public AVRational2 @white_point; + // /// Min luminance of mastering display (cd/m^2). + // public AVRational @min_luminance; + // /// Max luminance of mastering display (cd/m^2). + // public AVRational @max_luminance; + // /// Flag indicating whether the display primaries (and white point) are set. + // public int @has_primaries; + // /// Flag indicating whether the luminance (min_ and max_) have been set. + // public int @has_luminance; + // } + + /// AVOption + public unsafe partial struct AVOption + { + public byte* @name; + /// short English help text + public byte* @help; + /// Native access only. + public int @offset; + public AVOptionType @type; + public AVOption_default_val @default_val; + /// minimum valid value for the option + public double @min; + /// maximum valid value for the option + public double @max; + /// A combination of AV_OPT_FLAG_*. + public int @flags; + /// The logical unit to which the option belongs. Non-constant options and corresponding named constants share the same unit. May be NULL. + public byte* @unit; + } + + /// Native access only, except when documented otherwise. the default value for scalar options + [StructLayout(LayoutKind.Explicit)] + public unsafe partial struct AVOption_default_val + { + [FieldOffset(0)] + public long @i64; + [FieldOffset(0)] + public double @dbl; + [FieldOffset(0)] + public byte* @str; + [FieldOffset(0)] + public AVRational @q; + /// Used for AV_OPT_TYPE_FLAG_ARRAY options. May be NULL. + [FieldOffset(0)] + public AVOptionArrayDef* @arr; + } + + /// May be set as default_val for AV_OPT_TYPE_FLAG_ARRAY options. + public unsafe partial struct AVOptionArrayDef + { + /// Native access only. + public byte* @def; + /// Minimum number of elements in the array. When this field is non-zero, def must be non-NULL and contain at least this number of elements. + public uint @size_min; + /// Maximum number of elements in the array, 0 when unlimited. + public uint @size_max; + /// Separator between array elements in string representations of this option, used by av_opt_set() and av_opt_get(). It must be a printable ASCII character, excluding alphanumeric and the backslash. A comma is used when sep=0. + public byte @sep; + } + + /// A single allowed range of values, or a single allowed value. + public unsafe partial struct AVOptionRange + { + public byte* @str; + /// Value range. For string ranges this represents the min/max length. For dimensions this represents the min/max pixel count or width/height in multi-component case. + public double @value_min; + /// Value range. For string ranges this represents the min/max length. For dimensions this represents the min/max pixel count or width/height in multi-component case. + public double @value_max; + /// Value's component range. For string this represents the unicode range for chars, 0-127 limits to ASCII. + public double @component_min; + /// Value's component range. For string this represents the unicode range for chars, 0-127 limits to ASCII. + public double @component_max; + /// Range flag. If set to 1 the struct encodes a range, if set to 0 a single value. + public int @is_range; + } + + /// List of AVOptionRange structs. + public unsafe partial struct AVOptionRanges + { + /// Array of option ranges. + public AVOptionRange** @range; + /// Number of ranges per component. + public int @nb_ranges; + /// Number of componentes. + public int @nb_components; + } + + /// @{ + public unsafe partial struct AVOutputFormat + { + public byte* @name; + /// Descriptive name for the format, meant to be more human-readable than name. You should use the NULL_IF_CONFIG_SMALL() macro to define it. + public byte* @long_name; + public byte* @mime_type; + /// comma-separated filename extensions + public byte* @extensions; + /// default audio codec + public AVCodecID @audio_codec; + /// default video codec + public AVCodecID @video_codec; + /// default subtitle codec + public AVCodecID @subtitle_codec; + /// can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE + public int @flags; + /// List of supported codec_id-codec_tag pairs, ordered by "better choice first". The arrays are all terminated by AV_CODEC_ID_NONE. + public AVCodecTag** @codec_tag; + /// AVClass for the private context + public AVClass* @priv_class; + } + + /// This structure stores compressed data. It is typically exported by demuxers and then passed as input to decoders, or received as output from encoders and then passed to muxers. + public unsafe partial struct AVPacket + { + /// A reference to the reference-counted buffer where the packet data is stored. May be NULL, then the packet data is not reference-counted. + public AVBufferRef* @buf; + /// Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will be presented to the user. Can be AV_NOPTS_VALUE if it is not stored in the file. pts MUST be larger or equal to dts as presentation cannot happen before decompression, unless one wants to view hex dumps. Some formats misuse the terms dts and pts/cts to mean something different. Such timestamps must be converted to true pts/dts before they are stored in AVPacket. + public long @pts; + /// Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed. Can be AV_NOPTS_VALUE if it is not stored in the file. + public long @dts; + public byte* @data; + public int @size; + public int @stream_index; + /// A combination of AV_PKT_FLAG values + public int @flags; + /// Additional packet data that can be provided by the container. Packet can contain several types of side information. + public AVPacketSideData* @side_data; + public int @side_data_elems; + /// Duration of this packet in AVStream->time_base units, 0 if unknown. Equals next_pts - this_pts in presentation order. + public long @duration; + /// byte position in stream, -1 if unknown + public long @pos; + /// for some private data of the user + public void* @opaque; + /// AVBufferRef for free use by the API user. leviathan will never check the contents of the buffer ref. leviathan calls av_buffer_unref() on it when the packet is unreferenced. av_packet_copy_props() calls create a new reference with av_buffer_ref() for the target packet's opaque_ref field. + public AVBufferRef* @opaque_ref; + /// Time base of the packet's timestamps. In the future, this field may be set on packets output by encoders or demuxers, but its value will be by default ignored on input to decoders or muxers. + public AVRational @time_base; + } + + public unsafe partial struct AVPacketList + { + public AVPacket @pkt; + public AVPacketList* @next; + } + + /// This structure stores auxiliary information for decoding, presenting, or otherwise processing the coded stream. It is typically exported by demuxers and encoders and can be fed to decoders and muxers either in a per packet basis, or as global side data (applying to the entire coded stream). + public unsafe partial struct AVPacketSideData + { + public byte* @data; + public ulong @size; + public AVPacketSideDataType @type; + } + + // /// Pan Scan area. This specifies the area which should be displayed. Note there may be multiple such areas for one frame. + // public unsafe partial struct AVPanScan + // { + // /// id - encoding: Set by user. - decoding: Set by libavcodec. + // public int @id; + // /// width and height in 1/16 pel - encoding: Set by user. - decoding: Set by libavcodec. + // public int @width; + // public int @height; + // /// position of the top left corner in 1/16 pel for up to 3 fields/frames - encoding: Set by user. - decoding: Set by libavcodec. + // public short3x2 @position; + // } + + // /// Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes of an image. It also stores the subsampling factors and number of components. + // public unsafe partial struct AVPixFmtDescriptor + // { + // public byte* @name; + // /// The number of components each pixel has, (1-4) + // public byte @nb_components; + // /// Amount to shift the luma width right to find the chroma width. For YV12 this is 1 for example. chroma_width = AV_CEIL_RSHIFT(luma_width, log2_chroma_w) The note above is needed to ensure rounding up. This value only refers to the chroma components. + // public byte @log2_chroma_w; + // /// Amount to shift the luma height right to find the chroma height. For YV12 this is 1 for example. chroma_height= AV_CEIL_RSHIFT(luma_height, log2_chroma_h) The note above is needed to ensure rounding up. This value only refers to the chroma components. + // public byte @log2_chroma_h; + // /// Combination of AV_PIX_FMT_FLAG_... flags. + // public ulong @flags; + // /// Parameters that describe how pixels are packed. If the format has 1 or 2 components, then luma is 0. If the format has 3 or 4 components: if the RGB flag is set then 0 is red, 1 is green and 2 is blue; otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V. + // public AVComponentDescriptor4 @comp; + // /// Alternative comma-separated names. + // public byte* @alias; + // } + + // /// This structure contains the data a format has to probe a file. + // public unsafe partial struct AVProbeData + // { + // public byte* @filename; + // /// Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. + // public byte* @buf; + // /// Size of buf except extra allocated bytes + // public int @buf_size; + // /// mime_type, when known. + // public byte* @mime_type; + // } + + // /// This structure supplies correlation between a packet timestamp and a wall clock production time. The definition follows the Producer Reference Time ('prft') as defined in ISO/IEC 14496-12 + // public unsafe partial struct AVProducerReferenceTime + // { + // /// A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()). + // public long @wallclock; + // public int @flags; + // } + + /// AVProfile. + public unsafe partial struct AVProfile + { + public int @profile; + /// short name for the profile + public byte* @name; + } + + /// New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVProgram) must not be used outside libav*. + public unsafe partial struct AVProgram + { + public int @id; + public int @flags; + /// selects which program to discard and which to feed to the caller + public AVDiscard @discard; + public uint* @stream_index; + public uint @nb_stream_indexes; + public AVDictionary* @metadata; + public int @program_num; + public int @pmt_pid; + public int @pcr_pid; + public int @pmt_version; + /// *************************************************************** All fields below this line are not part of the public API. They may not be used outside of libavformat and can be changed and removed at will. New public fields should be added right above. **************************************************************** + public long @start_time; + public long @end_time; + /// reference dts for wrap detection + public long @pts_wrap_reference; + /// behavior on wrap detection + public int @pts_wrap_behavior; + } + + /// Rational number (pair of numerator and denominator). + public unsafe partial struct AVRational + { + /// Numerator + public int @num; + /// Denominator + public int @den; + } + + // /// Structure describing a single Region Of Interest. + // public unsafe partial struct AVRegionOfInterest + // { + // /// Must be set to the size of this data structure (that is, sizeof(AVRegionOfInterest)). + // public uint @self_size; + // /// Distance in pixels from the top edge of the frame to the top and bottom edges and from the left edge of the frame to the left and right edges of the rectangle defining this region of interest. + // public int @top; + // public int @bottom; + // public int @left; + // public int @right; + // /// Quantisation offset. + // public AVRational @qoffset; + // } + + /// Stream structure. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVStream) must not be used outside libav*. + public unsafe partial struct AVStream + { + /// A class for avoptions. Set on stream creation. + public AVClass* @av_class; + /// stream index in AVFormatContext + public int @index; + /// Format-specific stream ID. decoding: set by libavformat encoding: set by the user, replaced by libavformat if left unset + public int @id; + /// Codec parameters associated with this stream. Allocated and freed by libavformat in avformat_new_stream() and avformat_free_context() respectively. + public AVCodecParameters* @codecpar; + public void* @priv_data; + /// This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented. + public AVRational @time_base; + /// Decoding: pts of the first frame of the stream in presentation order, in stream time base. Only set this if you are absolutely 100% sure that the value you set it to really is the pts of the first frame. This may be undefined (AV_NOPTS_VALUE). + public long @start_time; + /// Decoding: duration of the stream, in stream time base. If a source file does not specify a duration, but does specify a bitrate, this value will be estimated from bitrate and file size. + public long @duration; + /// number of frames in this stream if known or 0 + public long @nb_frames; + /// Stream disposition - a combination of AV_DISPOSITION_* flags. - demuxing: set by libavformat when creating the stream or in avformat_find_stream_info(). - muxing: may be set by the caller before avformat_write_header(). + public int @disposition; + /// Selects which packets can be discarded at will and do not need to be demuxed. + public AVDiscard @discard; + /// sample aspect ratio (0 if unknown) - encoding: Set by user. - decoding: Set by libavformat. + public AVRational @sample_aspect_ratio; + public AVDictionary* @metadata; + /// Average framerate + public AVRational @avg_frame_rate; + /// For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet will contain the attached picture. + public AVPacket @attached_pic; + /// An array of side data that applies to the whole stream (i.e. the container does not allow it to change between packets). + [Obsolete("use AVStream's \"codecpar side data\".")] + public AVPacketSideData* @side_data; + /// The number of elements in the AVStream.side_data array. + [Obsolete("use AVStream's \"codecpar side data\".")] + public int @nb_side_data; + /// Flags indicating events happening on the stream, a combination of AVSTREAM_EVENT_FLAG_*. + public int @event_flags; + /// Real base framerate of the stream. This is the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream). Note, this value is just a guess! For example, if the time base is 1/90000 and all frames have either approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. + public AVRational @r_frame_rate; + /// Number of bits in timestamps. Used for wrapping control. + public int @pts_wrap_bits; + } + + public unsafe partial struct AVStreamGroup + { + /// A class for avoptions. Set by avformat_stream_group_create(). + public AVClass* @av_class; + public void* @priv_data; + /// Group index in AVFormatContext. + public uint @index; + /// Group type-specific group ID. + public long @id; + /// Group type + public AVStreamGroupParamsType @type; + public AVStreamGroup_params @params; + /// Metadata that applies to the whole group. + public AVDictionary* @metadata; + /// Number of elements in AVStreamGroup.streams. + public uint @nb_streams; + /// A list of streams in the group. New entries are created with avformat_stream_group_add_stream(). + public AVStream** @streams; + /// Stream group disposition - a combination of AV_DISPOSITION_* flags. This field currently applies to all defined AVStreamGroupParamsType. + public int @disposition; + } + + /// Group type-specific parameters + [StructLayout(LayoutKind.Explicit)] + public unsafe partial struct AVStreamGroup_params + { + [FieldOffset(0)] + public AVIAMFAudioElement* @iamf_audio_element; + [FieldOffset(0)] + public AVIAMFMixPresentation* @iamf_mix_presentation; + [FieldOffset(0)] + public AVStreamGroupTileGrid* @tile_grid; + } + + /// AVStreamGroupTileGrid holds information on how to combine several independent images on a single canvas for presentation. + public unsafe partial struct AVStreamGroupTileGrid + { + public AVClass* @av_class; + /// Amount of tiles in the grid. + public uint @nb_tiles; + /// Width of the canvas. + public int @coded_width; + /// Width of the canvas. + public int @coded_height; + public AVStreamGroupTileGrid_offsets* @offsets; + /// The pixel value per channel in RGBA format used if no pixel of any tile is located at a particular pixel location. + public byte4 @background; + /// Offset in pixels from the left edge of the canvas where the actual image meant for presentation starts. + public int @horizontal_offset; + /// Offset in pixels from the top edge of the canvas where the actual image meant for presentation starts. + public int @vertical_offset; + /// Width of the final image for presentation. + public int @width; + /// Height of the final image for presentation. + public int @height; + } + + /// An nb_tiles sized array of offsets in pixels from the topleft edge of the canvas, indicating where each stream should be placed. It must be allocated with the av_malloc() family of functions. + public unsafe partial struct AVStreamGroupTileGrid_offsets + { + /// Index of the stream in the group this tile references. + public uint @idx; + /// Offset in pixels from the left edge of the canvas where the tile should be placed. + public int @horizontal; + /// Offset in pixels from the top edge of the canvas where the tile should be placed. + public int @vertical; + } + + // public unsafe partial struct AVSubtitle + // { + // public ushort @format; + // public uint @start_display_time; + // public uint @end_display_time; + // public uint @num_rects; + // public AVSubtitleRect** @rects; + // /// Same as packet pts, in AV_TIME_BASE + // public long @pts; + // } + + // public unsafe partial struct AVSubtitleRect + // { + // /// top left corner of pict, undefined when pict is not set + // public int @x; + // /// top left corner of pict, undefined when pict is not set + // public int @y; + // /// width of pict, undefined when pict is not set + // public int @w; + // /// height of pict, undefined when pict is not set + // public int @h; + // /// number of colors in pict, undefined when pict is not set + // public int @nb_colors; + // /// data+linesize for the bitmap of this subtitle. Can be set for text/ass as well once they are rendered. + // public byte_ptr4 @data; + // public int4 @linesize; + // public int @flags; + // public AVSubtitleType @type; + // /// 0 terminated plain UTF-8 text + // public byte* @text; + // /// 0 terminated ASS/SSA compatible event line. The presentation of this is unaffected by the other values in this struct. + // public byte* @ass; + // } + + // public unsafe partial struct AVTimecode + // { + // /// timecode frame start (first base frame number) + // public int @start; + // /// flags such as drop frame, +24 hours support, ... + // public uint @flags; + // /// frame rate in rational form + // public AVRational @rate; + // /// frame per second; must be consistent with the rate field + // public uint @fps; + // } + + // public unsafe partial struct D3D11_VIDEO_DECODER_CONFIG + // { + // public _GUID @guidConfigBitstreamEncryption; + // public _GUID @guidConfigMBcontrolEncryption; + // public _GUID @guidConfigResidDiffEncryption; + // public uint @ConfigBitstreamRaw; + // public uint @ConfigMBcontrolRasterOrder; + // public uint @ConfigResidDiffHost; + // public uint @ConfigSpatialResid8; + // public uint @ConfigResid8Subtraction; + // public uint @ConfigSpatialHost8or9Clipping; + // public uint @ConfigSpatialResidInterleaved; + // public uint @ConfigIntraResidUnsigned; + // public uint @ConfigResidDiffAccelerator; + // public uint @ConfigHostInverseScan; + // public uint @ConfigSpecificIDCT; + // public uint @Config4GroupedCoefs; + // public ushort @ConfigMinRenderTargetBuffCount; + // public ushort @ConfigDecoderSpecific; + // } + + // public unsafe partial struct ID3D11Device + // { + // public ID3D11DeviceVtbl* @lpVtbl; + // } + + // public unsafe partial struct ID3D11DeviceContext + // { + // public ID3D11DeviceContextVtbl* @lpVtbl; + // } + + // public unsafe partial struct ID3D11DeviceContextVtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @GetDevice; + // public void* @GetPrivateData; + // public void* @SetPrivateData; + // public void* @SetPrivateDataInterface; + // public void* @VSSetConstantBuffers; + // public void* @PSSetShaderResources; + // public void* @PSSetShader; + // public void* @PSSetSamplers; + // public void* @VSSetShader; + // public void* @DrawIndexed; + // public void* @Draw; + // public void* @Map; + // public void* @Unmap; + // public void* @PSSetConstantBuffers; + // public void* @IASetInputLayout; + // public void* @IASetVertexBuffers; + // public void* @IASetIndexBuffer; + // public void* @DrawIndexedInstanced; + // public void* @DrawInstanced; + // public void* @GSSetConstantBuffers; + // public void* @GSSetShader; + // public void* @IASetPrimitiveTopology; + // public void* @VSSetShaderResources; + // public void* @VSSetSamplers; + // public void* @Begin; + // public void* @End; + // public void* @GetData; + // public void* @SetPredication; + // public void* @GSSetShaderResources; + // public void* @GSSetSamplers; + // public void* @OMSetRenderTargets; + // public void* @OMSetRenderTargetsAndUnorderedAccessViews; + // public void* @OMSetBlendState; + // public void* @OMSetDepthStencilState; + // public void* @SOSetTargets; + // public void* @DrawAuto; + // public void* @DrawIndexedInstancedIndirect; + // public void* @DrawInstancedIndirect; + // public void* @Dispatch; + // public void* @DispatchIndirect; + // public void* @RSSetState; + // public void* @RSSetViewports; + // public void* @RSSetScissorRects; + // public void* @CopySubresourceRegion; + // public void* @CopyResource; + // public void* @UpdateSubresource; + // public void* @CopyStructureCount; + // public void* @ClearRenderTargetView; + // public void* @ClearUnorderedAccessViewUint; + // public void* @ClearUnorderedAccessViewFloat; + // public void* @ClearDepthStencilView; + // public void* @GenerateMips; + // public void* @SetResourceMinLOD; + // public void* @GetResourceMinLOD; + // public void* @ResolveSubresource; + // public void* @ExecuteCommandList; + // public void* @HSSetShaderResources; + // public void* @HSSetShader; + // public void* @HSSetSamplers; + // public void* @HSSetConstantBuffers; + // public void* @DSSetShaderResources; + // public void* @DSSetShader; + // public void* @DSSetSamplers; + // public void* @DSSetConstantBuffers; + // public void* @CSSetShaderResources; + // public void* @CSSetUnorderedAccessViews; + // public void* @CSSetShader; + // public void* @CSSetSamplers; + // public void* @CSSetConstantBuffers; + // public void* @VSGetConstantBuffers; + // public void* @PSGetShaderResources; + // public void* @PSGetShader; + // public void* @PSGetSamplers; + // public void* @VSGetShader; + // public void* @PSGetConstantBuffers; + // public void* @IAGetInputLayout; + // public void* @IAGetVertexBuffers; + // public void* @IAGetIndexBuffer; + // public void* @GSGetConstantBuffers; + // public void* @GSGetShader; + // public void* @IAGetPrimitiveTopology; + // public void* @VSGetShaderResources; + // public void* @VSGetSamplers; + // public void* @GetPredication; + // public void* @GSGetShaderResources; + // public void* @GSGetSamplers; + // public void* @OMGetRenderTargets; + // public void* @OMGetRenderTargetsAndUnorderedAccessViews; + // public void* @OMGetBlendState; + // public void* @OMGetDepthStencilState; + // public void* @SOGetTargets; + // public void* @RSGetState; + // public void* @RSGetViewports; + // public void* @RSGetScissorRects; + // public void* @HSGetShaderResources; + // public void* @HSGetShader; + // public void* @HSGetSamplers; + // public void* @HSGetConstantBuffers; + // public void* @DSGetShaderResources; + // public void* @DSGetShader; + // public void* @DSGetSamplers; + // public void* @DSGetConstantBuffers; + // public void* @CSGetShaderResources; + // public void* @CSGetUnorderedAccessViews; + // public void* @CSGetShader; + // public void* @CSGetSamplers; + // public void* @CSGetConstantBuffers; + // public void* @ClearState; + // public void* @Flush; + // public void* @GetType; + // public void* @GetContextFlags; + // public void* @FinishCommandList; + // } + + // public unsafe partial struct ID3D11DeviceVtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @CreateBuffer; + // public void* @CreateTexture1D; + // public void* @CreateTexture2D; + // public void* @CreateTexture3D; + // public void* @CreateShaderResourceView; + // public void* @CreateUnorderedAccessView; + // public void* @CreateRenderTargetView; + // public void* @CreateDepthStencilView; + // public void* @CreateInputLayout; + // public void* @CreateVertexShader; + // public void* @CreateGeometryShader; + // public void* @CreateGeometryShaderWithStreamOutput; + // public void* @CreatePixelShader; + // public void* @CreateHullShader; + // public void* @CreateDomainShader; + // public void* @CreateComputeShader; + // public void* @CreateClassLinkage; + // public void* @CreateBlendState; + // public void* @CreateDepthStencilState; + // public void* @CreateRasterizerState; + // public void* @CreateSamplerState; + // public void* @CreateQuery; + // public void* @CreatePredicate; + // public void* @CreateCounter; + // public void* @CreateDeferredContext; + // public void* @OpenSharedResource; + // public void* @CheckFormatSupport; + // public void* @CheckMultisampleQualityLevels; + // public void* @CheckCounterInfo; + // public void* @CheckCounter; + // public void* @CheckFeatureSupport; + // public void* @GetPrivateData; + // public void* @SetPrivateData; + // public void* @SetPrivateDataInterface; + // public void* @GetFeatureLevel; + // public void* @GetCreationFlags; + // public void* @GetDeviceRemovedReason; + // public void* @GetImmediateContext; + // public void* @SetExceptionMode; + // public void* @GetExceptionMode; + // } + + // public unsafe partial struct ID3D11Texture2D + // { + // public ID3D11Texture2DVtbl* @lpVtbl; + // } + + // public unsafe partial struct ID3D11Texture2DVtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @GetDevice; + // public void* @GetPrivateData; + // public void* @SetPrivateData; + // public void* @SetPrivateDataInterface; + // public void* @GetType; + // public void* @SetEvictionPriority; + // public void* @GetEvictionPriority; + // public void* @GetDesc; + // } + + // public unsafe partial struct ID3D11VideoContext + // { + // public ID3D11VideoContextVtbl* @lpVtbl; + // } + + // public unsafe partial struct ID3D11VideoContextVtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @GetDevice; + // public void* @GetPrivateData; + // public void* @SetPrivateData; + // public void* @SetPrivateDataInterface; + // public void* @GetDecoderBuffer; + // public void* @ReleaseDecoderBuffer; + // public void* @DecoderBeginFrame; + // public void* @DecoderEndFrame; + // public void* @SubmitDecoderBuffers; + // public void* @DecoderExtension; + // public void* @VideoProcessorSetOutputTargetRect; + // public void* @VideoProcessorSetOutputBackgroundColor; + // public void* @VideoProcessorSetOutputColorSpace; + // public void* @VideoProcessorSetOutputAlphaFillMode; + // public void* @VideoProcessorSetOutputConstriction; + // public void* @VideoProcessorSetOutputStereoMode; + // public void* @VideoProcessorSetOutputExtension; + // public void* @VideoProcessorGetOutputTargetRect; + // public void* @VideoProcessorGetOutputBackgroundColor; + // public void* @VideoProcessorGetOutputColorSpace; + // public void* @VideoProcessorGetOutputAlphaFillMode; + // public void* @VideoProcessorGetOutputConstriction; + // public void* @VideoProcessorGetOutputStereoMode; + // public void* @VideoProcessorGetOutputExtension; + // public void* @VideoProcessorSetStreamFrameFormat; + // public void* @VideoProcessorSetStreamColorSpace; + // public void* @VideoProcessorSetStreamOutputRate; + // public void* @VideoProcessorSetStreamSourceRect; + // public void* @VideoProcessorSetStreamDestRect; + // public void* @VideoProcessorSetStreamAlpha; + // public void* @VideoProcessorSetStreamPalette; + // public void* @VideoProcessorSetStreamPixelAspectRatio; + // public void* @VideoProcessorSetStreamLumaKey; + // public void* @VideoProcessorSetStreamStereoFormat; + // public void* @VideoProcessorSetStreamAutoProcessingMode; + // public void* @VideoProcessorSetStreamFilter; + // public void* @VideoProcessorSetStreamExtension; + // public void* @VideoProcessorGetStreamFrameFormat; + // public void* @VideoProcessorGetStreamColorSpace; + // public void* @VideoProcessorGetStreamOutputRate; + // public void* @VideoProcessorGetStreamSourceRect; + // public void* @VideoProcessorGetStreamDestRect; + // public void* @VideoProcessorGetStreamAlpha; + // public void* @VideoProcessorGetStreamPalette; + // public void* @VideoProcessorGetStreamPixelAspectRatio; + // public void* @VideoProcessorGetStreamLumaKey; + // public void* @VideoProcessorGetStreamStereoFormat; + // public void* @VideoProcessorGetStreamAutoProcessingMode; + // public void* @VideoProcessorGetStreamFilter; + // public void* @VideoProcessorGetStreamExtension; + // public void* @VideoProcessorBlt; + // public void* @NegotiateCryptoSessionKeyExchange; + // public void* @EncryptionBlt; + // public void* @DecryptionBlt; + // public void* @StartSessionKeyRefresh; + // public void* @FinishSessionKeyRefresh; + // public void* @GetEncryptionBltKey; + // public void* @NegotiateAuthenticatedChannelKeyExchange; + // public void* @QueryAuthenticatedChannel; + // public void* @ConfigureAuthenticatedChannel; + // public void* @VideoProcessorSetStreamRotation; + // public void* @VideoProcessorGetStreamRotation; + // } + + // public unsafe partial struct ID3D11VideoDecoder + // { + // public ID3D11VideoDecoderVtbl* @lpVtbl; + // } + + // public unsafe partial struct ID3D11VideoDecoderOutputView + // { + // public ID3D11VideoDecoderOutputViewVtbl* @lpVtbl; + // } + + // public unsafe partial struct ID3D11VideoDecoderOutputViewVtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @GetDevice; + // public void* @GetPrivateData; + // public void* @SetPrivateData; + // public void* @SetPrivateDataInterface; + // public void* @GetResource; + // public void* @GetDesc; + // } + + // public unsafe partial struct ID3D11VideoDecoderVtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @GetDevice; + // public void* @GetPrivateData; + // public void* @SetPrivateData; + // public void* @SetPrivateDataInterface; + // public void* @GetCreationParameters; + // public void* @GetDriverHandle; + // } + + // public unsafe partial struct ID3D11VideoDevice + // { + // public ID3D11VideoDeviceVtbl* @lpVtbl; + // } + + // public unsafe partial struct ID3D11VideoDeviceVtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @CreateVideoDecoder; + // public void* @CreateVideoProcessor; + // public void* @CreateAuthenticatedChannel; + // public void* @CreateCryptoSession; + // public void* @CreateVideoDecoderOutputView; + // public void* @CreateVideoProcessorInputView; + // public void* @CreateVideoProcessorOutputView; + // public void* @CreateVideoProcessorEnumerator; + // public void* @GetVideoDecoderProfileCount; + // public void* @GetVideoDecoderProfile; + // public void* @CheckVideoDecoderFormat; + // public void* @GetVideoDecoderConfigCount; + // public void* @GetVideoDecoderConfig; + // public void* @GetContentProtectionCaps; + // public void* @CheckCryptoKeyExchange; + // public void* @SetPrivateData; + // public void* @SetPrivateDataInterface; + // } + + // public unsafe partial struct IDirect3DDeviceManager9 + // { + // public IDirect3DDeviceManager9Vtbl* @lpVtbl; + // } + + // public unsafe partial struct IDirect3DDeviceManager9Vtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @ResetDevice; + // public void* @OpenDeviceHandle; + // public void* @CloseDeviceHandle; + // public void* @TestDevice; + // public void* @LockDevice; + // public void* @UnlockDevice; + // public void* @GetVideoService; + // } + + // public unsafe partial struct IDirect3DSurface9 + // { + // public IDirect3DSurface9Vtbl* @lpVtbl; + // } + + // public unsafe partial struct IDirect3DSurface9Vtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @GetDevice; + // public void* @SetPrivateData; + // public void* @GetPrivateData; + // public void* @FreePrivateData; + // public void* @SetPriority; + // public void* @GetPriority; + // public void* @PreLoad; + // public void* @GetType; + // public void* @GetContainer; + // public void* @GetDesc; + // public void* @LockRect; + // public void* @UnlockRect; + // public void* @GetDC; + // public void* @ReleaseDC; + // } + + // public unsafe partial struct IDirectXVideoDecoder + // { + // public IDirectXVideoDecoderVtbl* @lpVtbl; + // } + + // public unsafe partial struct IDirectXVideoDecoderVtbl + // { + // public void* @QueryInterface; + // public void* @AddRef; + // public void* @Release; + // public void* @GetVideoDecoderService; + // public void* @GetCreationParameters; + // public void* @GetBuffer; + // public void* @ReleaseBuffer; + // public void* @BeginFrame; + // public void* @EndFrame; + // public void* @Execute; + // } + + public unsafe partial struct RcOverride + { + public int @start_frame; + public int @end_frame; + public int @qscale; + public float @quality_factor; + } + + // public unsafe partial struct SwsFilter + // { + // public SwsVector* @lumH; + // public SwsVector* @lumV; + // public SwsVector* @chrH; + // public SwsVector* @chrV; + // } + + // public unsafe partial struct SwsVector + // { + // /// pointer to the list of coefficients + // public double* @coeff; + // /// number of coefficients in the vector + // public int @length; + // } + + // /// Context for an Audio FIFO Buffer. + // /// This struct is incomplete. + // public unsafe partial struct AVAudioFifo + // { + // } + + // /// @} + // /// This struct is incomplete. + // public unsafe partial struct AVBPrint + // { + // } + + // /// Structure for chain/list of bitstream filters. Empty list can be allocated by av_bsf_list_alloc(). + // /// This struct is incomplete. + // public unsafe partial struct AVBSFList + // { + // } + + /// A reference counted buffer type. It is opaque and is meant to be used through references (AVBufferRef). + /// This struct is incomplete. + public unsafe partial struct AVBuffer + { + } + + /// The buffer pool. This structure is opaque and not meant to be accessed directly. It is allocated with av_buffer_pool_init() and freed with av_buffer_pool_uninit(). + /// This struct is incomplete. + public unsafe partial struct AVBufferPool + { + } + + /// This struct is incomplete. + public unsafe partial struct AVCodecInternal + { + } + + /// ********************************************** + /// This struct is incomplete. + public unsafe partial struct AVCodecTag + { + } + + /// This struct is incomplete. + public unsafe partial struct AVDictionary + { + } + + /// This struct is incomplete. + public unsafe partial struct AVFilterChannelLayouts + { + } + + /// This struct is incomplete. + public unsafe partial struct AVFilterCommand + { + } + + /// This struct is incomplete. + public unsafe partial struct AVFilterFormats + { + } + + /// This struct is incomplete. + public unsafe partial struct AVFilterPad + { + } + + /// This struct is incomplete. + public unsafe partial struct AVIAMFAudioElement + { + } + + /// This struct is incomplete. + public unsafe partial struct AVIAMFMixPresentation + { + } + + // /// This struct is incomplete. + // public unsafe partial struct AVIODirContext + // { + // } + + // /// Low-complexity tree container + // /// This struct is incomplete. + // public unsafe partial struct AVTreeNode + // { + // } + + // /// The libswresample context. Unlike libavcodec and libavformat, this structure is opaque. This means that if you would like to set options, you must use the avoptions API and cannot directly set values to members of the structure. + // /// This struct is incomplete. + // public unsafe partial struct SwrContext + // { + // } + + // /// This struct is incomplete. + // public unsafe partial struct SwsContext + // { + // } + +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Structs.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Structs.g.cs.meta new file mode 100644 index 0000000..7798f8f --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/Structs.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25e968c51067fb54a85f6052c03f6bcc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/UTF8Marshaler.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/UTF8Marshaler.cs new file mode 100644 index 0000000..9c58bf4 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/UTF8Marshaler.cs @@ -0,0 +1,91 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; +using System.Text; + +namespace LeviathanVideo.Abstractions +{ + + public class UTF8Marshaler : ICustomMarshaler + { + private static readonly UTF8Marshaler Instance = new UTF8Marshaler(); + + public virtual object MarshalNativeToManaged(IntPtr pNativeData) => FromNative(Encoding.UTF8, pNativeData); + + public virtual IntPtr MarshalManagedToNative(object managedObj) + { + if (managedObj == null) + return IntPtr.Zero; + + if (!(managedObj is string str)) + throw new MarshalDirectiveException($"{GetType().Name} must be used on a string."); + + return FromManaged(Encoding.UTF8, str); + } + + public virtual void CleanUpNativeData(IntPtr pNativeData) + { + //Free anything allocated by MarshalManagedToNative + //This is called after the native function call completes + + if (pNativeData != IntPtr.Zero) + Marshal.FreeHGlobal(pNativeData); + } + + public void CleanUpManagedData(object managedObj) + { + //Free anything allocated by MarshalNativeToManaged + //This is called after the native function call completes + } + + public int GetNativeDataSize() => -1; // Not a value type + + public static ICustomMarshaler GetInstance(string cookie) => Instance; + + public static unsafe string FromNative(Encoding encoding, IntPtr pNativeData) => FromNative(encoding, (byte*)pNativeData); + + public static unsafe string FromNative(Encoding encoding, byte* pNativeData) + { + if (pNativeData == null) + return null; + + var start = pNativeData; + var walk = start; + + // Find the end of the string + while (*walk != 0) walk++; + + if (walk == start) + return string.Empty; + + return new string((sbyte*)pNativeData, 0, (int)(walk - start), encoding); + } + + public static unsafe IntPtr FromManaged(Encoding encoding, string value) + { + if (encoding == null || value == null) + return IntPtr.Zero; + + var length = encoding.GetByteCount(value); + var buffer = (byte*)Marshal.AllocHGlobal(length + 1).ToPointer(); + + if (length > 0) + { + fixed (char* pValue = value) + { + encoding.GetBytes(pValue, value.Length, buffer, length); + } + } + + buffer[length] = 0; + + return new IntPtr(buffer); + } + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/UTF8Marshaler.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/UTF8Marshaler.cs.meta new file mode 100644 index 0000000..b9986b4 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/UTF8Marshaler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3d3fb0a766a91b74782afd15644bd45b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.facade.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.facade.g.cs new file mode 100644 index 0000000..85c79a9 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.facade.g.cs @@ -0,0 +1,3582 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; + +namespace LeviathanVideo.Abstractions +{ + + public static unsafe partial class leviathan + { + /// Allocate and initialize an AVIOContext for buffered I/O. It must be later freed with avio_context_free(). + /// Memory block for input/output operations via AVIOContext. The buffer must be allocated with av_malloc() and friends. It may be freed and replaced with a new buffer by libavformat. AVIOContext.buffer holds the buffer currently in use, which must be later freed with av_free(). + /// The buffer size is very important for performance. For protocols with fixed blocksize it should be set to this blocksize. For others a typical size is a cache page, e.g. 4kb. + /// Set to 1 if the buffer should be writable, 0 otherwise. + /// An opaque pointer to user-specific data. + /// A function for refilling the buffer, may be NULL. For stream protocols, must never return 0 but rather a proper AVERROR code. + /// A function for writing the buffer contents, may be NULL. The function may not change the input buffers content. + /// A function for seeking to specified byte position, may be NULL. + /// Allocated AVIOContext or NULL on failure. + public static AVIOContext* avio_alloc_context(byte* @buffer, int @buffer_size, int @write_flag, void* @opaque, avio_alloc_context_read_packet_func @read_packet, avio_alloc_context_write_packet_func @write_packet, avio_alloc_context_seek_func @seek) => vectors.avio_alloc_context(@buffer, @buffer_size, @write_flag, @opaque, @read_packet, @write_packet, @seek); + + /// Allocate an AVFormatContext. avformat_free_context() can be used to free the context and everything allocated by the framework within it. + public static AVFormatContext* avformat_alloc_context() => vectors.avformat_alloc_context(); + + /// Open an input stream and read the header. The codecs are not opened. The stream must be closed with avformat_close_input(). + /// Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). May be a pointer to NULL, in which case an AVFormatContext is allocated by this function and written into ps. Note that a user-supplied AVFormatContext will be freed on failure. + /// URL of the stream to open. + /// If non-NULL, this parameter forces a specific input format. Otherwise the format is autodetected. + /// A dictionary filled with AVFormatContext and demuxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. + /// 0 on success, a negative AVERROR on failure. + public static int avformat_open_input(AVFormatContext** @ps, string @url, AVInputFormat* @fmt, AVDictionary** @options) => vectors.avformat_open_input(@ps, @url, @fmt, @options); + + /// Read packets of a media file to get stream information. This is useful for file formats with no headers such as MPEG. This function also computes the real framerate in case of MPEG-2 repeat frame mode. The logical file position is not changed by this function; examined packets may be buffered for later processing. + /// media file handle + /// If non-NULL, an ic.nb_streams long array of pointers to dictionaries, where i-th member contains options for codec corresponding to i-th stream. On return each dictionary will be filled with options that were not found. + /// >=0 if OK, AVERROR_xxx on error + public static int avformat_find_stream_info(AVFormatContext* @ic, AVDictionary** @options) => vectors.avformat_find_stream_info(@ic, @options); + + /// Find the "best" stream in the file. The best stream is determined according to various heuristics as the most likely to be what the user expects. If the decoder parameter is non-NULL, av_find_best_stream will find the default decoder for the stream's codec; streams for which no decoder can be found are ignored. + /// media file handle + /// stream type: video, audio, subtitles, etc. + /// user-requested stream number, or -1 for automatic selection + /// try to find a stream related (eg. in the same program) to this one, or -1 if none + /// if non-NULL, returns the decoder for the selected stream + /// flags; none are currently defined + /// the non-negative stream number in case of success, AVERROR_STREAM_NOT_FOUND if no stream with the requested type could be found, AVERROR_DECODER_NOT_FOUND if streams were found but no decoder + public static int av_find_best_stream(AVFormatContext* @ic, AVMediaType @type, int @wanted_stream_nb, int @related_stream, AVCodec** @decoder_ret, int @flags) => vectors.av_find_best_stream(@ic, @type, @wanted_stream_nb, @related_stream, @decoder_ret, @flags); + + /// Allocate an AVCodecContext and set its fields to default values. The resulting struct should be freed with avcodec_free_context(). + /// if non-NULL, allocate private data and initialize defaults for the given codec. It is illegal to then call avcodec_open2() with a different codec. If NULL, then the codec-specific defaults won't be initialized, which may result in suboptimal default settings (this is important mainly for encoders, e.g. libx264). + /// An AVCodecContext filled with default values or NULL on failure. + public static AVCodecContext* avcodec_alloc_context3(AVCodec* @codec) => vectors.avcodec_alloc_context3(@codec); + + + /// Get the name of a codec. + /// a static string identifying the codec; never NULL + public static string avcodec_get_name(AVCodecID @id) => vectors.avcodec_get_name(@id); + + /// Initialize the AVCodecContext to use the given AVCodec. Prior to using this function the context has to be allocated with avcodec_alloc_context3(). + /// The context to initialize. + /// The codec to open this context for. If a non-NULL codec has been previously passed to avcodec_alloc_context3() or for this context, then this parameter MUST be either NULL or equal to the previously passed codec. + /// A dictionary filled with AVCodecContext and codec-private options, which are set on top of the options already set in avctx, can be NULL. On return this object will be filled with options that were not found in the avctx codec context. + /// zero on success, a negative value on error + public static int avcodec_open2(AVCodecContext* @avctx, AVCodec* @codec, AVDictionary** @options) => vectors.avcodec_open2(@avctx, @codec, @options); + + /// Allocate an AVFrame and set its fields to default values. The resulting struct must be freed using av_frame_free(). + /// An AVFrame filled with default values or NULL on failure. + public static AVFrame* av_frame_alloc() => vectors.av_frame_alloc(); + + /// Allocate an AVPacket and set its fields to default values. The resulting struct must be freed using av_packet_free(). + /// An AVPacket filled with default values or NULL on failure. + public static AVPacket* av_packet_alloc() => vectors.av_packet_alloc(); + + /// Free the codec context and everything associated with it and write NULL to the provided pointer. + public static void avcodec_free_context(AVCodecContext** @avctx) => vectors.avcodec_free_context(@avctx); + + /// Close an opened input AVFormatContext. Free it and all its contents and set *s to NULL. + public static void avformat_close_input(AVFormatContext** @s) => vectors.avformat_close_input(@s); + + /// Free the frame and any dynamically allocated objects in it, e.g. extended_data. If the frame is reference counted, it will be unreferenced first. + /// frame to be freed. The pointer will be set to NULL. + public static void av_frame_free(AVFrame** @frame) => vectors.av_frame_free(@frame); + + /// Free the packet, if the packet is reference counted, it will be unreferenced first. + /// packet to be freed. The pointer will be set to NULL. + public static void av_packet_free(AVPacket** @pkt) => vectors.av_packet_free(@pkt); + + /// Free the supplied IO context and everything associated with it. + /// Double pointer to the IO context. This function will write NULL into s. + public static void avio_context_free(AVIOContext** @s) => vectors.avio_context_free(@s); + + /// Return the size in bytes of the amount of data required to store an image with the given parameters. + /// the pixel format of the image + /// the width of the image in pixels + /// the height of the image in pixels + /// the assumed linesize alignment + /// the buffer size in bytes, a negative error code in case of failure + public static int av_image_get_buffer_size(AVPixelFormat @pix_fmt, int @width, int @height, int @align) => vectors.av_image_get_buffer_size(@pix_fmt, @width, @height, @align); + + /// Return decoded output data from a decoder or encoder (when the AV_CODEC_FLAG_RECON_FRAME flag is used). + /// codec context + /// This will be set to a reference-counted video or audio frame (depending on the decoder type) allocated by the codec. Note that the function will always call av_frame_unref(frame) before doing anything else. + public static int avcodec_receive_frame(AVCodecContext* @avctx, AVFrame* @frame) => vectors.avcodec_receive_frame(@avctx, @frame); + + /// Return the next frame of a stream. This function returns what is stored in the file, and does not validate that what is there are valid frames for the decoder. It will split what is stored in the file into frames and return one for each call. It will not omit invalid data between valid frames so as to give the decoder the maximum information possible for decoding. + /// 0 if OK, < 0 on error or end of file. On error, pkt will be blank (as if it came from av_packet_alloc()). + public static int av_read_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_read_frame(@s, @pkt); + + /// Supply raw packet data as input to a decoder. + /// codec context + /// The input AVPacket. Usually, this will be a single video frame, or several complete audio frames. Ownership of the packet remains with the caller, and the decoder will not write to the packet. The decoder may create a reference to the packet data (or copy it if the packet is not reference-counted). Unlike with older APIs, the packet is always fully consumed, and if it contains multiple frames (e.g. some audio codecs), will require you to call avcodec_receive_frame() multiple times afterwards before you can send a new packet. It can be NULL (or an AVPacket with data set to NULL and size set to 0); in this case, it is considered a flush packet, which signals the end of the stream. Sending the first flush packet will return success. Subsequent ones are unnecessary and will return AVERROR_EOF. If the decoder still has frames buffered, it will return them after sending a flush packet. + public static int avcodec_send_packet(AVCodecContext* @avctx, AVPacket* @avpkt) => vectors.avcodec_send_packet(@avctx, @avpkt); + + /// Wipe the packet. + /// The packet to be unreferenced. + public static void av_packet_unref(AVPacket* @pkt) => vectors.av_packet_unref(@pkt); + + + /// Seek to timestamp ts. Seeking will be done so that the point from which all active streams can be presented successfully will be closest to ts and within min/max_ts. Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + /// media file handle + /// index of the stream which is used as time base reference + /// smallest acceptable timestamp + /// target timestamp + /// largest acceptable timestamp + /// flags + /// >=0 on success, error code otherwise + public static int avformat_seek_file(AVFormatContext* @s, int @stream_index, long @min_ts, long @ts, long @max_ts, int @flags) => vectors.avformat_seek_file(@s, @stream_index, @min_ts, @ts, @max_ts, @flags); + + + /// Reset the internal codec state / flush internal buffers. Should be called e.g. when seeking or when switching to a different stream. + public static void avcodec_flush_buffers(AVCodecContext* @avctx) => vectors.avcodec_flush_buffers(@avctx); + + + /// Allocate a memory block with alignment suitable for all memory accesses (including vectors if available on the CPU). + /// Size in bytes for the memory block to be allocated + /// Pointer to the allocated block, or `NULL` if the block cannot be allocated + public static void* av_malloc(ulong @size) => vectors.av_malloc(@size); + + /// Free a memory block which has been allocated with a function of av_malloc() or av_realloc() family. + /// Pointer to the memory block which should be freed. + public static void av_free(void* @ptr) => vectors.av_free(@ptr); + + #region unuse code + /* + /// Add an index entry into a sorted list. Update the entry if the list already contains it. + /// timestamp in the time base of the given stream + public static int av_add_index_entry(AVStream* @st, long @pos, long @timestamp, int @size, int @distance, int @flags) => vectors.av_add_index_entry(@st, @pos, @timestamp, @size, @distance, @flags); + + /// Add two rationals. + /// First rational + /// Second rational + /// b+c + public static AVRational av_add_q(AVRational @b, AVRational @c) => vectors.av_add_q(@b, @c); + + /// Add a value to a timestamp. + /// Input timestamp time base + /// Input timestamp + /// Time base of `inc` + /// Value to be added + public static long av_add_stable(AVRational @ts_tb, long @ts, AVRational @inc_tb, long @inc) => vectors.av_add_stable(@ts_tb, @ts, @inc_tb, @inc); + + /// Read data and append it to the current content of the AVPacket. If pkt->size is 0 this is identical to av_get_packet. Note that this uses av_grow_packet and thus involves a realloc which is inefficient. Thus this function should only be used when there is no reasonable way to know (an upper bound of) the final size. + /// associated IO context + /// packet + /// amount of data to read + /// >0 (read size) if OK, AVERROR_xxx otherwise, previous data will not be lost even if an error occurs. + public static int av_append_packet(AVIOContext* @s, AVPacket* @pkt, int @size) => vectors.av_append_packet(@s, @pkt, @size); + + /// Allocate an AVAudioFifo. + /// sample format + /// number of channels + /// initial allocation size, in samples + /// newly allocated AVAudioFifo, or NULL on error + public static AVAudioFifo* av_audio_fifo_alloc(AVSampleFormat @sample_fmt, int @channels, int @nb_samples) => vectors.av_audio_fifo_alloc(@sample_fmt, @channels, @nb_samples); + + /// Drain data from an AVAudioFifo. + /// AVAudioFifo to drain + /// number of samples to drain + /// 0 if OK, or negative AVERROR code on failure + public static int av_audio_fifo_drain(AVAudioFifo* @af, int @nb_samples) => vectors.av_audio_fifo_drain(@af, @nb_samples); + + /// Free an AVAudioFifo. + /// AVAudioFifo to free + public static void av_audio_fifo_free(AVAudioFifo* @af) => vectors.av_audio_fifo_free(@af); + + /// Peek data from an AVAudioFifo. + /// AVAudioFifo to read from + /// audio data plane pointers + /// number of samples to peek + /// number of samples actually peek, or negative AVERROR code on failure. The number of samples actually peek will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. + public static int av_audio_fifo_peek(AVAudioFifo* @af, void** @data, int @nb_samples) => vectors.av_audio_fifo_peek(@af, @data, @nb_samples); + + /// Peek data from an AVAudioFifo. + /// AVAudioFifo to read from + /// audio data plane pointers + /// number of samples to peek + /// offset from current read position + /// number of samples actually peek, or negative AVERROR code on failure. The number of samples actually peek will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. + public static int av_audio_fifo_peek_at(AVAudioFifo* @af, void** @data, int @nb_samples, int @offset) => vectors.av_audio_fifo_peek_at(@af, @data, @nb_samples, @offset); + + /// Read data from an AVAudioFifo. + /// AVAudioFifo to read from + /// audio data plane pointers + /// number of samples to read + /// number of samples actually read, or negative AVERROR code on failure. The number of samples actually read will not be greater than nb_samples, and will only be less than nb_samples if av_audio_fifo_size is less than nb_samples. + public static int av_audio_fifo_read(AVAudioFifo* @af, void** @data, int @nb_samples) => vectors.av_audio_fifo_read(@af, @data, @nb_samples); + + /// Reallocate an AVAudioFifo. + /// AVAudioFifo to reallocate + /// new allocation size, in samples + /// 0 if OK, or negative AVERROR code on failure + public static int av_audio_fifo_realloc(AVAudioFifo* @af, int @nb_samples) => vectors.av_audio_fifo_realloc(@af, @nb_samples); + + /// Reset the AVAudioFifo buffer. + /// AVAudioFifo to reset + public static void av_audio_fifo_reset(AVAudioFifo* @af) => vectors.av_audio_fifo_reset(@af); + + /// Get the current number of samples in the AVAudioFifo available for reading. + /// the AVAudioFifo to query + /// number of samples available for reading + public static int av_audio_fifo_size(AVAudioFifo* @af) => vectors.av_audio_fifo_size(@af); + + /// Get the current number of samples in the AVAudioFifo available for writing. + /// the AVAudioFifo to query + /// number of samples available for writing + public static int av_audio_fifo_space(AVAudioFifo* @af) => vectors.av_audio_fifo_space(@af); + + /// Write data to an AVAudioFifo. + /// AVAudioFifo to write to + /// audio data plane pointers + /// number of samples to write + /// number of samples actually written, or negative AVERROR code on failure. If successful, the number of samples actually written will always be nb_samples. + public static int av_audio_fifo_write(AVAudioFifo* @af, void** @data, int @nb_samples) => vectors.av_audio_fifo_write(@af, @data, @nb_samples); + + /// 0th order modified bessel function of the first kind. + public static double av_bessel_i0(double @x) => vectors.av_bessel_i0(@x); + + /// Allocate a context for a given bitstream filter. The caller must fill in the context parameters as described in the documentation and then call av_bsf_init() before sending any data to the filter. + /// the filter for which to allocate an instance. + /// a pointer into which the pointer to the newly-allocated context will be written. It must be freed with av_bsf_free() after the filtering is done. + /// 0 on success, a negative AVERROR code on failure + public static int av_bsf_alloc(AVBitStreamFilter* @filter, AVBSFContext** @ctx) => vectors.av_bsf_alloc(@filter, @ctx); + + /// Reset the internal bitstream filter state. Should be called e.g. when seeking. + public static void av_bsf_flush(AVBSFContext* @ctx) => vectors.av_bsf_flush(@ctx); + + /// Free a bitstream filter context and everything associated with it; write NULL into the supplied pointer. + public static void av_bsf_free(AVBSFContext** @ctx) => vectors.av_bsf_free(@ctx); + + /// Returns a bitstream filter with the specified name or NULL if no such bitstream filter exists. + /// a bitstream filter with the specified name or NULL if no such bitstream filter exists. + public static AVBitStreamFilter* av_bsf_get_by_name(string @name) => vectors.av_bsf_get_by_name(@name); + + /// Get the AVClass for AVBSFContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + public static AVClass* av_bsf_get_class() => vectors.av_bsf_get_class(); + + /// Get null/pass-through bitstream filter. + /// Pointer to be set to new instance of pass-through bitstream filter + public static int av_bsf_get_null_filter(AVBSFContext** @bsf) => vectors.av_bsf_get_null_filter(@bsf); + + /// Prepare the filter for use, after all the parameters and options have been set. + /// a AVBSFContext previously allocated with av_bsf_alloc() + public static int av_bsf_init(AVBSFContext* @ctx) => vectors.av_bsf_init(@ctx); + + /// Iterate over all registered bitstream filters. + /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. + /// the next registered bitstream filter or NULL when the iteration is finished + public static AVBitStreamFilter* av_bsf_iterate(void** @opaque) => vectors.av_bsf_iterate(@opaque); + + /// Allocate empty list of bitstream filters. The list must be later freed by av_bsf_list_free() or finalized by av_bsf_list_finalize(). + /// Pointer to on success, NULL in case of failure + public static AVBSFList* av_bsf_list_alloc() => vectors.av_bsf_list_alloc(); + + /// Append bitstream filter to the list of bitstream filters. + /// List to append to + /// Filter context to be appended + /// >=0 on success, negative AVERROR in case of failure + public static int av_bsf_list_append(AVBSFList* @lst, AVBSFContext* @bsf) => vectors.av_bsf_list_append(@lst, @bsf); + + /// Construct new bitstream filter context given it's name and options and append it to the list of bitstream filters. + /// List to append to + /// Name of the bitstream filter + /// Options for the bitstream filter, can be set to NULL + /// >=0 on success, negative AVERROR in case of failure + public static int av_bsf_list_append2(AVBSFList* @lst, string @bsf_name, AVDictionary** @options) => vectors.av_bsf_list_append2(@lst, @bsf_name, @options); + + /// Finalize list of bitstream filters. + /// Filter list structure to be transformed + /// Pointer to be set to newly created structure representing the chain of bitstream filters + /// >=0 on success, negative AVERROR in case of failure + public static int av_bsf_list_finalize(AVBSFList** @lst, AVBSFContext** @bsf) => vectors.av_bsf_list_finalize(@lst, @bsf); + + /// Free list of bitstream filters. + /// Pointer to pointer returned by av_bsf_list_alloc() + public static void av_bsf_list_free(AVBSFList** @lst) => vectors.av_bsf_list_free(@lst); + + /// Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters. Resulting AVBSFContext can be treated as any other AVBSFContext freshly allocated by av_bsf_alloc(). + /// String describing chain of bitstream filters in format `bsf1[=opt1=val1:opt2=val2][,bsf2]` + /// Pointer to be set to newly created structure representing the chain of bitstream filters + /// >=0 on success, negative AVERROR in case of failure + public static int av_bsf_list_parse_str(string @str, AVBSFContext** @bsf) => vectors.av_bsf_list_parse_str(@str, @bsf); + + /// Retrieve a filtered packet. + /// an initialized AVBSFContext + /// this struct will be filled with the contents of the filtered packet. It is owned by the caller and must be freed using av_packet_unref() when it is no longer needed. This parameter should be "clean" (i.e. freshly allocated with av_packet_alloc() or unreffed with av_packet_unref()) when this function is called. If this function returns successfully, the contents of pkt will be completely overwritten by the returned data. On failure, pkt is not touched. + /// - 0 on success. - AVERROR(EAGAIN) if more packets need to be sent to the filter (using av_bsf_send_packet()) to get more output. - AVERROR_EOF if there will be no further output from the filter. - Another negative AVERROR value if an error occurs. + public static int av_bsf_receive_packet(AVBSFContext* @ctx, AVPacket* @pkt) => vectors.av_bsf_receive_packet(@ctx, @pkt); + + /// Submit a packet for filtering. + /// an initialized AVBSFContext + /// the packet to filter. The bitstream filter will take ownership of the packet and reset the contents of pkt. pkt is not touched if an error occurs. If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero), it signals the end of the stream (i.e. no more non-empty packets will be sent; sending more empty packets does nothing) and will cause the filter to output any packets it may have buffered internally. + /// - 0 on success. - AVERROR(EAGAIN) if packets need to be retrieved from the filter (using av_bsf_receive_packet()) before new input can be consumed. - Another negative AVERROR value if an error occurs. + public static int av_bsf_send_packet(AVBSFContext* @ctx, AVPacket* @pkt) => vectors.av_bsf_send_packet(@ctx, @pkt); + + /// Allocate an AVBuffer of the given size using av_malloc(). + /// an AVBufferRef of given size or NULL when out of memory + public static AVBufferRef* av_buffer_alloc(ulong @size) => vectors.av_buffer_alloc(@size); + + /// Same as av_buffer_alloc(), except the returned buffer will be initialized to zero. + public static AVBufferRef* av_buffer_allocz(ulong @size) => vectors.av_buffer_allocz(@size); + + /// Create an AVBuffer from an existing array. + /// data array + /// size of data in bytes + /// a callback for freeing this buffer's data + /// parameter to be got for processing or passed to free + /// a combination of AV_BUFFER_FLAG_* + /// an AVBufferRef referring to data on success, NULL on failure. + public static AVBufferRef* av_buffer_create(byte* @data, ulong @size, av_buffer_create_free_func @free, void* @opaque, int @flags) => vectors.av_buffer_create(@data, @size, @free, @opaque, @flags); + + /// Default free callback, which calls av_free() on the buffer data. This function is meant to be passed to av_buffer_create(), not called directly. + public static void av_buffer_default_free(void* @opaque, byte* @data) => vectors.av_buffer_default_free(@opaque, @data); + + /// Returns the opaque parameter set by av_buffer_create. + /// the opaque parameter set by av_buffer_create. + public static void* av_buffer_get_opaque(AVBufferRef* @buf) => vectors.av_buffer_get_opaque(@buf); + + public static int av_buffer_get_ref_count(AVBufferRef* @buf) => vectors.av_buffer_get_ref_count(@buf); + + /// Returns 1 if the caller may write to the data referred to by buf (which is true if and only if buf is the only reference to the underlying AVBuffer). Return 0 otherwise. A positive answer is valid until av_buffer_ref() is called on buf. + /// 1 if the caller may write to the data referred to by buf (which is true if and only if buf is the only reference to the underlying AVBuffer). Return 0 otherwise. A positive answer is valid until av_buffer_ref() is called on buf. + public static int av_buffer_is_writable(AVBufferRef* @buf) => vectors.av_buffer_is_writable(@buf); + + /// Create a writable reference from a given buffer reference, avoiding data copy if possible. + /// buffer reference to make writable. On success, buf is either left untouched, or it is unreferenced and a new writable AVBufferRef is written in its place. On failure, buf is left untouched. + /// 0 on success, a negative AVERROR on failure. + public static int av_buffer_make_writable(AVBufferRef** @buf) => vectors.av_buffer_make_writable(@buf); + + /// Query the original opaque parameter of an allocated buffer in the pool. + /// a buffer reference to a buffer returned by av_buffer_pool_get. + /// the opaque parameter set by the buffer allocator function of the buffer pool. + public static void* av_buffer_pool_buffer_get_opaque(AVBufferRef* @ref) => vectors.av_buffer_pool_buffer_get_opaque(@ref); + + /// Allocate a new AVBuffer, reusing an old buffer from the pool when available. This function may be called simultaneously from multiple threads. + /// a reference to the new buffer on success, NULL on error. + public static AVBufferRef* av_buffer_pool_get(AVBufferPool* @pool) => vectors.av_buffer_pool_get(@pool); + + /// Allocate and initialize a buffer pool. + /// size of each buffer in this pool + /// a function that will be used to allocate new buffers when the pool is empty. May be NULL, then the default allocator will be used (av_buffer_alloc()). + /// newly created buffer pool on success, NULL on error. + public static AVBufferPool* av_buffer_pool_init(ulong @size, av_buffer_pool_init_alloc_func @alloc) => vectors.av_buffer_pool_init(@size, @alloc); + + /// Allocate and initialize a buffer pool with a more complex allocator. + /// size of each buffer in this pool + /// arbitrary user data used by the allocator + /// a function that will be used to allocate new buffers when the pool is empty. May be NULL, then the default allocator will be used (av_buffer_alloc()). + /// a function that will be called immediately before the pool is freed. I.e. after av_buffer_pool_uninit() is called by the caller and all the frames are returned to the pool and freed. It is intended to uninitialize the user opaque data. May be NULL. + /// newly created buffer pool on success, NULL on error. + public static AVBufferPool* av_buffer_pool_init2(ulong @size, void* @opaque, av_buffer_pool_init2_alloc_func @alloc, av_buffer_pool_init2_pool_free_func @pool_free) => vectors.av_buffer_pool_init2(@size, @opaque, @alloc, @pool_free); + + /// Mark the pool as being available for freeing. It will actually be freed only once all the allocated buffers associated with the pool are released. Thus it is safe to call this function while some of the allocated buffers are still in use. + /// pointer to the pool to be freed. It will be set to NULL. + public static void av_buffer_pool_uninit(AVBufferPool** @pool) => vectors.av_buffer_pool_uninit(@pool); + + /// Reallocate a given buffer. + /// a buffer reference to reallocate. On success, buf will be unreferenced and a new reference with the required size will be written in its place. On failure buf will be left untouched. *buf may be NULL, then a new buffer is allocated. + /// required new buffer size. + /// 0 on success, a negative AVERROR on failure. + public static int av_buffer_realloc(AVBufferRef** @buf, ulong @size) => vectors.av_buffer_realloc(@buf, @size); + + /// Create a new reference to an AVBuffer. + /// a new AVBufferRef referring to the same AVBuffer as buf or NULL on failure. + public static AVBufferRef* av_buffer_ref(AVBufferRef* @buf) => vectors.av_buffer_ref(@buf); + + /// Ensure dst refers to the same data as src. + /// Pointer to either a valid buffer reference or NULL. On success, this will point to a buffer reference equivalent to src. On failure, dst will be left untouched. + /// A buffer reference to replace dst with. May be NULL, then this function is equivalent to av_buffer_unref(dst). + /// 0 on success AVERROR(ENOMEM) on memory allocation failure. + public static int av_buffer_replace(AVBufferRef** @dst, AVBufferRef* @src) => vectors.av_buffer_replace(@dst, @src); + + /// Free a given reference and automatically free the buffer if there are no more references to it. + /// the reference to be freed. The pointer is set to NULL on return. + public static void av_buffer_unref(AVBufferRef** @buf) => vectors.av_buffer_unref(@buf); + + public static int av_buffersink_get_ch_layout(AVFilterContext* @ctx, AVChannelLayout* @ch_layout) => vectors.av_buffersink_get_ch_layout(@ctx, @ch_layout); + + public static int av_buffersink_get_channels(AVFilterContext* @ctx) => vectors.av_buffersink_get_channels(@ctx); + + public static AVColorRange av_buffersink_get_color_range(AVFilterContext* @ctx) => vectors.av_buffersink_get_color_range(@ctx); + + public static AVColorSpace av_buffersink_get_colorspace(AVFilterContext* @ctx) => vectors.av_buffersink_get_colorspace(@ctx); + + public static int av_buffersink_get_format(AVFilterContext* @ctx) => vectors.av_buffersink_get_format(@ctx); + + /// Get a frame with filtered data from sink and put it in frame. + /// pointer to a context of a buffersink or abuffersink AVFilter. + /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() + /// - >= 0 if a frame was successfully returned. - AVERROR(EAGAIN) if no frames are available at this point; more input frames must be added to the filtergraph to get more output. - AVERROR_EOF if there will be no more output frames on this sink. - A different negative AVERROR code in other failure cases. + public static int av_buffersink_get_frame(AVFilterContext* @ctx, AVFrame* @frame) => vectors.av_buffersink_get_frame(@ctx, @frame); + + /// Get a frame with filtered data from sink and put it in frame. + /// pointer to a buffersink or abuffersink filter context. + /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() + /// a combination of AV_BUFFERSINK_FLAG_* flags + /// >= 0 in for success, a negative AVERROR code for failure. + public static int av_buffersink_get_frame_flags(AVFilterContext* @ctx, AVFrame* @frame, int @flags) => vectors.av_buffersink_get_frame_flags(@ctx, @frame, @flags); + + public static AVRational av_buffersink_get_frame_rate(AVFilterContext* @ctx) => vectors.av_buffersink_get_frame_rate(@ctx); + + public static int av_buffersink_get_h(AVFilterContext* @ctx) => vectors.av_buffersink_get_h(@ctx); + + public static AVBufferRef* av_buffersink_get_hw_frames_ctx(AVFilterContext* @ctx) => vectors.av_buffersink_get_hw_frames_ctx(@ctx); + + public static AVRational av_buffersink_get_sample_aspect_ratio(AVFilterContext* @ctx) => vectors.av_buffersink_get_sample_aspect_ratio(@ctx); + + public static int av_buffersink_get_sample_rate(AVFilterContext* @ctx) => vectors.av_buffersink_get_sample_rate(@ctx); + + /// Same as av_buffersink_get_frame(), but with the ability to specify the number of samples read. This function is less efficient than av_buffersink_get_frame(), because it copies the data around. + /// pointer to a context of the abuffersink AVFilter. + /// pointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() frame will contain exactly nb_samples audio samples, except at the end of stream, when it can contain less than nb_samples. + /// The return codes have the same meaning as for av_buffersink_get_frame(). + public static int av_buffersink_get_samples(AVFilterContext* @ctx, AVFrame* @frame, int @nb_samples) => vectors.av_buffersink_get_samples(@ctx, @frame, @nb_samples); + + public static AVRational av_buffersink_get_time_base(AVFilterContext* @ctx) => vectors.av_buffersink_get_time_base(@ctx); + + /// Get the properties of the stream @{ + public static AVMediaType av_buffersink_get_type(AVFilterContext* @ctx) => vectors.av_buffersink_get_type(@ctx); + + public static int av_buffersink_get_w(AVFilterContext* @ctx) => vectors.av_buffersink_get_w(@ctx); + + /// Set the frame size for an audio buffer sink. + public static void av_buffersink_set_frame_size(AVFilterContext* @ctx, uint @frame_size) => vectors.av_buffersink_set_frame_size(@ctx, @frame_size); + + /// Add a frame to the buffer source. + /// an instance of the buffersrc filter + /// frame to be added. If the frame is reference counted, this function will take ownership of the reference(s) and reset the frame. Otherwise the frame data will be copied. If this function returns an error, the input frame is not touched. + /// 0 on success, a negative AVERROR on error. + public static int av_buffersrc_add_frame(AVFilterContext* @ctx, AVFrame* @frame) => vectors.av_buffersrc_add_frame(@ctx, @frame); + + /// Add a frame to the buffer source. + /// pointer to a buffer source context + /// a frame, or NULL to mark EOF + /// a combination of AV_BUFFERSRC_FLAG_* + /// >= 0 in case of success, a negative AVERROR code in case of failure + public static int av_buffersrc_add_frame_flags(AVFilterContext* @buffer_src, AVFrame* @frame, int @flags) => vectors.av_buffersrc_add_frame_flags(@buffer_src, @frame, @flags); + + /// Close the buffer source after EOF. + public static int av_buffersrc_close(AVFilterContext* @ctx, long @pts, uint @flags) => vectors.av_buffersrc_close(@ctx, @pts, @flags); + + /// Get the number of failed requests. + public static uint av_buffersrc_get_nb_failed_requests(AVFilterContext* @buffer_src) => vectors.av_buffersrc_get_nb_failed_requests(@buffer_src); + + /// Allocate a new AVBufferSrcParameters instance. It should be freed by the caller with av_free(). + public static AVBufferSrcParameters* av_buffersrc_parameters_alloc() => vectors.av_buffersrc_parameters_alloc(); + + /// Initialize the buffersrc or abuffersrc filter with the provided parameters. This function may be called multiple times, the later calls override the previous ones. Some of the parameters may also be set through AVOptions, then whatever method is used last takes precedence. + /// an instance of the buffersrc or abuffersrc filter + /// the stream parameters. The frames later passed to this filter must conform to those parameters. All the allocated fields in param remain owned by the caller, libavfilter will make internal copies or references when necessary. + /// 0 on success, a negative AVERROR code on failure. + public static int av_buffersrc_parameters_set(AVFilterContext* @ctx, AVBufferSrcParameters* @param) => vectors.av_buffersrc_parameters_set(@ctx, @param); + + /// Add a frame to the buffer source. + /// an instance of the buffersrc filter + /// frame to be added. If the frame is reference counted, this function will make a new reference to it. Otherwise the frame data will be copied. + /// 0 on success, a negative AVERROR on error + public static int av_buffersrc_write_frame(AVFilterContext* @ctx, AVFrame* @frame) => vectors.av_buffersrc_write_frame(@ctx, @frame); + + /// Allocate a memory block for an array with av_mallocz(). + /// Number of elements + /// Size of the single element + /// Pointer to the allocated block, or `NULL` if the block cannot be allocated + public static void* av_calloc(ulong @nmemb, ulong @size) => vectors.av_calloc(@nmemb, @size); + + /// Get a human readable string describing a given channel. + /// pre-allocated buffer where to put the generated string + /// size in bytes of the buffer. + /// the AVChannel whose description to get + /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. + public static int av_channel_description(byte* @buf, ulong @buf_size, AVChannel @channel) => vectors.av_channel_description(@buf, @buf_size, @channel); + + /// bprint variant of av_channel_description(). + public static void av_channel_description_bprint(AVBPrint* @bp, AVChannel @channel_id) => vectors.av_channel_description_bprint(@bp, @channel_id); + + /// This is the inverse function of av_channel_name(). + /// the channel with the given name AV_CHAN_NONE when name does not identify a known channel + public static AVChannel av_channel_from_string(string @name) => vectors.av_channel_from_string(@name); + + /// Get the channel with the given index in a channel layout. + /// input channel layout + /// index of the channel + /// channel with the index idx in channel_layout on success or AV_CHAN_NONE on failure (if idx is not valid or the channel order is unspecified) + public static AVChannel av_channel_layout_channel_from_index(AVChannelLayout* @channel_layout, uint @idx) => vectors.av_channel_layout_channel_from_index(@channel_layout, @idx); + + /// Get a channel described by the given string. + /// input channel layout + /// string describing the channel to obtain + /// a channel described by the given string in channel_layout on success or AV_CHAN_NONE on failure (if the string is not valid or the channel order is unspecified) + public static AVChannel av_channel_layout_channel_from_string(AVChannelLayout* @channel_layout, string @name) => vectors.av_channel_layout_channel_from_string(@channel_layout, @name); + + /// Check whether a channel layout is valid, i.e. can possibly describe audio data. + /// input channel layout + /// 1 if channel_layout is valid, 0 otherwise. + public static int av_channel_layout_check(AVChannelLayout* @channel_layout) => vectors.av_channel_layout_check(@channel_layout); + + /// Check whether two channel layouts are semantically the same, i.e. the same channels are present on the same positions in both. + /// input channel layout + /// input channel layout + /// 0 if chl and chl1 are equal, 1 if they are not equal. A negative AVERROR code if one or both are invalid. + public static int av_channel_layout_compare(AVChannelLayout* @chl, AVChannelLayout* @chl1) => vectors.av_channel_layout_compare(@chl, @chl1); + + /// Make a copy of a channel layout. This differs from just assigning src to dst in that it allocates and copies the map for AV_CHANNEL_ORDER_CUSTOM. + /// destination channel layout + /// source channel layout + /// 0 on success, a negative AVERROR on error. + public static int av_channel_layout_copy(AVChannelLayout* @dst, AVChannelLayout* @src) => vectors.av_channel_layout_copy(@dst, @src); + + /// Initialize a custom channel layout with the specified number of channels. The channel map will be allocated and the designation of all channels will be set to AV_CHAN_UNKNOWN. + /// the layout structure to be initialized + /// the number of channels + /// 0 on success AVERROR(EINVAL) if the number of channels < = 0 AVERROR(ENOMEM) if the channel map could not be allocated + public static int av_channel_layout_custom_init(AVChannelLayout* @channel_layout, int @nb_channels) => vectors.av_channel_layout_custom_init(@channel_layout, @nb_channels); + + /// Get the default channel layout for a given number of channels. + /// the layout structure to be initialized + /// number of channels + public static void av_channel_layout_default(AVChannelLayout* @ch_layout, int @nb_channels) => vectors.av_channel_layout_default(@ch_layout, @nb_channels); + + /// Get a human-readable string describing the channel layout properties. The string will be in the same format that is accepted by av_channel_layout_from_string(), allowing to rebuild the same channel layout, except for opaque pointers. + /// channel layout to be described + /// pre-allocated buffer where to put the generated string + /// size in bytes of the buffer. + /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. + public static int av_channel_layout_describe(AVChannelLayout* @channel_layout, byte* @buf, ulong @buf_size) => vectors.av_channel_layout_describe(@channel_layout, @buf, @buf_size); + + /// bprint variant of av_channel_layout_describe(). + /// 0 on success, or a negative AVERROR value on failure. + public static int av_channel_layout_describe_bprint(AVChannelLayout* @channel_layout, AVBPrint* @bp) => vectors.av_channel_layout_describe_bprint(@channel_layout, @bp); + + /// Initialize a native channel layout from a bitmask indicating which channels are present. + /// the layout structure to be initialized + /// bitmask describing the channel layout + /// 0 on success AVERROR(EINVAL) for invalid mask values + public static int av_channel_layout_from_mask(AVChannelLayout* @channel_layout, ulong @mask) => vectors.av_channel_layout_from_mask(@channel_layout, @mask); + + /// Initialize a channel layout from a given string description. The input string can be represented by: - the formal channel layout name (returned by av_channel_layout_describe()) - single or multiple channel names (returned by av_channel_name(), eg. "FL", or concatenated with "+", each optionally containing a custom name after a "", eg. "FL+FR+LFE") - a decimal or hexadecimal value of a native channel layout (eg. "4" or "0x4") - the number of channels with default layout (eg. "4c") - the number of unordered channels (eg. "4C" or "4 channels") - the ambisonic order followed by optional non-diegetic channels (eg. "ambisonic 2+stereo") On error, the channel layout will remain uninitialized, but not necessarily untouched. + /// uninitialized channel layout for the result + /// string describing the channel layout + /// 0 on success parsing the channel layout AVERROR(EINVAL) if an invalid channel layout string was provided AVERROR(ENOMEM) if there was not enough memory + public static int av_channel_layout_from_string(AVChannelLayout* @channel_layout, string @str) => vectors.av_channel_layout_from_string(@channel_layout, @str); + + /// Get the index of a given channel in a channel layout. In case multiple channels are found, only the first match will be returned. + /// input channel layout + /// the channel whose index to obtain + /// index of channel in channel_layout on success or a negative number if channel is not present in channel_layout. + public static int av_channel_layout_index_from_channel(AVChannelLayout* @channel_layout, AVChannel @channel) => vectors.av_channel_layout_index_from_channel(@channel_layout, @channel); + + /// Get the index in a channel layout of a channel described by the given string. In case multiple channels are found, only the first match will be returned. + /// input channel layout + /// string describing the channel whose index to obtain + /// a channel index described by the given string, or a negative AVERROR value. + public static int av_channel_layout_index_from_string(AVChannelLayout* @channel_layout, string @name) => vectors.av_channel_layout_index_from_string(@channel_layout, @name); + + /// Change the AVChannelOrder of a channel layout. + /// channel layout which will be changed + /// the desired channel layout order + /// a combination of AV_CHANNEL_LAYOUT_RETYPE_FLAG_* constants + /// 0 if the conversion was successful and lossless or if the channel layout was already in the desired order >0 if the conversion was successful but lossy AVERROR(ENOSYS) if the conversion was not possible (or would be lossy and AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS was specified) AVERROR(EINVAL), AVERROR(ENOMEM) on error + public static int av_channel_layout_retype(AVChannelLayout* @channel_layout, AVChannelOrder @order, int @flags) => vectors.av_channel_layout_retype(@channel_layout, @order, @flags); + + /// Iterate over all standard channel layouts. + /// a pointer where libavutil will store the iteration state. Must point to NULL to start the iteration. + /// the standard channel layout or NULL when the iteration is finished + public static AVChannelLayout* av_channel_layout_standard(void** @opaque) => vectors.av_channel_layout_standard(@opaque); + + /// Find out what channels from a given set are present in a channel layout, without regard for their positions. + /// input channel layout + /// a combination of AV_CH_* representing a set of channels + /// a bitfield representing all the channels from mask that are present in channel_layout + public static ulong av_channel_layout_subset(AVChannelLayout* @channel_layout, ulong @mask) => vectors.av_channel_layout_subset(@channel_layout, @mask); + + /// Free any allocated data in the channel layout and reset the channel count to 0. + /// the layout structure to be uninitialized + public static void av_channel_layout_uninit(AVChannelLayout* @channel_layout) => vectors.av_channel_layout_uninit(@channel_layout); + + /// Get a human readable string in an abbreviated form describing a given channel. This is the inverse function of av_channel_from_string(). + /// pre-allocated buffer where to put the generated string + /// size in bytes of the buffer. + /// the AVChannel whose name to get + /// amount of bytes needed to hold the output string, or a negative AVERROR on failure. If the returned value is bigger than buf_size, then the string was truncated. + public static int av_channel_name(byte* @buf, ulong @buf_size, AVChannel @channel) => vectors.av_channel_name(@buf, @buf_size, @channel); + + /// bprint variant of av_channel_name(). + public static void av_channel_name_bprint(AVBPrint* @bp, AVChannel @channel_id) => vectors.av_channel_name_bprint(@bp, @channel_id); + + /// Converts AVChromaLocation to swscale x/y chroma position. + /// horizontal chroma sample position + /// vertical chroma sample position + public static int av_chroma_location_enum_to_pos(int* @xpos, int* @ypos, AVChromaLocation @pos) => vectors.av_chroma_location_enum_to_pos(@xpos, @ypos, @pos); + + /// Returns the AVChromaLocation value for name or an AVError if not found. + /// the AVChromaLocation value for name or an AVError if not found. + public static int av_chroma_location_from_name(string @name) => vectors.av_chroma_location_from_name(@name); + + /// Returns the name for provided chroma location or NULL if unknown. + /// the name for provided chroma location or NULL if unknown. + public static string av_chroma_location_name(AVChromaLocation @location) => vectors.av_chroma_location_name(@location); + + /// Converts swscale x/y chroma position to AVChromaLocation. + /// horizontal chroma sample position + /// vertical chroma sample position + public static AVChromaLocation av_chroma_location_pos_to_enum(int @xpos, int @ypos) => vectors.av_chroma_location_pos_to_enum(@xpos, @ypos); + + /// Get the AVCodecID for the given codec tag tag. If no codec id is found returns AV_CODEC_ID_NONE. + /// list of supported codec_id-codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + /// codec tag to match to a codec ID + public static AVCodecID av_codec_get_id(AVCodecTag** @tags, uint @tag) => vectors.av_codec_get_id(@tags, @tag); + + /// Get the codec tag for the given codec id id. If no codec tag is found returns 0. + /// list of supported codec_id-codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + /// codec ID to match to a codec tag + public static uint av_codec_get_tag(AVCodecTag** @tags, AVCodecID @id) => vectors.av_codec_get_tag(@tags, @id); + + /// Get the codec tag for the given codec id. + /// list of supported codec_id - codec_tag pairs, as stored in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + /// codec id that should be searched for in the list + /// A pointer to the found tag + /// 0 if id was not found in tags, > 0 if it was found + public static int av_codec_get_tag2(AVCodecTag** @tags, AVCodecID @id, uint* @tag) => vectors.av_codec_get_tag2(@tags, @id, @tag); + + /// Returns a non-zero number if codec is a decoder, zero otherwise + /// a non-zero number if codec is a decoder, zero otherwise + public static int av_codec_is_decoder(AVCodec* @codec) => vectors.av_codec_is_decoder(@codec); + + /// Returns a non-zero number if codec is an encoder, zero otherwise + /// a non-zero number if codec is an encoder, zero otherwise + public static int av_codec_is_encoder(AVCodec* @codec) => vectors.av_codec_is_encoder(@codec); + + /// Iterate over all registered codecs. + /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. + /// the next registered codec or NULL when the iteration is finished + public static AVCodec* av_codec_iterate(void** @opaque) => vectors.av_codec_iterate(@opaque); + + /// Returns the AVColorPrimaries value for name or an AVError if not found. + /// the AVColorPrimaries value for name or an AVError if not found. + public static int av_color_primaries_from_name(string @name) => vectors.av_color_primaries_from_name(@name); + + /// Returns the name for provided color primaries or NULL if unknown. + /// the name for provided color primaries or NULL if unknown. + public static string av_color_primaries_name(AVColorPrimaries @primaries) => vectors.av_color_primaries_name(@primaries); + + /// Returns the AVColorRange value for name or an AVError if not found. + /// the AVColorRange value for name or an AVError if not found. + public static int av_color_range_from_name(string @name) => vectors.av_color_range_from_name(@name); + + /// Returns the name for provided color range or NULL if unknown. + /// the name for provided color range or NULL if unknown. + public static string av_color_range_name(AVColorRange @range) => vectors.av_color_range_name(@range); + + /// Returns the AVColorSpace value for name or an AVError if not found. + /// the AVColorSpace value for name or an AVError if not found. + public static int av_color_space_from_name(string @name) => vectors.av_color_space_from_name(@name); + + /// Returns the name for provided color space or NULL if unknown. + /// the name for provided color space or NULL if unknown. + public static string av_color_space_name(AVColorSpace @space) => vectors.av_color_space_name(@space); + + /// Returns the AVColorTransferCharacteristic value for name or an AVError if not found. + /// the AVColorTransferCharacteristic value for name or an AVError if not found. + public static int av_color_transfer_from_name(string @name) => vectors.av_color_transfer_from_name(@name); + + /// Returns the name for provided color transfer or NULL if unknown. + /// the name for provided color transfer or NULL if unknown. + public static string av_color_transfer_name(AVColorTransferCharacteristic @transfer) => vectors.av_color_transfer_name(@transfer); + + /// Compare the remainders of two integer operands divided by a common divisor. + /// Operand + /// Operand + /// Divisor; must be a power of 2 + /// - a negative value if `a % mod < b % mod` - a positive value if `a % mod > b % mod` - zero if `a % mod == b % mod` + public static long av_compare_mod(ulong @a, ulong @b, ulong @mod) => vectors.av_compare_mod(@a, @b, @mod); + + /// Compare two timestamps each in its own time base. + /// One of the following values: - -1 if `ts_a` is before `ts_b` - 1 if `ts_a` is after `ts_b` - 0 if they represent the same position + public static int av_compare_ts(long @ts_a, AVRational @tb_a, long @ts_b, AVRational @tb_b) => vectors.av_compare_ts(@ts_a, @tb_a, @ts_b, @tb_b); + + /// Allocate an AVContentLightMetadata structure and set its fields to default values. The resulting struct can be freed using av_freep(). + /// An AVContentLightMetadata filled with default values or NULL on failure. + public static AVContentLightMetadata* av_content_light_metadata_alloc(ulong* @size) => vectors.av_content_light_metadata_alloc(@size); + + /// Allocate a complete AVContentLightMetadata and add it to the frame. + /// The frame which side data is added to. + /// The AVContentLightMetadata structure to be filled by caller. + public static AVContentLightMetadata* av_content_light_metadata_create_side_data(AVFrame* @frame) => vectors.av_content_light_metadata_create_side_data(@frame); + + /// Allocate a CPB properties structure and initialize its fields to default values. + /// if non-NULL, the size of the allocated struct will be written here. This is useful for embedding it in side data. + /// the newly allocated struct or NULL on failure + public static AVCPBProperties* av_cpb_properties_alloc(ulong* @size) => vectors.av_cpb_properties_alloc(@size); + + /// Returns the number of logical CPU cores present. + /// the number of logical CPU cores present. + public static int av_cpu_count() => vectors.av_cpu_count(); + + /// Overrides cpu count detection and forces the specified count. Count < 1 disables forcing of specific count. + public static void av_cpu_force_count(int @count) => vectors.av_cpu_force_count(@count); + + /// Get the maximum data alignment that may be required by leviathan. + public static ulong av_cpu_max_align() => vectors.av_cpu_max_align(); + + /// Convert a double precision floating point number to a rational. + /// `double` to convert + /// Maximum allowed numerator and denominator + /// `d` in AVRational form + public static AVRational av_d2q(double @d, int @max) => vectors.av_d2q(@d, @max); + + /// Allocate an AVD3D11VAContext. + /// Newly-allocated AVD3D11VAContext or NULL on failure. + public static AVD3D11VAContext* av_d3d11va_alloc_context() => vectors.av_d3d11va_alloc_context(); + + public static AVClassCategory av_default_get_category(void* @ptr) => vectors.av_default_get_category(@ptr); + + /// Return the context name + /// The AVClass context + /// The AVClass class_name + public static string av_default_item_name(void* @ctx) => vectors.av_default_item_name(@ctx); + + /// Iterate over all registered demuxers. + /// a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. + /// the next registered demuxer or NULL when the iteration is finished + public static AVInputFormat* av_demuxer_iterate(void** @opaque) => vectors.av_demuxer_iterate(@opaque); + + /// Copy entries from one AVDictionary struct into another. + /// Pointer to a pointer to a AVDictionary struct to copy into. If *dst is NULL, this function will allocate a struct for you and put it in *dst + /// Pointer to the source AVDictionary struct to copy items from. + /// Flags to use when setting entries in *dst + /// 0 on success, negative AVERROR code on failure. If dst was allocated by this function, callers should free the associated memory. + public static int av_dict_copy(AVDictionary** @dst, AVDictionary* @src, int @flags) => vectors.av_dict_copy(@dst, @src, @flags); + + /// Get number of entries in dictionary. + /// dictionary + /// number of entries in dictionary + public static int av_dict_count(AVDictionary* @m) => vectors.av_dict_count(@m); + + /// Free all the memory allocated for an AVDictionary struct and all keys and values. + public static void av_dict_free(AVDictionary** @m) => vectors.av_dict_free(@m); + + /// Get a dictionary entry with matching key. + /// Matching key + /// Set to the previous matching element to find the next. If set to NULL the first matching element is returned. + /// A collection of AV_DICT_* flags controlling how the entry is retrieved + /// Found entry or NULL in case no matching entry was found in the dictionary + public static AVDictionaryEntry* av_dict_get(AVDictionary* @m, string @key, AVDictionaryEntry* @prev, int @flags) => vectors.av_dict_get(@m, @key, @prev, @flags); + + /// Get dictionary entries as a string. + /// The dictionary + /// Pointer to buffer that will be allocated with string containg entries. Buffer must be freed by the caller when is no longer needed. + /// Character used to separate key from value + /// Character used to separate two pairs from each other + /// >= 0 on success, negative on error + public static int av_dict_get_string(AVDictionary* @m, byte** @buffer, byte @key_val_sep, byte @pairs_sep) => vectors.av_dict_get_string(@m, @buffer, @key_val_sep, @pairs_sep); + + /// Iterate over a dictionary + /// The dictionary to iterate over + /// Pointer to the previous AVDictionaryEntry, NULL initially + public static AVDictionaryEntry* av_dict_iterate(AVDictionary* @m, AVDictionaryEntry* @prev) => vectors.av_dict_iterate(@m, @prev); + + /// Parse the key/value pairs list and add the parsed entries to a dictionary. + /// A 0-terminated list of characters used to separate key from value + /// A 0-terminated list of characters used to separate two pairs from each other + /// Flags to use when adding to the dictionary. ::AV_DICT_DONT_STRDUP_KEY and ::AV_DICT_DONT_STRDUP_VAL are ignored since the key/value tokens will always be duplicated. + /// 0 on success, negative AVERROR code on failure + public static int av_dict_parse_string(AVDictionary** @pm, string @str, string @key_val_sep, string @pairs_sep, int @flags) => vectors.av_dict_parse_string(@pm, @str, @key_val_sep, @pairs_sep, @flags); + + /// Set the given entry in *pm, overwriting an existing entry. + /// Pointer to a pointer to a dictionary struct. If *pm is NULL a dictionary struct is allocated and put in *pm. + /// Entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) + /// Entry value to add to *pm (will be av_strduped or added as a new key depending on flags). Passing a NULL value will cause an existing entry to be deleted. + /// >= 0 on success otherwise an error code < 0 + public static int av_dict_set(AVDictionary** @pm, string @key, string @value, int @flags) => vectors.av_dict_set(@pm, @key, @value, @flags); + + /// Convenience wrapper for av_dict_set() that converts the value to a string and stores it. + public static int av_dict_set_int(AVDictionary** @pm, string @key, long @value, int @flags) => vectors.av_dict_set_int(@pm, @key, @value, @flags); + + /// Flip the input matrix horizontally and/or vertically. + /// a transformation matrix + /// whether the matrix should be flipped horizontally + /// whether the matrix should be flipped vertically + public static void av_display_matrix_flip(ref int9 @matrix, int @hflip, int @vflip) => vectors.av_display_matrix_flip(ref @matrix, @hflip, @vflip); + + /// Extract the rotation component of the transformation matrix. + /// the transformation matrix + /// the angle (in degrees) by which the transformation rotates the frame counterclockwise. The angle will be in range [-180.0, 180.0], or NaN if the matrix is singular. + public static double av_display_rotation_get(in int9 @matrix) => vectors.av_display_rotation_get(@matrix); + + /// Initialize a transformation matrix describing a pure clockwise rotation by the specified angle (in degrees). + /// a transformation matrix (will be fully overwritten by this function) + /// rotation angle in degrees. + public static void av_display_rotation_set(ref int9 @matrix, double @angle) => vectors.av_display_rotation_set(ref @matrix, @angle); + + /// Returns The AV_DISPOSITION_* flag corresponding to disp or a negative error code if disp does not correspond to a known stream disposition. + /// The AV_DISPOSITION_* flag corresponding to disp or a negative error code if disp does not correspond to a known stream disposition. + public static int av_disposition_from_string(string @disp) => vectors.av_disposition_from_string(@disp); + + /// Returns The string description corresponding to the lowest set bit in disposition. NULL when the lowest set bit does not correspond to a known disposition or when disposition is 0. + /// a combination of AV_DISPOSITION_* values + /// The string description corresponding to the lowest set bit in disposition. NULL when the lowest set bit does not correspond to a known disposition or when disposition is 0. + public static string av_disposition_to_string(int @disposition) => vectors.av_disposition_to_string(@disposition); + + /// Divide one rational by another. + /// First rational + /// Second rational + /// b/c + public static AVRational av_div_q(AVRational @b, AVRational @c) => vectors.av_div_q(@b, @c); + + /// Print detailed information about the input or output format, such as duration, bitrate, streams, container, programs, metadata, side data, codec and time base. + /// the context to analyze + /// index of the stream to dump information about + /// the URL to print, such as source or destination file + /// Select whether the specified context is an input(0) or output(1) + public static void av_dump_format(AVFormatContext* @ic, int @index, string @url, int @is_output) => vectors.av_dump_format(@ic, @index, @url, @is_output); + + /// Allocate an AVDynamicHDRPlus structure and set its fields to default values. The resulting struct can be freed using av_freep(). + /// An AVDynamicHDRPlus filled with default values or NULL on failure. + public static AVDynamicHDRPlus* av_dynamic_hdr_plus_alloc(ulong* @size) => vectors.av_dynamic_hdr_plus_alloc(@size); + + /// Allocate a complete AVDynamicHDRPlus and add it to the frame. + /// The frame which side data is added to. + /// The AVDynamicHDRPlus structure to be filled by caller or NULL on failure. + public static AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data(AVFrame* @frame) => vectors.av_dynamic_hdr_plus_create_side_data(@frame); + + /// Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). The T.35 buffer must begin with the application mode, skipping the country code, terminal provider codes, and application identifier. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// The byte array containing the raw ITU-T T.35 data. + /// Size of the data array in bytes. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + public static int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus* @s, byte* @data, ulong @size) => vectors.av_dynamic_hdr_plus_from_t35(@s, @data, @size); + + /// Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, excluding the first 48 bytes of the header, and beginning with the application mode. + /// A pointer containing the decoded AVDynamicHDRPlus structure. + /// A pointer to pointer to a byte buffer to be filled with the serialized metadata. If *data is NULL, a buffer be will be allocated and a pointer to it stored in its place. The caller assumes ownership of the buffer. May be NULL, in which case the function will only store the required buffer size in *size. + /// A pointer to a size to be set to the returned buffer's size. If *data is not NULL, *size must contain the size of the input buffer. May be NULL only if *data is NULL. + /// >= 0 on success. Otherwise, returns the appropriate AVERROR. + public static int av_dynamic_hdr_plus_to_t35(AVDynamicHDRPlus* @s, byte** @data, ulong* @size) => vectors.av_dynamic_hdr_plus_to_t35(@s, @data, @size); + + /// Add the pointer to an element to a dynamic array. + /// Pointer to the array to grow + /// Pointer to the number of elements in the array + /// Element to add + public static void av_dynarray_add(void* @tab_ptr, int* @nb_ptr, void* @elem) => vectors.av_dynarray_add(@tab_ptr, @nb_ptr, @elem); + + /// Add an element to a dynamic array. + /// >=0 on success, negative otherwise + public static int av_dynarray_add_nofree(void* @tab_ptr, int* @nb_ptr, void* @elem) => vectors.av_dynarray_add_nofree(@tab_ptr, @nb_ptr, @elem); + + /// Add an element of size `elem_size` to a dynamic array. + /// Pointer to the array to grow + /// Pointer to the number of elements in the array + /// Size in bytes of an element in the array + /// Pointer to the data of the element to add. If `NULL`, the space of the newly added element is allocated but left uninitialized. + /// Pointer to the data of the element to copy in the newly allocated space + public static void* av_dynarray2_add(void** @tab_ptr, int* @nb_ptr, ulong @elem_size, byte* @elem_data) => vectors.av_dynarray2_add(@tab_ptr, @nb_ptr, @elem_size, @elem_data); + + /// Allocate a buffer, reusing the given one if large enough. + /// Pointer to pointer to an already allocated buffer. `*ptr` will be overwritten with pointer to new buffer on success or `NULL` on failure + /// Pointer to the size of buffer `*ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. + /// Desired minimal size of buffer `*ptr` + public static void av_fast_malloc(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_malloc(@ptr, @size, @min_size); + + /// Allocate and clear a buffer, reusing the given one if large enough. + /// Pointer to pointer to an already allocated buffer. `*ptr` will be overwritten with pointer to new buffer on success or `NULL` on failure + /// Pointer to the size of buffer `*ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. + /// Desired minimal size of buffer `*ptr` + public static void av_fast_mallocz(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_mallocz(@ptr, @size, @min_size); + + /// Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0. + public static void av_fast_padded_malloc(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_padded_malloc(@ptr, @size, @min_size); + + /// Same behaviour av_fast_padded_malloc except that buffer will always be 0-initialized after call. + public static void av_fast_padded_mallocz(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_padded_mallocz(@ptr, @size, @min_size); + + /// Reallocate the given buffer if it is not large enough, otherwise do nothing. + /// Already allocated buffer, or `NULL` + /// Pointer to the size of buffer `ptr`. `*size` is updated to the new allocated size, in particular 0 in case of failure. + /// Desired minimal size of buffer `ptr` + /// `ptr` if the buffer is large enough, a pointer to newly reallocated buffer if the buffer was not large enough, or `NULL` in case of error + public static void* av_fast_realloc(void* @ptr, uint* @size, ulong @min_size) => vectors.av_fast_realloc(@ptr, @size, @min_size); + + /// Read the file with name filename, and put its content in a newly allocated buffer or map it with mmap() when available. In case of success set *bufptr to the read or mmapped buffer, and *size to the size in bytes of the buffer in *bufptr. Unlike mmap this function succeeds with zero sized files, in this case *bufptr will be set to NULL and *size will be set to 0. The returned buffer must be released with av_file_unmap(). + /// path to the file + /// pointee is set to the mapped or allocated buffer + /// pointee is set to the size in bytes of the buffer + /// loglevel offset used for logging + /// context used for logging + /// a non negative number in case of success, a negative value corresponding to an AVERROR error code in case of failure + public static int av_file_map(string @filename, byte** @bufptr, ulong* @size, int @log_offset, void* @log_ctx) => vectors.av_file_map(@filename, @bufptr, @size, @log_offset, @log_ctx); + + /// Unmap or free the buffer bufptr created by av_file_map(). + /// the buffer previously created with av_file_map() + /// size in bytes of bufptr, must be the same as returned by av_file_map() + public static void av_file_unmap(byte* @bufptr, ulong @size) => vectors.av_file_unmap(@bufptr, @size); + + /// Check whether filename actually is a numbered sequence generator. + /// possible numbered sequence string + /// 1 if a valid numbered sequence string, 0 otherwise + public static int av_filename_number_test(string @filename) => vectors.av_filename_number_test(@filename); + + /// Iterate over all registered filters. + /// a pointer where libavfilter will store the iteration state. Must point to NULL to start the iteration. + /// the next registered filter or NULL when the iteration is finished + public static AVFilter* av_filter_iterate(void** @opaque) => vectors.av_filter_iterate(@opaque); + + /// Compute what kind of losses will occur when converting from one specific pixel format to another. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. av_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another. + /// source pixel format + /// Whether the source pixel format alpha channel is used. + /// Combination of flags informing you what kind of losses will occur (maximum loss for an invalid dst_pix_fmt). + public static AVPixelFormat av_find_best_pix_fmt_of_2(AVPixelFormat @dst_pix_fmt1, AVPixelFormat @dst_pix_fmt2, AVPixelFormat @src_pix_fmt, int @has_alpha, int* @loss_ptr) => vectors.av_find_best_pix_fmt_of_2(@dst_pix_fmt1, @dst_pix_fmt2, @src_pix_fmt, @has_alpha, @loss_ptr); + + public static int av_find_default_stream_index(AVFormatContext* @s) => vectors.av_find_default_stream_index(@s); + + /// Find AVInputFormat based on the short name of the input format. + public static AVInputFormat* av_find_input_format(string @short_name) => vectors.av_find_input_format(@short_name); + + /// Find the value in a list of rationals nearest a given reference rational. + /// Reference rational + /// Array of rationals terminated by `{0, 0}` + /// Index of the nearest value found in the array + public static int av_find_nearest_q_idx(AVRational @q, AVRational* @q_list) => vectors.av_find_nearest_q_idx(@q, @q_list); + + /// Find the programs which belong to a given stream. + /// media file handle + /// the last found program, the search will start after this program, or from the beginning if it is NULL + /// stream index + /// the next program which belongs to s, NULL if no program is found or the last program is not among the programs of ic. + public static AVProgram* av_find_program_from_stream(AVFormatContext* @ic, AVProgram* @last, int @s) => vectors.av_find_program_from_stream(@ic, @last, @s); + + /// Returns the method used to set ctx->duration. + /// AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. + [Obsolete("duration_estimation_method is public and can be read directly.")] + public static AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(AVFormatContext* @ctx) => vectors.av_fmt_ctx_get_duration_estimation_method(@ctx); + + /// Disables cpu detection and forces the specified flags. -1 is a special case that disables forcing of specific flags. + public static void av_force_cpu_flags(int @flags) => vectors.av_force_cpu_flags(@flags); + + /// This function will cause global side data to be injected in the next packet of each stream as well as after any subsequent seek. + public static void av_format_inject_global_side_data(AVFormatContext* @s) => vectors.av_format_inject_global_side_data(@s); + + /// Fill the provided buffer with a string containing a FourCC (four-character code) representation. + /// a buffer with size in bytes of at least AV_FOURCC_MAX_STRING_SIZE + /// the fourcc to represent + /// the buffer in input + public static byte* av_fourcc_make_string(byte* @buf, uint @fourcc) => vectors.av_fourcc_make_string(@buf, @fourcc); + + /// Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ crop_bottom fields. If cropping is successful, the function will adjust the data pointers and the width/height fields, and set the crop fields to 0. + /// the frame which should be cropped + /// Some combination of AV_FRAME_CROP_* flags, or 0. + /// >= 0 on success, a negative AVERROR on error. If the cropping fields were invalid, AVERROR(ERANGE) is returned, and nothing is changed. + public static int av_frame_apply_cropping(AVFrame* @frame, int @flags) => vectors.av_frame_apply_cropping(@frame, @flags); + + /// Create a new frame that references the same data as src. + /// newly created AVFrame on success, NULL on error. + public static AVFrame* av_frame_clone(AVFrame* @src) => vectors.av_frame_clone(@src); + + /// Copy the frame data from src to dst. + /// >= 0 on success, a negative AVERROR on error. + public static int av_frame_copy(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_copy(@dst, @src); + + /// Copy only "metadata" fields from src to dst. + public static int av_frame_copy_props(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_copy_props(@dst, @src); + + /// Allocate new buffer(s) for audio or video data. + /// frame in which to store the new buffers. + /// Required buffer size alignment. If equal to 0, alignment will be chosen automatically for the current CPU. It is highly recommended to pass 0 here unless you know what you are doing. + /// 0 on success, a negative AVERROR on error. + public static int av_frame_get_buffer(AVFrame* @frame, int @align) => vectors.av_frame_get_buffer(@frame, @align); + + /// Get the buffer reference a given data plane is stored in. + /// the frame to get the plane's buffer from + /// index of the data plane of interest in frame->extended_data. + /// the buffer reference that contains the plane or NULL if the input frame is not valid. + public static AVBufferRef* av_frame_get_plane_buffer(AVFrame* @frame, int @plane) => vectors.av_frame_get_plane_buffer(@frame, @plane); + + /// Returns a pointer to the side data of a given type on success, NULL if there is no side data with such type in this frame. + /// a pointer to the side data of a given type on success, NULL if there is no side data with such type in this frame. + public static AVFrameSideData* av_frame_get_side_data(AVFrame* @frame, AVFrameSideDataType @type) => vectors.av_frame_get_side_data(@frame, @type); + + /// Check if the frame data is writable. + /// A positive value if the frame data is writable (which is true if and only if each of the underlying buffers has only one reference, namely the one stored in this frame). Return 0 otherwise. + public static int av_frame_is_writable(AVFrame* @frame) => vectors.av_frame_is_writable(@frame); + + /// Ensure that the frame data is writable, avoiding data copy if possible. + /// 0 on success, a negative AVERROR on error. + public static int av_frame_make_writable(AVFrame* @frame) => vectors.av_frame_make_writable(@frame); + + /// Move everything contained in src to dst and reset src. + public static void av_frame_move_ref(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_move_ref(@dst, @src); + + /// Add a new side data to a frame. + /// a frame to which the side data should be added + /// type of the added side data + /// size of the side data + /// newly added side data on success, NULL on error + public static AVFrameSideData* av_frame_new_side_data(AVFrame* @frame, AVFrameSideDataType @type, ulong @size) => vectors.av_frame_new_side_data(@frame, @type, @size); + + /// Add a new side data to a frame from an existing AVBufferRef + /// a frame to which the side data should be added + /// the type of the added side data + /// an AVBufferRef to add as side data. The ownership of the reference is transferred to the frame. + /// newly added side data on success, NULL on error. On failure the frame is unchanged and the AVBufferRef remains owned by the caller. + public static AVFrameSideData* av_frame_new_side_data_from_buf(AVFrame* @frame, AVFrameSideDataType @type, AVBufferRef* @buf) => vectors.av_frame_new_side_data_from_buf(@frame, @type, @buf); + + /// Set up a new reference to the data described by the source frame. + /// 0 on success, a negative AVERROR on error + public static int av_frame_ref(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_ref(@dst, @src); + + /// Remove and free all side data instances of the given type. + public static void av_frame_remove_side_data(AVFrame* @frame, AVFrameSideDataType @type) => vectors.av_frame_remove_side_data(@frame, @type); + + /// Ensure the destination frame refers to the same data described by the source frame, either by creating a new reference for each AVBufferRef from src if they differ from those in dst, by allocating new buffers and copying data if src is not reference counted, or by unrefencing it if src is empty. + /// 0 on success, a negative AVERROR on error. On error, dst is unreferenced. + public static int av_frame_replace(AVFrame* @dst, AVFrame* @src) => vectors.av_frame_replace(@dst, @src); + + /// Add a new side data entry to an array based on existing side data, taking a reference towards the contained AVBufferRef. + /// pointer to array of side data to which to add another entry, or to NULL in order to start a new array. + /// pointer to an integer containing the number of entries in the array. + /// side data to be cloned, with a new reference utilized for the buffer. + /// Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. + /// negative error code on failure, >=0 on success. In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of matching AVFrameSideDataType will be removed before the addition is attempted. + public static int av_frame_side_data_clone(AVFrameSideData*** @sd, int* @nb_sd, AVFrameSideData* @src, uint @flags) => vectors.av_frame_side_data_clone(@sd, @nb_sd, @src, @flags); + + /// Free all side data entries and their contents, then zeroes out the values which the pointers are pointing to. + /// pointer to array of side data to free. Will be set to NULL upon return. + /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. + public static void av_frame_side_data_free(AVFrameSideData*** @sd, int* @nb_sd) => vectors.av_frame_side_data_free(@sd, @nb_sd); + + /// Get a side data entry of a specific type from an array. + /// array of side data. + /// integer containing the number of entries in the array. + /// type of side data to be queried + /// a pointer to the side data of a given type on success, NULL if there is no side data with such type in this set. + public static AVFrameSideData* av_frame_side_data_get_c(AVFrameSideData** @sd, int @nb_sd, AVFrameSideDataType @type) => vectors.av_frame_side_data_get_c(@sd, @nb_sd, @type); + + /// Returns a string identifying the side data type + /// a string identifying the side data type + public static string av_frame_side_data_name(AVFrameSideDataType @type) => vectors.av_frame_side_data_name(@type); + + /// Add new side data entry to an array. + /// pointer to array of side data to which to add another entry, or to NULL in order to start a new array. + /// pointer to an integer containing the number of entries in the array. + /// type of the added side data + /// size of the side data + /// Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. + /// newly added side data on success, NULL on error. In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of matching AVFrameSideDataType will be removed before the addition is attempted. + public static AVFrameSideData* av_frame_side_data_new(AVFrameSideData*** @sd, int* @nb_sd, AVFrameSideDataType @type, ulong @size, uint @flags) => vectors.av_frame_side_data_new(@sd, @nb_sd, @type, @size, @flags); + + /// Unreference all the buffers referenced by frame and reset the frame fields. + public static void av_frame_unref(AVFrame* @frame) => vectors.av_frame_unref(@frame); + + /// Free a memory block which has been allocated with a function of av_malloc() or av_realloc() family, and set the pointer pointing to it to `NULL`. + /// Pointer to the pointer to the memory block which should be freed + public static void av_freep(void* @ptr) => vectors.av_freep(@ptr); + + /// Compute the greatest common divisor of two integer operands. + /// Operand + /// Operand + /// GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; if a == 0 and b == 0, returns 0. + public static long av_gcd(long @a, long @b) => vectors.av_gcd(@a, @b); + + /// Return the best rational so that a and b are multiple of it. If the resulting denominator is larger than max_den, return def. + public static AVRational av_gcd_q(AVRational @a, AVRational @b, int @max_den, AVRational @def) => vectors.av_gcd_q(@a, @b, @max_den, @def); + + /// Return the planar<->packed alternative form of the given sample format, or AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the requested planar/packed format, the format returned is the same as the input. + public static AVSampleFormat av_get_alt_sample_fmt(AVSampleFormat @sample_fmt, int @planar) => vectors.av_get_alt_sample_fmt(@sample_fmt, @planar); + + /// Return audio frame duration. + /// codec context + /// size of the frame, or 0 if unknown + /// frame duration, in samples, if known. 0 if not able to determine. + public static int av_get_audio_frame_duration(AVCodecContext* @avctx, int @frame_bytes) => vectors.av_get_audio_frame_duration(@avctx, @frame_bytes); + + /// This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters instead of an AVCodecContext. + public static int av_get_audio_frame_duration2(AVCodecParameters* @par, int @frame_bytes) => vectors.av_get_audio_frame_duration2(@par, @frame_bytes); + + /// Return the number of bits per pixel used by the pixel format described by pixdesc. Note that this is not the same as the number of bits per sample. + public static int av_get_bits_per_pixel(AVPixFmtDescriptor* @pixdesc) => vectors.av_get_bits_per_pixel(@pixdesc); + + /// Return codec bits per sample. + /// the codec + /// Number of bits per sample or zero if unknown for the given codec. + public static int av_get_bits_per_sample(AVCodecID @codec_id) => vectors.av_get_bits_per_sample(@codec_id); + + /// Return number of bytes per sample. + /// the sample format + /// number of bytes per sample or zero if unknown for the given sample format + public static int av_get_bytes_per_sample(AVSampleFormat @sample_fmt) => vectors.av_get_bytes_per_sample(@sample_fmt); + + /// Return the flags which specify extensions supported by the CPU. The returned value is affected by av_force_cpu_flags() if that was used before. So av_get_cpu_flags() can easily be used in an application to detect the enabled cpu flags. + public static int av_get_cpu_flags() => vectors.av_get_cpu_flags(); + + /// Return codec bits per sample. Only return non-zero if the bits per sample is exactly correct, not an approximation. + /// the codec + /// Number of bits per sample or zero if unknown for the given codec. + public static int av_get_exact_bits_per_sample(AVCodecID @codec_id) => vectors.av_get_exact_bits_per_sample(@codec_id); + + public static int av_get_frame_filename(byte* @buf, int @buf_size, string @path, int @number) => vectors.av_get_frame_filename(@buf, @buf_size, @path, @number); + + /// Return in 'buf' the path with '%d' replaced by a number. + /// destination buffer + /// destination buffer size + /// numbered sequence string + /// frame number + /// AV_FRAME_FILENAME_FLAGS_* + /// 0 if OK, -1 on format error + public static int av_get_frame_filename2(byte* @buf, int @buf_size, string @path, int @number, int @flags) => vectors.av_get_frame_filename2(@buf, @buf_size, @path, @number, @flags); + + /// Return a string describing the media_type enum, NULL if media_type is unknown. + public static string av_get_media_type_string(AVMediaType @media_type) => vectors.av_get_media_type_string(@media_type); + + /// Get timing information for the data currently output. The exact meaning of "currently output" depends on the format. It is mostly relevant for devices that have an internal buffer and/or work in real time. + /// media file handle + /// stream in the media file + /// DTS of the last packet output for the stream, in stream time_base units + /// absolute time when that packet whas output, in microsecond + public static int av_get_output_timestamp(AVFormatContext* @s, int @stream, long* @dts, long* @wall) => vectors.av_get_output_timestamp(@s, @stream, @dts, @wall); + + /// Get the packed alternative form of the given sample format. + /// the packed alternative form of the given sample format or AV_SAMPLE_FMT_NONE on error. + public static AVSampleFormat av_get_packed_sample_fmt(AVSampleFormat @sample_fmt) => vectors.av_get_packed_sample_fmt(@sample_fmt); + + /// Allocate and read the payload of a packet and initialize its fields with default values. + /// associated IO context + /// packet + /// desired payload size + /// >0 (read size) if OK, AVERROR_xxx otherwise + public static int av_get_packet(AVIOContext* @s, AVPacket* @pkt, int @size) => vectors.av_get_packet(@s, @pkt, @size); + + /// Return the number of bits per pixel for the pixel format described by pixdesc, including any padding or unused bits. + public static int av_get_padded_bits_per_pixel(AVPixFmtDescriptor* @pixdesc) => vectors.av_get_padded_bits_per_pixel(@pixdesc); + + /// Return the PCM codec associated with a sample format. + /// endianness, 0 for little, 1 for big, -1 (or anything else) for native + /// AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE + public static AVCodecID av_get_pcm_codec(AVSampleFormat @fmt, int @be) => vectors.av_get_pcm_codec(@fmt, @be); + + /// Return a single letter to describe the given picture type pict_type. + /// the picture type + /// a single character representing the picture type, '?' if pict_type is unknown + public static byte av_get_picture_type_char(AVPictureType @pict_type) => vectors.av_get_picture_type_char(@pict_type); + + /// Return the pixel format corresponding to name. + public static AVPixelFormat av_get_pix_fmt(string @name) => vectors.av_get_pix_fmt(@name); + + /// Compute what kind of losses will occur when converting from one specific pixel format to another. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. av_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another. + /// destination pixel format + /// source pixel format + /// Whether the source pixel format alpha channel is used. + /// Combination of flags informing you what kind of losses will occur (maximum loss for an invalid dst_pix_fmt). + public static int av_get_pix_fmt_loss(AVPixelFormat @dst_pix_fmt, AVPixelFormat @src_pix_fmt, int @has_alpha) => vectors.av_get_pix_fmt_loss(@dst_pix_fmt, @src_pix_fmt, @has_alpha); + + /// Return the short name for a pixel format, NULL in case pix_fmt is unknown. + public static string av_get_pix_fmt_name(AVPixelFormat @pix_fmt) => vectors.av_get_pix_fmt_name(@pix_fmt); + + /// Print in buf the string corresponding to the pixel format with number pix_fmt, or a header if pix_fmt is negative. + /// the buffer where to write the string + /// the size of buf + /// the number of the pixel format to print the corresponding info string, or a negative value to print the corresponding header. + public static byte* av_get_pix_fmt_string(byte* @buf, int @buf_size, AVPixelFormat @pix_fmt) => vectors.av_get_pix_fmt_string(@buf, @buf_size, @pix_fmt); + + /// Get the planar alternative form of the given sample format. + /// the planar alternative form of the given sample format or AV_SAMPLE_FMT_NONE on error. + public static AVSampleFormat av_get_planar_sample_fmt(AVSampleFormat @sample_fmt) => vectors.av_get_planar_sample_fmt(@sample_fmt); + + /// Return a name for the specified profile, if available. + /// the codec that is searched for the given profile + /// the profile value for which a name is requested + /// A name for the profile if found, NULL otherwise. + public static string av_get_profile_name(AVCodec* @codec, int @profile) => vectors.av_get_profile_name(@codec, @profile); + + /// Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error. + public static AVSampleFormat av_get_sample_fmt(string @name) => vectors.av_get_sample_fmt(@name); + + /// Return the name of sample_fmt, or NULL if sample_fmt is not recognized. + public static string av_get_sample_fmt_name(AVSampleFormat @sample_fmt) => vectors.av_get_sample_fmt_name(@sample_fmt); + + /// Generate a string corresponding to the sample format with sample_fmt, or a header if sample_fmt is negative. + /// the buffer where to write the string + /// the size of buf + /// the number of the sample format to print the corresponding info string, or a negative value to print the corresponding header. + /// the pointer to the filled buffer or NULL if sample_fmt is unknown or in case of other errors + public static byte* av_get_sample_fmt_string(byte* @buf, int @buf_size, AVSampleFormat @sample_fmt) => vectors.av_get_sample_fmt_string(@buf, @buf_size, @sample_fmt); + + /// Return the fractional representation of the internal time base. + public static AVRational av_get_time_base_q() => vectors.av_get_time_base_q(); + + /// Get the current time in microseconds. + public static long av_gettime() => vectors.av_gettime(); + + /// Get the current time in microseconds since some unspecified starting point. On platforms that support it, the time comes from a monotonic clock This property makes this time source ideal for measuring relative time. The returned values may not be monotonic on platforms where a monotonic clock is not available. + public static long av_gettime_relative() => vectors.av_gettime_relative(); + + /// Indicates with a boolean result if the av_gettime_relative() time source is monotonic. + public static int av_gettime_relative_is_monotonic() => vectors.av_gettime_relative_is_monotonic(); + + /// Increase packet size, correctly zeroing padding + /// packet + /// number of bytes by which to increase the size of the packet + public static int av_grow_packet(AVPacket* @pkt, int @grow_by) => vectors.av_grow_packet(@pkt, @grow_by); + + /// Guess the codec ID based upon muxer and filename. + public static AVCodecID av_guess_codec(AVOutputFormat* @fmt, string @short_name, string @filename, string @mime_type, AVMediaType @type) => vectors.av_guess_codec(@fmt, @short_name, @filename, @mime_type, @type); + + /// Return the output format in the list of registered output formats which best matches the provided parameters, or return NULL if there is no match. + /// if non-NULL checks if short_name matches with the names of the registered formats + /// if non-NULL checks if filename terminates with the extensions of the registered formats + /// if non-NULL checks if mime_type matches with the MIME type of the registered formats + public static AVOutputFormat* av_guess_format(string @short_name, string @filename, string @mime_type) => vectors.av_guess_format(@short_name, @filename, @mime_type); + + /// Guess the frame rate, based on both the container and codec information. + /// the format context which the stream is part of + /// the stream which the frame is part of + /// the frame for which the frame rate should be determined, may be NULL + /// the guessed (valid) frame rate, 0/1 if no idea + public static AVRational av_guess_frame_rate(AVFormatContext* @ctx, AVStream* @stream, AVFrame* @frame) => vectors.av_guess_frame_rate(@ctx, @stream, @frame); + + /// Guess the sample aspect ratio of a frame, based on both the stream and the frame aspect ratio. + /// the format context which the stream is part of + /// the stream which the frame is part of + /// the frame with the aspect ratio to be determined + /// the guessed (valid) sample_aspect_ratio, 0/1 if no idea + public static AVRational av_guess_sample_aspect_ratio(AVFormatContext* @format, AVStream* @stream, AVFrame* @frame) => vectors.av_guess_sample_aspect_ratio(@format, @stream, @frame); + + /// Send a nice hexadecimal dump of a buffer to the specified file stream. + /// The file stream pointer where the dump should be sent to. + /// buffer + /// buffer size + public static void av_hex_dump(_iobuf* @f, byte* @buf, int @size) => vectors.av_hex_dump(@f, @buf, @size); + + /// Send a nice hexadecimal dump of a buffer to the log. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. + /// The importance level of the message, lower values signifying higher importance. + /// buffer + /// buffer size + public static void av_hex_dump_log(void* @avcl, int @level, byte* @buf, int @size) => vectors.av_hex_dump_log(@avcl, @level, @buf, @size); + + /// Allocate an AVHWDeviceContext for a given hardware type. + /// the type of the hardware device to allocate. + /// a reference to the newly created AVHWDeviceContext on success or NULL on failure. + public static AVBufferRef* av_hwdevice_ctx_alloc(AVHWDeviceType @type) => vectors.av_hwdevice_ctx_alloc(@type); + + /// Open a device of the specified type and create an AVHWDeviceContext for it. + /// On success, a reference to the newly-created device context will be written here. The reference is owned by the caller and must be released with av_buffer_unref() when no longer needed. On failure, NULL will be written to this pointer. + /// The type of the device to create. + /// A type-specific string identifying the device to open. + /// A dictionary of additional (type-specific) options to use in opening the device. The dictionary remains owned by the caller. + /// currently unused + /// 0 on success, a negative AVERROR code on failure. + public static int av_hwdevice_ctx_create(AVBufferRef** @device_ctx, AVHWDeviceType @type, string @device, AVDictionary* @opts, int @flags) => vectors.av_hwdevice_ctx_create(@device_ctx, @type, @device, @opts, @flags); + + /// Create a new device of the specified type from an existing device. + /// On success, a reference to the newly-created AVHWDeviceContext. + /// The type of the new device to create. + /// A reference to an existing AVHWDeviceContext which will be used to create the new device. + /// Currently unused; should be set to zero. + /// Zero on success, a negative AVERROR code on failure. + public static int av_hwdevice_ctx_create_derived(AVBufferRef** @dst_ctx, AVHWDeviceType @type, AVBufferRef* @src_ctx, int @flags) => vectors.av_hwdevice_ctx_create_derived(@dst_ctx, @type, @src_ctx, @flags); + + /// Create a new device of the specified type from an existing device. + /// On success, a reference to the newly-created AVHWDeviceContext. + /// The type of the new device to create. + /// A reference to an existing AVHWDeviceContext which will be used to create the new device. + /// Options for the new device to create, same format as in av_hwdevice_ctx_create. + /// Currently unused; should be set to zero. + /// Zero on success, a negative AVERROR code on failure. + public static int av_hwdevice_ctx_create_derived_opts(AVBufferRef** @dst_ctx, AVHWDeviceType @type, AVBufferRef* @src_ctx, AVDictionary* @options, int @flags) => vectors.av_hwdevice_ctx_create_derived_opts(@dst_ctx, @type, @src_ctx, @options, @flags); + + /// Finalize the device context before use. This function must be called after the context is filled with all the required information and before it is used in any way. + /// a reference to the AVHWDeviceContext + /// 0 on success, a negative AVERROR code on failure + public static int av_hwdevice_ctx_init(AVBufferRef* @ref) => vectors.av_hwdevice_ctx_init(@ref); + + /// Look up an AVHWDeviceType by name. + /// String name of the device type (case-insensitive). + /// The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if not found. + public static AVHWDeviceType av_hwdevice_find_type_by_name(string @name) => vectors.av_hwdevice_find_type_by_name(@name); + + /// Get the constraints on HW frames given a device and the HW-specific configuration to be used with that device. If no HW-specific configuration is provided, returns the maximum possible capabilities of the device. + /// a reference to the associated AVHWDeviceContext. + /// a filled HW-specific configuration structure, or NULL to return the maximum possible capabilities of the device. + /// AVHWFramesConstraints structure describing the constraints on the device, or NULL if not available. + public static AVHWFramesConstraints* av_hwdevice_get_hwframe_constraints(AVBufferRef* @ref, void* @hwconfig) => vectors.av_hwdevice_get_hwframe_constraints(@ref, @hwconfig); + + /// Get the string name of an AVHWDeviceType. + /// Type from enum AVHWDeviceType. + /// Pointer to a static string containing the name, or NULL if the type is not valid. + public static string av_hwdevice_get_type_name(AVHWDeviceType @type) => vectors.av_hwdevice_get_type_name(@type); + + /// Allocate a HW-specific configuration structure for a given HW device. After use, the user must free all members as required by the specific hardware structure being used, then free the structure itself with av_free(). + /// a reference to the associated AVHWDeviceContext. + /// The newly created HW-specific configuration structure on success or NULL on failure. + public static void* av_hwdevice_hwconfig_alloc(AVBufferRef* @device_ctx) => vectors.av_hwdevice_hwconfig_alloc(@device_ctx); + + /// Iterate over supported device types. + /// AV_HWDEVICE_TYPE_NONE initially, then the previous type returned by this function in subsequent iterations. + /// The next usable device type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if there are no more. + public static AVHWDeviceType av_hwdevice_iterate_types(AVHWDeviceType @prev) => vectors.av_hwdevice_iterate_types(@prev); + + /// Free an AVHWFrameConstraints structure. + /// The (filled or unfilled) AVHWFrameConstraints structure. + public static void av_hwframe_constraints_free(AVHWFramesConstraints** @constraints) => vectors.av_hwframe_constraints_free(@constraints); + + /// Allocate an AVHWFramesContext tied to a given device context. + /// a reference to a AVHWDeviceContext. This function will make a new reference for internal use, the one passed to the function remains owned by the caller. + /// a reference to the newly created AVHWFramesContext on success or NULL on failure. + public static AVBufferRef* av_hwframe_ctx_alloc(AVBufferRef* @device_ctx) => vectors.av_hwframe_ctx_alloc(@device_ctx); + + /// Create and initialise an AVHWFramesContext as a mapping of another existing AVHWFramesContext on a different device. + /// On success, a reference to the newly created AVHWFramesContext. + /// The AVPixelFormat for the derived context. + /// A reference to the device to create the new AVHWFramesContext on. + /// A reference to an existing AVHWFramesContext which will be mapped to the derived context. + /// Some combination of AV_HWFRAME_MAP_* flags, defining the mapping parameters to apply to frames which are allocated in the derived device. + /// Zero on success, negative AVERROR code on failure. + public static int av_hwframe_ctx_create_derived(AVBufferRef** @derived_frame_ctx, AVPixelFormat @format, AVBufferRef* @derived_device_ctx, AVBufferRef* @source_frame_ctx, int @flags) => vectors.av_hwframe_ctx_create_derived(@derived_frame_ctx, @format, @derived_device_ctx, @source_frame_ctx, @flags); + + /// Finalize the context before use. This function must be called after the context is filled with all the required information and before it is attached to any frames. + /// a reference to the AVHWFramesContext + /// 0 on success, a negative AVERROR code on failure + public static int av_hwframe_ctx_init(AVBufferRef* @ref) => vectors.av_hwframe_ctx_init(@ref); + + /// Allocate a new frame attached to the given AVHWFramesContext. + /// a reference to an AVHWFramesContext + /// an empty (freshly allocated or unreffed) frame to be filled with newly allocated buffers. + /// currently unused, should be set to zero + /// 0 on success, a negative AVERROR code on failure + public static int av_hwframe_get_buffer(AVBufferRef* @hwframe_ctx, AVFrame* @frame, int @flags) => vectors.av_hwframe_get_buffer(@hwframe_ctx, @frame, @flags); + + /// Map a hardware frame. + /// Destination frame, to contain the mapping. + /// Source frame, to be mapped. + /// Some combination of AV_HWFRAME_MAP_* flags. + /// Zero on success, negative AVERROR code on failure. + public static int av_hwframe_map(AVFrame* @dst, AVFrame* @src, int @flags) => vectors.av_hwframe_map(@dst, @src, @flags); + + /// Copy data to or from a hw surface. At least one of dst/src must have an AVHWFramesContext attached. + /// the destination frame. dst is not touched on failure. + /// the source frame. + /// currently unused, should be set to zero + /// 0 on success, a negative AVERROR error code on failure. + public static int av_hwframe_transfer_data(AVFrame* @dst, AVFrame* @src, int @flags) => vectors.av_hwframe_transfer_data(@dst, @src, @flags); + + /// Get a list of possible source or target formats usable in av_hwframe_transfer_data(). + /// the frame context to obtain the information for + /// the direction of the transfer + /// the pointer to the output format list will be written here. The list is terminated with AV_PIX_FMT_NONE and must be freed by the caller when no longer needed using av_free(). If this function returns successfully, the format list will have at least one item (not counting the terminator). On failure, the contents of this pointer are unspecified. + /// currently unused, should be set to zero + /// 0 on success, a negative AVERROR code on failure. + public static int av_hwframe_transfer_get_formats(AVBufferRef* @hwframe_ctx, AVHWFrameTransferDirection @dir, AVPixelFormat** @formats, int @flags) => vectors.av_hwframe_transfer_get_formats(@hwframe_ctx, @dir, @formats, @flags); + + /// Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordingly. The allocated image buffer has to be freed by using av_freep(&pointers[0]). + /// array to be filled with the pointer for each image plane + /// the array filled with the linesize for each plane + /// width of the image in pixels + /// height of the image in pixels + /// the AVPixelFormat of the image + /// the value to use for buffer size alignment + /// the size in bytes required for the image buffer, a negative error code in case of failure + public static int av_image_alloc(ref byte_ptr4 @pointers, ref int4 @linesizes, int @w, int @h, AVPixelFormat @pix_fmt, int @align) => vectors.av_image_alloc(ref @pointers, ref @linesizes, @w, @h, @pix_fmt, @align); + + /// Check if the given sample aspect ratio of an image is valid. + /// width of the image + /// height of the image + /// sample aspect ratio of the image + /// 0 if valid, a negative AVERROR code otherwise + public static int av_image_check_sar(uint @w, uint @h, AVRational @sar) => vectors.av_image_check_sar(@w, @h, @sar); + + /// Check if the given dimension of an image is valid, meaning that all bytes of the image can be addressed with a signed int. + /// the width of the picture + /// the height of the picture + /// the offset to sum to the log level for logging with log_ctx + /// the parent logging context, it may be NULL + /// >= 0 if valid, a negative error code otherwise + public static int av_image_check_size(uint @w, uint @h, int @log_offset, void* @log_ctx) => vectors.av_image_check_size(@w, @h, @log_offset, @log_ctx); + + /// Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with the specified pix_fmt can be addressed with a signed int. + /// the width of the picture + /// the height of the picture + /// the maximum number of pixels the user wants to accept + /// the pixel format, can be AV_PIX_FMT_NONE if unknown. + /// the offset to sum to the log level for logging with log_ctx + /// the parent logging context, it may be NULL + /// >= 0 if valid, a negative error code otherwise + public static int av_image_check_size2(uint @w, uint @h, long @max_pixels, AVPixelFormat @pix_fmt, int @log_offset, void* @log_ctx) => vectors.av_image_check_size2(@w, @h, @max_pixels, @pix_fmt, @log_offset, @log_ctx); + + /// Copy image in src_data to dst_data. + /// destination image data buffer to copy to + /// linesizes for the image in dst_data + /// source image data buffer to copy from + /// linesizes for the image in src_data + /// the AVPixelFormat of the image + /// width of the image in pixels + /// height of the image in pixels + public static void av_image_copy(ref byte_ptr4 @dst_data, in int4 @dst_linesizes, in byte_ptr4 @src_data, in int4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => vectors.av_image_copy(ref @dst_data, @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); + + /// Copy image plane from src to dst. That is, copy "height" number of lines of "bytewidth" bytes each. The first byte of each successive line is separated by *_linesize bytes. + /// destination plane to copy to + /// linesize for the image plane in dst + /// source plane to copy from + /// linesize for the image plane in src + /// height (number of lines) of the plane + public static void av_image_copy_plane(byte* @dst, int @dst_linesize, byte* @src, int @src_linesize, int @bytewidth, int @height) => vectors.av_image_copy_plane(@dst, @dst_linesize, @src, @src_linesize, @bytewidth, @height); + + /// Copy image data located in uncacheable (e.g. GPU mapped) memory. Where available, this function will use special functionality for reading from such memory, which may result in greatly improved performance compared to plain av_image_copy_plane(). + public static void av_image_copy_plane_uc_from(byte* @dst, long @dst_linesize, byte* @src, long @src_linesize, long @bytewidth, int @height) => vectors.av_image_copy_plane_uc_from(@dst, @dst_linesize, @src, @src_linesize, @bytewidth, @height); + + /// Copy image data from an image into a buffer. + /// a buffer into which picture data will be copied + /// the size in bytes of dst + /// pointers containing the source image data + /// linesizes for the image in src_data + /// the pixel format of the source image + /// the width of the source image in pixels + /// the height of the source image in pixels + /// the assumed linesize alignment for dst + /// the number of bytes written to dst, or a negative value (error code) on error + public static int av_image_copy_to_buffer(byte* @dst, int @dst_size, in byte_ptr4 @src_data, in int4 @src_linesize, AVPixelFormat @pix_fmt, int @width, int @height, int @align) => vectors.av_image_copy_to_buffer(@dst, @dst_size, @src_data, @src_linesize, @pix_fmt, @width, @height, @align); + + /// Copy image data located in uncacheable (e.g. GPU mapped) memory. Where available, this function will use special functionality for reading from such memory, which may result in greatly improved performance compared to plain av_image_copy(). + public static void av_image_copy_uc_from(ref byte_ptr4 @dst_data, in long4 @dst_linesizes, in byte_ptr4 @src_data, in long4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height) => vectors.av_image_copy_uc_from(ref @dst_data, @dst_linesizes, @src_data, @src_linesizes, @pix_fmt, @width, @height); + + /// Setup the data pointers and linesizes based on the specified image parameters and the provided array. + /// data pointers to be filled in + /// linesizes for the image in dst_data to be filled in + /// buffer which will contain or contains the actual image data, can be NULL + /// the pixel format of the image + /// the width of the image in pixels + /// the height of the image in pixels + /// the value used in src for linesize alignment + /// the size in bytes required for src, a negative error code in case of failure + public static int av_image_fill_arrays(ref byte_ptr4 @dst_data, ref int4 @dst_linesize, byte* @src, AVPixelFormat @pix_fmt, int @width, int @height, int @align) => vectors.av_image_fill_arrays(ref @dst_data, ref @dst_linesize, @src, @pix_fmt, @width, @height, @align); + + /// Overwrite the image data with black. This is suitable for filling a sub-rectangle of an image, meaning the padding between the right most pixel and the left most pixel on the next line will not be overwritten. For some formats, the image size might be rounded up due to inherent alignment. + /// data pointers to destination image + /// linesizes for the destination image + /// the pixel format of the image + /// the color range of the image (important for colorspaces such as YUV) + /// the width of the image in pixels + /// the height of the image in pixels + /// 0 if the image data was cleared, a negative AVERROR code otherwise + public static int av_image_fill_black(ref byte_ptr4 @dst_data, in long4 @dst_linesize, AVPixelFormat @pix_fmt, AVColorRange @range, int @width, int @height) => vectors.av_image_fill_black(ref @dst_data, @dst_linesize, @pix_fmt, @range, @width, @height); + + /// Overwrite the image data with a color. This is suitable for filling a sub-rectangle of an image, meaning the padding between the right most pixel and the left most pixel on the next line will not be overwritten. For some formats, the image size might be rounded up due to inherent alignment. + /// data pointers to destination image + /// linesizes for the destination image + /// the pixel format of the image + /// the color components to be used for the fill + /// the width of the image in pixels + /// the height of the image in pixels + /// currently unused + /// 0 if the image data was filled, a negative AVERROR code otherwise + public static int av_image_fill_color(ref byte_ptr4 @dst_data, in long4 @dst_linesize, AVPixelFormat @pix_fmt, in uint4 @color, int @width, int @height, int @flags) => vectors.av_image_fill_color(ref @dst_data, @dst_linesize, @pix_fmt, @color, @width, @height, @flags); + + /// Fill plane linesizes for an image with pixel format pix_fmt and width width. + /// array to be filled with the linesize for each plane + /// the AVPixelFormat of the image + /// width of the image in pixels + /// >= 0 in case of success, a negative error code otherwise + public static int av_image_fill_linesizes(ref int4 @linesizes, AVPixelFormat @pix_fmt, int @width) => vectors.av_image_fill_linesizes(ref @linesizes, @pix_fmt, @width); + + /// Compute the max pixel step for each plane of an image with a format described by pixdesc. + /// an array which is filled with the max pixel step for each plane. Since a plane may contain different pixel components, the computed max_pixsteps[plane] is relative to the component in the plane with the max pixel step. + /// an array which is filled with the component for each plane which has the max pixel step. May be NULL. + /// the AVPixFmtDescriptor for the image, describing its format + public static void av_image_fill_max_pixsteps(ref int4 @max_pixsteps, ref int4 @max_pixstep_comps, AVPixFmtDescriptor* @pixdesc) => vectors.av_image_fill_max_pixsteps(ref @max_pixsteps, ref @max_pixstep_comps, @pixdesc); + + /// Fill plane sizes for an image with pixel format pix_fmt and height height. + /// the array to be filled with the size of each image plane + /// the AVPixelFormat of the image + /// height of the image in pixels + /// the array containing the linesize for each plane, should be filled by av_image_fill_linesizes() + /// >= 0 in case of success, a negative error code otherwise + public static int av_image_fill_plane_sizes(ref ulong4 @size, AVPixelFormat @pix_fmt, int @height, in long4 @linesizes) => vectors.av_image_fill_plane_sizes(ref @size, @pix_fmt, @height, @linesizes); + + /// Fill plane data pointers for an image with pixel format pix_fmt and height height. + /// pointers array to be filled with the pointer for each image plane + /// the AVPixelFormat of the image + /// height of the image in pixels + /// the pointer to a buffer which will contain the image + /// the array containing the linesize for each plane, should be filled by av_image_fill_linesizes() + /// the size in bytes required for the image buffer, a negative error code in case of failure + public static int av_image_fill_pointers(ref byte_ptr4 @data, AVPixelFormat @pix_fmt, int @height, byte* @ptr, in int4 @linesizes) => vectors.av_image_fill_pointers(ref @data, @pix_fmt, @height, @ptr, @linesizes); + + /// Compute the size of an image line with format pix_fmt and width width for the plane plane. + /// the computed size in bytes + public static int av_image_get_linesize(AVPixelFormat @pix_fmt, int @width, int @plane) => vectors.av_image_get_linesize(@pix_fmt, @width, @plane); + + /// Get the index for a specific timestamp. + /// stream that the timestamp belongs to + /// timestamp to retrieve the index for + /// if AVSEEK_FLAG_BACKWARD then the returned index will correspond to the timestamp which is < = the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise + /// < 0 if no such timestamp could be found + public static int av_index_search_timestamp(AVStream* @st, long @timestamp, int @flags) => vectors.av_index_search_timestamp(@st, @timestamp, @flags); + + /// Initialize optional fields of a packet with default values. + /// packet + [Obsolete("This function is deprecated. Once it's removed, sizeof(AVPacket) will not be a part of the ABI anymore.")] + public static void av_init_packet(AVPacket* @pkt) => vectors.av_init_packet(@pkt); + + /// Audio input devices iterator. + public static AVInputFormat* av_input_audio_device_next(AVInputFormat* @d) => vectors.av_input_audio_device_next(@d); + + /// Video input devices iterator. + public static AVInputFormat* av_input_video_device_next(AVInputFormat* @d) => vectors.av_input_video_device_next(@d); + + /// Compute the length of an integer list. + /// size in bytes of each list element (only 1, 2, 4 or 8) + /// pointer to the list + /// list terminator (usually 0 or -1) + /// length of the list, in elements, not counting the terminator + public static uint av_int_list_length_for_size(uint @elsize, void* @list, ulong @term) => vectors.av_int_list_length_for_size(@elsize, @list, @term); + + /// Write a packet to an output media file ensuring correct interleaving. + /// media file handle + /// The packet containing the data to be written. If the packet is reference-counted, this function will take ownership of this reference and unreference it later when it sees fit. If the packet is not reference-counted, libavformat will make a copy. The returned packet will be blank (as if returned from av_packet_alloc()), even on error. This parameter can be NULL (at any time, not just at the end), to flush the interleaving queues. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets in one stream must be strictly increasing (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration" should also be set if known. + /// 0 on success, a negative AVERROR on error. + public static int av_interleaved_write_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_interleaved_write_frame(@s, @pkt); + + /// Write an uncoded frame to an output media file. + /// >=0 for success, a negative code on error + public static int av_interleaved_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame) => vectors.av_interleaved_write_uncoded_frame(@s, @stream_index, @frame); + + /// Send the specified message to the log if the level is less than or equal to the current av_log_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct or NULL if general log. + /// The importance level of the message expressed using a "Logging Constant". + /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. + public static void av_log(void* @avcl, int @level, string @fmt) => vectors.av_log(@avcl, @level, @fmt); + + /// Default logging callback + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. + /// The importance level of the message expressed using a "Logging Constant". + /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. + /// The arguments referenced by the format string. + public static void av_log_default_callback(void* @avcl, int @level, string @fmt, byte* @vl) => vectors.av_log_default_callback(@avcl, @level, @fmt, @vl); + + /// Format a line of log the same way as the default callback. + /// buffer to receive the formatted line + /// size of the buffer + /// used to store whether the prefix must be printed; must point to a persistent integer initially set to 1 + public static void av_log_format_line(void* @ptr, int @level, string @fmt, byte* @vl, byte* @line, int @line_size, int* @print_prefix) => vectors.av_log_format_line(@ptr, @level, @fmt, @vl, @line, @line_size, @print_prefix); + + /// Format a line of log the same way as the default callback. + /// buffer to receive the formatted line; may be NULL if line_size is 0 + /// size of the buffer; at most line_size-1 characters will be written to the buffer, plus one null terminator + /// used to store whether the prefix must be printed; must point to a persistent integer initially set to 1 + /// Returns a negative value if an error occurred, otherwise returns the number of characters that would have been written for a sufficiently large buffer, not including the terminating null character. If the return value is not less than line_size, it means that the log message was truncated to fit the buffer. + public static int av_log_format_line2(void* @ptr, int @level, string @fmt, byte* @vl, byte* @line, int @line_size, int* @print_prefix) => vectors.av_log_format_line2(@ptr, @level, @fmt, @vl, @line, @line_size, @print_prefix); + + public static int av_log_get_flags() => vectors.av_log_get_flags(); + + /// Get the current log level + /// Current log level + public static int av_log_get_level() => vectors.av_log_get_level(); + + /// Send the specified message to the log once with the initial_level and then with the subsequent_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct or NULL if general log. + /// importance level of the message expressed using a "Logging Constant" for the first occurance. + /// importance level of the message expressed using a "Logging Constant" after the first occurance. + /// a variable to keep trak of if a message has already been printed this must be initialized to 0 before the first use. The same state must not be accessed by 2 Threads simultaneously. + /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. + public static void av_log_once(void* @avcl, int @initial_level, int @subsequent_level, int* @state, string @fmt) => vectors.av_log_once(@avcl, @initial_level, @subsequent_level, @state, @fmt); + + /// Set the logging callback + /// A logging function with a compatible signature. + public static void av_log_set_callback(av_log_set_callback_callback_func @callback) => vectors.av_log_set_callback(@callback); + + public static void av_log_set_flags(int @arg) => vectors.av_log_set_flags(@arg); + + /// Set the log level + /// Logging level + public static void av_log_set_level(int @level) => vectors.av_log_set_level(@level); + + public static int av_log2(uint @v) => vectors.av_log2(@v); + + public static int av_log2_16bit(uint @v) => vectors.av_log2_16bit(@v); + + /// Allocate a memory block for an array with av_malloc(). + /// Number of element + /// Size of a single element + /// Pointer to the allocated block, or `NULL` if the block cannot be allocated + public static void* av_malloc_array(ulong @nmemb, ulong @size) => vectors.av_malloc_array(@nmemb, @size); + + /// Allocate a memory block with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block. + /// Size in bytes for the memory block to be allocated + /// Pointer to the allocated block, or `NULL` if it cannot be allocated + public static void* av_mallocz(ulong @size) => vectors.av_mallocz(@size); + + /// Allocate an AVMasteringDisplayMetadata structure and set its fields to default values. The resulting struct can be freed using av_freep(). + /// An AVMasteringDisplayMetadata filled with default values or NULL on failure. + public static AVMasteringDisplayMetadata* av_mastering_display_metadata_alloc() => vectors.av_mastering_display_metadata_alloc(); + + /// Allocate a complete AVMasteringDisplayMetadata and add it to the frame. + /// The frame which side data is added to. + /// The AVMasteringDisplayMetadata structure to be filled by caller. + public static AVMasteringDisplayMetadata* av_mastering_display_metadata_create_side_data(AVFrame* @frame) => vectors.av_mastering_display_metadata_create_side_data(@frame); + + /// Return a positive value if the given filename has one of the given extensions, 0 otherwise. + /// file name to check against the given extensions + /// a comma-separated list of filename extensions + public static int av_match_ext(string @filename, string @extensions) => vectors.av_match_ext(@filename, @extensions); + + /// Set the maximum size that may be allocated in one block. + /// Value to be set as the new maximum size + public static void av_max_alloc(ulong @max) => vectors.av_max_alloc(@max); + + /// Overlapping memcpy() implementation. + /// Destination buffer + /// Number of bytes back to start copying (i.e. the initial size of the overlapping window); must be > 0 + /// Number of bytes to copy; must be >= 0 + public static void av_memcpy_backptr(byte* @dst, int @back, int @cnt) => vectors.av_memcpy_backptr(@dst, @back, @cnt); + + /// Duplicate a buffer with av_malloc(). + /// Buffer to be duplicated + /// Size in bytes of the buffer copied + /// Pointer to a newly allocated buffer containing a copy of `p` or `NULL` if the buffer cannot be allocated + public static void* av_memdup(void* @p, ulong @size) => vectors.av_memdup(@p, @size); + + /// Multiply two rationals. + /// First rational + /// Second rational + /// b*c + public static AVRational av_mul_q(AVRational @b, AVRational @c) => vectors.av_mul_q(@b, @c); + + /// Iterate over all registered muxers. + /// a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. + /// the next registered muxer or NULL when the iteration is finished + public static AVOutputFormat* av_muxer_iterate(void** @opaque) => vectors.av_muxer_iterate(@opaque); + + /// Find which of the two rationals is closer to another rational. + /// Rational to be compared against + /// Rational to be tested + /// Rational to be tested + /// One of the following values: - 1 if `q1` is nearer to `q` than `q2` - -1 if `q2` is nearer to `q` than `q1` - 0 if they have the same distance + public static int av_nearer_q(AVRational @q, AVRational @q1, AVRational @q2) => vectors.av_nearer_q(@q, @q1, @q2); + + /// Allocate the payload of a packet and initialize its fields with default values. + /// packet + /// wanted payload size + /// 0 if OK, AVERROR_xxx otherwise + public static int av_new_packet(AVPacket* @pkt, int @size) => vectors.av_new_packet(@pkt, @size); + + public static AVProgram* av_new_program(AVFormatContext* @s, int @id) => vectors.av_new_program(@s, @id); + + /// Iterate over potential AVOptions-enabled children of parent. + /// a pointer where iteration state is stored. + /// AVClass corresponding to next potential child or NULL + public static AVClass* av_opt_child_class_iterate(AVClass* @parent, void** @iter) => vectors.av_opt_child_class_iterate(@parent, @iter); + + /// Iterate over AVOptions-enabled children of obj. + /// result of a previous call to this function or NULL + /// next AVOptions-enabled child or NULL + public static void* av_opt_child_next(void* @obj, void* @prev) => vectors.av_opt_child_next(@obj, @prev); + + /// Copy options from src object into dest object. + /// Object to copy from + /// Object to copy into + /// 0 on success, negative on error + public static int av_opt_copy(void* @dest, void* @src) => vectors.av_opt_copy(@dest, @src); + + public static int av_opt_eval_double(void* @obj, AVOption* @o, string @val, double* @double_out) => vectors.av_opt_eval_double(@obj, @o, @val, @double_out); + + /// @{ This group of functions can be used to evaluate option strings and get numbers out of them. They do the same thing as av_opt_set(), except the result is written into the caller-supplied pointer. + /// a struct whose first element is a pointer to AVClass. + /// an option for which the string is to be evaluated. + /// string to be evaluated. + /// 0 on success, a negative number on failure. + public static int av_opt_eval_flags(void* @obj, AVOption* @o, string @val, int* @flags_out) => vectors.av_opt_eval_flags(@obj, @o, @val, @flags_out); + + public static int av_opt_eval_float(void* @obj, AVOption* @o, string @val, float* @float_out) => vectors.av_opt_eval_float(@obj, @o, @val, @float_out); + + public static int av_opt_eval_int(void* @obj, AVOption* @o, string @val, int* @int_out) => vectors.av_opt_eval_int(@obj, @o, @val, @int_out); + + public static int av_opt_eval_int64(void* @obj, AVOption* @o, string @val, long* @int64_out) => vectors.av_opt_eval_int64(@obj, @o, @val, @int64_out); + + public static int av_opt_eval_q(void* @obj, AVOption* @o, string @val, AVRational* @q_out) => vectors.av_opt_eval_q(@obj, @o, @val, @q_out); + + /// Look for an option in an object. Consider only options which have all the specified flags set. + /// A pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set. + /// The name of the option to look for. + /// When searching for named constants, name of the unit it belongs to. + /// Find only options with all the specified flags set (AV_OPT_FLAG). + /// A combination of AV_OPT_SEARCH_*. + /// A pointer to the option found, or NULL if no option was found. + public static AVOption* av_opt_find(void* @obj, string @name, string @unit, int @opt_flags, int @search_flags) => vectors.av_opt_find(@obj, @name, @unit, @opt_flags, @search_flags); + + /// Look for an option in an object. Consider only options which have all the specified flags set. + /// A pointer to a struct whose first element is a pointer to an AVClass. Alternatively a double pointer to an AVClass, if AV_OPT_SEARCH_FAKE_OBJ search flag is set. + /// The name of the option to look for. + /// When searching for named constants, name of the unit it belongs to. + /// Find only options with all the specified flags set (AV_OPT_FLAG). + /// A combination of AV_OPT_SEARCH_*. + /// if non-NULL, an object to which the option belongs will be written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present in search_flags. This parameter is ignored if search_flags contain AV_OPT_SEARCH_FAKE_OBJ. + /// A pointer to the option found, or NULL if no option was found. + public static AVOption* av_opt_find2(void* @obj, string @name, string @unit, int @opt_flags, int @search_flags, void** @target_obj) => vectors.av_opt_find2(@obj, @name, @unit, @opt_flags, @search_flags, @target_obj); + + /// Check whether a particular flag is set in a flags field. + /// the name of the flag field option + /// the name of the flag to check + /// non-zero if the flag is set, zero if the flag isn't set, isn't of the right type, or the flags field doesn't exist. + public static int av_opt_flag_is_set(void* @obj, string @field_name, string @flag_name) => vectors.av_opt_flag_is_set(@obj, @field_name, @flag_name); + + /// Free all allocated objects in obj. + public static void av_opt_free(void* @obj) => vectors.av_opt_free(@obj); + + /// Free an AVOptionRanges struct and set it to NULL. + public static void av_opt_freep_ranges(AVOptionRanges** @ranges) => vectors.av_opt_freep_ranges(@ranges); + + /// @{ Those functions get a value of the option with the given name from an object. + /// a struct whose first element is a pointer to an AVClass. + /// name of the option to get. + /// flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be found in a child of obj. + /// value of the option will be written here + /// >=0 on success, a negative error code otherwise + public static int av_opt_get(void* @obj, string @name, int @search_flags, byte** @out_val) => vectors.av_opt_get(@obj, @name, @search_flags, @out_val); + + public static int av_opt_get_chlayout(void* @obj, string @name, int @search_flags, AVChannelLayout* @layout) => vectors.av_opt_get_chlayout(@obj, @name, @search_flags, @layout); + + /// The returned dictionary is a copy of the actual value and must be freed with av_dict_free() by the caller + public static int av_opt_get_dict_val(void* @obj, string @name, int @search_flags, AVDictionary** @out_val) => vectors.av_opt_get_dict_val(@obj, @name, @search_flags, @out_val); + + public static int av_opt_get_double(void* @obj, string @name, int @search_flags, double* @out_val) => vectors.av_opt_get_double(@obj, @name, @search_flags, @out_val); + + public static int av_opt_get_image_size(void* @obj, string @name, int @search_flags, int* @w_out, int* @h_out) => vectors.av_opt_get_image_size(@obj, @name, @search_flags, @w_out, @h_out); + + public static int av_opt_get_int(void* @obj, string @name, int @search_flags, long* @out_val) => vectors.av_opt_get_int(@obj, @name, @search_flags, @out_val); + + /// Extract a key-value pair from the beginning of a string. + /// pointer to the options string, will be updated to point to the rest of the string (one of the pairs_sep or the final NUL) + /// a 0-terminated list of characters used to separate key from value, for example '=' + /// a 0-terminated list of characters used to separate two pairs from each other, for example ':' or ',' + /// flags; see the AV_OPT_FLAG_* values below + /// parsed key; must be freed using av_free() + /// parsed value; must be freed using av_free() + /// >=0 for success, or a negative value corresponding to an AVERROR code in case of error; in particular: AVERROR(EINVAL) if no key is present + public static int av_opt_get_key_value(byte** @ropts, string @key_val_sep, string @pairs_sep, uint @flags, byte** @rkey, byte** @rval) => vectors.av_opt_get_key_value(@ropts, @key_val_sep, @pairs_sep, @flags, @rkey, @rval); + + public static int av_opt_get_pixel_fmt(void* @obj, string @name, int @search_flags, AVPixelFormat* @out_fmt) => vectors.av_opt_get_pixel_fmt(@obj, @name, @search_flags, @out_fmt); + + public static int av_opt_get_q(void* @obj, string @name, int @search_flags, AVRational* @out_val) => vectors.av_opt_get_q(@obj, @name, @search_flags, @out_val); + + public static int av_opt_get_sample_fmt(void* @obj, string @name, int @search_flags, AVSampleFormat* @out_fmt) => vectors.av_opt_get_sample_fmt(@obj, @name, @search_flags, @out_fmt); + + public static int av_opt_get_video_rate(void* @obj, string @name, int @search_flags, AVRational* @out_val) => vectors.av_opt_get_video_rate(@obj, @name, @search_flags, @out_val); + + /// Check if given option is set to its default value. + /// AVClass object to check option on + /// option to be checked + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + public static int av_opt_is_set_to_default(void* @obj, AVOption* @o) => vectors.av_opt_is_set_to_default(@obj, @o); + + /// Check if given option is set to its default value. + /// AVClass object to check option on + /// option name + /// combination of AV_OPT_SEARCH_* + /// >0 when option is set to its default, 0 when option is not set its default, < 0 on error + public static int av_opt_is_set_to_default_by_name(void* @obj, string @name, int @search_flags) => vectors.av_opt_is_set_to_default_by_name(@obj, @name, @search_flags); + + /// Iterate over all AVOptions belonging to obj. + /// an AVOptions-enabled struct or a double pointer to an AVClass describing it. + /// result of the previous call to av_opt_next() on this object or NULL + /// next AVOption or NULL + public static AVOption* av_opt_next(void* @obj, AVOption* @prev) => vectors.av_opt_next(@obj, @prev); + + /// Gets a pointer to the requested field in a struct. This function allows accessing a struct even when its fields are moved or renamed since the application making the access has been compiled, + public static void* av_opt_ptr(AVClass* @avclass, void* @obj, string @name) => vectors.av_opt_ptr(@avclass, @obj, @name); + + /// Get a list of allowed ranges for the given option. + /// is a bitmask of flags, undefined flags should not be set and should be ignored AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, + /// number of compontents returned on success, a negative errro code otherwise + public static int av_opt_query_ranges(AVOptionRanges** @p0, void* @obj, string @key, int @flags) => vectors.av_opt_query_ranges(@p0, @obj, @key, @flags); + + /// Get a default list of allowed ranges for the given option. + /// is a bitmask of flags, undefined flags should not be set and should be ignored AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, + /// number of compontents returned on success, a negative errro code otherwise + public static int av_opt_query_ranges_default(AVOptionRanges** @p0, void* @obj, string @key, int @flags) => vectors.av_opt_query_ranges_default(@p0, @obj, @key, @flags); + + /// Serialize object's options. + /// AVClass object to serialize + /// serialize options with all the specified flags set (AV_OPT_FLAG) + /// combination of AV_OPT_SERIALIZE_* flags + /// Pointer to buffer that will be allocated with string containg serialized options. Buffer must be freed by the caller when is no longer needed. + /// character used to separate key from value + /// character used to separate two pairs from each other + /// >= 0 on success, negative on error + public static int av_opt_serialize(void* @obj, int @opt_flags, int @flags, byte** @buffer, byte @key_val_sep, byte @pairs_sep) => vectors.av_opt_serialize(@obj, @opt_flags, @flags, @buffer, @key_val_sep, @pairs_sep); + + /// @{ Those functions set the field of obj with the given name to value. + /// A struct whose first element is a pointer to an AVClass. + /// the name of the field to set + /// The value to set. In case of av_opt_set() if the field is not of a string type, then the given string is parsed. SI postfixes and some named scalars are supported. If the field is of a numeric type, it has to be a numeric or named scalar. Behavior with more than one scalar and +- infix operators is undefined. If the field is of a flags type, it has to be a sequence of numeric scalars or named flags separated by '+' or '-'. Prefixing a flag with '+' causes it to be set without affecting the other flags; similarly, '-' unsets a flag. If the field is of a dictionary type, it has to be a ':' separated list of key=value parameters. Values containing ':' special characters must be escaped. + /// flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN is passed here, then the option may be set on a child of obj. + /// 0 if the value has been set, or an AVERROR code in case of error: AVERROR_OPTION_NOT_FOUND if no matching option exists AVERROR(ERANGE) if the value is out of range AVERROR(EINVAL) if the value is not valid + public static int av_opt_set(void* @obj, string @name, string @val, int @search_flags) => vectors.av_opt_set(@obj, @name, @val, @search_flags); + + public static int av_opt_set_bin(void* @obj, string @name, byte* @val, int @size, int @search_flags) => vectors.av_opt_set_bin(@obj, @name, @val, @size, @search_flags); + + public static int av_opt_set_chlayout(void* @obj, string @name, AVChannelLayout* @layout, int @search_flags) => vectors.av_opt_set_chlayout(@obj, @name, @layout, @search_flags); + + /// Set the values of all AVOption fields to their default values. + /// an AVOption-enabled struct (its first member must be a pointer to AVClass) + public static void av_opt_set_defaults(void* @s) => vectors.av_opt_set_defaults(@s); + + /// Set the values of all AVOption fields to their default values. Only these AVOption fields for which (opt->flags & mask) == flags will have their default applied to s. + /// an AVOption-enabled struct (its first member must be a pointer to AVClass) + /// combination of AV_OPT_FLAG_* + /// combination of AV_OPT_FLAG_* + public static void av_opt_set_defaults2(void* @s, int @mask, int @flags) => vectors.av_opt_set_defaults2(@s, @mask, @flags); + + /// Set all the options from a given dictionary on an object. + /// a struct whose first element is a pointer to AVClass + /// options to process. This dictionary will be freed and replaced by a new one containing all options not found in obj. Of course this new dictionary needs to be freed by caller with av_dict_free(). + /// 0 on success, a negative AVERROR if some option was found in obj, but could not be set. + public static int av_opt_set_dict(void* @obj, AVDictionary** @options) => vectors.av_opt_set_dict(@obj, @options); + + public static int av_opt_set_dict_val(void* @obj, string @name, AVDictionary* @val, int @search_flags) => vectors.av_opt_set_dict_val(@obj, @name, @val, @search_flags); + + /// Set all the options from a given dictionary on an object. + /// a struct whose first element is a pointer to AVClass + /// options to process. This dictionary will be freed and replaced by a new one containing all options not found in obj. Of course this new dictionary needs to be freed by caller with av_dict_free(). + /// A combination of AV_OPT_SEARCH_*. + /// 0 on success, a negative AVERROR if some option was found in obj, but could not be set. + public static int av_opt_set_dict2(void* @obj, AVDictionary** @options, int @search_flags) => vectors.av_opt_set_dict2(@obj, @options, @search_flags); + + public static int av_opt_set_double(void* @obj, string @name, double @val, int @search_flags) => vectors.av_opt_set_double(@obj, @name, @val, @search_flags); + + /// Parse the key-value pairs list in opts. For each key=value pair found, set the value of the corresponding option in ctx. + /// the AVClass object to set options on + /// the options string, key-value pairs separated by a delimiter + /// a NULL-terminated array of options names for shorthand notation: if the first field in opts has no key part, the key is taken from the first element of shorthand; then again for the second, etc., until either opts is finished, shorthand is finished or a named option is found; after that, all options must be named + /// a 0-terminated list of characters used to separate key from value, for example '=' + /// a 0-terminated list of characters used to separate two pairs from each other, for example ':' or ',' + /// the number of successfully set key=value pairs, or a negative value corresponding to an AVERROR code in case of error: AVERROR(EINVAL) if opts cannot be parsed, the error code issued by av_set_string3() if a key/value pair cannot be set + public static int av_opt_set_from_string(void* @ctx, string @opts, byte** @shorthand, string @key_val_sep, string @pairs_sep) => vectors.av_opt_set_from_string(@ctx, @opts, @shorthand, @key_val_sep, @pairs_sep); + + public static int av_opt_set_image_size(void* @obj, string @name, int @w, int @h, int @search_flags) => vectors.av_opt_set_image_size(@obj, @name, @w, @h, @search_flags); + + public static int av_opt_set_int(void* @obj, string @name, long @val, int @search_flags) => vectors.av_opt_set_int(@obj, @name, @val, @search_flags); + + public static int av_opt_set_pixel_fmt(void* @obj, string @name, AVPixelFormat @fmt, int @search_flags) => vectors.av_opt_set_pixel_fmt(@obj, @name, @fmt, @search_flags); + + public static int av_opt_set_q(void* @obj, string @name, AVRational @val, int @search_flags) => vectors.av_opt_set_q(@obj, @name, @val, @search_flags); + + public static int av_opt_set_sample_fmt(void* @obj, string @name, AVSampleFormat @fmt, int @search_flags) => vectors.av_opt_set_sample_fmt(@obj, @name, @fmt, @search_flags); + + public static int av_opt_set_video_rate(void* @obj, string @name, AVRational @val, int @search_flags) => vectors.av_opt_set_video_rate(@obj, @name, @val, @search_flags); + + /// Show the obj options. + /// log context to use for showing the options + /// requested flags for the options to show. Show only the options for which it is opt->flags & req_flags. + /// rejected flags for the options to show. Show only the options for which it is !(opt->flags & req_flags). + public static int av_opt_show2(void* @obj, void* @av_log_obj, int @req_flags, int @rej_flags) => vectors.av_opt_show2(@obj, @av_log_obj, @req_flags, @rej_flags); + + /// Audio output devices iterator. + public static AVOutputFormat* av_output_audio_device_next(AVOutputFormat* @d) => vectors.av_output_audio_device_next(@d); + + /// Video output devices iterator. + public static AVOutputFormat* av_output_video_device_next(AVOutputFormat* @d) => vectors.av_output_video_device_next(@d); + + /// Wrap an existing array as a packet side data. + /// packet + /// side information type + /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to pkt. + /// side information size + /// a non-negative number on success, a negative AVERROR code on failure. On failure, the packet is unchanged and the data remains owned by the caller. + public static int av_packet_add_side_data(AVPacket* @pkt, AVPacketSideDataType @type, byte* @data, ulong @size) => vectors.av_packet_add_side_data(@pkt, @type, @data, @size); + + /// Create a new packet that references the same data as src. + /// newly created AVPacket on success, NULL on error. + public static AVPacket* av_packet_clone(AVPacket* @src) => vectors.av_packet_clone(@src); + + /// Copy only "properties" fields from src to dst. + /// Destination packet + /// Source packet + /// 0 on success AVERROR on failure. + public static int av_packet_copy_props(AVPacket* @dst, AVPacket* @src) => vectors.av_packet_copy_props(@dst, @src); + + /// Convenience function to free all the side data stored. All the other fields stay untouched. + /// packet + public static void av_packet_free_side_data(AVPacket* @pkt) => vectors.av_packet_free_side_data(@pkt); + + /// Initialize a reference-counted packet from av_malloc()ed data. + /// packet to be initialized. This function will set the data, size, and buf fields, all others are left untouched. + /// Data allocated by av_malloc() to be used as packet data. If this function returns successfully, the data is owned by the underlying AVBuffer. The caller may not access the data through other means. + /// size of data in bytes, without the padding. I.e. the full buffer size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. + /// 0 on success, a negative AVERROR on error + public static int av_packet_from_data(AVPacket* @pkt, byte* @data, int @size) => vectors.av_packet_from_data(@pkt, @data, @size); + + /// Get side information from packet. + /// packet + /// desired side information type + /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. + /// pointer to data if present or NULL otherwise + public static byte* av_packet_get_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong* @size) => vectors.av_packet_get_side_data(@pkt, @type, @size); + + /// Ensure the data described by a given packet is reference counted. + /// packet whose data should be made reference counted. + /// 0 on success, a negative AVERROR on error. On failure, the packet is unchanged. + public static int av_packet_make_refcounted(AVPacket* @pkt) => vectors.av_packet_make_refcounted(@pkt); + + /// Create a writable reference for the data described by a given packet, avoiding data copy if possible. + /// Packet whose data should be made writable. + /// 0 on success, a negative AVERROR on failure. On failure, the packet is unchanged. + public static int av_packet_make_writable(AVPacket* @pkt) => vectors.av_packet_make_writable(@pkt); + + /// Move every field in src to dst and reset src. + /// Destination packet + /// Source packet, will be reset + public static void av_packet_move_ref(AVPacket* @dst, AVPacket* @src) => vectors.av_packet_move_ref(@dst, @src); + + /// Allocate new information of a packet. + /// packet + /// side information type + /// side information size + /// pointer to fresh allocated data or NULL otherwise + public static byte* av_packet_new_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size) => vectors.av_packet_new_side_data(@pkt, @type, @size); + + /// Pack a dictionary for use in side_data. + /// The dictionary to pack. + /// pointer to store the size of the returned data + /// pointer to data if successful, NULL otherwise + public static byte* av_packet_pack_dictionary(AVDictionary* @dict, ulong* @size) => vectors.av_packet_pack_dictionary(@dict, @size); + + /// Setup a new reference to the data described by a given packet + /// Destination packet. Will be completely overwritten. + /// Source packet + /// 0 on success, a negative AVERROR on error. On error, dst will be blank (as if returned by av_packet_alloc()). + public static int av_packet_ref(AVPacket* @dst, AVPacket* @src) => vectors.av_packet_ref(@dst, @src); + + /// Convert valid timing fields (timestamps / durations) in a packet from one timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be ignored. + /// packet on which the conversion will be performed + /// source timebase, in which the timing fields in pkt are expressed + /// destination timebase, to which the timing fields will be converted + public static void av_packet_rescale_ts(AVPacket* @pkt, AVRational @tb_src, AVRational @tb_dst) => vectors.av_packet_rescale_ts(@pkt, @tb_src, @tb_dst); + + /// Shrink the already allocated side data buffer + /// packet + /// side information type + /// new side information size + /// 0 on success, < 0 on failure + public static int av_packet_shrink_side_data(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size) => vectors.av_packet_shrink_side_data(@pkt, @type, @size); + + /// Wrap existing data as packet side data. + /// pointer to an array of side data to which the side data should be added. *sd may be NULL, in which case the array will be initialized + /// pointer to an integer containing the number of entries in the array. The integer value will be increased by 1 on success. + /// side data type + /// a data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to the side data array on success + /// size of the data array + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise On failure, the side data array is unchanged and the data remains owned by the caller. + public static AVPacketSideData* av_packet_side_data_add(AVPacketSideData** @sd, int* @nb_sd, AVPacketSideDataType @type, void* @data, ulong @size, int @flags) => vectors.av_packet_side_data_add(@sd, @nb_sd, @type, @data, @size, @flags); + + /// Convenience function to free all the side data stored in an array, and the array itself. + /// pointer to array of side data to free. Will be set to NULL upon return. + /// pointer to an integer containing the number of entries in the array. Will be set to 0 upon return. + public static void av_packet_side_data_free(AVPacketSideData** @sd, int* @nb_sd) => vectors.av_packet_side_data_free(@sd, @nb_sd); + + /// Get side information from a side data array. + /// the array from which the side data should be fetched + /// value containing the number of entries in the array. + /// desired side information type + /// pointer to side data if present or NULL otherwise + public static AVPacketSideData* av_packet_side_data_get(AVPacketSideData* @sd, int @nb_sd, AVPacketSideDataType @type) => vectors.av_packet_side_data_get(@sd, @nb_sd, @type); + + public static string av_packet_side_data_name(AVPacketSideDataType @type) => vectors.av_packet_side_data_name(@type); + + /// Allocate a new packet side data. + /// side data type + /// desired side data size + /// currently unused. Must be zero + /// pointer to freshly allocated side data on success, or NULL otherwise. + public static AVPacketSideData* av_packet_side_data_new(AVPacketSideData** @psd, int* @pnb_sd, AVPacketSideDataType @type, ulong @size, int @flags) => vectors.av_packet_side_data_new(@psd, @pnb_sd, @type, @size, @flags); + + /// Remove side data of the given type from a side data array. + /// the array from which the side data should be removed + /// pointer to an integer containing the number of entries in the array. Will be reduced by the amount of entries removed upon return + /// side information type + public static void av_packet_side_data_remove(AVPacketSideData* @sd, int* @nb_sd, AVPacketSideDataType @type) => vectors.av_packet_side_data_remove(@sd, @nb_sd, @type); + + /// Unpack a dictionary from side_data. + /// data from side_data + /// size of the data + /// the metadata storage dictionary + /// 0 on success, < 0 on failure + public static int av_packet_unpack_dictionary(byte* @data, ulong @size, AVDictionary** @dict) => vectors.av_packet_unpack_dictionary(@data, @size, @dict); + + /// Parse CPU caps from a string and update the given AV_CPU_* flags based on that. + /// negative on error. + public static int av_parse_cpu_caps(uint* @flags, string @s) => vectors.av_parse_cpu_caps(@flags, @s); + + public static void av_parser_close(AVCodecParserContext* @s) => vectors.av_parser_close(@s); + + public static AVCodecParserContext* av_parser_init(int @codec_id) => vectors.av_parser_init(@codec_id); + + /// Iterate over all registered codec parsers. + /// a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. + /// the next registered codec parser or NULL when the iteration is finished + public static AVCodecParser* av_parser_iterate(void** @opaque) => vectors.av_parser_iterate(@opaque); + + /// Parse a packet. + /// parser context. + /// codec context. + /// set to pointer to parsed buffer or NULL if not yet finished. + /// set to size of parsed buffer or zero if not yet finished. + /// input buffer. + /// buffer size in bytes without the padding. I.e. the full buffer size is assumed to be buf_size + AV_INPUT_BUFFER_PADDING_SIZE. To signal EOF, this should be 0 (so that the last frame can be output). + /// input presentation timestamp. + /// input decoding timestamp. + /// input byte position in stream. + /// the number of bytes of the input bitstream used. + public static int av_parser_parse2(AVCodecParserContext* @s, AVCodecContext* @avctx, byte** @poutbuf, int* @poutbuf_size, byte* @buf, int @buf_size, long @pts, long @dts, long @pos) => vectors.av_parser_parse2(@s, @avctx, @poutbuf, @poutbuf_size, @buf, @buf_size, @pts, @dts, @pos); + + /// Returns number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a valid pixel format. + /// number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a valid pixel format. + public static int av_pix_fmt_count_planes(AVPixelFormat @pix_fmt) => vectors.av_pix_fmt_count_planes(@pix_fmt); + + /// Returns a pixel format descriptor for provided pixel format or NULL if this pixel format is unknown. + /// a pixel format descriptor for provided pixel format or NULL if this pixel format is unknown. + public static AVPixFmtDescriptor* av_pix_fmt_desc_get(AVPixelFormat @pix_fmt) => vectors.av_pix_fmt_desc_get(@pix_fmt); + + /// Returns an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc is not a valid pointer to a pixel format descriptor. + /// an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc is not a valid pointer to a pixel format descriptor. + public static AVPixelFormat av_pix_fmt_desc_get_id(AVPixFmtDescriptor* @desc) => vectors.av_pix_fmt_desc_get_id(@desc); + + /// Iterate over all pixel format descriptors known to libavutil. + /// previous descriptor. NULL to get the first descriptor. + /// next descriptor or NULL after the last descriptor + public static AVPixFmtDescriptor* av_pix_fmt_desc_next(AVPixFmtDescriptor* @prev) => vectors.av_pix_fmt_desc_next(@prev); + + /// Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor. + /// the pixel format + /// store log2_chroma_w (horizontal/width shift) + /// store log2_chroma_h (vertical/height shift) + /// 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format + public static int av_pix_fmt_get_chroma_sub_sample(AVPixelFormat @pix_fmt, int* @h_shift, int* @v_shift) => vectors.av_pix_fmt_get_chroma_sub_sample(@pix_fmt, @h_shift, @v_shift); + + /// Utility function to swap the endianness of a pixel format. + /// the pixel format + /// pixel format with swapped endianness if it exists, otherwise AV_PIX_FMT_NONE + public static AVPixelFormat av_pix_fmt_swap_endianness(AVPixelFormat @pix_fmt) => vectors.av_pix_fmt_swap_endianness(@pix_fmt); + + /// Send a nice dump of a packet to the log. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. + /// The importance level of the message, lower values signifying higher importance. + /// packet to dump + /// True if the payload must be displayed, too. + /// AVStream that the packet belongs to + public static void av_pkt_dump_log2(void* @avcl, int @level, AVPacket* @pkt, int @dump_payload, AVStream* @st) => vectors.av_pkt_dump_log2(@avcl, @level, @pkt, @dump_payload, @st); + + /// Send a nice dump of a packet to the specified file stream. + /// The file stream pointer where the dump should be sent to. + /// packet to dump + /// True if the payload must be displayed, too. + /// AVStream that the packet belongs to + public static void av_pkt_dump2(_iobuf* @f, AVPacket* @pkt, int @dump_payload, AVStream* @st) => vectors.av_pkt_dump2(@f, @pkt, @dump_payload, @st); + + /// Like av_probe_input_buffer2() but returns 0 on success + public static int av_probe_input_buffer(AVIOContext* @pb, AVInputFormat** @fmt, string @url, void* @logctx, uint @offset, uint @max_probe_size) => vectors.av_probe_input_buffer(@pb, @fmt, @url, @logctx, @offset, @max_probe_size); + + /// Probe a bytestream to determine the input format. Each time a probe returns with a score that is too low, the probe buffer size is increased and another attempt is made. When the maximum probe size is reached, the input format with the highest score is returned. + /// the bytestream to probe + /// the input format is put here + /// the url of the stream + /// the log context + /// the offset within the bytestream to probe from + /// the maximum probe buffer size (zero for default) + /// the score in case of success, a negative value corresponding to an the maximal score is AVPROBE_SCORE_MAX AVERROR code otherwise + public static int av_probe_input_buffer2(AVIOContext* @pb, AVInputFormat** @fmt, string @url, void* @logctx, uint @offset, uint @max_probe_size) => vectors.av_probe_input_buffer2(@pb, @fmt, @url, @logctx, @offset, @max_probe_size); + + /// Guess the file format. + /// data to be probed + /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. + public static AVInputFormat* av_probe_input_format(AVProbeData* @pd, int @is_opened) => vectors.av_probe_input_format(@pd, @is_opened); + + /// Guess the file format. + /// data to be probed + /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. + /// A probe score larger that this is required to accept a detection, the variable is set to the actual detection score afterwards. If the score is < = AVPROBE_SCORE_MAX / 4 it is recommended to retry with a larger probe buffer. + public static AVInputFormat* av_probe_input_format2(AVProbeData* @pd, int @is_opened, int* @score_max) => vectors.av_probe_input_format2(@pd, @is_opened, @score_max); + + /// Guess the file format. + /// Whether the file is already opened; determines whether demuxers with or without AVFMT_NOFILE are probed. + /// The score of the best detection. + public static AVInputFormat* av_probe_input_format3(AVProbeData* @pd, int @is_opened, int* @score_ret) => vectors.av_probe_input_format3(@pd, @is_opened, @score_ret); + + public static void av_program_add_stream_index(AVFormatContext* @ac, int @progid, uint @idx) => vectors.av_program_add_stream_index(@ac, @progid, @idx); + + /// Convert an AVRational to a IEEE 32-bit `float` expressed in fixed-point format. + /// Rational to be converted + /// Equivalent floating-point value, expressed as an unsigned 32-bit integer. + public static uint av_q2intfloat(AVRational @q) => vectors.av_q2intfloat(@q); + + public static void av_read_image_line(ushort* @dst, in byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @read_pal_component) => vectors.av_read_image_line(@dst, @data, @linesize, @desc, @x, @y, @c, @w, @read_pal_component); + + /// Read a line from an image, and write the values of the pixel format component c to dst. + /// the array containing the pointers to the planes of the image + /// the array containing the linesizes of the image + /// the pixel format descriptor for the image + /// the horizontal coordinate of the first pixel to read + /// the vertical coordinate of the first pixel to read + /// the width of the line to read, that is the number of values to write to dst + /// if not zero and the format is a paletted format writes the values corresponding to the palette component c in data[1] to dst, rather than the palette indexes in data[0]. The behavior is undefined if the format is not paletted. + /// size of elements in dst array (2 or 4 byte) + public static void av_read_image_line2(void* @dst, in byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @read_pal_component, int @dst_element_size) => vectors.av_read_image_line2(@dst, @data, @linesize, @desc, @x, @y, @c, @w, @read_pal_component, @dst_element_size); + + /// Pause a network-based stream (e.g. RTSP stream). + public static int av_read_pause(AVFormatContext* @s) => vectors.av_read_pause(@s); + + /// Start playing a network-based stream (e.g. RTSP stream) at the current position. + public static int av_read_play(AVFormatContext* @s) => vectors.av_read_play(@s); + + /// Allocate, reallocate, or free a block of memory. + /// Pointer to a memory block already allocated with av_realloc() or `NULL` + /// Size in bytes of the memory block to be allocated or reallocated + /// Pointer to a newly-reallocated block or `NULL` if the block cannot be reallocated + public static void* av_realloc(void* @ptr, ulong @size) => vectors.av_realloc(@ptr, @size); + + /// Allocate, reallocate, or free an array. + /// Pointer to a memory block already allocated with av_realloc() or `NULL` + /// Number of elements in the array + /// Size of the single element of the array + /// Pointer to a newly-reallocated block or NULL if the block cannot be reallocated + public static void* av_realloc_array(void* @ptr, ulong @nmemb, ulong @size) => vectors.av_realloc_array(@ptr, @nmemb, @size); + + /// Allocate, reallocate, or free a block of memory. + public static void* av_realloc_f(void* @ptr, ulong @nelem, ulong @elsize) => vectors.av_realloc_f(@ptr, @nelem, @elsize); + + /// Allocate, reallocate, or free a block of memory through a pointer to a pointer. + /// Pointer to a pointer to a memory block already allocated with av_realloc(), or a pointer to `NULL`. The pointer is updated on success, or freed on failure. + /// Size in bytes for the memory block to be allocated or reallocated + /// Zero on success, an AVERROR error code on failure + public static int av_reallocp(void* @ptr, ulong @size) => vectors.av_reallocp(@ptr, @size); + + /// Allocate, reallocate an array through a pointer to a pointer. + /// Pointer to a pointer to a memory block already allocated with av_realloc(), or a pointer to `NULL`. The pointer is updated on success, or freed on failure. + /// Number of elements + /// Size of the single element + /// Zero on success, an AVERROR error code on failure + public static int av_reallocp_array(void* @ptr, ulong @nmemb, ulong @size) => vectors.av_reallocp_array(@ptr, @nmemb, @size); + + /// Reduce a fraction. + /// Destination numerator + /// Destination denominator + /// Source numerator + /// Source denominator + /// Maximum allowed values for `dst_num` & `dst_den` + /// 1 if the operation is exact, 0 otherwise + public static int av_reduce(int* @dst_num, int* @dst_den, long @num, long @den, long @max) => vectors.av_reduce(@dst_num, @dst_den, @num, @den, @max); + + /// Rescale a 64-bit integer with rounding to nearest. + public static long av_rescale(long @a, long @b, long @c) => vectors.av_rescale(@a, @b, @c); + + /// Rescale a timestamp while preserving known durations. + /// Input time base + /// Input timestamp + /// Duration time base; typically this is finer-grained (greater) than `in_tb` and `out_tb` + /// Duration till the next call to this function (i.e. duration of the current packet/frame) + /// Pointer to a timestamp expressed in terms of `fs_tb`, acting as a state variable + /// Output timebase + /// Timestamp expressed in terms of `out_tb` + public static long av_rescale_delta(AVRational @in_tb, long @in_ts, AVRational @fs_tb, int @duration, long* @last, AVRational @out_tb) => vectors.av_rescale_delta(@in_tb, @in_ts, @fs_tb, @duration, @last, @out_tb); + + /// Rescale a 64-bit integer by 2 rational numbers. + public static long av_rescale_q(long @a, AVRational @bq, AVRational @cq) => vectors.av_rescale_q(@a, @bq, @cq); + + /// Rescale a 64-bit integer by 2 rational numbers with specified rounding. + public static long av_rescale_q_rnd(long @a, AVRational @bq, AVRational @cq, AVRounding @rnd) => vectors.av_rescale_q_rnd(@a, @bq, @cq, @rnd); + + /// Rescale a 64-bit integer with specified rounding. + public static long av_rescale_rnd(long @a, long @b, long @c, AVRounding @rnd) => vectors.av_rescale_rnd(@a, @b, @c, @rnd); + + /// Check if the sample format is planar. + /// the sample format to inspect + /// 1 if the sample format is planar, 0 if it is interleaved + public static int av_sample_fmt_is_planar(AVSampleFormat @sample_fmt) => vectors.av_sample_fmt_is_planar(@sample_fmt); + + /// Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly. The allocated samples buffer can be freed by using av_freep(&audio_data[0]) Allocated data will be initialized to silence. + /// array to be filled with the pointer for each channel + /// aligned size for audio buffer(s), may be NULL + /// number of audio channels + /// number of samples per channel + /// the sample format + /// buffer size alignment (0 = default, 1 = no alignment) + /// >=0 on success or a negative error code on failure + public static int av_samples_alloc(byte** @audio_data, int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align) => vectors.av_samples_alloc(@audio_data, @linesize, @nb_channels, @nb_samples, @sample_fmt, @align); + + /// Allocate a data pointers array, samples buffer for nb_samples samples, and fill data pointers and linesize accordingly. + public static int av_samples_alloc_array_and_samples(byte*** @audio_data, int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align) => vectors.av_samples_alloc_array_and_samples(@audio_data, @linesize, @nb_channels, @nb_samples, @sample_fmt, @align); + + /// Copy samples from src to dst. + /// destination array of pointers to data planes + /// source array of pointers to data planes + /// offset in samples at which the data will be written to dst + /// offset in samples at which the data will be read from src + /// number of samples to be copied + /// number of audio channels + /// audio sample format + public static int av_samples_copy(byte** @dst, byte** @src, int @dst_offset, int @src_offset, int @nb_samples, int @nb_channels, AVSampleFormat @sample_fmt) => vectors.av_samples_copy(@dst, @src, @dst_offset, @src_offset, @nb_samples, @nb_channels, @sample_fmt); + + /// Fill plane data pointers and linesize for samples with sample format sample_fmt. + /// array to be filled with the pointer for each channel + /// calculated linesize, may be NULL + /// the pointer to a buffer containing the samples + /// the number of channels + /// the number of samples in a single channel + /// the sample format + /// buffer size alignment (0 = default, 1 = no alignment) + /// minimum size in bytes required for the buffer on success, or a negative error code on failure + public static int av_samples_fill_arrays(byte** @audio_data, int* @linesize, byte* @buf, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align) => vectors.av_samples_fill_arrays(@audio_data, @linesize, @buf, @nb_channels, @nb_samples, @sample_fmt, @align); + + /// Get the required buffer size for the given audio parameters. + /// calculated linesize, may be NULL + /// the number of channels + /// the number of samples in a single channel + /// the sample format + /// buffer size alignment (0 = default, 1 = no alignment) + /// required buffer size, or negative error code on failure + public static int av_samples_get_buffer_size(int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align) => vectors.av_samples_get_buffer_size(@linesize, @nb_channels, @nb_samples, @sample_fmt, @align); + + /// Fill an audio buffer with silence. + /// array of pointers to data planes + /// offset in samples at which to start filling + /// number of samples to fill + /// number of audio channels + /// audio sample format + public static int av_samples_set_silence(byte** @audio_data, int @offset, int @nb_samples, int @nb_channels, AVSampleFormat @sample_fmt) => vectors.av_samples_set_silence(@audio_data, @offset, @nb_samples, @nb_channels, @sample_fmt); + + /// Generate an SDP for an RTP session. + /// array of AVFormatContexts describing the RTP streams. If the array is composed by only one context, such context can contain multiple AVStreams (one AVStream per RTP stream). Otherwise, all the contexts in the array (an AVCodecContext per RTP stream) must contain only one AVStream. + /// number of AVCodecContexts contained in ac + /// buffer where the SDP will be stored (must be allocated by the caller) + /// the size of the buffer + /// 0 if OK, AVERROR_xxx on error + public static int av_sdp_create(AVFormatContext** @ac, int @n_files, byte* @buf, int @size) => vectors.av_sdp_create(@ac, @n_files, @buf, @size); + + /// Seek to the keyframe at timestamp. 'timestamp' in 'stream_index'. + /// media file handle + /// If stream_index is (-1), a default stream is selected, and timestamp is automatically converted from AV_TIME_BASE units to the stream specific time_base. + /// Timestamp in AVStream.time_base units or, if no stream is specified, in AV_TIME_BASE units. + /// flags which select direction and seeking mode + /// >= 0 on success + public static int av_seek_frame(AVFormatContext* @s, int @stream_index, long @timestamp, int @flags) => vectors.av_seek_frame(@s, @stream_index, @timestamp, @flags); + + /// Parse the key/value pairs list in opts. For each key/value pair found, stores the value in the field in ctx that is named like the key. ctx must be an AVClass context, storing is done using AVOptions. + /// options string to parse, may be NULL + /// a 0-terminated list of characters used to separate key from value + /// a 0-terminated list of characters used to separate two pairs from each other + /// the number of successfully set key/value pairs, or a negative value corresponding to an AVERROR code in case of error: AVERROR(EINVAL) if opts cannot be parsed, the error code issued by av_opt_set() if a key/value pair cannot be set + public static int av_set_options_string(void* @ctx, string @opts, string @key_val_sep, string @pairs_sep) => vectors.av_set_options_string(@ctx, @opts, @key_val_sep, @pairs_sep); + + /// Reduce packet size, correctly zeroing padding + /// packet + /// new size + public static void av_shrink_packet(AVPacket* @pkt, int @size) => vectors.av_shrink_packet(@pkt, @size); + + /// Multiply two `size_t` values checking for overflow. + /// Operand of multiplication + /// Operand of multiplication + /// Pointer to the result of the operation + /// 0 on success, AVERROR(EINVAL) on overflow + public static int av_size_mult(ulong @a, ulong @b, ulong* @r) => vectors.av_size_mult(@a, @b, @r); + + /// Duplicate a string. + /// String to be duplicated + /// Pointer to a newly-allocated string containing a copy of `s` or `NULL` if the string cannot be allocated + public static byte* av_strdup(string @s) => vectors.av_strdup(@s); + + /// Wrap an existing array as stream side data. + /// stream + /// side information type + /// the side data array. It must be allocated with the av_malloc() family of functions. The ownership of the data is transferred to st. + /// side information size + /// zero on success, a negative AVERROR code on failure. On failure, the stream is unchanged and the data remains owned by the caller. + [Obsolete("use av_packet_side_data_add() with the stream's \"codecpar side data\"")] + public static int av_stream_add_side_data(AVStream* @st, AVPacketSideDataType @type, byte* @data, ulong @size) => vectors.av_stream_add_side_data(@st, @type, @data, @size); + + /// Get the AVClass for AVStream. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + public static AVClass* av_stream_get_class() => vectors.av_stream_get_class(); + + /// Get the internal codec timebase from a stream. + /// input stream to extract the timebase from + public static AVRational av_stream_get_codec_timebase(AVStream* @st) => vectors.av_stream_get_codec_timebase(@st); + + public static AVCodecParserContext* av_stream_get_parser(AVStream* @s) => vectors.av_stream_get_parser(@s); + + /// Get side information from stream. + /// stream + /// desired side information type + /// If supplied, *size will be set to the size of the side data or to zero if the desired side data is not present. + /// pointer to data if present or NULL otherwise + [Obsolete("use av_packet_side_data_get() with the stream's \"codecpar side data\"")] + public static byte* av_stream_get_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong* @size) => vectors.av_stream_get_side_data(@stream, @type, @size); + + /// Get the AVClass for AVStreamGroup. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + public static AVClass* av_stream_group_get_class() => vectors.av_stream_group_get_class(); + + /// Allocate new information from stream. + /// stream + /// desired side information type + /// side information size + /// pointer to fresh allocated data or NULL otherwise + [Obsolete("use av_packet_side_data_new() with the stream's \"codecpar side data\"")] + public static byte* av_stream_new_side_data(AVStream* @stream, AVPacketSideDataType @type, ulong @size) => vectors.av_stream_new_side_data(@stream, @type, @size); + + /// Put a description of the AVERROR code errnum in errbuf. In case of failure the global variable errno is set to indicate the error. Even in case of failure av_strerror() will print a generic error message indicating the errnum provided to errbuf. + /// error code to describe + /// buffer to which description is written + /// the size in bytes of errbuf + /// 0 on success, a negative value if a description for errnum cannot be found + public static int av_strerror(int @errnum, byte* @errbuf, ulong @errbuf_size) => vectors.av_strerror(@errnum, @errbuf, @errbuf_size); + + /// Duplicate a substring of a string. + /// String to be duplicated + /// Maximum length of the resulting string (not counting the terminating byte) + /// Pointer to a newly-allocated string containing a substring of `s` or `NULL` if the string cannot be allocated + public static byte* av_strndup(string @s, ulong @len) => vectors.av_strndup(@s, @len); + + /// Subtract one rational from another. + /// First rational + /// Second rational + /// b-c + public static AVRational av_sub_q(AVRational @b, AVRational @c) => vectors.av_sub_q(@b, @c); + + /// Adjust frame number for NTSC drop frame time code. + /// frame number to adjust + /// frame per second, multiples of 30 + /// adjusted frame number + public static int av_timecode_adjust_ntsc_framenum2(int @framenum, int @fps) => vectors.av_timecode_adjust_ntsc_framenum2(@framenum, @fps); + + /// Check if the timecode feature is available for the given frame rate + /// 0 if supported, < 0 otherwise + public static int av_timecode_check_frame_rate(AVRational @rate) => vectors.av_timecode_check_frame_rate(@rate); + + /// Convert sei info to SMPTE 12M binary representation. + /// frame rate in rational form + /// drop flag + /// hour + /// minute + /// second + /// frame number + /// the SMPTE binary representation + public static uint av_timecode_get_smpte(AVRational @rate, int @drop, int @hh, int @mm, int @ss, int @ff) => vectors.av_timecode_get_smpte(@rate, @drop, @hh, @mm, @ss, @ff); + + /// Convert frame number to SMPTE 12M binary representation. + /// timecode data correctly initialized + /// frame number + /// the SMPTE binary representation + public static uint av_timecode_get_smpte_from_framenum(AVTimecode* @tc, int @framenum) => vectors.av_timecode_get_smpte_from_framenum(@tc, @framenum); + + /// Init a timecode struct with the passed parameters. + /// pointer to an allocated AVTimecode + /// frame rate in rational form + /// miscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag) + /// the first frame number + /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) + /// 0 on success, AVERROR otherwise + public static int av_timecode_init(AVTimecode* @tc, AVRational @rate, int @flags, int @frame_start, void* @log_ctx) => vectors.av_timecode_init(@tc, @rate, @flags, @frame_start, @log_ctx); + + /// Init a timecode struct from the passed timecode components. + /// pointer to an allocated AVTimecode + /// frame rate in rational form + /// miscellaneous flags such as drop frame, +24 hours, ... (see AVTimecodeFlag) + /// hours + /// minutes + /// seconds + /// frames + /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log) + /// 0 on success, AVERROR otherwise + public static int av_timecode_init_from_components(AVTimecode* @tc, AVRational @rate, int @flags, int @hh, int @mm, int @ss, int @ff, void* @log_ctx) => vectors.av_timecode_init_from_components(@tc, @rate, @flags, @hh, @mm, @ss, @ff, @log_ctx); + + /// Parse timecode representation (hh:mm:ss[:;.]ff). + /// pointer to an allocated AVTimecode + /// frame rate in rational form + /// timecode string which will determine the frame start + /// a pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log). + /// 0 on success, AVERROR otherwise + public static int av_timecode_init_from_string(AVTimecode* @tc, AVRational @rate, string @str, void* @log_ctx) => vectors.av_timecode_init_from_string(@tc, @rate, @str, @log_ctx); + + /// Get the timecode string from the 25-bit timecode format (MPEG GOP format). + /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long + /// the 25-bits timecode + /// the buf parameter + public static byte* av_timecode_make_mpeg_tc_string(byte* @buf, uint @tc25bit) => vectors.av_timecode_make_mpeg_tc_string(@buf, @tc25bit); + + /// Get the timecode string from the SMPTE timecode format. + /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long + /// the 32-bit SMPTE timecode + /// prevent the use of a drop flag when it is known the DF bit is arbitrary + /// the buf parameter + public static byte* av_timecode_make_smpte_tc_string(byte* @buf, uint @tcsmpte, int @prevent_df) => vectors.av_timecode_make_smpte_tc_string(@buf, @tcsmpte, @prevent_df); + + /// Get the timecode string from the SMPTE timecode format. + /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long + /// frame rate of the timecode + /// the 32-bit SMPTE timecode + /// prevent the use of a drop flag when it is known the DF bit is arbitrary + /// prevent the use of a field flag when it is known the field bit is arbitrary (e.g. because it is used as PC flag) + /// the buf parameter + public static byte* av_timecode_make_smpte_tc_string2(byte* @buf, AVRational @rate, uint @tcsmpte, int @prevent_df, int @skip_field) => vectors.av_timecode_make_smpte_tc_string2(@buf, @rate, @tcsmpte, @prevent_df, @skip_field); + + /// Load timecode string in buf. + /// timecode data correctly initialized + /// destination buffer, must be at least AV_TIMECODE_STR_SIZE long + /// frame number + /// the buf parameter + public static byte* av_timecode_make_string(AVTimecode* @tc, byte* @buf, int @framenum) => vectors.av_timecode_make_string(@tc, @buf, @framenum); + + public static void av_tree_destroy(AVTreeNode* @t) => vectors.av_tree_destroy(@t); + + /// Apply enu(opaque, &elem) to all the elements in the tree in a given range. + /// a comparison function that returns < 0 for an element below the range, > 0 for an element above the range and == 0 for an element inside the range + public static void av_tree_enumerate(AVTreeNode* @t, void* @opaque, av_tree_enumerate_cmp_func @cmp, av_tree_enumerate_enu_func @enu) => vectors.av_tree_enumerate(@t, @opaque, @cmp, @enu); + + /// Find an element. + /// a pointer to the root node of the tree + /// compare function used to compare elements in the tree, API identical to that of Standard C's qsort It is guaranteed that the first and only the first argument to cmp() will be the key parameter to av_tree_find(), thus it could if the user wants, be a different type (like an opaque context). + /// If next is not NULL, then next[0] will contain the previous element and next[1] the next element. If either does not exist, then the corresponding entry in next is unchanged. + /// An element with cmp(key, elem) == 0 or NULL if no such element exists in the tree. + public static void* av_tree_find(AVTreeNode* @root, void* @key, av_tree_find_cmp_func @cmp, ref void_ptr2 @next) => vectors.av_tree_find(@root, @key, @cmp, ref @next); + + /// Insert or remove an element. + /// A pointer to a pointer to the root node of the tree; note that the root node can change during insertions, this is required to keep the tree balanced. + /// pointer to the element key to insert in the tree + /// compare function used to compare elements in the tree, API identical to that of Standard C's qsort + /// Used to allocate and free AVTreeNodes. For insertion the user must set it to an allocated and zeroed object of at least av_tree_node_size bytes size. av_tree_insert() will set it to NULL if it has been consumed. For deleting elements *next is set to NULL by the user and av_tree_insert() will set it to the AVTreeNode which was used for the removed element. This allows the use of flat arrays, which have lower overhead compared to many malloced elements. You might want to define a function like: + /// If no insertion happened, the found element; if an insertion or removal happened, then either key or NULL will be returned. Which one it is depends on the tree state and the implementation. You should make no assumptions that it's one or the other in the code. + public static void* av_tree_insert(AVTreeNode** @rootp, void* @key, av_tree_insert_cmp_func @cmp, AVTreeNode** @next) => vectors.av_tree_insert(@rootp, @key, @cmp, @next); + + /// Allocate an AVTreeNode. + public static AVTreeNode* av_tree_node_alloc() => vectors.av_tree_node_alloc(); + + /// Split a URL string into components. + /// the buffer for the protocol + /// the size of the proto buffer + /// the buffer for the authorization + /// the size of the authorization buffer + /// the buffer for the host name + /// the size of the hostname buffer + /// a pointer to store the port number in + /// the buffer for the path + /// the size of the path buffer + /// the URL to split + public static void av_url_split(byte* @proto, int @proto_size, byte* @authorization, int @authorization_size, byte* @hostname, int @hostname_size, int* @port_ptr, byte* @path, int @path_size, string @url) => vectors.av_url_split(@proto, @proto_size, @authorization, @authorization_size, @hostname, @hostname_size, @port_ptr, @path, @path_size, @url); + + /// Sleep for a period of time. Although the duration is expressed in microseconds, the actual delay may be rounded to the precision of the system timer. + /// Number of microseconds to sleep. + /// zero on success or (negative) error code. + public static int av_usleep(uint @usec) => vectors.av_usleep(@usec); + + /// Return an informative version string. This usually is the actual release version number or a git commit description. This string has no fixed format and can change any time. It should never be parsed by code. + public static string av_version_info() => vectors.av_version_info(); + + /// Send the specified message to the log if the level is less than or equal to the current av_log_level. By default, all logging messages are sent to stderr. This behavior can be altered by setting a different logging callback function. + /// A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct. + /// The importance level of the message expressed using a "Logging Constant". + /// The format string (printf-compatible) that specifies how subsequent arguments are converted to output. + /// The arguments referenced by the format string. + public static void av_vlog(void* @avcl, int @level, string @fmt, byte* @vl) => vectors.av_vlog(@avcl, @level, @fmt, @vl); + + /// Write a packet to an output media file. + /// media file handle + /// The packet containing the data to be written. Note that unlike av_interleaved_write_frame(), this function does not take ownership of the packet passed to it (though some muxers may make an internal reference to the input packet). This parameter can be NULL (at any time, not just at the end), in order to immediately flush data buffered within the muxer, for muxers that buffer up data internally before writing it to the output. Packet's "stream_index" field must be set to the index of the corresponding stream in "s->streams". The timestamps ( "pts", "dts") must be set to correct values in the stream's timebase (unless the output format is flagged with the AVFMT_NOTIMESTAMPS flag, then they can be set to AV_NOPTS_VALUE). The dts for subsequent packets passed to this function must be strictly increasing when compared in their respective timebases (unless the output format is flagged with the AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing). "duration") should also be set if known. + /// < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush + public static int av_write_frame(AVFormatContext* @s, AVPacket* @pkt) => vectors.av_write_frame(@s, @pkt); + + public static void av_write_image_line(ushort* @src, ref byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w) => vectors.av_write_image_line(@src, ref @data, @linesize, @desc, @x, @y, @c, @w); + + /// Write the values from src to the pixel format component c of an image line. + /// array containing the values to write + /// the array containing the pointers to the planes of the image to write into. It is supposed to be zeroed. + /// the array containing the linesizes of the image + /// the pixel format descriptor for the image + /// the horizontal coordinate of the first pixel to write + /// the vertical coordinate of the first pixel to write + /// the width of the line to write, that is the number of values to write to the image line + /// size of elements in src array (2 or 4 byte) + public static void av_write_image_line2(void* @src, ref byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @src_element_size) => vectors.av_write_image_line2(@src, ref @data, @linesize, @desc, @x, @y, @c, @w, @src_element_size); + + /// Write the stream trailer to an output media file and free the file private data. + /// media file handle + /// 0 if OK, AVERROR_xxx on error + public static int av_write_trailer(AVFormatContext* @s) => vectors.av_write_trailer(@s); + + /// Write an uncoded frame to an output media file. + public static int av_write_uncoded_frame(AVFormatContext* @s, int @stream_index, AVFrame* @frame) => vectors.av_write_uncoded_frame(@s, @stream_index, @frame); + + /// Test whether a muxer supports uncoded frame. + /// >=0 if an uncoded frame can be written to that muxer and stream, < 0 if not + public static int av_write_uncoded_frame_query(AVFormatContext* @s, int @stream_index) => vectors.av_write_uncoded_frame_query(@s, @stream_index); + + /// Encode extradata length to a buffer. Used by xiph codecs. + /// buffer to write to; must be at least (v/255+1) bytes long + /// size of extradata in bytes + /// number of bytes written to the buffer. + public static uint av_xiphlacing(byte* @s, uint @v) => vectors.av_xiphlacing(@s, @v); + + /// Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you do not use any horizontal padding. + public static void avcodec_align_dimensions(AVCodecContext* @s, int* @width, int* @height) => vectors.avcodec_align_dimensions(@s, @width, @height); + + /// Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you also ensure that all line sizes are a multiple of the respective linesize_align[i]. + public static void avcodec_align_dimensions2(AVCodecContext* @s, int* @width, int* @height, ref int8 @linesize_align) => vectors.avcodec_align_dimensions2(@s, @width, @height, ref @linesize_align); + + /// Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext itself). + [Obsolete("Do not use this function. Use avcodec_free_context() to destroy a codec context (either open or closed). Opening and closing a codec context multiple times is not supported anymore -- use multiple codec contexts instead.")] + public static int avcodec_close(AVCodecContext* @avctx) => vectors.avcodec_close(@avctx); + + /// Return the libavcodec build-time configuration. + public static string avcodec_configuration() => vectors.avcodec_configuration(); + + /// Decode a subtitle message. Return a negative value on error, otherwise return the number of bytes used. If no subtitle could be decompressed, got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for simplicity, because the performance difference is expected to be negligible and reusing a get_buffer written for video codecs would probably perform badly due to a potentially very different allocation pattern. + /// the codec context + /// The preallocated AVSubtitle in which the decoded subtitle will be stored, must be freed with avsubtitle_free if *got_sub_ptr is set. + /// Zero if no subtitle could be decompressed, otherwise, it is nonzero. + /// The input AVPacket containing the input buffer. + public static int avcodec_decode_subtitle2(AVCodecContext* @avctx, AVSubtitle* @sub, int* @got_sub_ptr, AVPacket* @avpkt) => vectors.avcodec_decode_subtitle2(@avctx, @sub, @got_sub_ptr, @avpkt); + + public static int avcodec_default_execute(AVCodecContext* @c, avcodec_default_execute_func_func @func, void* @arg, int* @ret, int @count, int @size) => vectors.avcodec_default_execute(@c, @func, @arg, @ret, @count, @size); + + public static int avcodec_default_execute2(AVCodecContext* @c, avcodec_default_execute2_func_func @func, void* @arg, int* @ret, int @count) => vectors.avcodec_default_execute2(@c, @func, @arg, @ret, @count); + + /// The default callback for AVCodecContext.get_buffer2(). It is made public so it can be called by custom get_buffer2() implementations for decoders without AV_CODEC_CAP_DR1 set. + public static int avcodec_default_get_buffer2(AVCodecContext* @s, AVFrame* @frame, int @flags) => vectors.avcodec_default_get_buffer2(@s, @frame, @flags); + + /// The default callback for AVCodecContext.get_encode_buffer(). It is made public so it can be called by custom get_encode_buffer() implementations for encoders without AV_CODEC_CAP_DR1 set. + public static int avcodec_default_get_encode_buffer(AVCodecContext* @s, AVPacket* @pkt, int @flags) => vectors.avcodec_default_get_encode_buffer(@s, @pkt, @flags); + + public static AVPixelFormat avcodec_default_get_format(AVCodecContext* @s, AVPixelFormat* @fmt) => vectors.avcodec_default_get_format(@s, @fmt); + + /// Returns descriptor for given codec ID or NULL if no descriptor exists. + /// descriptor for given codec ID or NULL if no descriptor exists. + public static AVCodecDescriptor* avcodec_descriptor_get(AVCodecID @id) => vectors.avcodec_descriptor_get(@id); + + /// Returns codec descriptor with the given name or NULL if no such descriptor exists. + /// codec descriptor with the given name or NULL if no such descriptor exists. + public static AVCodecDescriptor* avcodec_descriptor_get_by_name(string @name) => vectors.avcodec_descriptor_get_by_name(@name); + + /// Iterate over all codec descriptors known to libavcodec. + /// previous descriptor. NULL to get the first descriptor. + /// next descriptor or NULL after the last descriptor + public static AVCodecDescriptor* avcodec_descriptor_next(AVCodecDescriptor* @prev) => vectors.avcodec_descriptor_next(@prev); + + /// @{ + public static int avcodec_encode_subtitle(AVCodecContext* @avctx, byte* @buf, int @buf_size, AVSubtitle* @sub) => vectors.avcodec_encode_subtitle(@avctx, @buf, @buf_size, @sub); + + /// Fill AVFrame audio data and linesize pointers. + /// the AVFrame frame->nb_samples must be set prior to calling the function. This function fills in frame->data, frame->extended_data, frame->linesize[0]. + /// channel count + /// sample format + /// buffer to use for frame data + /// size of buffer + /// plane size sample alignment (0 = default) + /// >=0 on success, negative error code on failure + public static int avcodec_fill_audio_frame(AVFrame* @frame, int @nb_channels, AVSampleFormat @sample_fmt, byte* @buf, int @buf_size, int @align) => vectors.avcodec_fill_audio_frame(@frame, @nb_channels, @sample_fmt, @buf, @buf_size, @align); + + /// Find the best pixel format to convert to given a certain source pixel format. When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of the given pixel formats should be used to suffer the least amount of loss. The pixel formats from which it chooses one, are determined by the pix_fmt_list parameter. + /// AV_PIX_FMT_NONE terminated array of pixel formats to choose from + /// source pixel format + /// Whether the source pixel format alpha channel is used. + /// Combination of flags informing you what kind of losses will occur. + /// The best pixel format to convert to or -1 if none was found. + public static AVPixelFormat avcodec_find_best_pix_fmt_of_list(AVPixelFormat* @pix_fmt_list, AVPixelFormat @src_pix_fmt, int @has_alpha, int* @loss_ptr) => vectors.avcodec_find_best_pix_fmt_of_list(@pix_fmt_list, @src_pix_fmt, @has_alpha, @loss_ptr); + + /// Find a registered decoder with a matching codec ID. + /// AVCodecID of the requested decoder + /// A decoder if one was found, NULL otherwise. + public static AVCodec* avcodec_find_decoder(AVCodecID @id) => vectors.avcodec_find_decoder(@id); + + /// Find a registered decoder with the specified name. + /// name of the requested decoder + /// A decoder if one was found, NULL otherwise. + public static AVCodec* avcodec_find_decoder_by_name(string @name) => vectors.avcodec_find_decoder_by_name(@name); + + /// Find a registered encoder with a matching codec ID. + /// AVCodecID of the requested encoder + /// An encoder if one was found, NULL otherwise. + public static AVCodec* avcodec_find_encoder(AVCodecID @id) => vectors.avcodec_find_encoder(@id); + + /// Find a registered encoder with the specified name. + /// name of the requested encoder + /// An encoder if one was found, NULL otherwise. + public static AVCodec* avcodec_find_encoder_by_name(string @name) => vectors.avcodec_find_encoder_by_name(@name); + + /// Get the AVClass for AVCodecContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + public static AVClass* avcodec_get_class() => vectors.avcodec_get_class(); + + /// Retrieve supported hardware configurations for a codec. + public static AVCodecHWConfig* avcodec_get_hw_config(AVCodec* @codec, int @index) => vectors.avcodec_get_hw_config(@codec, @index); + + /// Create and return a AVHWFramesContext with values adequate for hardware decoding. This is meant to get called from the get_format callback, and is a helper for preparing a AVHWFramesContext for AVCodecContext.hw_frames_ctx. This API is for decoding with certain hardware acceleration modes/APIs only. + /// The context which is currently calling get_format, and which implicitly contains all state needed for filling the returned AVHWFramesContext properly. + /// A reference to the AVHWDeviceContext describing the device which will be used by the hardware decoder. + /// The hwaccel format you are going to return from get_format. + /// On success, set to a reference to an _uninitialized_ AVHWFramesContext, created from the given device_ref. Fields will be set to values required for decoding. Not changed if an error is returned. + /// zero on success, a negative value on error. The following error codes have special semantics: AVERROR(ENOENT): the decoder does not support this functionality. Setup is always manual, or it is a decoder which does not support setting AVCodecContext.hw_frames_ctx at all, or it is a software format. AVERROR(EINVAL): it is known that hardware decoding is not supported for this configuration, or the device_ref is not supported for the hwaccel referenced by hw_pix_fmt. + public static int avcodec_get_hw_frames_parameters(AVCodecContext* @avctx, AVBufferRef* @device_ref, AVPixelFormat @hw_pix_fmt, AVBufferRef** @out_frames_ref) => vectors.avcodec_get_hw_frames_parameters(@avctx, @device_ref, @hw_pix_fmt, @out_frames_ref); + + /// Get the AVClass for AVSubtitleRect. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + public static AVClass* avcodec_get_subtitle_rect_class() => vectors.avcodec_get_subtitle_rect_class(); + + /// Get the type of the given codec. + public static AVMediaType avcodec_get_type(AVCodecID @codec_id) => vectors.avcodec_get_type(@codec_id); + + /// Returns a positive value if s is open (i.e. avcodec_open2() was called on it with no corresponding avcodec_close()), 0 otherwise. + /// a positive value if s is open (i.e. avcodec_open2() was called on it with no corresponding avcodec_close()), 0 otherwise. + public static int avcodec_is_open(AVCodecContext* @s) => vectors.avcodec_is_open(@s); + + /// Return the libavcodec license. + public static string avcodec_license() => vectors.avcodec_license(); + + /// Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0). The returned struct must be freed with avcodec_parameters_free(). + public static AVCodecParameters* avcodec_parameters_alloc() => vectors.avcodec_parameters_alloc(); + + /// Copy the contents of src to dst. Any allocated fields in dst are freed and replaced with newly allocated duplicates of the corresponding fields in src. + /// >= 0 on success, a negative AVERROR code on failure. + public static int avcodec_parameters_copy(AVCodecParameters* @dst, AVCodecParameters* @src) => vectors.avcodec_parameters_copy(@dst, @src); + + /// Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied pointer. + public static void avcodec_parameters_free(AVCodecParameters** @par) => vectors.avcodec_parameters_free(@par); + + /// Fill the parameters struct based on the values from the supplied codec context. Any allocated fields in par are freed and replaced with duplicates of the corresponding fields in codec. + /// >= 0 on success, a negative AVERROR code on failure + public static int avcodec_parameters_from_context(AVCodecParameters* @par, AVCodecContext* @codec) => vectors.avcodec_parameters_from_context(@par, @codec); + + /// Fill the codec context based on the values from the supplied codec parameters. Any allocated fields in codec that have a corresponding field in par are freed and replaced with duplicates of the corresponding field in par. Fields in codec that do not have a counterpart in par are not touched. + /// >= 0 on success, a negative AVERROR code on failure. + public static int avcodec_parameters_to_context(AVCodecContext* @codec, AVCodecParameters* @par) => vectors.avcodec_parameters_to_context(@codec, @par); + + /// Return a value representing the fourCC code associated to the pixel format pix_fmt, or 0 if no associated fourCC code can be found. + public static uint avcodec_pix_fmt_to_codec_tag(AVPixelFormat @pix_fmt) => vectors.avcodec_pix_fmt_to_codec_tag(@pix_fmt); + + /// Return a name for the specified profile, if available. + /// the ID of the codec to which the requested profile belongs + /// the profile value for which a name is requested + /// A name for the profile if found, NULL otherwise. + public static string avcodec_profile_name(AVCodecID @codec_id, int @profile) => vectors.avcodec_profile_name(@codec_id, @profile); + + /// Read encoded data from the encoder. + /// codec context + /// This will be set to a reference-counted packet allocated by the encoder. Note that the function will always call av_packet_unref(avpkt) before doing anything else. + public static int avcodec_receive_packet(AVCodecContext* @avctx, AVPacket* @avpkt) => vectors.avcodec_receive_packet(@avctx, @avpkt); + + /// Supply a raw video or audio frame to the encoder. Use avcodec_receive_packet() to retrieve buffered output packets. + /// codec context + /// AVFrame containing the raw audio or video frame to be encoded. Ownership of the frame remains with the caller, and the encoder will not write to the frame. The encoder may create a reference to the frame data (or copy it if the frame is not reference-counted). It can be NULL, in which case it is considered a flush packet. This signals the end of the stream. If the encoder still has packets buffered, it will return them after this call. Once flushing mode has been entered, additional flush packets are ignored, and sending frames will return AVERROR_EOF. + public static int avcodec_send_frame(AVCodecContext* @avctx, AVFrame* @frame) => vectors.avcodec_send_frame(@avctx, @frame); + + /// @} + public static void avcodec_string(byte* @buf, int @buf_size, AVCodecContext* @enc, int @encode) => vectors.avcodec_string(@buf, @buf_size, @enc, @encode); + + /// Return the LIBAVCODEC_VERSION_INT constant. + public static uint avcodec_version() => vectors.avcodec_version(); + + /// Send control message from application to device. + /// device context. + /// message type. + /// message data. Exact type depends on message type. + /// size of message data. + /// >= 0 on success, negative on error. AVERROR(ENOSYS) when device doesn't implement handler of the message. + public static int avdevice_app_to_dev_control_message(AVFormatContext* @s, AVAppToDevMessageType @type, void* @data, ulong @data_size) => vectors.avdevice_app_to_dev_control_message(@s, @type, @data, @data_size); + + /// Return the libavdevice build-time configuration. + public static string avdevice_configuration() => vectors.avdevice_configuration(); + + /// Send control message from device to application. + /// device context. + /// message type. + /// message data. Can be NULL. + /// size of message data. + /// >= 0 on success, negative on error. AVERROR(ENOSYS) when application doesn't implement handler of the message. + public static int avdevice_dev_to_app_control_message(AVFormatContext* @s, AVDevToAppMessageType @type, void* @data, ulong @data_size) => vectors.avdevice_dev_to_app_control_message(@s, @type, @data, @data_size); + + /// Convenient function to free result of avdevice_list_devices(). + /// device list to be freed. + public static void avdevice_free_list_devices(AVDeviceInfoList** @device_list) => vectors.avdevice_free_list_devices(@device_list); + + /// Return the libavdevice license. + public static string avdevice_license() => vectors.avdevice_license(); + + /// List devices. + /// device context. + /// list of autodetected devices. + /// count of autodetected devices, negative on error. + public static int avdevice_list_devices(AVFormatContext* @s, AVDeviceInfoList** @device_list) => vectors.avdevice_list_devices(@s, @device_list); + + /// List devices. + /// device format. May be NULL if device name is set. + /// device name. May be NULL if device format is set. + /// An AVDictionary filled with device-private options. May be NULL. The same options must be passed later to avformat_write_header() for output devices or avformat_open_input() for input devices, or at any other place that affects device-private options. + /// list of autodetected devices + /// count of autodetected devices, negative on error. + public static int avdevice_list_input_sources(AVInputFormat* @device, string @device_name, AVDictionary* @device_options, AVDeviceInfoList** @device_list) => vectors.avdevice_list_input_sources(@device, @device_name, @device_options, @device_list); + + public static int avdevice_list_output_sinks(AVOutputFormat* @device, string @device_name, AVDictionary* @device_options, AVDeviceInfoList** @device_list) => vectors.avdevice_list_output_sinks(@device, @device_name, @device_options, @device_list); + + /// Initialize libavdevice and register all the input and output devices. + public static void avdevice_register_all() => vectors.avdevice_register_all(); + + /// Return the LIBAVDEVICE_VERSION_INT constant. + public static uint avdevice_version() => vectors.avdevice_version(); + + [Obsolete("this function should never be called by users")] + public static int avfilter_config_links(AVFilterContext* @filter) => vectors.avfilter_config_links(@filter); + + /// Return the libavfilter build-time configuration. + public static string avfilter_configuration() => vectors.avfilter_configuration(); + + /// Get the number of elements in an AVFilter's inputs or outputs array. + public static uint avfilter_filter_pad_count(AVFilter* @filter, int @is_output) => vectors.avfilter_filter_pad_count(@filter, @is_output); + + /// Free a filter context. This will also remove the filter from its filtergraph's list of filters. + /// the filter to free + public static void avfilter_free(AVFilterContext* @filter) => vectors.avfilter_free(@filter); + + /// Get a filter definition matching the given name. + /// the filter name to find + /// the filter definition, if any matching one is registered. NULL if none found. + public static AVFilter* avfilter_get_by_name(string @name) => vectors.avfilter_get_by_name(@name); + + /// Returns AVClass for AVFilterContext. + /// AVClass for AVFilterContext. + public static AVClass* avfilter_get_class() => vectors.avfilter_get_class(); + + /// Allocate a filter graph. + /// the allocated filter graph on success or NULL. + public static AVFilterGraph* avfilter_graph_alloc() => vectors.avfilter_graph_alloc(); + + /// Create a new filter instance in a filter graph. + /// graph in which the new filter will be used + /// the filter to create an instance of + /// Name to give to the new instance (will be copied to AVFilterContext.name). This may be used by the caller to identify different filters, libavfilter itself assigns no semantics to this parameter. May be NULL. + /// the context of the newly created filter instance (note that it is also retrievable directly through AVFilterGraph.filters or with avfilter_graph_get_filter()) on success or NULL on failure. + public static AVFilterContext* avfilter_graph_alloc_filter(AVFilterGraph* @graph, AVFilter* @filter, string @name) => vectors.avfilter_graph_alloc_filter(@graph, @filter, @name); + + /// Check validity and configure all the links and formats in the graph. + /// the filter graph + /// context used for logging + /// >= 0 in case of success, a negative AVERROR code otherwise + public static int avfilter_graph_config(AVFilterGraph* @graphctx, void* @log_ctx) => vectors.avfilter_graph_config(@graphctx, @log_ctx); + + /// Create and add a filter instance into an existing graph. The filter instance is created from the filter filt and inited with the parameter args. opaque is currently ignored. + /// the instance name to give to the created filter instance + /// the filter graph + /// a negative AVERROR error code in case of failure, a non negative value otherwise + public static int avfilter_graph_create_filter(AVFilterContext** @filt_ctx, AVFilter* @filt, string @name, string @args, void* @opaque, AVFilterGraph* @graph_ctx) => vectors.avfilter_graph_create_filter(@filt_ctx, @filt, @name, @args, @opaque, @graph_ctx); + + /// Dump a graph into a human-readable string representation. + /// the graph to dump + /// formatting options; currently ignored + /// a string, or NULL in case of memory allocation failure; the string must be freed using av_free + public static byte* avfilter_graph_dump(AVFilterGraph* @graph, string @options) => vectors.avfilter_graph_dump(@graph, @options); + + /// Free a graph, destroy its links, and set *graph to NULL. If *graph is NULL, do nothing. + public static void avfilter_graph_free(AVFilterGraph** @graph) => vectors.avfilter_graph_free(@graph); + + /// Get a filter instance identified by instance name from graph. + /// filter graph to search through. + /// filter instance name (should be unique in the graph). + /// the pointer to the found filter instance or NULL if it cannot be found. + public static AVFilterContext* avfilter_graph_get_filter(AVFilterGraph* @graph, string @name) => vectors.avfilter_graph_get_filter(@graph, @name); + + /// Add a graph described by a string to a graph. + /// the filter graph where to link the parsed graph context + /// string to be parsed + /// linked list to the inputs of the graph + /// linked list to the outputs of the graph + /// zero on success, a negative AVERROR code on error + public static int avfilter_graph_parse(AVFilterGraph* @graph, string @filters, AVFilterInOut* @inputs, AVFilterInOut* @outputs, void* @log_ctx) => vectors.avfilter_graph_parse(@graph, @filters, @inputs, @outputs, @log_ctx); + + /// Add a graph described by a string to a graph. + /// the filter graph where to link the parsed graph context + /// string to be parsed + /// pointer to a linked list to the inputs of the graph, may be NULL. If non-NULL, *inputs is updated to contain the list of open inputs after the parsing, should be freed with avfilter_inout_free(). + /// pointer to a linked list to the outputs of the graph, may be NULL. If non-NULL, *outputs is updated to contain the list of open outputs after the parsing, should be freed with avfilter_inout_free(). + /// non negative on success, a negative AVERROR code on error + public static int avfilter_graph_parse_ptr(AVFilterGraph* @graph, string @filters, AVFilterInOut** @inputs, AVFilterInOut** @outputs, void* @log_ctx) => vectors.avfilter_graph_parse_ptr(@graph, @filters, @inputs, @outputs, @log_ctx); + + /// Add a graph described by a string to a graph. + /// the filter graph where to link the parsed graph context + /// string to be parsed + /// a linked list of all free (unlinked) inputs of the parsed graph will be returned here. It is to be freed by the caller using avfilter_inout_free(). + /// a linked list of all free (unlinked) outputs of the parsed graph will be returned here. It is to be freed by the caller using avfilter_inout_free(). + /// zero on success, a negative AVERROR code on error + public static int avfilter_graph_parse2(AVFilterGraph* @graph, string @filters, AVFilterInOut** @inputs, AVFilterInOut** @outputs) => vectors.avfilter_graph_parse2(@graph, @filters, @inputs, @outputs); + + /// Queue a command for one or more filter instances. + /// the filter graph + /// the filter(s) to which the command should be sent "all" sends to all filters otherwise it can be a filter or filter instance name which will send the command to all matching filters. + /// the command to sent, for handling simplicity all commands must be alphanumeric only + /// the argument for the command + /// time at which the command should be sent to the filter + public static int avfilter_graph_queue_command(AVFilterGraph* @graph, string @target, string @cmd, string @arg, int @flags, double @ts) => vectors.avfilter_graph_queue_command(@graph, @target, @cmd, @arg, @flags, @ts); + + /// Request a frame on the oldest sink link. + /// the return value of ff_request_frame(), or AVERROR_EOF if all links returned AVERROR_EOF + public static int avfilter_graph_request_oldest(AVFilterGraph* @graph) => vectors.avfilter_graph_request_oldest(@graph); + + /// Apply all filter/link descriptions from a graph segment to the associated filtergraph. + /// the filtergraph segment to process + /// reserved for future use, caller must set to 0 for now + /// passed to avfilter_graph_segment_link() + /// passed to avfilter_graph_segment_link() + public static int avfilter_graph_segment_apply(AVFilterGraphSegment* @seg, int @flags, AVFilterInOut** @inputs, AVFilterInOut** @outputs) => vectors.avfilter_graph_segment_apply(@seg, @flags, @inputs, @outputs); + + /// Apply parsed options to filter instances in a graph segment. + /// the filtergraph segment to process + /// reserved for future use, caller must set to 0 for now + public static int avfilter_graph_segment_apply_opts(AVFilterGraphSegment* @seg, int @flags) => vectors.avfilter_graph_segment_apply_opts(@seg, @flags); + + /// Create filters specified in a graph segment. + /// the filtergraph segment to process + /// reserved for future use, caller must set to 0 for now + public static int avfilter_graph_segment_create_filters(AVFilterGraphSegment* @seg, int @flags) => vectors.avfilter_graph_segment_create_filters(@seg, @flags); + + /// Free the provided AVFilterGraphSegment and everything associated with it. + /// double pointer to the AVFilterGraphSegment to be freed. NULL will be written to this pointer on exit from this function. + public static void avfilter_graph_segment_free(AVFilterGraphSegment** @seg) => vectors.avfilter_graph_segment_free(@seg); + + /// Initialize all filter instances in a graph segment. + /// the filtergraph segment to process + /// reserved for future use, caller must set to 0 for now + public static int avfilter_graph_segment_init(AVFilterGraphSegment* @seg, int @flags) => vectors.avfilter_graph_segment_init(@seg, @flags); + + /// Link filters in a graph segment. + /// the filtergraph segment to process + /// reserved for future use, caller must set to 0 for now + /// a linked list of all free (unlinked) inputs of the filters in this graph segment will be returned here. It is to be freed by the caller using avfilter_inout_free(). + /// a linked list of all free (unlinked) outputs of the filters in this graph segment will be returned here. It is to be freed by the caller using avfilter_inout_free(). + public static int avfilter_graph_segment_link(AVFilterGraphSegment* @seg, int @flags, AVFilterInOut** @inputs, AVFilterInOut** @outputs) => vectors.avfilter_graph_segment_link(@seg, @flags, @inputs, @outputs); + + /// Parse a textual filtergraph description into an intermediate form. + /// Filter graph the parsed segment is associated with. Will only be used for logging and similar auxiliary purposes. The graph will not be actually modified by this function - the parsing results are instead stored in seg for further processing. + /// a string describing the filtergraph segment + /// reserved for future use, caller must set to 0 for now + /// A pointer to the newly-created AVFilterGraphSegment is written here on success. The graph segment is owned by the caller and must be freed with avfilter_graph_segment_free() before graph itself is freed. + public static int avfilter_graph_segment_parse(AVFilterGraph* @graph, string @graph_str, int @flags, AVFilterGraphSegment** @seg) => vectors.avfilter_graph_segment_parse(@graph, @graph_str, @flags, @seg); + + /// Send a command to one or more filter instances. + /// the filter graph + /// the filter(s) to which the command should be sent "all" sends to all filters otherwise it can be a filter or filter instance name which will send the command to all matching filters. + /// the command to send, for handling simplicity all commands must be alphanumeric only + /// the argument for the command + /// a buffer with size res_size where the filter(s) can return a response. + public static int avfilter_graph_send_command(AVFilterGraph* @graph, string @target, string @cmd, string @arg, byte* @res, int @res_len, int @flags) => vectors.avfilter_graph_send_command(@graph, @target, @cmd, @arg, @res, @res_len, @flags); + + /// Enable or disable automatic format conversion inside the graph. + /// any of the AVFILTER_AUTO_CONVERT_* constants + public static void avfilter_graph_set_auto_convert(AVFilterGraph* @graph, uint @flags) => vectors.avfilter_graph_set_auto_convert(@graph, @flags); + + /// Initialize a filter with the supplied dictionary of options. + /// uninitialized filter context to initialize + /// An AVDictionary filled with options for this filter. On return this parameter will be destroyed and replaced with a dict containing options that were not found. This dictionary must be freed by the caller. May be NULL, then this function is equivalent to avfilter_init_str() with the second parameter set to NULL. + /// 0 on success, a negative AVERROR on failure + public static int avfilter_init_dict(AVFilterContext* @ctx, AVDictionary** @options) => vectors.avfilter_init_dict(@ctx, @options); + + /// Initialize a filter with the supplied parameters. + /// uninitialized filter context to initialize + /// Options to initialize the filter with. This must be a ':'-separated list of options in the 'key=value' form. May be NULL if the options have been set directly using the AVOptions API or there are no options that need to be set. + /// 0 on success, a negative AVERROR on failure + public static int avfilter_init_str(AVFilterContext* @ctx, string @args) => vectors.avfilter_init_str(@ctx, @args); + + /// Allocate a single AVFilterInOut entry. Must be freed with avfilter_inout_free(). + /// allocated AVFilterInOut on success, NULL on failure. + public static AVFilterInOut* avfilter_inout_alloc() => vectors.avfilter_inout_alloc(); + + /// Free the supplied list of AVFilterInOut and set *inout to NULL. If *inout is NULL, do nothing. + public static void avfilter_inout_free(AVFilterInOut** @inout) => vectors.avfilter_inout_free(@inout); + + /// Insert a filter in the middle of an existing link. + /// the link into which the filter should be inserted + /// the filter to be inserted + /// the input pad on the filter to connect + /// the output pad on the filter to connect + /// zero on success + public static int avfilter_insert_filter(AVFilterLink* @link, AVFilterContext* @filt, uint @filt_srcpad_idx, uint @filt_dstpad_idx) => vectors.avfilter_insert_filter(@link, @filt, @filt_srcpad_idx, @filt_dstpad_idx); + + /// Return the libavfilter license. + public static string avfilter_license() => vectors.avfilter_license(); + + /// Link two filters together. + /// the source filter + /// index of the output pad on the source filter + /// the destination filter + /// index of the input pad on the destination filter + /// zero on success + public static int avfilter_link(AVFilterContext* @src, uint @srcpad, AVFilterContext* @dst, uint @dstpad) => vectors.avfilter_link(@src, @srcpad, @dst, @dstpad); + + [Obsolete("this function should never be called by users")] + public static void avfilter_link_free(AVFilterLink** @link) => vectors.avfilter_link_free(@link); + + /// Get the name of an AVFilterPad. + /// an array of AVFilterPads + /// index of the pad in the array; it is the caller's responsibility to ensure the index is valid + /// name of the pad_idx'th pad in pads + public static string avfilter_pad_get_name(AVFilterPad* @pads, int @pad_idx) => vectors.avfilter_pad_get_name(@pads, @pad_idx); + + /// Get the type of an AVFilterPad. + /// an array of AVFilterPads + /// index of the pad in the array; it is the caller's responsibility to ensure the index is valid + /// type of the pad_idx'th pad in pads + public static AVMediaType avfilter_pad_get_type(AVFilterPad* @pads, int @pad_idx) => vectors.avfilter_pad_get_type(@pads, @pad_idx); + + /// Make the filter instance process a command. It is recommended to use avfilter_graph_send_command(). + public static int avfilter_process_command(AVFilterContext* @filter, string @cmd, string @arg, byte* @res, int @res_len, int @flags) => vectors.avfilter_process_command(@filter, @cmd, @arg, @res, @res_len, @flags); + + /// Return the LIBAVFILTER_VERSION_INT constant. + public static uint avfilter_version() => vectors.avfilter_version(); + + /// Allocate an AVFormatContext for an output format. avformat_free_context() can be used to free the context and everything allocated by the framework within it. + /// pointee is set to the created format context, or to NULL in case of failure + /// format to use for allocating the context, if NULL format_name and filename are used instead + /// the name of output format to use for allocating the context, if NULL filename is used instead + /// the name of the filename to use for allocating the context, may be NULL + /// >= 0 in case of success, a negative AVERROR code in case of failure + public static int avformat_alloc_output_context2(AVFormatContext** @ctx, AVOutputFormat* @oformat, string @format_name, string @filename) => vectors.avformat_alloc_output_context2(@ctx, @oformat, @format_name, @filename); + + /// Return the libavformat build-time configuration. + public static string avformat_configuration() => vectors.avformat_configuration(); + + /// Discard all internally buffered data. This can be useful when dealing with discontinuities in the byte stream. Generally works only with formats that can resync. This includes headerless formats like MPEG-TS/TS but should also work with NUT, Ogg and in a limited way AVI for example. + /// media file handle + /// >=0 on success, error code otherwise + public static int avformat_flush(AVFormatContext* @s) => vectors.avformat_flush(@s); + + /// Free an AVFormatContext and all its streams. + /// context to free + public static void avformat_free_context(AVFormatContext* @s) => vectors.avformat_free_context(@s); + + /// Get the AVClass for AVFormatContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + public static AVClass* avformat_get_class() => vectors.avformat_get_class(); + + /// Returns the table mapping MOV FourCCs for audio to AVCodecID. + /// the table mapping MOV FourCCs for audio to AVCodecID. + public static AVCodecTag* avformat_get_mov_audio_tags() => vectors.avformat_get_mov_audio_tags(); + + /// Returns the table mapping MOV FourCCs for video to libavcodec AVCodecID. + /// the table mapping MOV FourCCs for video to libavcodec AVCodecID. + public static AVCodecTag* avformat_get_mov_video_tags() => vectors.avformat_get_mov_video_tags(); + + /// Returns the table mapping RIFF FourCCs for audio to AVCodecID. + /// the table mapping RIFF FourCCs for audio to AVCodecID. + public static AVCodecTag* avformat_get_riff_audio_tags() => vectors.avformat_get_riff_audio_tags(); + + /// @{ Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the following code: + /// the table mapping RIFF FourCCs for video to libavcodec AVCodecID. + public static AVCodecTag* avformat_get_riff_video_tags() => vectors.avformat_get_riff_video_tags(); + + /// Get the index entry count for the given AVStream. + /// stream + /// the number of index entries in the stream + public static int avformat_index_get_entries_count(AVStream* @st) => vectors.avformat_index_get_entries_count(@st); + + /// Get the AVIndexEntry corresponding to the given index. + /// Stream containing the requested AVIndexEntry. + /// The desired index. + /// A pointer to the requested AVIndexEntry if it exists, NULL otherwise. + public static AVIndexEntry* avformat_index_get_entry(AVStream* @st, int @idx) => vectors.avformat_index_get_entry(@st, @idx); + + /// Get the AVIndexEntry corresponding to the given timestamp. + /// Stream containing the requested AVIndexEntry. + /// Timestamp to retrieve the index entry for. + /// If AVSEEK_FLAG_BACKWARD then the returned entry will correspond to the timestamp which is < = the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise. + /// A pointer to the requested AVIndexEntry if it exists, NULL otherwise. + public static AVIndexEntry* avformat_index_get_entry_from_timestamp(AVStream* @st, long @wanted_timestamp, int @flags) => vectors.avformat_index_get_entry_from_timestamp(@st, @wanted_timestamp, @flags); + + /// Allocate the stream private data and initialize the codec, but do not write the header. May optionally be used before avformat_write_header() to initialize stream parameters before actually writing the header. If using this function, do not pass the same options to avformat_write_header(). + /// Media file handle, must be allocated with avformat_alloc_context(). Its "oformat" field must be set to the desired output format; Its "pb" field must be set to an already opened ::AVIOContext. + /// An ::AVDictionary filled with AVFormatContext and muxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. + public static int avformat_init_output(AVFormatContext* @s, AVDictionary** @options) => vectors.avformat_init_output(@s, @options); + + /// Return the libavformat license. + public static string avformat_license() => vectors.avformat_license(); + + /// Check if the stream st contained in s is matched by the stream specifier spec. + /// >0 if st is matched by spec; 0 if st is not matched by spec; AVERROR code if spec is invalid + public static int avformat_match_stream_specifier(AVFormatContext* @s, AVStream* @st, string @spec) => vectors.avformat_match_stream_specifier(@s, @st, @spec); + + /// Undo the initialization done by avformat_network_init. Call it only once for each time you called avformat_network_init. + public static int avformat_network_deinit() => vectors.avformat_network_deinit(); + + /// Do global initialization of network libraries. This is optional, and not recommended anymore. + public static int avformat_network_init() => vectors.avformat_network_init(); + + /// Add a new stream to a media file. + /// media file handle + /// unused, does nothing + /// newly created stream or NULL on error. + public static AVStream* avformat_new_stream(AVFormatContext* @s, AVCodec* @c) => vectors.avformat_new_stream(@s, @c); + + /// Test if the given container can store a codec. + /// container to check for compatibility + /// codec to potentially store in container + /// standards compliance level, one of FF_COMPLIANCE_* + /// 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. A negative number if this information is not available. + public static int avformat_query_codec(AVOutputFormat* @ofmt, AVCodecID @codec_id, int @std_compliance) => vectors.avformat_query_codec(@ofmt, @codec_id, @std_compliance); + + public static int avformat_queue_attached_pictures(AVFormatContext* @s) => vectors.avformat_queue_attached_pictures(@s); + + /// Add an already allocated stream to a stream group. + /// stream group belonging to a media file. + /// stream in the media file to add to the group. + public static int avformat_stream_group_add_stream(AVStreamGroup* @stg, AVStream* @st) => vectors.avformat_stream_group_add_stream(@stg, @st); + + /// Add a new empty stream group to a media file. + /// media file handle + /// newly created group or NULL on error. + public static AVStreamGroup* avformat_stream_group_create(AVFormatContext* @s, AVStreamGroupParamsType @type, AVDictionary** @options) => vectors.avformat_stream_group_create(@s, @type, @options); + + /// Returns a string identifying the stream group type, or NULL if unknown + /// a string identifying the stream group type, or NULL if unknown + public static string avformat_stream_group_name(AVStreamGroupParamsType @type) => vectors.avformat_stream_group_name(@type); + + /// Transfer internal timing information from one stream to another. + /// target output format for ost + /// output stream which needs timings copy and adjustments + /// reference input stream to copy timings from + /// define from where the stream codec timebase needs to be imported + public static int avformat_transfer_internal_stream_timing_info(AVOutputFormat* @ofmt, AVStream* @ost, AVStream* @ist, AVTimebaseSource @copy_tb) => vectors.avformat_transfer_internal_stream_timing_info(@ofmt, @ost, @ist, @copy_tb); + + /// Return the LIBAVFORMAT_VERSION_INT constant. + public static uint avformat_version() => vectors.avformat_version(); + + /// Allocate the stream private data and write the stream header to an output media file. + /// Media file handle, must be allocated with avformat_alloc_context(). Its "oformat" field must be set to the desired output format; Its "pb" field must be set to an already opened ::AVIOContext. + /// An ::AVDictionary filled with AVFormatContext and muxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. + public static int avformat_write_header(AVFormatContext* @s, AVDictionary** @options) => vectors.avformat_write_header(@s, @options); + + /// Accept and allocate a client context on a server context. + /// the server context + /// the client context, must be unallocated + /// >= 0 on success or a negative value corresponding to an AVERROR on failure + public static int avio_accept(AVIOContext* @s, AVIOContext** @c) => vectors.avio_accept(@s, @c); + + /// Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url, or a negative value corresponding to an AVERROR code in case of failure. The returned access flags are masked by the value in flags. + public static int avio_check(string @url, int @flags) => vectors.avio_check(@url, @flags); + + /// Close the resource accessed by the AVIOContext s and free it. This function can only be used if s was opened by avio_open(). + /// 0 on success, an AVERROR < 0 on error. + public static int avio_close(AVIOContext* @s) => vectors.avio_close(@s); + + /// Close directory. + /// directory read context. + /// >=0 on success or negative on error. + public static int avio_close_dir(AVIODirContext** @s) => vectors.avio_close_dir(@s); + + /// Return the written size and a pointer to the buffer. The buffer must be freed with av_free(). Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer. + /// IO context + /// pointer to a byte buffer + /// the length of the byte buffer + public static int avio_close_dyn_buf(AVIOContext* @s, byte** @pbuffer) => vectors.avio_close_dyn_buf(@s, @pbuffer); + + /// Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL. This function can only be used if s was opened by avio_open(). + /// 0 on success, an AVERROR < 0 on error. + public static int avio_closep(AVIOContext** @s) => vectors.avio_closep(@s); + + /// Iterate through names of available protocols. + /// A private pointer representing current protocol. It must be a pointer to NULL on first iteration and will be updated by successive calls to avio_enum_protocols. + /// If set to 1, iterate over output protocols, otherwise over input protocols. + /// A static string containing the name of current protocol or NULL + public static string avio_enum_protocols(void** @opaque, int @output) => vectors.avio_enum_protocols(@opaque, @output); + + /// Similar to feof() but also returns nonzero on read errors. + /// non zero if and only if at end of file or a read error happened when reading. + public static int avio_feof(AVIOContext* @s) => vectors.avio_feof(@s); + + /// Return the name of the protocol that will handle the passed URL. + /// Name of the protocol or NULL. + public static string avio_find_protocol_name(string @url) => vectors.avio_find_protocol_name(@url); + + /// Force flushing of buffered data. + public static void avio_flush(AVIOContext* @s) => vectors.avio_flush(@s); + + /// Free entry allocated by avio_read_dir(). + /// entry to be freed. + public static void avio_free_directory_entry(AVIODirEntry** @entry) => vectors.avio_free_directory_entry(@entry); + + /// Return the written size and a pointer to the buffer. The AVIOContext stream is left intact. The buffer must NOT be freed. No padding is added to the buffer. + /// IO context + /// pointer to a byte buffer + /// the length of the byte buffer + public static int avio_get_dyn_buf(AVIOContext* @s, byte** @pbuffer) => vectors.avio_get_dyn_buf(@s, @pbuffer); + + /// Read a string from pb into buf. The reading will terminate when either a NULL character was encountered, maxlen bytes have been read, or nothing more can be read from pb. The result is guaranteed to be NULL-terminated, it will be truncated if buf is too small. Note that the string is not interpreted or validated in any way, it might get truncated in the middle of a sequence for multi-byte encodings. + /// number of bytes read (is always < = maxlen). If reading ends on EOF or error, the return value will be one more than bytes actually read. + public static int avio_get_str(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen) => vectors.avio_get_str(@pb, @maxlen, @buf, @buflen); + + public static int avio_get_str16be(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen) => vectors.avio_get_str16be(@pb, @maxlen, @buf, @buflen); + + /// Read a UTF-16 string from pb and convert it to UTF-8. The reading will terminate when either a null or invalid character was encountered or maxlen bytes have been read. + /// number of bytes read (is always < = maxlen) + public static int avio_get_str16le(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen) => vectors.avio_get_str16le(@pb, @maxlen, @buf, @buflen); + + /// Perform one step of the protocol handshake to accept a new client. This function must be called on a client returned by avio_accept() before using it as a read/write context. It is separate from avio_accept() because it may block. A step of the handshake is defined by places where the application may decide to change the proceedings. For example, on a protocol with a request header and a reply header, each one can constitute a step because the application may use the parameters from the request to change parameters in the reply; or each individual chunk of the request can constitute a step. If the handshake is already finished, avio_handshake() does nothing and returns 0 immediately. + /// the client context to perform the handshake on + /// 0 on a complete and successful handshake > 0 if the handshake progressed, but is not complete < 0 for an AVERROR code + public static int avio_handshake(AVIOContext* @c) => vectors.avio_handshake(@c); + + /// Create and initialize a AVIOContext for accessing the resource indicated by url. + /// Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL. + /// resource to access + /// flags which control how the resource indicated by url is to be opened + /// >= 0 in case of success, a negative value corresponding to an AVERROR code in case of failure + public static int avio_open(AVIOContext** @s, string @url, int @flags) => vectors.avio_open(@s, @url, @flags); + + /// Open directory for reading. + /// directory read context. Pointer to a NULL pointer must be passed. + /// directory to be listed. + /// A dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dictionary containing options that were not found. May be NULL. + /// >=0 on success or negative on error. + public static int avio_open_dir(AVIODirContext** @s, string @url, AVDictionary** @options) => vectors.avio_open_dir(@s, @url, @options); + + /// Open a write only memory stream. + /// new IO context + /// zero if no error. + public static int avio_open_dyn_buf(AVIOContext** @s) => vectors.avio_open_dyn_buf(@s); + + /// Create and initialize a AVIOContext for accessing the resource indicated by url. + /// Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL. + /// resource to access + /// flags which control how the resource indicated by url is to be opened + /// an interrupt callback to be used at the protocols level + /// A dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. + /// >= 0 in case of success, a negative value corresponding to an AVERROR code in case of failure + public static int avio_open2(AVIOContext** @s, string @url, int @flags, AVIOInterruptCB* @int_cb, AVDictionary** @options) => vectors.avio_open2(@s, @url, @flags, @int_cb, @options); + + /// Pause and resume playing - only meaningful if using a network streaming protocol (e.g. MMS). + /// IO context from which to call the read_pause function pointer + /// 1 for pause, 0 for resume + public static int avio_pause(AVIOContext* @h, int @pause) => vectors.avio_pause(@h, @pause); + + /// Write a NULL terminated array of strings to the context. Usually you don't need to use this function directly but its macro wrapper, avio_print. + public static void avio_print_string_array(AVIOContext* @s, byte*[] @strings) => vectors.avio_print_string_array(@s, @strings); + + /// Writes a formatted string to the context. + /// number of bytes written, < 0 on error. + public static int avio_printf(AVIOContext* @s, string @fmt) => vectors.avio_printf(@s, @fmt); + + /// Get AVClass by names of available protocols. + /// A AVClass of input protocol name or NULL + public static AVClass* avio_protocol_get_class(string @name) => vectors.avio_protocol_get_class(@name); + + /// Write a NULL-terminated string. + /// number of bytes written. + public static int avio_put_str(AVIOContext* @s, string @str) => vectors.avio_put_str(@s, @str); + + /// Convert an UTF-8 string to UTF-16BE and write it. + /// the AVIOContext + /// NULL-terminated UTF-8 string + /// number of bytes written. + public static int avio_put_str16be(AVIOContext* @s, string @str) => vectors.avio_put_str16be(@s, @str); + + /// Convert an UTF-8 string to UTF-16LE and write it. + /// the AVIOContext + /// NULL-terminated UTF-8 string + /// number of bytes written. + public static int avio_put_str16le(AVIOContext* @s, string @str) => vectors.avio_put_str16le(@s, @str); + + /// @{ + public static int avio_r8(AVIOContext* @s) => vectors.avio_r8(@s); + + public static uint avio_rb16(AVIOContext* @s) => vectors.avio_rb16(@s); + + public static uint avio_rb24(AVIOContext* @s) => vectors.avio_rb24(@s); + + public static uint avio_rb32(AVIOContext* @s) => vectors.avio_rb32(@s); + + public static ulong avio_rb64(AVIOContext* @s) => vectors.avio_rb64(@s); + + /// Read size bytes from AVIOContext into buf. + /// number of bytes read or AVERROR + public static int avio_read(AVIOContext* @s, byte* @buf, int @size) => vectors.avio_read(@s, @buf, @size); + + /// Get next directory entry. + /// directory read context. + /// next entry or NULL when no more entries. + /// >=0 on success or negative on error. End of list is not considered an error. + public static int avio_read_dir(AVIODirContext* @s, AVIODirEntry** @next) => vectors.avio_read_dir(@s, @next); + + /// Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed to read fewer bytes than requested. The missing bytes can be read in the next call. This always tries to read at least 1 byte. Useful to reduce latency in certain cases. + /// number of bytes read or AVERROR + public static int avio_read_partial(AVIOContext* @s, byte* @buf, int @size) => vectors.avio_read_partial(@s, @buf, @size); + + /// Read contents of h into print buffer, up to max_size bytes, or up to EOF. + /// 0 for success (max_size bytes read or EOF reached), negative error code otherwise + public static int avio_read_to_bprint(AVIOContext* @h, AVBPrint* @pb, ulong @max_size) => vectors.avio_read_to_bprint(@h, @pb, @max_size); + + public static uint avio_rl16(AVIOContext* @s) => vectors.avio_rl16(@s); + + public static uint avio_rl24(AVIOContext* @s) => vectors.avio_rl24(@s); + + public static uint avio_rl32(AVIOContext* @s) => vectors.avio_rl32(@s); + + public static ulong avio_rl64(AVIOContext* @s) => vectors.avio_rl64(@s); + + /// fseek() equivalent for AVIOContext. + /// new position or AVERROR. + public static long avio_seek(AVIOContext* @s, long @offset, int @whence) => vectors.avio_seek(@s, @offset, @whence); + + /// Seek to a given timestamp relative to some component stream. Only meaningful if using a network streaming protocol (e.g. MMS.). + /// IO context from which to call the seek function pointers + /// The stream index that the timestamp is relative to. If stream_index is (-1) the timestamp should be in AV_TIME_BASE units from the beginning of the presentation. If a stream_index >= 0 is used and the protocol does not support seeking based on component streams, the call will fail. + /// timestamp in AVStream.time_base units or if there is no stream specified then in AV_TIME_BASE units. + /// Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE and AVSEEK_FLAG_ANY. The protocol may silently ignore AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will fail if used and not supported. + /// >= 0 on success + public static long avio_seek_time(AVIOContext* @h, int @stream_index, long @timestamp, int @flags) => vectors.avio_seek_time(@h, @stream_index, @timestamp, @flags); + + /// Get the filesize. + /// filesize or AVERROR + public static long avio_size(AVIOContext* @s) => vectors.avio_size(@s); + + /// Skip given number of bytes forward + /// new position or AVERROR. + public static long avio_skip(AVIOContext* @s, long @offset) => vectors.avio_skip(@s, @offset); + + /// Writes a formatted string to the context taking a va_list. + /// number of bytes written, < 0 on error. + public static int avio_vprintf(AVIOContext* @s, string @fmt, byte* @ap) => vectors.avio_vprintf(@s, @fmt, @ap); + + public static void avio_w8(AVIOContext* @s, int @b) => vectors.avio_w8(@s, @b); + + public static void avio_wb16(AVIOContext* @s, uint @val) => vectors.avio_wb16(@s, @val); + + public static void avio_wb24(AVIOContext* @s, uint @val) => vectors.avio_wb24(@s, @val); + + public static void avio_wb32(AVIOContext* @s, uint @val) => vectors.avio_wb32(@s, @val); + + public static void avio_wb64(AVIOContext* @s, ulong @val) => vectors.avio_wb64(@s, @val); + + public static void avio_wl16(AVIOContext* @s, uint @val) => vectors.avio_wl16(@s, @val); + + public static void avio_wl24(AVIOContext* @s, uint @val) => vectors.avio_wl24(@s, @val); + + public static void avio_wl32(AVIOContext* @s, uint @val) => vectors.avio_wl32(@s, @val); + + public static void avio_wl64(AVIOContext* @s, ulong @val) => vectors.avio_wl64(@s, @val); + + public static void avio_write(AVIOContext* @s, byte* @buf, int @size) => vectors.avio_write(@s, @buf, @size); + + /// Mark the written bytestream as a specific type. + /// the AVIOContext + /// the stream time the current bytestream pos corresponds to (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not applicable + /// the kind of data written starting at the current pos + public static void avio_write_marker(AVIOContext* @s, long @time, AVIODataMarkerType @type) => vectors.avio_write_marker(@s, @time, @type); + + /// Free all allocated data in the given subtitle struct. + /// AVSubtitle to free. + public static void avsubtitle_free(AVSubtitle* @sub) => vectors.avsubtitle_free(@sub); + + /// Return the libavutil build-time configuration. + public static string avutil_configuration() => vectors.avutil_configuration(); + + /// Return the libavutil license. + public static string avutil_license() => vectors.avutil_license(); + + /// Return the LIBAVUTIL_VERSION_INT constant. + public static uint avutil_version() => vectors.avutil_version(); + + /// Return the libpostproc build-time configuration. + public static string postproc_configuration() => vectors.postproc_configuration(); + + /// Return the libpostproc license. + public static string postproc_license() => vectors.postproc_license(); + + /// Return the LIBPOSTPROC_VERSION_INT constant. + public static uint postproc_version() => vectors.postproc_version(); + + public static void pp_free_context(void* @ppContext) => vectors.pp_free_context(@ppContext); + + public static void pp_free_mode(void* @mode) => vectors.pp_free_mode(@mode); + + public static void* pp_get_context(int @width, int @height, int @flags) => vectors.pp_get_context(@width, @height, @flags); + + /// Return a pp_mode or NULL if an error occurred. + /// the string after "-pp" on the command line + /// a number from 0 to PP_QUALITY_MAX + public static void* pp_get_mode_by_name_and_quality(string @name, int @quality) => vectors.pp_get_mode_by_name_and_quality(@name, @quality); + + public static void pp_postprocess(in byte_ptr3 @src, in int3 @srcStride, ref byte_ptr3 @dst, in int3 @dstStride, int @horizontalSize, int @verticalSize, sbyte* @QP_store, int @QP_stride, void* @mode, void* @ppContext, int @pict_type) => vectors.pp_postprocess(@src, @srcStride, ref @dst, @dstStride, @horizontalSize, @verticalSize, @QP_store, @QP_stride, @mode, @ppContext, @pict_type); + + /// Allocate SwrContext. + /// NULL on error, allocated context otherwise + public static SwrContext* swr_alloc() => vectors.swr_alloc(); + + /// Allocate SwrContext if needed and set/reset common parameters. + /// Pointer to an existing Swr context if available, or to NULL if not. On success, *ps will be set to the allocated context. + /// output channel layout (e.g. AV_CHANNEL_LAYOUT_*) + /// output sample format (AV_SAMPLE_FMT_*). + /// output sample rate (frequency in Hz) + /// input channel layout (e.g. AV_CHANNEL_LAYOUT_*) + /// input sample format (AV_SAMPLE_FMT_*). + /// input sample rate (frequency in Hz) + /// logging level offset + /// parent logging context, can be NULL + /// 0 on success, a negative AVERROR code on error. On error, the Swr context is freed and *ps set to NULL. + public static int swr_alloc_set_opts2(SwrContext** @ps, AVChannelLayout* @out_ch_layout, AVSampleFormat @out_sample_fmt, int @out_sample_rate, AVChannelLayout* @in_ch_layout, AVSampleFormat @in_sample_fmt, int @in_sample_rate, int @log_offset, void* @log_ctx) => vectors.swr_alloc_set_opts2(@ps, @out_ch_layout, @out_sample_fmt, @out_sample_rate, @in_ch_layout, @in_sample_fmt, @in_sample_rate, @log_offset, @log_ctx); + + /// Generate a channel mixing matrix. + /// input channel layout + /// output channel layout + /// mix level for the center channel + /// mix level for the surround channel(s) + /// mix level for the low-frequency effects channel + /// mixing coefficients; matrix[i + stride * o] is the weight of input channel i in output channel o. + /// distance between adjacent input channels in the matrix array + /// matrixed stereo downmix mode (e.g. dplii) + /// 0 on success, negative AVERROR code on failure + public static int swr_build_matrix2(AVChannelLayout* @in_layout, AVChannelLayout* @out_layout, double @center_mix_level, double @surround_mix_level, double @lfe_mix_level, double @maxval, double @rematrix_volume, double* @matrix, long @stride, AVMatrixEncoding @matrix_encoding, void* @log_context) => vectors.swr_build_matrix2(@in_layout, @out_layout, @center_mix_level, @surround_mix_level, @lfe_mix_level, @maxval, @rematrix_volume, @matrix, @stride, @matrix_encoding, @log_context); + + /// Closes the context so that swr_is_initialized() returns 0. + /// Swr context to be closed + public static void swr_close(SwrContext* @s) => vectors.swr_close(@s); + + /// Configure or reconfigure the SwrContext using the information provided by the AVFrames. + /// audio resample context + /// output AVFrame + /// input AVFrame + /// 0 on success, AVERROR on failure. + public static int swr_config_frame(SwrContext* @swr, AVFrame* @out, AVFrame* @in) => vectors.swr_config_frame(@swr, @out, @in); + + /// Convert audio. + /// allocated Swr context, with parameters set + /// output buffers, only the first one need be set in case of packed audio + /// amount of space available for output in samples per channel + /// input buffers, only the first one need to be set in case of packed audio + /// number of input samples available in one channel + /// number of samples output per channel, negative value on error + public static int swr_convert(SwrContext* @s, byte** @out, int @out_count, byte** @in, int @in_count) => vectors.swr_convert(@s, @out, @out_count, @in, @in_count); + + /// Convert the samples in the input AVFrame and write them to the output AVFrame. + /// audio resample context + /// output AVFrame + /// input AVFrame + /// 0 on success, AVERROR on failure or nonmatching configuration. + public static int swr_convert_frame(SwrContext* @swr, AVFrame* @output, AVFrame* @input) => vectors.swr_convert_frame(@swr, @output, @input); + + /// Drops the specified number of output samples. + /// allocated Swr context + /// number of samples to be dropped + /// >= 0 on success, or a negative AVERROR code on failure + public static int swr_drop_output(SwrContext* @s, int @count) => vectors.swr_drop_output(@s, @count); + + /// Free the given SwrContext and set the pointer to NULL. + /// a pointer to a pointer to Swr context + public static void swr_free(SwrContext** @s) => vectors.swr_free(@s); + + /// Get the AVClass for SwrContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + /// the AVClass of SwrContext + public static AVClass* swr_get_class() => vectors.swr_get_class(); + + /// Gets the delay the next input sample will experience relative to the next output sample. + /// swr context + /// timebase in which the returned delay will be: + public static long swr_get_delay(SwrContext* @s, long @base) => vectors.swr_get_delay(@s, @base); + + /// Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples. This depends on the internal state, and anything changing the internal state (like further swr_convert() calls) will may change the number of samples swr_get_out_samples() returns for the same number of input samples. + /// number of input samples. + public static int swr_get_out_samples(SwrContext* @s, int @in_samples) => vectors.swr_get_out_samples(@s, @in_samples); + + /// Initialize context after user parameters have been set. + /// Swr context to initialize + /// AVERROR error code in case of failure. + public static int swr_init(SwrContext* @s) => vectors.swr_init(@s); + + /// Injects the specified number of silence samples. + /// allocated Swr context + /// number of samples to be dropped + /// >= 0 on success, or a negative AVERROR code on failure + public static int swr_inject_silence(SwrContext* @s, int @count) => vectors.swr_inject_silence(@s, @count); + + /// Check whether an swr context has been initialized or not. + /// Swr context to check + /// positive if it has been initialized, 0 if not initialized + public static int swr_is_initialized(SwrContext* @s) => vectors.swr_is_initialized(@s); + + /// Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate) units. + /// initialized Swr context + /// timestamp for the next input sample, INT64_MIN if unknown + /// the output timestamp for the next output sample + public static long swr_next_pts(SwrContext* @s, long @pts) => vectors.swr_next_pts(@s, @pts); + + /// Set a customized input channel mapping. + /// allocated Swr context, not yet initialized + /// customized input channel mapping (array of channel indexes, -1 for a muted channel) + /// >= 0 on success, or AVERROR error code in case of failure. + public static int swr_set_channel_mapping(SwrContext* @s, int* @channel_map) => vectors.swr_set_channel_mapping(@s, @channel_map); + + /// Activate resampling compensation ("soft" compensation). This function is internally called when needed in swr_next_pts(). + /// allocated Swr context. If it is not initialized, or SWR_FLAG_RESAMPLE is not set, swr_init() is called with the flag set. + /// delta in PTS per sample + /// number of samples to compensate for + /// >= 0 on success, AVERROR error codes if: + public static int swr_set_compensation(SwrContext* @s, int @sample_delta, int @compensation_distance) => vectors.swr_set_compensation(@s, @sample_delta, @compensation_distance); + + /// Set a customized remix matrix. + /// allocated Swr context, not yet initialized + /// remix coefficients; matrix[i + stride * o] is the weight of input channel i in output channel o + /// offset between lines of the matrix + /// >= 0 on success, or AVERROR error code in case of failure. + public static int swr_set_matrix(SwrContext* @s, double* @matrix, int @stride) => vectors.swr_set_matrix(@s, @matrix, @stride); + + /// Return the swr build-time configuration. + public static string swresample_configuration() => vectors.swresample_configuration(); + + /// Return the swr license. + public static string swresample_license() => vectors.swresample_license(); + + /// Return the LIBSWRESAMPLE_VERSION_INT constant. + public static uint swresample_version() => vectors.swresample_version(); + + /// Allocate an empty SwsContext. This must be filled and passed to sws_init_context(). For filling see AVOptions, options.c and sws_setColorspaceDetails(). + public static SwsContext* sws_alloc_context() => vectors.sws_alloc_context(); + + /// Allocate and return an uninitialized vector with length coefficients. + public static SwsVector* sws_allocVec(int @length) => vectors.sws_allocVec(@length); + + /// Convert an 8-bit paletted frame into a frame with a color depth of 24 bits. + /// source frame buffer + /// destination frame buffer + /// number of pixels to convert + /// array with [256] entries, which must match color arrangement (RGB or BGR) of src + public static void sws_convertPalette8ToPacked24(byte* @src, byte* @dst, int @num_pixels, byte* @palette) => vectors.sws_convertPalette8ToPacked24(@src, @dst, @num_pixels, @palette); + + /// Convert an 8-bit paletted frame into a frame with a color depth of 32 bits. + /// source frame buffer + /// destination frame buffer + /// number of pixels to convert + /// array with [256] entries, which must match color arrangement (RGB or BGR) of src + public static void sws_convertPalette8ToPacked32(byte* @src, byte* @dst, int @num_pixels, byte* @palette) => vectors.sws_convertPalette8ToPacked32(@src, @dst, @num_pixels, @palette); + + /// Finish the scaling process for a pair of source/destination frames previously submitted with sws_frame_start(). Must be called after all sws_send_slice() and sws_receive_slice() calls are done, before any new sws_frame_start() calls. + /// The scaling context + public static void sws_frame_end(SwsContext* @c) => vectors.sws_frame_end(@c); + + /// Initialize the scaling process for a given pair of source/destination frames. Must be called before any calls to sws_send_slice() and sws_receive_slice(). + /// The scaling context + /// The destination frame. + /// The source frame. The data buffers must be allocated, but the frame data does not have to be ready at this point. Data availability is then signalled by sws_send_slice(). + /// 0 on success, a negative AVERROR code on failure + public static int sws_frame_start(SwsContext* @c, AVFrame* @dst, AVFrame* @src) => vectors.sws_frame_start(@c, @dst, @src); + + /// Free the swscaler context swsContext. If swsContext is NULL, then does nothing. + public static void sws_freeContext(SwsContext* @swsContext) => vectors.sws_freeContext(@swsContext); + + public static void sws_freeFilter(SwsFilter* @filter) => vectors.sws_freeFilter(@filter); + + public static void sws_freeVec(SwsVector* @a) => vectors.sws_freeVec(@a); + + /// Get the AVClass for swsContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options. + public static AVClass* sws_get_class() => vectors.sws_get_class(); + + /// Check if context can be reused, otherwise reallocate a new one. + public static SwsContext* sws_getCachedContext(SwsContext* @context, int @srcW, int @srcH, AVPixelFormat @srcFormat, int @dstW, int @dstH, AVPixelFormat @dstFormat, int @flags, SwsFilter* @srcFilter, SwsFilter* @dstFilter, double* @param) => vectors.sws_getCachedContext(@context, @srcW, @srcH, @srcFormat, @dstW, @dstH, @dstFormat, @flags, @srcFilter, @dstFilter, @param); + + /// Return a pointer to yuv<->rgb coefficients for the given colorspace suitable for sws_setColorspaceDetails(). + /// One of the SWS_CS_* macros. If invalid, SWS_CS_DEFAULT is used. + public static int* sws_getCoefficients(int @colorspace) => vectors.sws_getCoefficients(@colorspace); + + /// Returns A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. + /// A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. + public static int sws_getColorspaceDetails(SwsContext* @c, int** @inv_table, int* @srcRange, int** @table, int* @dstRange, int* @brightness, int* @contrast, int* @saturation) => vectors.sws_getColorspaceDetails(@c, @inv_table, @srcRange, @table, @dstRange, @brightness, @contrast, @saturation); + + /// Allocate and return an SwsContext. You need it to perform scaling/conversion operations using sws_scale(). + /// the width of the source image + /// the height of the source image + /// the source image format + /// the width of the destination image + /// the height of the destination image + /// the destination image format + /// specify which algorithm and options to use for rescaling + /// extra parameters to tune the used scaler For SWS_BICUBIC param[0] and [1] tune the shape of the basis function, param[0] tunes f(1) and param[1] f´(1) For SWS_GAUSS param[0] tunes the exponent and thus cutoff frequency For SWS_LANCZOS param[0] tunes the width of the window function + /// a pointer to an allocated context, or NULL in case of error + public static SwsContext* sws_getContext(int @srcW, int @srcH, AVPixelFormat @srcFormat, int @dstW, int @dstH, AVPixelFormat @dstFormat, int @flags, SwsFilter* @srcFilter, SwsFilter* @dstFilter, double* @param) => vectors.sws_getContext(@srcW, @srcH, @srcFormat, @dstW, @dstH, @dstFormat, @flags, @srcFilter, @dstFilter, @param); + + public static SwsFilter* sws_getDefaultFilter(float @lumaGBlur, float @chromaGBlur, float @lumaSharpen, float @chromaSharpen, float @chromaHShift, float @chromaVShift, int @verbose) => vectors.sws_getDefaultFilter(@lumaGBlur, @chromaGBlur, @lumaSharpen, @chromaSharpen, @chromaHShift, @chromaVShift, @verbose); + + /// Return a normalized Gaussian curve used to filter stuff quality = 3 is high quality, lower is lower quality. + public static SwsVector* sws_getGaussianVec(double @variance, double @quality) => vectors.sws_getGaussianVec(@variance, @quality); + + /// Initialize the swscaler context sws_context. + /// zero or positive value on success, a negative value on error + public static int sws_init_context(SwsContext* @sws_context, SwsFilter* @srcFilter, SwsFilter* @dstFilter) => vectors.sws_init_context(@sws_context, @srcFilter, @dstFilter); + + /// Returns a positive value if an endianness conversion for pix_fmt is supported, 0 otherwise. + /// the pixel format + /// a positive value if an endianness conversion for pix_fmt is supported, 0 otherwise. + public static int sws_isSupportedEndiannessConversion(AVPixelFormat @pix_fmt) => vectors.sws_isSupportedEndiannessConversion(@pix_fmt); + + /// Return a positive value if pix_fmt is a supported input format, 0 otherwise. + public static int sws_isSupportedInput(AVPixelFormat @pix_fmt) => vectors.sws_isSupportedInput(@pix_fmt); + + /// Return a positive value if pix_fmt is a supported output format, 0 otherwise. + public static int sws_isSupportedOutput(AVPixelFormat @pix_fmt) => vectors.sws_isSupportedOutput(@pix_fmt); + + /// Scale all the coefficients of a so that their sum equals height. + public static void sws_normalizeVec(SwsVector* @a, double @height) => vectors.sws_normalizeVec(@a, @height); + + /// Request a horizontal slice of the output data to be written into the frame previously provided to sws_frame_start(). + /// The scaling context + /// first row of the slice; must be a multiple of sws_receive_slice_alignment() + /// number of rows in the slice; must be a multiple of sws_receive_slice_alignment(), except for the last slice (i.e. when slice_start+slice_height is equal to output frame height) + /// a non-negative number if the data was successfully written into the output AVERROR(EAGAIN) if more input data needs to be provided before the output can be produced another negative AVERROR code on other kinds of scaling failure + public static int sws_receive_slice(SwsContext* @c, uint @slice_start, uint @slice_height) => vectors.sws_receive_slice(@c, @slice_start, @slice_height); + + /// Get the alignment required for slices + /// The scaling context + /// alignment required for output slices requested with sws_receive_slice(). Slice offsets and sizes passed to sws_receive_slice() must be multiples of the value returned from this function. + public static uint sws_receive_slice_alignment(SwsContext* @c) => vectors.sws_receive_slice_alignment(@c); + + /// Scale the image slice in srcSlice and put the resulting scaled slice in the image in dst. A slice is a sequence of consecutive rows in an image. + /// the scaling context previously created with sws_getContext() + /// the array containing the pointers to the planes of the source slice + /// the array containing the strides for each plane of the source image + /// the position in the source image of the slice to process, that is the number (counted starting from zero) in the image of the first row of the slice + /// the height of the source slice, that is the number of rows in the slice + /// the array containing the pointers to the planes of the destination image + /// the array containing the strides for each plane of the destination image + /// the height of the output slice + public static int sws_scale(SwsContext* @c, byte*[] @srcSlice, int[] @srcStride, int @srcSliceY, int @srcSliceH, byte*[] @dst, int[] @dstStride) => vectors.sws_scale(@c, @srcSlice, @srcStride, @srcSliceY, @srcSliceH, @dst, @dstStride); + + /// Scale source data from src and write the output to dst. + /// The scaling context + /// The destination frame. See documentation for sws_frame_start() for more details. + /// The source frame. + /// 0 on success, a negative AVERROR code on failure + public static int sws_scale_frame(SwsContext* @c, AVFrame* @dst, AVFrame* @src) => vectors.sws_scale_frame(@c, @dst, @src); + + /// Scale all the coefficients of a by the scalar value. + public static void sws_scaleVec(SwsVector* @a, double @scalar) => vectors.sws_scaleVec(@a, @scalar); + + /// Indicate that a horizontal slice of input data is available in the source frame previously provided to sws_frame_start(). The slices may be provided in any order, but may not overlap. For vertically subsampled pixel formats, the slices must be aligned according to subsampling. + /// The scaling context + /// first row of the slice + /// number of rows in the slice + /// a non-negative number on success, a negative AVERROR code on failure. + public static int sws_send_slice(SwsContext* @c, uint @slice_start, uint @slice_height) => vectors.sws_send_slice(@c, @slice_start, @slice_height); + + /// Returns A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. + /// the scaling context + /// the yuv2rgb coefficients describing the input yuv space, normally ff_yuv2rgb_coeffs[x] + /// flag indicating the while-black range of the input (1=jpeg / 0=mpeg) + /// the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] + /// flag indicating the while-black range of the output (1=jpeg / 0=mpeg) + /// 16.16 fixed point brightness correction + /// 16.16 fixed point contrast correction + /// 16.16 fixed point saturation correction + /// A negative error code on error, non negative otherwise. If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. + public static int sws_setColorspaceDetails(SwsContext* @c, in int4 @inv_table, int @srcRange, in int4 @table, int @dstRange, int @brightness, int @contrast, int @saturation) => vectors.sws_setColorspaceDetails(@c, @inv_table, @srcRange, @table, @dstRange, @brightness, @contrast, @saturation); + + /// Return the libswscale build-time configuration. + public static string swscale_configuration() => vectors.swscale_configuration(); + + /// Return the libswscale license. + public static string swscale_license() => vectors.swscale_license(); + + /// Color conversion and scaling library. + public static uint swscale_version() => vectors.swscale_version(); + + */ + #endregion + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.facade.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.facade.g.cs.meta new file mode 100644 index 0000000..3d12144 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.facade.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f5804ddd88f687945bf3886c41d4a565 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.inline.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.inline.g.cs new file mode 100644 index 0000000..83d4696 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.inline.g.cs @@ -0,0 +1,402 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; + +namespace LeviathanVideo.Abstractions +{ + + public static unsafe partial class leviathan + { + /// Clip a signed 64-bit integer value into the -2147483648,2147483647 range. + /// value to clip + /// clipped value + public static int av_clipl_int32_c(long @a) + { + if ((((ulong)a + (2147483648UL)) & ~(4294967295UL)) != 0) + return (int)((a >> 63) ^ 2147483647); + else + return (int)a; + } + // original body hash: hVbFRW9NmALaR5Wqm8W2hfXu9xV8Kg7CEndQKK0wY4I= + + + /// Convert an AVRational to a `double`. + /// AVRational to convert + /// `a` in floating-point form + public static double av_q2d(AVRational @a) + { + return a.num / (double)a.den; + } + // original body hash: j4R2BS8nF6czcUDVk5kKi9nLEdlTI/NRDYtnc1KFeyE= + + #region unuse code + /* + /// Compute ceil(log2(x)). + /// value used to compute ceil(log2(x)) + /// computed ceiling of log2(x) + public static int av_ceil_log2_c(int @x) + { + return av_log2((uint)(x - 1U) << 1); + } + // original body hash: Y9QGw919/NB5ltczSPmZu5WZt+BfR1GGQ58ULgOxiNo= + + /// Clip a signed integer value into the amin-amax range. + /// value to clip + /// minimum value of the clip range + /// maximum value of the clip range + /// clipped value + public static int av_clip_c(int @a, int @amin, int @amax) + { + if (a < amin) + return amin; + else if (a > amax) + return amax; + else + return a; + } + // original body hash: FGSX8EvLhMgYqP9+0z1+Clej4HxjpENDPDX7uAYLx6k= + + /// Clip a signed integer value into the -32768,32767 range. + /// value to clip + /// clipped value + public static short av_clip_int16_c(int @a) + { + if (((a + 32768U) & ~65535) != 0) + return (short)((a >> 31) ^ 32767); + else + return (short)a; + } + // original body hash: l7ot2X+8YIG7Ze9ecaMTap87pGl9Q5kffGq1e9dS9Es= + + /// Clip a signed integer value into the -128,127 range. + /// value to clip + /// clipped value + public static sbyte av_clip_int8_c(int @a) + { + if (((a + 128U) & ~255) != 0) + return (sbyte)((a >> 31) ^ 127); + else + return (sbyte)a; + } + // original body hash: 959D6ojD8+Bo9o7pGvHcWTnCDg5Ax0o328RGYDIiUvo= + + /// Clip a signed integer into the -(2^p),(2^p-1) range. + /// value to clip + /// bit position to clip at + /// clipped value + public static int av_clip_intp2_c(int @a, int @p) + { + if ((((uint)a + (1U << p)) & ~((2U << p) - 1)) != 0) + return (a >> 31) ^ ((1 << p) - 1); + else + return a; + } + // original body hash: H4R9TdJsLPxie0kMNORwLhiEFWSn5cG8vNmgEcRcwaE= + + /// Clip a signed integer value into the 0-65535 range. + /// value to clip + /// clipped value + public static ushort av_clip_uint16_c(int @a) + { + if ((a & (~65535)) != 0) + return (ushort)((~a) >> 31); + else + return (ushort)a; + } + // original body hash: nI5Vkw30nAjS2NmNSdCSnHeAUcY47XT0lnrnsUK/bJ4= + + /// Clip a signed integer value into the 0-255 range. + /// value to clip + /// clipped value + public static byte av_clip_uint8_c(int @a) + { + if ((a & (~255)) != 0) + return (byte)((~a) >> 31); + else + return (byte)a; + } + // original body hash: 32OGGgXBFRL7EcU8DizK9KbIFfU356+5hgUEyAOjIUY= + + /// Clip a signed integer to an unsigned power of two range. + /// value to clip + /// bit position to clip at + /// clipped value + public static uint av_clip_uintp2_c(int @a, int @p) + { + if ((a & ~((1U << p) - 1)) != 0) + return (uint)(~a) >> 31 & ((1U << p) - 1); + else + return (uint)a; + } + // original body hash: e+b5mkBcLXfL9tlPoRVY9A8fy1jLPsqovjAobPBirRs= + + /// Clip a signed 64bit integer value into the amin-amax range. + /// value to clip + /// minimum value of the clip range + /// maximum value of the clip range + /// clipped value + public static long av_clip64_c(long @a, long @amin, long @amax) + { + if (a < amin) + return amin; + else if (a > amax) + return amax; + else + return a; + } + // original body hash: FGSX8EvLhMgYqP9+0z1+Clej4HxjpENDPDX7uAYLx6k= + + /// Clip a double value into the amin-amax range. If a is nan or -inf amin will be returned. If a is +inf amax will be returned. + /// value to clip + /// minimum value of the clip range + /// maximum value of the clip range + /// clipped value + public static double av_clipd_c(double @a, double @amin, double @amax) + { + return ((((a) > (amin) ? (a) : (amin))) > (amax) ? (amax) : (((a) > (amin) ? (a) : (amin)))); + } + // original body hash: 3g76qefPWCYqXraY2vYdxoH58/EKn5EeR9v7cGEBM6Y= + + /// Clip a float value into the amin-amax range. If a is nan or -inf amin will be returned. If a is +inf amax will be returned. + /// value to clip + /// minimum value of the clip range + /// maximum value of the clip range + /// clipped value + public static float av_clipf_c(float @a, float @amin, float @amax) + { + return ((((a) > (amin) ? (a) : (amin))) > (amax) ? (amax) : (((a) > (amin) ? (a) : (amin)))); + } + // original body hash: 3g76qefPWCYqXraY2vYdxoH58/EKn5EeR9v7cGEBM6Y= + + /// Compare two rationals. + /// First rational + /// Second rational + /// One of the following values: - 0 if `a == b` - 1 if `a > b` - -1 if `a < b` - `INT_MIN` if one of the values is of the form `0 / 0` + public static int av_cmp_q(AVRational @a, AVRational @b) + { + long tmp = a.num * (long)b.den - b.num * (long)a.den; + if (tmp != 0) + return (int)((tmp ^ a.den ^ b.den) >> 63) | 1; + else if (b.den != 0 && a.den != 0) + return 0; + else if (a.num != 0 && b.num != 0) + return (a.num >> 31) - (b.num >> 31); + else + return (-2147483647 - 1); + } + // original body hash: M+RGb5gXGdDjfY/gK5ZeCYeYrZAxjTXZA9+XVu0I66Q= + + /// Reinterpret a double as a 64-bit integer. + public static ulong av_double2int(double @f) + { + return (ulong)@f; + } + // original body hash: 2HuHK8WLchm3u+cK6H4QWhflx2JqfewtaSpj2Cwfi8M= + + /// Reinterpret a float as a 32-bit integer. + public static uint av_float2int(float @f) + { + return (uint)@f; + } + // original body hash: uBvsHd8EeFnxDvSdDE1+k5Um29kCuf0aEJhAvDy0wZk= + + /// Wrapper around av_frame_side_data_get_c() to workaround the limitation that for any type T the conversion from T * const * to const T * const * is not performed automatically in C. + public static AVFrameSideData* av_frame_side_data_get(AVFrameSideData** @sd, int @nb_sd, AVFrameSideDataType @type) + { + return av_frame_side_data_get_c(sd, nb_sd, type); + } + // original body hash: nxiyu/BnkvF9Z/fWwpii6qfquOeLA/wdeiuxyQQxS4E= + + /// 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) + { + return (double)@i; + } + // original body hash: iFt3hVHTpF9jjqIGAAf/c7FrGfenOXGxdsyMjmrbwvw= + + /// Reinterpret a 32-bit integer as a float. + public static float av_int2float(uint @i) + { + return (float)@i; + } + // original body hash: wLGFPpW+aIvxW79y6BVY1LKz/j7yc3BdiaJ7mD4oQmw= + + /// Invert a rational. + /// value + /// 1 / q + public static AVRational av_inv_q(AVRational @q) + { + var r = new AVRational { @num = q.den, @den = q.num }; + return r; + } + // original body hash: sXbO4D7vmayAx56EFqz9C0kakcSPSryJHdk0hr0MOFY= + + /// Fill the provided buffer with a string containing an error string corresponding to the AVERROR code errnum. + /// a buffer + /// size in bytes of errbuf + /// error code to describe + /// the buffer in input, filled with the error description + public static byte* av_make_error_string(byte* @errbuf, ulong @errbuf_size, int @errnum) + { + av_strerror(errnum, errbuf, errbuf_size); + return errbuf; + } + // original body hash: DRHQHyLQNo9pTxA+wRw4zVDrC7Md1u3JWawQX0BVkqE= + + /// Create an AVRational. + public static AVRational av_make_q(int @num, int @den) + { + var r = new AVRational { @num = num, @den = den }; + return r; + } + // original body hash: IAPYNNcg3GX0PGxINeLQhb41dH921lPVKcnqxCk7ERA= + + [Obsolete()] + public static uint av_mod_uintp2_c(uint @a, uint @p) + { + return av_zero_extend_c(a, p); + } + // original body hash: MfDd5KRKGNiwvccdrrbME05wNKCRzGTF1T24OggAyp0= + + public static int av_parity_c(uint @v) + { + return av_popcount_c(v) & 1; + } + // original body hash: Hsrq5CWkNvuNTnqES92ZJYVYpKXFwosrZNja/oaUd0s= + + /// Count number of bits set to one in x + /// value to count bits of + /// the number of bits set to one in x + public static int av_popcount_c(uint @x) + { + x -= (x >> 1) & 1431655765; + x = (x & 858993459) + ((x >> 2) & 858993459); + x = (x + (x >> 4)) & 252645135; + x += x >> 8; + return (int)((x + (x >> 16)) & 63); + } + // original body hash: 6EqV8Ll7t/MGINV9Nh3TSEbNyUYeskm7HucpU0SAkgg= + + /// Count number of bits set to one in x + /// value to count bits of + /// the number of bits set to one in x + public static int av_popcount64_c(ulong @x) + { + return av_popcount_c((uint)x) + av_popcount_c((uint)(x >> 32)); + } + // original body hash: 4wjPAKU9R0yS6OI8Y9h3L6de+uXt/lBm+zX7t5Ch18k= + + /// Add two signed 32-bit values with saturation. + /// one value + /// another value + /// sum with signed saturation + public static int av_sat_add32_c(int @a, int @b) + { + return av_clipl_int32_c((long)a + b); + } + // original body hash: GAAy4GsS2n+9kJ/8hzuONPUOGIsiOj7PvXnLHUVrimY= + + /// Add two signed 64-bit values with saturation. + /// one value + /// another value + /// sum with signed saturation + public static long av_sat_add64_c(long @a, long @b) + { + try + { + return @a + @b; + } + catch (OverflowException) + { + return ((double)@a + (double)@b) > 0d ? long.MaxValue : long.MinValue; + } + } + // original body hash: qeup76rp1rjakhMYQJWWEYIkpgscUcDfzDIrjyqk5iM= + + /// Add a doubled value to another value with saturation at both stages. + /// first value + /// value doubled and added to a + /// sum sat(a + sat(2*b)) with signed saturation + public static int av_sat_dadd32_c(int @a, int @b) + { + return av_sat_add32_c(a, av_sat_add32_c(b, b)); + } + // original body hash: Kbha6XFULk7dxB6zc5WRwoPczQVN7HBcNs9Hjlj/Caw= + + /// Subtract a doubled value from another value with saturation at both stages. + /// first value + /// value doubled and subtracted from a + /// difference sat(a - sat(2*b)) with signed saturation + public static int av_sat_dsub32_c(int @a, int @b) + { + return av_sat_sub32_c(a, av_sat_add32_c(b, b)); + } + // original body hash: ypu4i+30n3CeMxdL8pq7XDYAFBi1N5d2mkIT6zQ1bO0= + + /// Subtract two signed 32-bit values with saturation. + /// one value + /// another value + /// difference with signed saturation + public static int av_sat_sub32_c(int @a, int @b) + { + return av_clipl_int32_c((long)a - b); + } + // original body hash: /tgXI2zbIgliqOwZbpnq7jSiVj0N70RjBFsbkIkWhsM= + + /// Subtract two signed 64-bit values with saturation. + /// one value + /// another value + /// difference with signed saturation + public static long av_sat_sub64_c(long @a, long @b) + { + try + { + return @a - @b; + } + catch (OverflowException) + { + return ((double)@a - (double)@b) > 0d ? long.MaxValue : long.MinValue; + } + } + // original body hash: 6YrSxDrYVG1ac1wlCiXKMhTwj7Kx6eym/YtspKusrGk= + + /// Return x default pointer in case p is NULL. + public static void* av_x_if_null(void* @p, void* @x) + { + return (void*)(p != null ? p : x); + } + // original body hash: zOY924eIk3VeTSNb9XcE2Yw8aZ4/jlzQSfP06k5n0nU= + + /// Clear high bits from an unsigned integer starting with specific bit position + /// value to clip + /// bit position to clip at. Must be between 0 and 31. + /// clipped value + public static uint av_zero_extend_c(uint @a, uint @p) + { + return a & ((1U << (int)p) - 1); + } + // original body hash: ncn4Okxr9Nas1g/qCfpRHKtywuNmJuf3UED+o3wjadc= + + /// ftell() equivalent for AVIOContext. + /// position or AVERROR. + public static long avio_tell(AVIOContext* @s) + { + return avio_seek(s, 0, 1); + } + // original body hash: o18c3ypeh9EsmYaplTel2ssgM2PZKTTDfMjsqEopycw= + */ + #endregion + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.inline.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.inline.g.cs.meta new file mode 100644 index 0000000..93db88c --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.functions.inline.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6aafe78d5c8f034e91415b317e7a463 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.macros.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.macros.g.cs new file mode 100644 index 0000000..40673c8 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.macros.g.cs @@ -0,0 +1,2020 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +namespace LeviathanVideo.Abstractions +{ + + public static unsafe partial class leviathan + { + /// AVERROR_EOF = FFERRTAG( 'E','O','F',' ') + public static readonly int AVERROR_EOF = FFERRTAG('E', 'O', 'F', ' '); + /// FF_THREAD_FRAME = 0x1 + public const int FF_THREAD_FRAME = 0x1; + /// FF_THREAD_SLICE = 0x2 + public const int FF_THREAD_SLICE = 0x2; + /// AVSEEK_FLAG_FRAME = 8 + public const int AVSEEK_FLAG_FRAME = 0x8; + + #region unuse code + /* + /// _WIN32_WINNT = 0x602 + public const int _WIN32_WINNT = 0x602; + // public static attribute_deprecated = __declspec(deprecated); + // public static av_alias = __attribute__((may_alias)); + // public static av_alloc_size = (...); + // public static av_always_inline = __forceinline; + /// AV_BUFFER_FLAG_READONLY = (1 << 0) + public const int AV_BUFFER_FLAG_READONLY = 0x1 << 0x0; + /// AV_BUFFERSINK_FLAG_NO_REQUEST = 0x2 + public const int AV_BUFFERSINK_FLAG_NO_REQUEST = 0x2; + /// AV_BUFFERSINK_FLAG_PEEK = 0x1 + public const int AV_BUFFERSINK_FLAG_PEEK = 0x1; + // public static av_builtin_constant_p = __builtin_constant_p; + // public static av_ceil_log2 = av_ceil_log2_c; + // public static AV_CEIL_RSHIFT = (a,b) (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) : ((a) + (1<<(b)) - 1) >> (b)); + /// AV_CH_BACK_CENTER = (1ULL << AV_CHAN_BACK_CENTER ) + public static readonly ulong AV_CH_BACK_CENTER = 0x1UL << 8; + /// AV_CH_BACK_LEFT = (1ULL << AV_CHAN_BACK_LEFT ) + public static readonly ulong AV_CH_BACK_LEFT = 0x1UL << 4; + /// AV_CH_BACK_RIGHT = (1ULL << AV_CHAN_BACK_RIGHT ) + public static readonly ulong AV_CH_BACK_RIGHT = 0x1UL << 5; + /// AV_CH_BOTTOM_FRONT_CENTER = (1ULL << AV_CHAN_BOTTOM_FRONT_CENTER ) + public static readonly ulong AV_CH_BOTTOM_FRONT_CENTER = 0x1UL << 38; + /// AV_CH_BOTTOM_FRONT_LEFT = (1ULL << AV_CHAN_BOTTOM_FRONT_LEFT ) + public static readonly ulong AV_CH_BOTTOM_FRONT_LEFT = 0x1UL << 39; + /// AV_CH_BOTTOM_FRONT_RIGHT = (1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT ) + public static readonly ulong AV_CH_BOTTOM_FRONT_RIGHT = 0x1UL << 40; + /// AV_CH_FRONT_CENTER = (1ULL << AV_CHAN_FRONT_CENTER ) + public static readonly ulong AV_CH_FRONT_CENTER = 0x1UL << 2; + /// AV_CH_FRONT_LEFT = (1ULL << AV_CHAN_FRONT_LEFT ) + public static readonly ulong AV_CH_FRONT_LEFT = 0x1UL << 0; + /// AV_CH_FRONT_LEFT_OF_CENTER = (1ULL << AV_CHAN_FRONT_LEFT_OF_CENTER ) + public static readonly ulong AV_CH_FRONT_LEFT_OF_CENTER = 0x1UL << 6; + /// AV_CH_FRONT_RIGHT = (1ULL << AV_CHAN_FRONT_RIGHT ) + public static readonly ulong AV_CH_FRONT_RIGHT = 0x1UL << 1; + /// AV_CH_FRONT_RIGHT_OF_CENTER = (1ULL << AV_CHAN_FRONT_RIGHT_OF_CENTER) + public static readonly ulong AV_CH_FRONT_RIGHT_OF_CENTER = 0x1UL << 7; + /// AV_CH_LAYOUT_2_1 = (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER) + 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_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) + public static readonly ulong AV_CH_LAYOUT_4POINT1 = AV_CH_LAYOUT_4POINT0 | AV_CH_LOW_FREQUENCY; + /// AV_CH_LAYOUT_5POINT0 = (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) + public static readonly ulong AV_CH_LAYOUT_5POINT0 = AV_CH_LAYOUT_SURROUND | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT; + /// AV_CH_LAYOUT_5POINT0_BACK = (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) + public static readonly ulong AV_CH_LAYOUT_5POINT0_BACK = AV_CH_LAYOUT_SURROUND | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT; + /// AV_CH_LAYOUT_5POINT1 = (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY) + 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) + public static readonly ulong AV_CH_LAYOUT_6POINT0_FRONT = AV_CH_LAYOUT_2_2 | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; + /// AV_CH_LAYOUT_6POINT1 = (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER) + public static readonly ulong AV_CH_LAYOUT_6POINT1 = AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_CENTER; + /// AV_CH_LAYOUT_6POINT1_BACK = (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER) + public static readonly ulong AV_CH_LAYOUT_6POINT1_BACK = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_BACK_CENTER; + /// AV_CH_LAYOUT_6POINT1_FRONT = (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY) + public static readonly ulong AV_CH_LAYOUT_6POINT1_FRONT = AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_LOW_FREQUENCY; + /// AV_CH_LAYOUT_7POINT0 = (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) + public static readonly ulong AV_CH_LAYOUT_7POINT0 = AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT; + /// AV_CH_LAYOUT_7POINT0_FRONT = (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) + 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_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_7POINT2POINT3 = (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_CENTER|AV_CH_LOW_FREQUENCY_2) + public static readonly ulong AV_CH_LAYOUT_7POINT2POINT3 = AV_CH_LAYOUT_7POINT1POINT2 | AV_CH_TOP_BACK_CENTER | AV_CH_LOW_FREQUENCY_2; + /// AV_CH_LAYOUT_9POINT1POINT4_BACK = (AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) + public static readonly ulong AV_CH_LAYOUT_9POINT1POINT4_BACK = AV_CH_LAYOUT_7POINT1POINT4_BACK | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER; + /// 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) + public static readonly ulong 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; + /// AV_CH_LAYOUT_HEXAGONAL = (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER) + public static readonly ulong AV_CH_LAYOUT_HEXAGONAL = AV_CH_LAYOUT_5POINT0_BACK | AV_CH_BACK_CENTER; + /// AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER) + public static readonly ulong AV_CH_LAYOUT_MONO = AV_CH_FRONT_CENTER; + /// AV_CH_LAYOUT_OCTAGONAL = (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT) + public static readonly ulong AV_CH_LAYOUT_OCTAGONAL = AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_LEFT | AV_CH_BACK_CENTER | AV_CH_BACK_RIGHT; + /// AV_CH_LAYOUT_QUAD = (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) + public static readonly ulong AV_CH_LAYOUT_QUAD = AV_CH_LAYOUT_STEREO | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT; + /// AV_CH_LAYOUT_STEREO = (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT) + public static readonly ulong AV_CH_LAYOUT_STEREO = AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT; + /// AV_CH_LAYOUT_STEREO_DOWNMIX = (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT) + public static readonly ulong AV_CH_LAYOUT_STEREO_DOWNMIX = AV_CH_STEREO_LEFT | AV_CH_STEREO_RIGHT; + /// AV_CH_LAYOUT_SURROUND = (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER) + public static readonly ulong AV_CH_LAYOUT_SURROUND = AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER; + /// AV_CH_LOW_FREQUENCY = (1ULL << AV_CHAN_LOW_FREQUENCY ) + public static readonly ulong AV_CH_LOW_FREQUENCY = 0x1UL << 3; + /// AV_CH_LOW_FREQUENCY_2 = (1ULL << AV_CHAN_LOW_FREQUENCY_2 ) + public static readonly ulong AV_CH_LOW_FREQUENCY_2 = 0x1UL << 35; + /// AV_CH_SIDE_LEFT = (1ULL << AV_CHAN_SIDE_LEFT ) + public static readonly ulong AV_CH_SIDE_LEFT = 0x1UL << 9; + /// AV_CH_SIDE_RIGHT = (1ULL << AV_CHAN_SIDE_RIGHT ) + public static readonly ulong AV_CH_SIDE_RIGHT = 0x1UL << 10; + /// AV_CH_STEREO_LEFT = (1ULL << AV_CHAN_STEREO_LEFT ) + public static readonly ulong AV_CH_STEREO_LEFT = 0x1UL << 29; + /// AV_CH_STEREO_RIGHT = (1ULL << AV_CHAN_STEREO_RIGHT ) + public static readonly ulong AV_CH_STEREO_RIGHT = 0x1UL << 30; + /// AV_CH_SURROUND_DIRECT_LEFT = (1ULL << AV_CHAN_SURROUND_DIRECT_LEFT ) + public static readonly ulong AV_CH_SURROUND_DIRECT_LEFT = 0x1UL << 33; + /// AV_CH_SURROUND_DIRECT_RIGHT = (1ULL << AV_CHAN_SURROUND_DIRECT_RIGHT) + public static readonly ulong AV_CH_SURROUND_DIRECT_RIGHT = 0x1UL << 34; + /// AV_CH_TOP_BACK_CENTER = (1ULL << AV_CHAN_TOP_BACK_CENTER ) + public static readonly ulong AV_CH_TOP_BACK_CENTER = 0x1UL << 16; + /// AV_CH_TOP_BACK_LEFT = (1ULL << AV_CHAN_TOP_BACK_LEFT ) + public static readonly ulong AV_CH_TOP_BACK_LEFT = 0x1UL << 15; + /// AV_CH_TOP_BACK_RIGHT = (1ULL << AV_CHAN_TOP_BACK_RIGHT ) + public static readonly ulong AV_CH_TOP_BACK_RIGHT = 0x1UL << 17; + /// AV_CH_TOP_CENTER = (1ULL << AV_CHAN_TOP_CENTER ) + public static readonly ulong AV_CH_TOP_CENTER = 0x1UL << 11; + /// AV_CH_TOP_FRONT_CENTER = (1ULL << AV_CHAN_TOP_FRONT_CENTER ) + public static readonly ulong AV_CH_TOP_FRONT_CENTER = 0x1UL << 13; + /// AV_CH_TOP_FRONT_LEFT = (1ULL << AV_CHAN_TOP_FRONT_LEFT ) + public static readonly ulong AV_CH_TOP_FRONT_LEFT = 0x1UL << 12; + /// AV_CH_TOP_FRONT_RIGHT = (1ULL << AV_CHAN_TOP_FRONT_RIGHT ) + public static readonly ulong AV_CH_TOP_FRONT_RIGHT = 0x1UL << 14; + /// AV_CH_TOP_SIDE_LEFT = (1ULL << AV_CHAN_TOP_SIDE_LEFT ) + public static readonly ulong AV_CH_TOP_SIDE_LEFT = 0x1UL << 36; + /// AV_CH_TOP_SIDE_RIGHT = (1ULL << AV_CHAN_TOP_SIDE_RIGHT ) + public static readonly ulong AV_CH_TOP_SIDE_RIGHT = 0x1UL << 37; + /// AV_CH_WIDE_LEFT = (1ULL << AV_CHAN_WIDE_LEFT ) + public static readonly ulong AV_CH_WIDE_LEFT = 0x1UL << 31; + /// AV_CH_WIDE_RIGHT = (1ULL << AV_CHAN_WIDE_RIGHT ) + public static readonly ulong AV_CH_WIDE_RIGHT = 0x1UL << 32; + // public static AV_CHANNEL_LAYOUT_2_1 = AV_CHANNEL_LAYOUT_MASK(0x3, AV_CH_LAYOUT_2_1); + // public static AV_CHANNEL_LAYOUT_2_2 = AV_CHANNEL_LAYOUT_MASK(0x4, AV_CH_LAYOUT_2_2); + // 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); + // public static AV_CHANNEL_LAYOUT_6POINT1_BACK = AV_CHANNEL_LAYOUT_MASK(0x7, AV_CH_LAYOUT_6POINT1_BACK); + // public static AV_CHANNEL_LAYOUT_6POINT1_FRONT = AV_CHANNEL_LAYOUT_MASK(0x7, AV_CH_LAYOUT_6POINT1_FRONT); + // 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_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_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_7POINT2POINT3 = AV_CHANNEL_LAYOUT_MASK(0xc, AV_CH_LAYOUT_7POINT2POINT3); + // public static AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK = AV_CHANNEL_LAYOUT_MASK(0xe, AV_CH_LAYOUT_9POINT1POINT4_BACK); + // .order .nb_channels .u.mask .opaque + // public static AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER = {AV_CHANNEL_ORDER_AMBISONIC, 4, { 0 }, 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); + // public static AV_CHANNEL_LAYOUT_MASK = nb; + // public static AV_CHANNEL_LAYOUT_MONO = AV_CHANNEL_LAYOUT_MASK(0x1, AV_CH_LAYOUT_MONO); + // public static AV_CHANNEL_LAYOUT_OCTAGONAL = AV_CHANNEL_LAYOUT_MASK(0x8, AV_CH_LAYOUT_OCTAGONAL); + // public static AV_CHANNEL_LAYOUT_QUAD = AV_CHANNEL_LAYOUT_MASK(0x4, AV_CH_LAYOUT_QUAD); + /// AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL = (1 << 1) + public const int AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL = 0x1 << 0x1; + /// AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS = (1 << 0) + public const int AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS = 0x1 << 0x0; + // public static AV_CHANNEL_LAYOUT_STEREO = AV_CHANNEL_LAYOUT_MASK(0x2, AV_CH_LAYOUT_STEREO); + // public static AV_CHANNEL_LAYOUT_STEREO_DOWNMIX = AV_CHANNEL_LAYOUT_MASK(0x2, AV_CH_LAYOUT_STEREO_DOWNMIX); + // public static AV_CHANNEL_LAYOUT_SURROUND = AV_CHANNEL_LAYOUT_MASK(0x3, AV_CH_LAYOUT_SURROUND); + // public static av_clip = av_clip_c; + // public static av_clip_int16 = av_clip_int16_c; + // public static av_clip_int8 = av_clip_int8_c; + // public static av_clip_intp2 = av_clip_intp2_c; + // public static av_clip_uint16 = av_clip_uint16_c; + // public static av_clip_uint8 = av_clip_uint8_c; + // public static av_clip_uintp2 = av_clip_uintp2_c; + // public static av_clip64 = av_clip64_c; + // public static av_clipd = av_clipd_c; + // public static av_clipf = av_clipf_c; + // public static av_clipl_int32 = av_clipl_int32_c; + /// AV_CODEC_CAP_AVOID_PROBING = (1 << 17) + public const int AV_CODEC_CAP_AVOID_PROBING = 0x1 << 0x11; + /// AV_CODEC_CAP_CHANNEL_CONF = (1 << 10) + public const int AV_CODEC_CAP_CHANNEL_CONF = 0x1 << 0xa; + /// AV_CODEC_CAP_DELAY = (1 << 5) + public const int AV_CODEC_CAP_DELAY = 0x1 << 0x5; + /// AV_CODEC_CAP_DR1 = (1 << 1) + public const int AV_CODEC_CAP_DR1 = 0x1 << 0x1; + /// AV_CODEC_CAP_DRAW_HORIZ_BAND = (1 << 0) + public const int AV_CODEC_CAP_DRAW_HORIZ_BAND = 0x1 << 0x0; + /// AV_CODEC_CAP_ENCODER_FLUSH = (1 << 21) + public const int AV_CODEC_CAP_ENCODER_FLUSH = 0x1 << 0x15; + /// AV_CODEC_CAP_ENCODER_RECON_FRAME = (1 << 22) + public const int AV_CODEC_CAP_ENCODER_RECON_FRAME = 0x1 << 0x16; + /// AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE = (1 << 20) + public const int AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE = 0x1 << 0x14; + /// AV_CODEC_CAP_EXPERIMENTAL = (1 << 9) + public const int AV_CODEC_CAP_EXPERIMENTAL = 0x1 << 0x9; + /// AV_CODEC_CAP_FRAME_THREADS = (1 << 12) + public const int AV_CODEC_CAP_FRAME_THREADS = 0x1 << 0xc; + /// AV_CODEC_CAP_HARDWARE = (1 << 18) + public const int AV_CODEC_CAP_HARDWARE = 0x1 << 0x12; + /// AV_CODEC_CAP_HYBRID = (1 << 19) + public const int AV_CODEC_CAP_HYBRID = 0x1 << 0x13; + /// AV_CODEC_CAP_OTHER_THREADS = (1 << 15) + public const int AV_CODEC_CAP_OTHER_THREADS = 0x1 << 0xf; + /// AV_CODEC_CAP_PARAM_CHANGE = (1 << 14) + public const int AV_CODEC_CAP_PARAM_CHANGE = 0x1 << 0xe; + /// AV_CODEC_CAP_SLICE_THREADS = (1 << 13) + public const int AV_CODEC_CAP_SLICE_THREADS = 0x1 << 0xd; + /// AV_CODEC_CAP_SMALL_LAST_FRAME = (1 << 6) + public const int AV_CODEC_CAP_SMALL_LAST_FRAME = 0x1 << 0x6; + /// AV_CODEC_CAP_SUBFRAMES = (1 << 8) + public const int AV_CODEC_CAP_SUBFRAMES = 0x1 << 0x8; + /// AV_CODEC_CAP_VARIABLE_FRAME_SIZE = (1 << 16) + public const int AV_CODEC_CAP_VARIABLE_FRAME_SIZE = 0x1 << 0x10; + /// AV_CODEC_EXPORT_DATA_FILM_GRAIN = 0x1 << 0x3 + public const int AV_CODEC_EXPORT_DATA_FILM_GRAIN = 0x1 << 0x3; + /// AV_CODEC_EXPORT_DATA_MVS = 0x1 << 0x0 + public const int AV_CODEC_EXPORT_DATA_MVS = 0x1 << 0x0; + /// AV_CODEC_EXPORT_DATA_PRFT = 0x1 << 0x1 + public const int AV_CODEC_EXPORT_DATA_PRFT = 0x1 << 0x1; + /// AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS = 0x1 << 0x2 + public const int AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS = 0x1 << 0x2; + /// AV_CODEC_FLAG_4MV = 0x1 << 0x2 + public const int AV_CODEC_FLAG_4MV = 0x1 << 0x2; + /// AV_CODEC_FLAG_AC_PRED = 0x1 << 0x18 + public const int AV_CODEC_FLAG_AC_PRED = 0x1 << 0x18; + /// AV_CODEC_FLAG_BITEXACT = 0x1 << 0x17 + public const int AV_CODEC_FLAG_BITEXACT = 0x1 << 0x17; + /// AV_CODEC_FLAG_CLOSED_GOP = 0x1U << 0x1f + public const uint AV_CODEC_FLAG_CLOSED_GOP = 0x1U << 0x1f; + /// AV_CODEC_FLAG_COPY_OPAQUE = 0x1 << 0x7 + public const int AV_CODEC_FLAG_COPY_OPAQUE = 0x1 << 0x7; + /// AV_CODEC_FLAG_DROPCHANGED = 0x1 << 0x5 + public const int AV_CODEC_FLAG_DROPCHANGED = 0x1 << 0x5; + /// AV_CODEC_FLAG_FRAME_DURATION = 0x1 << 0x8 + public const int AV_CODEC_FLAG_FRAME_DURATION = 0x1 << 0x8; + /// AV_CODEC_FLAG_GLOBAL_HEADER = 0x1 << 0x16 + public const int AV_CODEC_FLAG_GLOBAL_HEADER = 0x1 << 0x16; + /// AV_CODEC_FLAG_GRAY = 0x1 << 0xd + public const int AV_CODEC_FLAG_GRAY = 0x1 << 0xd; + /// AV_CODEC_FLAG_INTERLACED_DCT = 0x1 << 0x12 + public const int AV_CODEC_FLAG_INTERLACED_DCT = 0x1 << 0x12; + /// AV_CODEC_FLAG_INTERLACED_ME = 0x1 << 0x1d + public const int AV_CODEC_FLAG_INTERLACED_ME = 0x1 << 0x1d; + /// AV_CODEC_FLAG_LOOP_FILTER = 0x1 << 0xb + public const int AV_CODEC_FLAG_LOOP_FILTER = 0x1 << 0xb; + /// AV_CODEC_FLAG_LOW_DELAY = 0x1 << 0x13 + public const int AV_CODEC_FLAG_LOW_DELAY = 0x1 << 0x13; + /// AV_CODEC_FLAG_OUTPUT_CORRUPT = 0x1 << 0x3 + public const int AV_CODEC_FLAG_OUTPUT_CORRUPT = 0x1 << 0x3; + /// AV_CODEC_FLAG_PASS1 = 0x1 << 0x9 + public const int AV_CODEC_FLAG_PASS1 = 0x1 << 0x9; + /// AV_CODEC_FLAG_PASS2 = 0x1 << 0xa + public const int AV_CODEC_FLAG_PASS2 = 0x1 << 0xa; + /// AV_CODEC_FLAG_PSNR = 0x1 << 0xf + public const int AV_CODEC_FLAG_PSNR = 0x1 << 0xf; + /// AV_CODEC_FLAG_QPEL = 0x1 << 0x4 + public const int AV_CODEC_FLAG_QPEL = 0x1 << 0x4; + /// AV_CODEC_FLAG_QSCALE = 0x1 << 0x1 + public const int AV_CODEC_FLAG_QSCALE = 0x1 << 0x1; + /// AV_CODEC_FLAG_RECON_FRAME = 0x1 << 0x6 + public const int AV_CODEC_FLAG_RECON_FRAME = 0x1 << 0x6; + /// AV_CODEC_FLAG_UNALIGNED = 0x1 << 0x0 + public const int AV_CODEC_FLAG_UNALIGNED = 0x1 << 0x0; + /// AV_CODEC_FLAG2_CHUNKS = 0x1 << 0xf + public const int AV_CODEC_FLAG2_CHUNKS = 0x1 << 0xf; + /// AV_CODEC_FLAG2_EXPORT_MVS = 0x1 << 0x1c + public const int AV_CODEC_FLAG2_EXPORT_MVS = 0x1 << 0x1c; + /// AV_CODEC_FLAG2_FAST = 0x1 << 0x0 + public const int AV_CODEC_FLAG2_FAST = 0x1 << 0x0; + /// AV_CODEC_FLAG2_ICC_PROFILES = 0x1U << 0x1f + public const uint AV_CODEC_FLAG2_ICC_PROFILES = 0x1U << 0x1f; + /// AV_CODEC_FLAG2_IGNORE_CROP = 0x1 << 0x10 + public const int AV_CODEC_FLAG2_IGNORE_CROP = 0x1 << 0x10; + /// AV_CODEC_FLAG2_LOCAL_HEADER = 0x1 << 0x3 + public const int AV_CODEC_FLAG2_LOCAL_HEADER = 0x1 << 0x3; + /// AV_CODEC_FLAG2_NO_OUTPUT = 0x1 << 0x2 + public const int AV_CODEC_FLAG2_NO_OUTPUT = 0x1 << 0x2; + /// AV_CODEC_FLAG2_RO_FLUSH_NOOP = 0x1 << 0x1e + public const int AV_CODEC_FLAG2_RO_FLUSH_NOOP = 0x1 << 0x1e; + /// AV_CODEC_FLAG2_SHOW_ALL = 0x1 << 0x16 + public const int AV_CODEC_FLAG2_SHOW_ALL = 0x1 << 0x16; + /// AV_CODEC_FLAG2_SKIP_MANUAL = 0x1 << 0x1d + public const int AV_CODEC_FLAG2_SKIP_MANUAL = 0x1 << 0x1d; + /// AV_CODEC_ID_H265 = AV_CODEC_ID_HEVC + public static readonly int AV_CODEC_ID_H265 = 173; + /// AV_CODEC_ID_H266 = AV_CODEC_ID_VVC + public static readonly int AV_CODEC_ID_H266 = 196; + /// AV_CODEC_ID_IFF_BYTERUN1 = AV_CODEC_ID_IFF_ILBM + 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 + public const int AV_CODEC_PROP_LOSSLESS = 0x1 << 0x2; + /// AV_CODEC_PROP_LOSSY = 0x1 << 0x1 + public const int AV_CODEC_PROP_LOSSY = 0x1 << 0x1; + /// AV_CODEC_PROP_REORDER = 0x1 << 0x3 + public const int AV_CODEC_PROP_REORDER = 0x1 << 0x3; + /// AV_CODEC_PROP_TEXT_SUB = 0x1 << 0x11 + public const int AV_CODEC_PROP_TEXT_SUB = 0x1 << 0x11; + // public static av_cold = __attribute__((cold)); + // public static av_const = __attribute__((const)); + /// AV_CPU_FLAG_3DNOW = 0x4 + public const int AV_CPU_FLAG_3DNOW = 0x4; + /// AV_CPU_FLAG_3DNOWEXT = 0x20 + public const int AV_CPU_FLAG_3DNOWEXT = 0x20; + /// AV_CPU_FLAG_AESNI = 0x80000 + public const int AV_CPU_FLAG_AESNI = 0x80000; + /// AV_CPU_FLAG_ALTIVEC = 0x1 + public const int AV_CPU_FLAG_ALTIVEC = 0x1; + /// AV_CPU_FLAG_ARMV5TE = 0x1 << 0x0 + public const int AV_CPU_FLAG_ARMV5TE = 0x1 << 0x0; + /// AV_CPU_FLAG_ARMV6 = 0x1 << 0x1 + public const int AV_CPU_FLAG_ARMV6 = 0x1 << 0x1; + /// AV_CPU_FLAG_ARMV6T2 = 0x1 << 0x2 + public const int AV_CPU_FLAG_ARMV6T2 = 0x1 << 0x2; + /// AV_CPU_FLAG_ARMV8 = 0x1 << 0x6 + public const int AV_CPU_FLAG_ARMV8 = 0x1 << 0x6; + /// AV_CPU_FLAG_ATOM = 0x10000000 + public const int AV_CPU_FLAG_ATOM = 0x10000000; + /// AV_CPU_FLAG_AVX = 0x4000 + public const int AV_CPU_FLAG_AVX = 0x4000; + /// AV_CPU_FLAG_AVX2 = 0x8000 + public const int AV_CPU_FLAG_AVX2 = 0x8000; + /// AV_CPU_FLAG_AVX512 = 0x100000 + public const int AV_CPU_FLAG_AVX512 = 0x100000; + /// AV_CPU_FLAG_AVX512ICL = 0x200000 + public const int AV_CPU_FLAG_AVX512ICL = 0x200000; + /// AV_CPU_FLAG_AVXSLOW = 0x8000000 + public const int AV_CPU_FLAG_AVXSLOW = 0x8000000; + /// AV_CPU_FLAG_BMI1 = 0x20000 + public const int AV_CPU_FLAG_BMI1 = 0x20000; + /// AV_CPU_FLAG_BMI2 = 0x40000 + 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 + public const int AV_CPU_FLAG_LSX = 0x1 << 0x0; + /// AV_CPU_FLAG_MMI = 0x1 << 0x0 + public const int AV_CPU_FLAG_MMI = 0x1 << 0x0; + /// AV_CPU_FLAG_MMX = 0x1 + public const int AV_CPU_FLAG_MMX = 0x1; + /// AV_CPU_FLAG_MMX2 = 0x2 + public const int AV_CPU_FLAG_MMX2 = 0x2; + /// AV_CPU_FLAG_MMXEXT = 0x2 + public const int AV_CPU_FLAG_MMXEXT = 0x2; + /// AV_CPU_FLAG_MSA = 0x1 << 0x1 + public const int AV_CPU_FLAG_MSA = 0x1 << 0x1; + /// AV_CPU_FLAG_NEON = 0x1 << 0x5 + 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 + public const int AV_CPU_FLAG_RVD = 0x1 << 0x2; + /// AV_CPU_FLAG_RVF = 0x1 << 0x1 + public const int AV_CPU_FLAG_RVF = 0x1 << 0x1; + /// AV_CPU_FLAG_RVI = 0x1 << 0x0 + public const int AV_CPU_FLAG_RVI = 0x1 << 0x0; + /// AV_CPU_FLAG_RVV_F32 = 0x1 << 0x4 + public const int AV_CPU_FLAG_RVV_F32 = 0x1 << 0x4; + /// AV_CPU_FLAG_RVV_F64 = 0x1 << 0x6 + public const int AV_CPU_FLAG_RVV_F64 = 0x1 << 0x6; + /// AV_CPU_FLAG_RVV_I32 = 0x1 << 0x3 + public const int AV_CPU_FLAG_RVV_I32 = 0x1 << 0x3; + /// AV_CPU_FLAG_RVV_I64 = 0x1 << 0x5 + public const int AV_CPU_FLAG_RVV_I64 = 0x1 << 0x5; + /// AV_CPU_FLAG_SETEND = 0x1 << 0x10 + public const int AV_CPU_FLAG_SETEND = 0x1 << 0x10; + /// AV_CPU_FLAG_SLOW_GATHER = 0x2000000 + public const int AV_CPU_FLAG_SLOW_GATHER = 0x2000000; + /// AV_CPU_FLAG_SSE = 0x8 + public const int AV_CPU_FLAG_SSE = 0x8; + /// AV_CPU_FLAG_SSE2 = 0x10 + public const int AV_CPU_FLAG_SSE2 = 0x10; + /// AV_CPU_FLAG_SSE2SLOW = 0x40000000 + public const int AV_CPU_FLAG_SSE2SLOW = 0x40000000; + /// AV_CPU_FLAG_SSE3 = 0x40 + public const int AV_CPU_FLAG_SSE3 = 0x40; + /// AV_CPU_FLAG_SSE3SLOW = 0x20000000 + public const int AV_CPU_FLAG_SSE3SLOW = 0x20000000; + /// AV_CPU_FLAG_SSE4 = 0x100 + public const int AV_CPU_FLAG_SSE4 = 0x100; + /// AV_CPU_FLAG_SSE42 = 0x200 + public const int AV_CPU_FLAG_SSE42 = 0x200; + /// AV_CPU_FLAG_SSSE3 = 0x80 + public const int AV_CPU_FLAG_SSSE3 = 0x80; + /// AV_CPU_FLAG_SSSE3SLOW = 0x4000000 + public const int AV_CPU_FLAG_SSSE3SLOW = 0x4000000; + /// AV_CPU_FLAG_VFP = 0x1 << 0x3 + public const int AV_CPU_FLAG_VFP = 0x1 << 0x3; + /// AV_CPU_FLAG_VFP_VM = 0x1 << 0x7 + public const int AV_CPU_FLAG_VFP_VM = 0x1 << 0x7; + /// AV_CPU_FLAG_VFPV3 = 0x1 << 0x4 + public const int AV_CPU_FLAG_VFPV3 = 0x1 << 0x4; + /// AV_CPU_FLAG_VSX = 0x2 + public const int AV_CPU_FLAG_VSX = 0x2; + /// AV_CPU_FLAG_XOP = 0x400 + public const int AV_CPU_FLAG_XOP = 0x400; + /// AV_DICT_APPEND = 32 + public const int AV_DICT_APPEND = 0x20; + /// AV_DICT_DONT_OVERWRITE = 16 + public const int AV_DICT_DONT_OVERWRITE = 0x10; + /// AV_DICT_DONT_STRDUP_KEY = 4 + public const int AV_DICT_DONT_STRDUP_KEY = 0x4; + /// AV_DICT_DONT_STRDUP_VAL = 8 + public const int AV_DICT_DONT_STRDUP_VAL = 0x8; + /// AV_DICT_IGNORE_SUFFIX = 2 + public const int AV_DICT_IGNORE_SUFFIX = 0x2; + /// AV_DICT_MATCH_CASE = 1 + public const int AV_DICT_MATCH_CASE = 0x1; + /// AV_DICT_MULTIKEY = 64 + public const int AV_DICT_MULTIKEY = 0x40; + /// AV_DISPOSITION_ATTACHED_PIC = (1 << 10) + public const int AV_DISPOSITION_ATTACHED_PIC = 0x1 << 0xa; + /// AV_DISPOSITION_CAPTIONS = (1 << 16) + public const int AV_DISPOSITION_CAPTIONS = 0x1 << 0x10; + /// AV_DISPOSITION_CLEAN_EFFECTS = (1 << 9) + public const int AV_DISPOSITION_CLEAN_EFFECTS = 0x1 << 0x9; + /// AV_DISPOSITION_COMMENT = (1 << 3) + public const int AV_DISPOSITION_COMMENT = 0x1 << 0x3; + /// AV_DISPOSITION_DEFAULT = (1 << 0) + public const int AV_DISPOSITION_DEFAULT = 0x1 << 0x0; + /// AV_DISPOSITION_DEPENDENT = (1 << 19) + public const int AV_DISPOSITION_DEPENDENT = 0x1 << 0x13; + /// AV_DISPOSITION_DESCRIPTIONS = (1 << 17) + public const int AV_DISPOSITION_DESCRIPTIONS = 0x1 << 0x11; + /// AV_DISPOSITION_DUB = (1 << 1) + public const int AV_DISPOSITION_DUB = 0x1 << 0x1; + /// AV_DISPOSITION_FORCED = (1 << 6) + public const int AV_DISPOSITION_FORCED = 0x1 << 0x6; + /// AV_DISPOSITION_HEARING_IMPAIRED = (1 << 7) + public const int AV_DISPOSITION_HEARING_IMPAIRED = 0x1 << 0x7; + /// AV_DISPOSITION_KARAOKE = (1 << 5) + public const int AV_DISPOSITION_KARAOKE = 0x1 << 0x5; + /// AV_DISPOSITION_LYRICS = (1 << 4) + public const int AV_DISPOSITION_LYRICS = 0x1 << 0x4; + /// AV_DISPOSITION_METADATA = (1 << 18) + public const int AV_DISPOSITION_METADATA = 0x1 << 0x12; + /// AV_DISPOSITION_NON_DIEGETIC = (1 << 12) + public const int AV_DISPOSITION_NON_DIEGETIC = 0x1 << 0xc; + /// AV_DISPOSITION_ORIGINAL = (1 << 2) + public const int AV_DISPOSITION_ORIGINAL = 0x1 << 0x2; + /// AV_DISPOSITION_STILL_IMAGE = (1 << 20) + public const int AV_DISPOSITION_STILL_IMAGE = 0x1 << 0x14; + /// AV_DISPOSITION_TIMED_THUMBNAILS = (1 << 11) + public const int AV_DISPOSITION_TIMED_THUMBNAILS = 0x1 << 0xb; + /// AV_DISPOSITION_VISUAL_IMPAIRED = (1 << 8) + public const int AV_DISPOSITION_VISUAL_IMPAIRED = 0x1 << 0x8; + /// AV_EF_AGGRESSIVE = (1<<18) + public const int AV_EF_AGGRESSIVE = 0x1 << 0x12; + /// AV_EF_BITSTREAM = (1<<1) + public const int AV_EF_BITSTREAM = 0x1 << 0x1; + /// AV_EF_BUFFER = (1<<2) + public const int AV_EF_BUFFER = 0x1 << 0x2; + /// AV_EF_CAREFUL = (1<<16) + public const int AV_EF_CAREFUL = 0x1 << 0x10; + /// AV_EF_COMPLIANT = (1<<17) + public const int AV_EF_COMPLIANT = 0x1 << 0x11; + /// AV_EF_CRCCHECK = (1<<0) + public const int AV_EF_CRCCHECK = 0x1 << 0x0; + /// AV_EF_EXPLODE = (1<<3) + public const int AV_EF_EXPLODE = 0x1 << 0x3; + /// AV_EF_IGNORE_ERR = (1<<15) + public const int AV_EF_IGNORE_ERR = 0x1 << 0xf; + // public static av_err2str = (errnum) av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum); + /// AV_ERROR_MAX_STRING_SIZE = 64 + public const int AV_ERROR_MAX_STRING_SIZE = 0x40; + // public static av_extern_inline = inline; + /// AV_FOURCC_MAX_STRING_SIZE = 32 + public const int AV_FOURCC_MAX_STRING_SIZE = 0x20; + // public static av_fourcc2str = (fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc); + /// AV_FRAME_FILENAME_FLAGS_MULTIPLE = 1 + public const int AV_FRAME_FILENAME_FLAGS_MULTIPLE = 0x1; + /// AV_FRAME_FLAG_CORRUPT = (1 << 0) + 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; + /// AV_FRAME_SIDE_DATA_FLAG_UNIQUE = (1 << 0) + public const int AV_FRAME_SIDE_DATA_FLAG_UNIQUE = 0x1 << 0x0; + // public static AV_GCC_VERSION_AT_LEAST = x; + // public static AV_GCC_VERSION_AT_MOST = x; + /// AV_GET_BUFFER_FLAG_REF = 0x1 << 0x0 + public const int AV_GET_BUFFER_FLAG_REF = 0x1 << 0x0; + /// AV_GET_ENCODE_BUFFER_FLAG_REF = 0x1 << 0x0 + public const int AV_GET_ENCODE_BUFFER_FLAG_REF = 0x1 << 0x0; + // public static AV_GLUE = (a, b) a ## b; + // public static AV_HAS_BUILTIN = (x)(__has_builtin(x)); + /// AV_HAVE_BIGENDIAN = 0 + 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 + public const int AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = 0x1 << 0x1; + /// AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH = 0x1 << 0x2 + public const int AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH = 0x1 << 0x2; + /// AV_HWACCEL_FLAG_IGNORE_LEVEL = 0x1 << 0x0 + public const int AV_HWACCEL_FLAG_IGNORE_LEVEL = 0x1 << 0x0; + /// AV_HWACCEL_FLAG_UNSAFE_OUTPUT = 0x1 << 0x3 + public const int AV_HWACCEL_FLAG_UNSAFE_OUTPUT = 0x1 << 0x3; + /// AV_INPUT_BUFFER_MIN_SIZE = 0x4000 + public const int AV_INPUT_BUFFER_MIN_SIZE = 0x4000; + /// AV_INPUT_BUFFER_PADDING_SIZE = 64 + public const int AV_INPUT_BUFFER_PADDING_SIZE = 0x40; + // public static av_int_list_length = list; + // 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; + /// AV_LOG_ERROR = 16 + public const int AV_LOG_ERROR = 0x10; + /// AV_LOG_FATAL = 8 + public const int AV_LOG_FATAL = 0x8; + /// AV_LOG_INFO = 32 + public const int AV_LOG_INFO = 0x20; + /// AV_LOG_MAX_OFFSET = (AV_LOG_TRACE - AV_LOG_QUIET) + public const int AV_LOG_MAX_OFFSET = AV_LOG_TRACE - AV_LOG_QUIET; + /// AV_LOG_PANIC = 0 + public const int AV_LOG_PANIC = 0x0; + /// AV_LOG_PRINT_LEVEL = 2 + public const int AV_LOG_PRINT_LEVEL = 0x2; + /// AV_LOG_QUIET = -8 + public const int AV_LOG_QUIET = -0x8; + /// AV_LOG_SKIP_REPEATED = 1 + public const int AV_LOG_SKIP_REPEATED = 0x1; + /// AV_LOG_TRACE = 56 + public const int AV_LOG_TRACE = 0x38; + /// AV_LOG_VERBOSE = 40 + public const int AV_LOG_VERBOSE = 0x28; + /// AV_LOG_WARNING = 24 + public const int AV_LOG_WARNING = 0x18; + // public static av_mod_uintp2 = av_mod_uintp2_c; + // public static AV_NE = be; + // public static av_noinline = __declspec(noinline); + /// AV_NOPTS_VALUE = ((int64_t)UINT64_C(0x8000000000000000)) + public static readonly long AV_NOPTS_VALUE = (long)(UINT64_C(0x8000000000000000L)); + // public static av_noreturn = __attribute__((noreturn)); + // public static AV_NOWARN_DEPRECATED = (code)(_Pragma("GCC diagnostic push")); + /// AV_NUM_DATA_POINTERS = 8 + public const int AV_NUM_DATA_POINTERS = 0x8; + /// AV_OPT_ALLOW_NULL = (1 << 2) + public const int AV_OPT_ALLOW_NULL = 0x1 << 0x2; + /// AV_OPT_FLAG_AUDIO_PARAM = (1 << 3) + public const int AV_OPT_FLAG_AUDIO_PARAM = 0x1 << 0x3; + /// AV_OPT_FLAG_BSF_PARAM = (1 << 8) + public const int AV_OPT_FLAG_BSF_PARAM = 0x1 << 0x8; + /// AV_OPT_FLAG_CHILD_CONSTS = (1 << 18) + public const int AV_OPT_FLAG_CHILD_CONSTS = 0x1 << 0x12; + /// AV_OPT_FLAG_DECODING_PARAM = (1 << 1) + public const int AV_OPT_FLAG_DECODING_PARAM = 0x1 << 0x1; + /// AV_OPT_FLAG_DEPRECATED = (1 << 17) + public const int AV_OPT_FLAG_DEPRECATED = 0x1 << 0x11; + /// AV_OPT_FLAG_ENCODING_PARAM = (1 << 0) + public const int AV_OPT_FLAG_ENCODING_PARAM = 0x1 << 0x0; + /// AV_OPT_FLAG_EXPORT = (1 << 6) + public const int AV_OPT_FLAG_EXPORT = 0x1 << 0x6; + /// AV_OPT_FLAG_FILTERING_PARAM = (1 << 16) + public const int AV_OPT_FLAG_FILTERING_PARAM = 0x1 << 0x10; + /// AV_OPT_FLAG_READONLY = (1 << 7) + public const int AV_OPT_FLAG_READONLY = 0x1 << 0x7; + /// AV_OPT_FLAG_RUNTIME_PARAM = (1 << 15) + public const int AV_OPT_FLAG_RUNTIME_PARAM = 0x1 << 0xf; + /// AV_OPT_FLAG_SUBTITLE_PARAM = (1 << 5) + public const int AV_OPT_FLAG_SUBTITLE_PARAM = 0x1 << 0x5; + /// AV_OPT_FLAG_VIDEO_PARAM = (1 << 4) + public const int AV_OPT_FLAG_VIDEO_PARAM = 0x1 << 0x4; + /// AV_OPT_MULTI_COMPONENT_RANGE = (1 << 12) + public const int AV_OPT_MULTI_COMPONENT_RANGE = 0x1 << 0xc; + /// AV_OPT_SEARCH_CHILDREN = (1 << 0) + public const int AV_OPT_SEARCH_CHILDREN = 0x1 << 0x0; + /// AV_OPT_SEARCH_FAKE_OBJ = (1 << 1) + public const int AV_OPT_SEARCH_FAKE_OBJ = 0x1 << 0x1; + /// AV_OPT_SERIALIZE_OPT_FLAGS_EXACT = 0x00000002 + public const int AV_OPT_SERIALIZE_OPT_FLAGS_EXACT = 0x2; + /// AV_OPT_SERIALIZE_SKIP_DEFAULTS = 0x00000001 + public const int AV_OPT_SERIALIZE_SKIP_DEFAULTS = 0x1; + // public static av_opt_set_int_list = (obj, name, val, term, flags) (av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? AVERROR(EINVAL) : av_opt_set_bin(obj, name, (const uint8_t *)(val), av_int_list_length(val, term) * sizeof(*(val)), flags)); + // public static av_parity = av_parity_c; + /// AV_PARSER_PTS_NB = 0x4 + public const int AV_PARSER_PTS_NB = 0x4; + // public static AV_PIX_FMT_0BGR32 = AV_PIX_FMT_NE(0BGR, RGB0); + // public static AV_PIX_FMT_0RGB32 = AV_PIX_FMT_NE(0x0, RGB, BGR0); + // public static AV_PIX_FMT_AYUV64 = AV_PIX_FMT_NE(AYUV64BE, AYUV64LE); + // public static AV_PIX_FMT_BAYER_BGGR16 = AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE); + // public static AV_PIX_FMT_BAYER_GBRG16 = AV_PIX_FMT_NE(BAYER_GBRG16BE, BAYER_GBRG16LE); + // public static AV_PIX_FMT_BAYER_GRBG16 = AV_PIX_FMT_NE(BAYER_GRBG16BE, BAYER_GRBG16LE); + // public static AV_PIX_FMT_BAYER_RGGB16 = AV_PIX_FMT_NE(BAYER_RGGB16BE, BAYER_RGGB16LE); + // public static AV_PIX_FMT_BGR32 = AV_PIX_FMT_NE(ABGR, RGBA); + // public static AV_PIX_FMT_BGR32_1 = AV_PIX_FMT_NE(BGRA, ARGB); + // public static AV_PIX_FMT_BGR444 = AV_PIX_FMT_NE(BGR444BE, BGR444LE); + // public static AV_PIX_FMT_BGR48 = AV_PIX_FMT_NE(BGR48BE, BGR48LE); + // public static AV_PIX_FMT_BGR555 = AV_PIX_FMT_NE(BGR555BE, BGR555LE); + // public static AV_PIX_FMT_BGR565 = AV_PIX_FMT_NE(BGR565BE, BGR565LE); + // public static AV_PIX_FMT_BGRA64 = AV_PIX_FMT_NE(BGRA64BE, BGRA64LE); + /// AV_PIX_FMT_FLAG_ALPHA = 0x1 << 0x7 + public const int AV_PIX_FMT_FLAG_ALPHA = 0x1 << 0x7; + /// AV_PIX_FMT_FLAG_BAYER = 0x1 << 0x8 + public const int AV_PIX_FMT_FLAG_BAYER = 0x1 << 0x8; + /// AV_PIX_FMT_FLAG_BE = 0x1 << 0x0 + public const int AV_PIX_FMT_FLAG_BE = 0x1 << 0x0; + /// AV_PIX_FMT_FLAG_BITSTREAM = 0x1 << 0x2 + public const int AV_PIX_FMT_FLAG_BITSTREAM = 0x1 << 0x2; + /// AV_PIX_FMT_FLAG_FLOAT = 0x1 << 0x9 + public const int AV_PIX_FMT_FLAG_FLOAT = 0x1 << 0x9; + /// AV_PIX_FMT_FLAG_HWACCEL = 0x1 << 0x3 + public const int AV_PIX_FMT_FLAG_HWACCEL = 0x1 << 0x3; + /// AV_PIX_FMT_FLAG_PAL = 0x1 << 0x1 + public const int AV_PIX_FMT_FLAG_PAL = 0x1 << 0x1; + /// AV_PIX_FMT_FLAG_PLANAR = 0x1 << 0x4 + public const int AV_PIX_FMT_FLAG_PLANAR = 0x1 << 0x4; + /// AV_PIX_FMT_FLAG_RGB = 0x1 << 0x5 + public const int AV_PIX_FMT_FLAG_RGB = 0x1 << 0x5; + /// AV_PIX_FMT_FLAG_XYZ = 0x1 << 0xa + public const int AV_PIX_FMT_FLAG_XYZ = 0x1 << 0xa; + // 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); + // public static AV_PIX_FMT_GBRP12 = AV_PIX_FMT_NE(GBRP12BE, GBRP12LE); + // public static AV_PIX_FMT_GBRP14 = AV_PIX_FMT_NE(GBRP14BE, GBRP14LE); + // public static AV_PIX_FMT_GBRP16 = AV_PIX_FMT_NE(GBRP16BE, GBRP16LE); + // public static AV_PIX_FMT_GBRP9 = AV_PIX_FMT_NE(GBRP9BE, GBRP9LE); + // public static AV_PIX_FMT_GBRPF32 = AV_PIX_FMT_NE(GBRPF32BE, GBRPF32LE); + // public static AV_PIX_FMT_GRAY10 = AV_PIX_FMT_NE(GRAY10BE, GRAY10LE); + // public static AV_PIX_FMT_GRAY12 = AV_PIX_FMT_NE(GRAY12BE, GRAY12LE); + // public static AV_PIX_FMT_GRAY14 = AV_PIX_FMT_NE(GRAY14BE, GRAY14LE); + // public static AV_PIX_FMT_GRAY16 = AV_PIX_FMT_NE(GRAY16BE, GRAY16LE); + // public static AV_PIX_FMT_GRAY9 = AV_PIX_FMT_NE(GRAY9BE, GRAY9LE); + // public static AV_PIX_FMT_GRAYF32 = AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE); + // public static AV_PIX_FMT_NE = (be, le) AV_PIX_FMT_##le; + // public static AV_PIX_FMT_NV20 = AV_PIX_FMT_NE(NV20BE, NV20LE); + // public static AV_PIX_FMT_P010 = AV_PIX_FMT_NE(P010BE, P010LE); + // 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); + // public static AV_PIX_FMT_RGB444 = AV_PIX_FMT_NE(RGB444BE, RGB444LE); + // public static AV_PIX_FMT_RGB48 = AV_PIX_FMT_NE(RGB48BE, RGB48LE); + // public static AV_PIX_FMT_RGB555 = AV_PIX_FMT_NE(RGB555BE, RGB555LE); + // public static AV_PIX_FMT_RGB565 = AV_PIX_FMT_NE(RGB565BE, RGB565LE); + // public static AV_PIX_FMT_RGBA64 = AV_PIX_FMT_NE(RGBA64BE, RGBA64LE); + // public static AV_PIX_FMT_RGBAF16 = AV_PIX_FMT_NE(RGBAF16BE, RGBAF16LE); + // public static AV_PIX_FMT_RGBAF32 = AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE); + // public static AV_PIX_FMT_RGBF32 = AV_PIX_FMT_NE(RGBF32BE, RGBF32LE); + // public static AV_PIX_FMT_X2BGR10 = AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE); + // public static AV_PIX_FMT_X2RGB10 = AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE); + // public static AV_PIX_FMT_XV30 = AV_PIX_FMT_NE(XV30BE, XV30LE); + // public static AV_PIX_FMT_XV36 = AV_PIX_FMT_NE(XV36BE, XV36LE); + // public static AV_PIX_FMT_XYZ12 = AV_PIX_FMT_NE(XYZ12BE, XYZ12LE); + // public static AV_PIX_FMT_Y210 = AV_PIX_FMT_NE(Y210BE, Y210LE); + // public static AV_PIX_FMT_Y212 = AV_PIX_FMT_NE(Y212BE, Y212LE); + // public static AV_PIX_FMT_YA16 = AV_PIX_FMT_NE(YA16BE, YA16LE); + // public static AV_PIX_FMT_YUV420P10 = AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE); + // public static AV_PIX_FMT_YUV420P12 = AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE); + // public static AV_PIX_FMT_YUV420P14 = AV_PIX_FMT_NE(YUV420P14BE, YUV420P14LE); + // public static AV_PIX_FMT_YUV420P16 = AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE); + // public static AV_PIX_FMT_YUV420P9 = AV_PIX_FMT_NE(YUV420P9BE, YUV420P9LE); + // public static AV_PIX_FMT_YUV422P10 = AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE); + // public static AV_PIX_FMT_YUV422P12 = AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE); + // public static AV_PIX_FMT_YUV422P14 = AV_PIX_FMT_NE(YUV422P14BE, YUV422P14LE); + // public static AV_PIX_FMT_YUV422P16 = AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE); + // public static AV_PIX_FMT_YUV422P9 = AV_PIX_FMT_NE(YUV422P9BE, YUV422P9LE); + // public static AV_PIX_FMT_YUV440P10 = AV_PIX_FMT_NE(YUV440P10BE, YUV440P10LE); + // public static AV_PIX_FMT_YUV440P12 = AV_PIX_FMT_NE(YUV440P12BE, YUV440P12LE); + // public static AV_PIX_FMT_YUV444P10 = AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE); + // public static AV_PIX_FMT_YUV444P12 = AV_PIX_FMT_NE(YUV444P12BE, YUV444P12LE); + // public static AV_PIX_FMT_YUV444P14 = AV_PIX_FMT_NE(YUV444P14BE, YUV444P14LE); + // public static AV_PIX_FMT_YUV444P16 = AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE); + // public static AV_PIX_FMT_YUV444P9 = AV_PIX_FMT_NE(YUV444P9BE, YUV444P9LE); + // public static AV_PIX_FMT_YUVA420P10 = AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE); + // public static AV_PIX_FMT_YUVA420P16 = AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE); + // public static AV_PIX_FMT_YUVA420P9 = AV_PIX_FMT_NE(YUVA420P9BE, YUVA420P9LE); + // public static AV_PIX_FMT_YUVA422P10 = AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE); + // public static AV_PIX_FMT_YUVA422P12 = AV_PIX_FMT_NE(YUVA422P12BE, YUVA422P12LE); + // public static AV_PIX_FMT_YUVA422P16 = AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE); + // public static AV_PIX_FMT_YUVA422P9 = AV_PIX_FMT_NE(YUVA422P9BE, YUVA422P9LE); + // public static AV_PIX_FMT_YUVA444P10 = AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE); + // public static AV_PIX_FMT_YUVA444P12 = AV_PIX_FMT_NE(YUVA444P12BE, YUVA444P12LE); + // public static AV_PIX_FMT_YUVA444P16 = AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE); + // public static AV_PIX_FMT_YUVA444P9 = AV_PIX_FMT_NE(YUVA444P9BE, YUVA444P9LE); + /// AV_PKT_DATA_QUALITY_FACTOR = AV_PKT_DATA_QUALITY_STATS + public static readonly int AV_PKT_DATA_QUALITY_FACTOR = 8; + /// AV_PKT_FLAG_CORRUPT = 0x0002 + public const int AV_PKT_FLAG_CORRUPT = 0x2; + /// AV_PKT_FLAG_DISCARD = 0x0004 + public const int AV_PKT_FLAG_DISCARD = 0x4; + /// AV_PKT_FLAG_DISPOSABLE = 0x0010 + public const int AV_PKT_FLAG_DISPOSABLE = 0x10; + /// AV_PKT_FLAG_KEY = 0x0001 + public const int AV_PKT_FLAG_KEY = 0x1; + /// AV_PKT_FLAG_TRUSTED = 0x0008 + public const int AV_PKT_FLAG_TRUSTED = 0x8; + // public static av_popcount = av_popcount_c; + // 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 + public const int AV_PTS_WRAP_ADD_OFFSET = 0x1; + /// AV_PTS_WRAP_IGNORE = 0 + public const int AV_PTS_WRAP_IGNORE = 0x0; + /// AV_PTS_WRAP_SUB_OFFSET = -1 + public const int AV_PTS_WRAP_SUB_OFFSET = -0x1; + // public static av_pure = __attribute__((pure)); + // public static av_sat_add32 = av_sat_add32_c; + // public static av_sat_add64 = av_sat_add64_c; + // public static av_sat_dadd32 = av_sat_dadd32_c; + // public static av_sat_dsub32 = av_sat_dsub32_c; + // public static av_sat_sub32 = av_sat_sub32_c; + // public static av_sat_sub64 = av_sat_sub64_c; + // public static AV_STRINGIFY = (s)(AV_TOSTRING(s)); + /// AV_SUBTITLE_FLAG_FORCED = 0x1 + public const int AV_SUBTITLE_FLAG_FORCED = 0x1; + /// AV_TIME_BASE = 1000000 + public const int AV_TIME_BASE = 0xf4240; + // public static AV_TIME_BASE_Q = (AVRational){1, AV_TIME_BASE}; + /// AV_TIMECODE_STR_SIZE = 0x17 + public const int AV_TIMECODE_STR_SIZE = 0x17; + // public static AV_TOSTRING = (s) #s; + // public static av_uninit = (x) x=x; + // public static av_unused = __attribute__((unused)); + // public static av_used = __attribute__((used)); + // public static AV_VERSION = a; + // public static AV_VERSION_DOT = (a, b, c) a ##.## b ##.## c; + // public static AV_VERSION_INT = a; + // public static AV_VERSION_MAJOR = (a)((a)(>>0x10)); + // public static AV_VERSION_MICRO = (a)((a)(&0xff)); + // public static AV_VERSION_MINOR = (a)((a)(&0xff00) >> 0x8); + /// AV_VIDEO_MAX_PLANES = 4 + public const int AV_VIDEO_MAX_PLANES = 0x4; + // public static AVERROR = (e) (-(e)); + /// AVERROR_BSF_NOT_FOUND = FFERRTAG(0xF8,'B','S','F') + public static readonly int AVERROR_BSF_NOT_FOUND = FFERRTAG(0xf8, 'B', 'S', 'F'); + /// AVERROR_BUFFER_TOO_SMALL = FFERRTAG( 'B','U','F','S') + public static readonly int AVERROR_BUFFER_TOO_SMALL = FFERRTAG('B', 'U', 'F', 'S'); + /// AVERROR_BUG = FFERRTAG( 'B','U','G','!') + public static readonly int AVERROR_BUG = FFERRTAG('B', 'U', 'G', '!'); + /// AVERROR_BUG2 = FFERRTAG( 'B','U','G',' ') + public static readonly int AVERROR_BUG2 = FFERRTAG('B', 'U', 'G', ' '); + /// AVERROR_DECODER_NOT_FOUND = FFERRTAG(0xF8,'D','E','C') + public static readonly int AVERROR_DECODER_NOT_FOUND = FFERRTAG(0xf8, 'D', 'E', 'C'); + /// AVERROR_DEMUXER_NOT_FOUND = FFERRTAG(0xF8,'D','E','M') + public static readonly int AVERROR_DEMUXER_NOT_FOUND = FFERRTAG(0xf8, 'D', 'E', 'M'); + /// AVERROR_ENCODER_NOT_FOUND = FFERRTAG(0xF8,'E','N','C') + public static readonly int AVERROR_ENCODER_NOT_FOUND = FFERRTAG(0xf8, 'E', 'N', 'C'); + /// AVERROR_EXIT = FFERRTAG( 'E','X','I','T') + public static readonly int AVERROR_EXIT = FFERRTAG('E', 'X', 'I', 'T'); + /// AVERROR_EXPERIMENTAL = (-0x2bb2afa8) + public const int AVERROR_EXPERIMENTAL = -0x2bb2afa8; + /// AVERROR_EXTERNAL = FFERRTAG( 'E','X','T',' ') + public static readonly int AVERROR_EXTERNAL = FFERRTAG('E', 'X', 'T', ' '); + /// AVERROR_FILTER_NOT_FOUND = FFERRTAG(0xF8,'F','I','L') + public static readonly int AVERROR_FILTER_NOT_FOUND = FFERRTAG(0xf8, 'F', 'I', 'L'); + /// AVERROR_HTTP_BAD_REQUEST = FFERRTAG(0xF8,'4','0','0') + public static readonly int AVERROR_HTTP_BAD_REQUEST = FFERRTAG(0xf8, '4', '0', '0'); + /// AVERROR_HTTP_FORBIDDEN = FFERRTAG(0xF8,'4','0','3') + public static readonly int AVERROR_HTTP_FORBIDDEN = FFERRTAG(0xf8, '4', '0', '3'); + /// AVERROR_HTTP_NOT_FOUND = FFERRTAG(0xF8,'4','0','4') + public static readonly int AVERROR_HTTP_NOT_FOUND = FFERRTAG(0xf8, '4', '0', '4'); + /// AVERROR_HTTP_OTHER_4XX = FFERRTAG(0xF8,'4','X','X') + public static readonly int AVERROR_HTTP_OTHER_4XX = FFERRTAG(0xf8, '4', 'X', 'X'); + /// AVERROR_HTTP_SERVER_ERROR = FFERRTAG(0xF8,'5','X','X') + public static readonly int AVERROR_HTTP_SERVER_ERROR = FFERRTAG(0xf8, '5', 'X', 'X'); + /// AVERROR_HTTP_UNAUTHORIZED = FFERRTAG(0xF8,'4','0','1') + public static readonly int AVERROR_HTTP_UNAUTHORIZED = FFERRTAG(0xf8, '4', '0', '1'); + /// AVERROR_INPUT_CHANGED = (-0x636e6701) + public const int AVERROR_INPUT_CHANGED = -0x636e6701; + /// AVERROR_INVALIDDATA = FFERRTAG( 'I','N','D','A') + public static readonly int AVERROR_INVALIDDATA = FFERRTAG('I', 'N', 'D', 'A'); + /// AVERROR_MUXER_NOT_FOUND = FFERRTAG(0xF8,'M','U','X') + public static readonly int AVERROR_MUXER_NOT_FOUND = FFERRTAG(0xf8, 'M', 'U', 'X'); + /// AVERROR_OPTION_NOT_FOUND = FFERRTAG(0xF8,'O','P','T') + public static readonly int AVERROR_OPTION_NOT_FOUND = FFERRTAG(0xf8, 'O', 'P', 'T'); + /// AVERROR_OUTPUT_CHANGED = (-0x636e6702) + public const int AVERROR_OUTPUT_CHANGED = -0x636e6702; + /// AVERROR_PATCHWELCOME = FFERRTAG( 'P','A','W','E') + public static readonly int AVERROR_PATCHWELCOME = FFERRTAG('P', 'A', 'W', 'E'); + /// AVERROR_PROTOCOL_NOT_FOUND = FFERRTAG(0xF8,'P','R','O') + public static readonly int AVERROR_PROTOCOL_NOT_FOUND = FFERRTAG(0xf8, 'P', 'R', 'O'); + /// AVERROR_STREAM_NOT_FOUND = FFERRTAG(0xF8,'S','T','R') + public static readonly int AVERROR_STREAM_NOT_FOUND = FFERRTAG(0xf8, 'S', 'T', 'R'); + /// AVERROR_UNKNOWN = FFERRTAG( 'U','N','K','N') + public static readonly int AVERROR_UNKNOWN = FFERRTAG('U', 'N', 'K', 'N'); + /// AVFILTER_CMD_FLAG_FAST = 0x2 + public const int AVFILTER_CMD_FLAG_FAST = 0x2; + /// AVFILTER_CMD_FLAG_ONE = 0x1 + public const int AVFILTER_CMD_FLAG_ONE = 0x1; + /// AVFILTER_FLAG_DYNAMIC_INPUTS = 0x1 << 0x0 + 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 + public const int AVFILTER_FLAG_SLICE_THREADS = 0x1 << 0x2; + /// AVFILTER_FLAG_SUPPORT_TIMELINE = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL + public const int AVFILTER_FLAG_SUPPORT_TIMELINE = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL; + /// AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC = 0x1 << 0x10 + public const int AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC = 0x1 << 0x10; + /// AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL = 0x1 << 0x11 + public const int AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL = 0x1 << 0x11; + /// AVFILTER_THREAD_SLICE = 0x1 << 0x0 + public const int AVFILTER_THREAD_SLICE = 0x1 << 0x0; + /// AVFMT_ALLOW_FLUSH = 0x10000 + public const int AVFMT_ALLOW_FLUSH = 0x10000; + /// AVFMT_AVOID_NEG_TS_AUTO = -1 + public const int AVFMT_AVOID_NEG_TS_AUTO = -0x1; + /// AVFMT_AVOID_NEG_TS_DISABLED = 0 + public const int AVFMT_AVOID_NEG_TS_DISABLED = 0x0; + /// AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 1 + public const int AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE = 0x1; + /// AVFMT_AVOID_NEG_TS_MAKE_ZERO = 2 + public const int AVFMT_AVOID_NEG_TS_MAKE_ZERO = 0x2; + /// AVFMT_EVENT_FLAG_METADATA_UPDATED = 0x0001 + public const int AVFMT_EVENT_FLAG_METADATA_UPDATED = 0x1; + /// AVFMT_EXPERIMENTAL = 0x0004 + public const int AVFMT_EXPERIMENTAL = 0x4; + /// AVFMT_FLAG_AUTO_BSF = 0x200000 + public const int AVFMT_FLAG_AUTO_BSF = 0x200000; + /// AVFMT_FLAG_BITEXACT = 0x0400 + public const int AVFMT_FLAG_BITEXACT = 0x400; + /// AVFMT_FLAG_CUSTOM_IO = 0x0080 + public const int AVFMT_FLAG_CUSTOM_IO = 0x80; + /// AVFMT_FLAG_DISCARD_CORRUPT = 0x0100 + public const int AVFMT_FLAG_DISCARD_CORRUPT = 0x100; + /// AVFMT_FLAG_FAST_SEEK = 0x80000 + public const int AVFMT_FLAG_FAST_SEEK = 0x80000; + /// AVFMT_FLAG_FLUSH_PACKETS = 0x0200 + public const int AVFMT_FLAG_FLUSH_PACKETS = 0x200; + /// AVFMT_FLAG_GENPTS = 0x0001 + public const int AVFMT_FLAG_GENPTS = 0x1; + /// AVFMT_FLAG_IGNDTS = 0x0008 + public const int AVFMT_FLAG_IGNDTS = 0x8; + /// AVFMT_FLAG_IGNIDX = 0x0002 + public const int AVFMT_FLAG_IGNIDX = 0x2; + /// AVFMT_FLAG_NOBUFFER = 0x0040 + public const int AVFMT_FLAG_NOBUFFER = 0x40; + /// AVFMT_FLAG_NOFILLIN = 0x0010 + public const int AVFMT_FLAG_NOFILLIN = 0x10; + /// AVFMT_FLAG_NONBLOCK = 0x0004 + public const int AVFMT_FLAG_NONBLOCK = 0x4; + /// AVFMT_FLAG_NOPARSE = 0x0020 + public const int AVFMT_FLAG_NOPARSE = 0x20; + /// AVFMT_FLAG_SHORTEST = 0x100000 + public const int AVFMT_FLAG_SHORTEST = 0x100000; + /// AVFMT_FLAG_SORT_DTS = 0x10000 + public const int AVFMT_FLAG_SORT_DTS = 0x10000; + /// AVFMT_GENERIC_INDEX = 0x0100 + public const int AVFMT_GENERIC_INDEX = 0x100; + /// AVFMT_GLOBALHEADER = 0x0040 + public const int AVFMT_GLOBALHEADER = 0x40; + /// AVFMT_NEEDNUMBER = 0x0002 + public const int AVFMT_NEEDNUMBER = 0x2; + /// AVFMT_NO_BYTE_SEEK = 0x8000 + public const int AVFMT_NO_BYTE_SEEK = 0x8000; + /// AVFMT_NOBINSEARCH = 0x2000 + public const int AVFMT_NOBINSEARCH = 0x2000; + /// AVFMT_NODIMENSIONS = 0x0800 + public const int AVFMT_NODIMENSIONS = 0x800; + /// AVFMT_NOFILE = 0x0001 + public const int AVFMT_NOFILE = 0x1; + /// AVFMT_NOGENSEARCH = 0x4000 + public const int AVFMT_NOGENSEARCH = 0x4000; + /// AVFMT_NOSTREAMS = 0x1000 + public const int AVFMT_NOSTREAMS = 0x1000; + /// AVFMT_NOTIMESTAMPS = 0x0080 + public const int AVFMT_NOTIMESTAMPS = 0x80; + /// AVFMT_SEEK_TO_PTS = 0x4000000 + public const int AVFMT_SEEK_TO_PTS = 0x4000000; + /// AVFMT_SHOW_IDS = 0x0008 + public const int AVFMT_SHOW_IDS = 0x8; + /// AVFMT_TS_DISCONT = 0x0200 + public const int AVFMT_TS_DISCONT = 0x200; + /// AVFMT_TS_NEGATIVE = 0x40000 + public const int AVFMT_TS_NEGATIVE = 0x40000; + /// AVFMT_TS_NONSTRICT = 0x20000 + public const int AVFMT_TS_NONSTRICT = 0x20000; + /// AVFMT_VARIABLE_FPS = 0x0400 + public const int AVFMT_VARIABLE_FPS = 0x400; + /// AVFMTCTX_NOHEADER = 0x0001 + public const int AVFMTCTX_NOHEADER = 0x1; + /// AVFMTCTX_UNSEEKABLE = 0x0002 + public const int AVFMTCTX_UNSEEKABLE = 0x2; + /// AVINDEX_DISCARD_FRAME = 0x0002 + public const int AVINDEX_DISCARD_FRAME = 0x2; + /// AVINDEX_KEYFRAME = 0x0001 + public const int AVINDEX_KEYFRAME = 0x1; + /// AVIO_FLAG_DIRECT = 0x8000 + public const int AVIO_FLAG_DIRECT = 0x8000; + /// AVIO_FLAG_NONBLOCK = 8 + public const int AVIO_FLAG_NONBLOCK = 0x8; + /// AVIO_FLAG_READ = 1 + public const int AVIO_FLAG_READ = 0x1; + /// AVIO_FLAG_READ_WRITE = (AVIO_FLAG_READ|AVIO_FLAG_WRITE) + public const int AVIO_FLAG_READ_WRITE = AVIO_FLAG_READ | AVIO_FLAG_WRITE; + /// AVIO_FLAG_WRITE = 2 + public const int AVIO_FLAG_WRITE = 0x2; + // public static avio_print = s; + /// AVIO_SEEKABLE_NORMAL = (1 << 0) + public const int AVIO_SEEKABLE_NORMAL = 0x1 << 0x0; + /// AVIO_SEEKABLE_TIME = (1 << 1) + public const int AVIO_SEEKABLE_TIME = 0x1 << 0x1; + /// AVPALETTE_COUNT = 256 + public const int AVPALETTE_COUNT = 0x100; + /// AVPALETTE_SIZE = 1024 + public const int AVPALETTE_SIZE = 0x400; + /// AVPROBE_PADDING_SIZE = 32 + public const int AVPROBE_PADDING_SIZE = 0x20; + /// AVPROBE_SCORE_EXTENSION = 50 + public const int AVPROBE_SCORE_EXTENSION = 0x32; + /// AVPROBE_SCORE_MAX = 100 + public const int AVPROBE_SCORE_MAX = 0x64; + /// AVPROBE_SCORE_MIME = 75 + public const int AVPROBE_SCORE_MIME = 0x4b; + /// AVPROBE_SCORE_RETRY = (AVPROBE_SCORE_MAX/4) + public const int AVPROBE_SCORE_RETRY = AVPROBE_SCORE_MAX / 0x4; + /// AVPROBE_SCORE_STREAM_RETRY = (AVPROBE_SCORE_MAX/4-1) + public const int AVPROBE_SCORE_STREAM_RETRY = AVPROBE_SCORE_MAX / 0x4 - 0x1; + /// AVSEEK_FLAG_ANY = 4 + public const int AVSEEK_FLAG_ANY = 0x4; + /// AVSEEK_FLAG_BACKWARD = 1 + public const int AVSEEK_FLAG_BACKWARD = 0x1; + /// AVSEEK_FLAG_BYTE = 2 + public const int AVSEEK_FLAG_BYTE = 0x2; + /// AVSEEK_FORCE = 0x20000 + public const int AVSEEK_FORCE = 0x20000; + /// AVSEEK_SIZE = 0x10000 + public const int AVSEEK_SIZE = 0x10000; + /// AVSTREAM_EVENT_FLAG_METADATA_UPDATED = 0x0001 + public const int AVSTREAM_EVENT_FLAG_METADATA_UPDATED = 0x1; + /// AVSTREAM_EVENT_FLAG_NEW_PACKETS = (1 << 1) + public const int AVSTREAM_EVENT_FLAG_NEW_PACKETS = 0x1 << 0x1; + /// AVSTREAM_INIT_IN_INIT_OUTPUT = 1 + public const int AVSTREAM_INIT_IN_INIT_OUTPUT = 0x1; + /// 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 < 62) + public const bool FF_API_ALLOW_FLUSH = LIBAVFORMAT_VERSION_MAJOR < 0x3e; + /// FF_API_AVCODEC_CLOSE = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_AVCODEC_CLOSE = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_AVFFT = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_AVFFT = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_AVSTREAM_SIDE_DATA = (LIBAVFORMAT_VERSION_MAJOR < 62) + public const bool FF_API_AVSTREAM_SIDE_DATA = LIBAVFORMAT_VERSION_MAJOR < 0x3e; + /// FF_API_BKTR_DEVICE = (LIBAVDEVICE_VERSION_MAJOR < 62) + public const bool FF_API_BKTR_DEVICE = LIBAVDEVICE_VERSION_MAJOR < 0x3e; + /// FF_API_BUFFER_MIN_SIZE = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_BUFFER_MIN_SIZE = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_COMPUTE_PKT_FIELDS2 = (LIBAVFORMAT_VERSION_MAJOR < 62) + public const bool FF_API_COMPUTE_PKT_FIELDS2 = LIBAVFORMAT_VERSION_MAJOR < 0x3e; + /// FF_API_DROPCHANGED = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_DROPCHANGED = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_FF_PROFILE_LEVEL = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_FF_PROFILE_LEVEL = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_FRAME_KEY = (LIBAVUTIL_VERSION_MAJOR < 60) + public const bool FF_API_FRAME_KEY = LIBAVUTIL_VERSION_MAJOR < 0x3c; + /// FF_API_FRAME_PKT = (LIBAVUTIL_VERSION_MAJOR < 60) + public const bool FF_API_FRAME_PKT = LIBAVUTIL_VERSION_MAJOR < 0x3c; + /// FF_API_GET_DUR_ESTIMATE_METHOD = (LIBAVFORMAT_VERSION_MAJOR < 62) + public const bool FF_API_GET_DUR_ESTIMATE_METHOD = LIBAVFORMAT_VERSION_MAJOR < 0x3e; + /// FF_API_H274_FILM_GRAIN_VCS = (LIBAVUTIL_VERSION_MAJOR < 60) + public const bool FF_API_H274_FILM_GRAIN_VCS = LIBAVUTIL_VERSION_MAJOR < 0x3c; + /// FF_API_HDR_VIVID_THREE_SPLINE = (LIBAVUTIL_VERSION_MAJOR < 60) + public const bool FF_API_HDR_VIVID_THREE_SPLINE = LIBAVUTIL_VERSION_MAJOR < 0x3c; + /// FF_API_INIT_PACKET = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_INIT_PACKET = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_INTERLACED_FRAME = (LIBAVUTIL_VERSION_MAJOR < 60) + public const bool FF_API_INTERLACED_FRAME = LIBAVUTIL_VERSION_MAJOR < 0x3c; + /// FF_API_LAVF_SHORTEST = (LIBAVFORMAT_VERSION_MAJOR < 62) + public const bool FF_API_LAVF_SHORTEST = LIBAVFORMAT_VERSION_MAJOR < 0x3e; + /// FF_API_LINK_PUBLIC = LIBAVFILTER_VERSION_MAJOR < 0xb + public const bool FF_API_LINK_PUBLIC = LIBAVFILTER_VERSION_MAJOR < 0xb; + /// FF_API_OPENGL_DEVICE = (LIBAVDEVICE_VERSION_MAJOR < 62) + public const bool FF_API_OPENGL_DEVICE = LIBAVDEVICE_VERSION_MAJOR < 0x3e; + /// FF_API_PALETTE_HAS_CHANGED = (LIBAVUTIL_VERSION_MAJOR < 60) + public const bool FF_API_PALETTE_HAS_CHANGED = LIBAVUTIL_VERSION_MAJOR < 0x3c; + /// FF_API_R_FRAME_RATE = 1 + public const int FF_API_R_FRAME_RATE = 0x1; + /// FF_API_SDL2_DEVICE = (LIBAVDEVICE_VERSION_MAJOR < 62) + public const bool FF_API_SDL2_DEVICE = LIBAVDEVICE_VERSION_MAJOR < 0x3e; + /// FF_API_SUBFRAMES = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_SUBFRAMES = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_TICKS_PER_FRAME = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_TICKS_PER_FRAME = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_VDPAU_ALLOC_GET_SET = (LIBAVCODEC_VERSION_MAJOR < 62) + public const bool FF_API_VDPAU_ALLOC_GET_SET = LIBAVCODEC_VERSION_MAJOR < 0x3e; + /// FF_API_VULKAN_CONTIGUOUS_MEMORY = (LIBAVUTIL_VERSION_MAJOR < 60) + public const bool FF_API_VULKAN_CONTIGUOUS_MEMORY = LIBAVUTIL_VERSION_MAJOR < 0x3c; + // public static FF_ARRAY_ELEMS = (a) (sizeof(a) / sizeof((a)[0])); + /// FF_BUG_AMV = 0x20 + public const int FF_BUG_AMV = 0x20; + /// FF_BUG_AUTODETECT = 0x1 + public const int FF_BUG_AUTODETECT = 0x1; + /// FF_BUG_DC_CLIP = 0x1000 + public const int FF_BUG_DC_CLIP = 0x1000; + /// FF_BUG_DIRECT_BLOCKSIZE = 0x200 + public const int FF_BUG_DIRECT_BLOCKSIZE = 0x200; + /// FF_BUG_EDGE = 0x400 + public const int FF_BUG_EDGE = 0x400; + /// FF_BUG_HPEL_CHROMA = 0x800 + public const int FF_BUG_HPEL_CHROMA = 0x800; + /// FF_BUG_IEDGE = 0x8000 + public const int FF_BUG_IEDGE = 0x8000; + /// FF_BUG_MS = 0x2000 + public const int FF_BUG_MS = 0x2000; + /// FF_BUG_NO_PADDING = 0x10 + public const int FF_BUG_NO_PADDING = 0x10; + /// FF_BUG_QPEL_CHROMA = 0x40 + public const int FF_BUG_QPEL_CHROMA = 0x40; + /// FF_BUG_QPEL_CHROMA2 = 0x100 + public const int FF_BUG_QPEL_CHROMA2 = 0x100; + /// FF_BUG_STD_QPEL = 0x80 + public const int FF_BUG_STD_QPEL = 0x80; + /// FF_BUG_TRUNCATED = 0x4000 + public const int FF_BUG_TRUNCATED = 0x4000; + /// FF_BUG_UMP4 = 0x8 + public const int FF_BUG_UMP4 = 0x8; + /// FF_BUG_XVID_ILACE = 0x4 + public const int FF_BUG_XVID_ILACE = 0x4; + // public static FF_CEIL_RSHIFT = AV_CEIL_RSHIFT; + /// FF_CMP_BIT = 0x5 + public const int FF_CMP_BIT = 0x5; + /// FF_CMP_CHROMA = 0x100 + public const int FF_CMP_CHROMA = 0x100; + /// FF_CMP_DCT = 0x3 + public const int FF_CMP_DCT = 0x3; + /// FF_CMP_DCT264 = 0xe + public const int FF_CMP_DCT264 = 0xe; + /// FF_CMP_DCTMAX = 0xd + public const int FF_CMP_DCTMAX = 0xd; + /// FF_CMP_MEDIAN_SAD = 0xf + public const int FF_CMP_MEDIAN_SAD = 0xf; + /// FF_CMP_NSSE = 0xa + public const int FF_CMP_NSSE = 0xa; + /// FF_CMP_PSNR = 0x4 + public const int FF_CMP_PSNR = 0x4; + /// FF_CMP_RD = 0x6 + public const int FF_CMP_RD = 0x6; + /// FF_CMP_SAD = 0x0 + public const int FF_CMP_SAD = 0x0; + /// FF_CMP_SATD = 0x2 + public const int FF_CMP_SATD = 0x2; + /// FF_CMP_SSE = 0x1 + public const int FF_CMP_SSE = 0x1; + /// FF_CMP_VSAD = 0x8 + public const int FF_CMP_VSAD = 0x8; + /// FF_CMP_VSSE = 0x9 + public const int FF_CMP_VSSE = 0x9; + /// FF_CMP_W53 = 0xb + public const int FF_CMP_W53 = 0xb; + /// FF_CMP_W97 = 0xc + public const int FF_CMP_W97 = 0xc; + /// FF_CMP_ZERO = 0x7 + public const int FF_CMP_ZERO = 0x7; + /// FF_CODEC_PROPERTY_CLOSED_CAPTIONS = 0x2 + public const int FF_CODEC_PROPERTY_CLOSED_CAPTIONS = 0x2; + /// FF_CODEC_PROPERTY_FILM_GRAIN = 0x4 + public const int FF_CODEC_PROPERTY_FILM_GRAIN = 0x4; + /// FF_CODEC_PROPERTY_LOSSLESS = 0x1 + public const int FF_CODEC_PROPERTY_LOSSLESS = 0x1; + /// FF_COMPLIANCE_EXPERIMENTAL = -2 + public const int FF_COMPLIANCE_EXPERIMENTAL = -0x2; + /// FF_COMPLIANCE_NORMAL = 0 + public const int FF_COMPLIANCE_NORMAL = 0x0; + /// FF_COMPLIANCE_STRICT = 1 + public const int FF_COMPLIANCE_STRICT = 0x1; + /// FF_COMPLIANCE_UNOFFICIAL = -1 + public const int FF_COMPLIANCE_UNOFFICIAL = -0x1; + /// FF_COMPLIANCE_VERY_STRICT = 2 + public const int FF_COMPLIANCE_VERY_STRICT = 0x2; + /// FF_COMPRESSION_DEFAULT = -0x1 + public const int FF_COMPRESSION_DEFAULT = -0x1; + /// FF_DCT_ALTIVEC = 0x5 + public const int FF_DCT_ALTIVEC = 0x5; + /// FF_DCT_AUTO = 0x0 + public const int FF_DCT_AUTO = 0x0; + /// FF_DCT_FAAN = 0x6 + public const int FF_DCT_FAAN = 0x6; + /// FF_DCT_FASTINT = 0x1 + public const int FF_DCT_FASTINT = 0x1; + /// FF_DCT_INT = 0x2 + public const int FF_DCT_INT = 0x2; + /// FF_DCT_MMX = 0x3 + public const int FF_DCT_MMX = 0x3; + /// FF_DEBUG_BITSTREAM = 0x4 + public const int FF_DEBUG_BITSTREAM = 0x4; + /// FF_DEBUG_BUFFERS = 0x8000 + public const int FF_DEBUG_BUFFERS = 0x8000; + /// FF_DEBUG_BUGS = 0x1000 + public const int FF_DEBUG_BUGS = 0x1000; + /// FF_DEBUG_DCT_COEFF = 0x40 + public const int FF_DEBUG_DCT_COEFF = 0x40; + /// FF_DEBUG_ER = 0x400 + public const int FF_DEBUG_ER = 0x400; + /// FF_DEBUG_GREEN_MD = 0x800000 + public const int FF_DEBUG_GREEN_MD = 0x800000; + /// FF_DEBUG_MB_TYPE = 0x8 + public const int FF_DEBUG_MB_TYPE = 0x8; + /// FF_DEBUG_MMCO = 0x800 + public const int FF_DEBUG_MMCO = 0x800; + /// FF_DEBUG_NOMC = 0x1000000 + public const int FF_DEBUG_NOMC = 0x1000000; + /// FF_DEBUG_PICT_INFO = 0x1 + public const int FF_DEBUG_PICT_INFO = 0x1; + /// FF_DEBUG_QP = 0x10 + public const int FF_DEBUG_QP = 0x10; + /// FF_DEBUG_RC = 0x2 + public const int FF_DEBUG_RC = 0x2; + /// FF_DEBUG_SKIP = 0x80 + public const int FF_DEBUG_SKIP = 0x80; + /// FF_DEBUG_STARTCODE = 0x100 + public const int FF_DEBUG_STARTCODE = 0x100; + /// FF_DEBUG_THREADS = 0x10000 + public const int FF_DEBUG_THREADS = 0x10000; + /// FF_DECODE_ERROR_CONCEALMENT_ACTIVE = 4 + public const int FF_DECODE_ERROR_CONCEALMENT_ACTIVE = 0x4; + /// FF_DECODE_ERROR_DECODE_SLICES = 8 + public const int FF_DECODE_ERROR_DECODE_SLICES = 0x8; + /// FF_DECODE_ERROR_INVALID_BITSTREAM = 1 + public const int FF_DECODE_ERROR_INVALID_BITSTREAM = 0x1; + /// FF_DECODE_ERROR_MISSING_REFERENCE = 2 + public const int FF_DECODE_ERROR_MISSING_REFERENCE = 0x2; + /// FF_EC_DEBLOCK = 0x2 + public const int FF_EC_DEBLOCK = 0x2; + /// FF_EC_FAVOR_INTER = 0x100 + public const int FF_EC_FAVOR_INTER = 0x100; + /// FF_EC_GUESS_MVS = 0x1 + public const int FF_EC_GUESS_MVS = 0x1; + /// FF_FDEBUG_TS = 0x0001 + public const int FF_FDEBUG_TS = 0x1; + /// FF_IDCT_ALTIVEC = 0x8 + public const int FF_IDCT_ALTIVEC = 0x8; + /// FF_IDCT_ARM = 0x7 + public const int FF_IDCT_ARM = 0x7; + /// FF_IDCT_AUTO = 0x0 + public const int FF_IDCT_AUTO = 0x0; + /// FF_IDCT_FAAN = 0x14 + public const int FF_IDCT_FAAN = 0x14; + /// FF_IDCT_INT = 0x1 + public const int FF_IDCT_INT = 0x1; + /// FF_IDCT_SIMPLE = 0x2 + public const int FF_IDCT_SIMPLE = 0x2; + /// FF_IDCT_SIMPLEARM = 0xa + public const int FF_IDCT_SIMPLEARM = 0xa; + /// FF_IDCT_SIMPLEARMV5TE = 0x10 + public const int FF_IDCT_SIMPLEARMV5TE = 0x10; + /// FF_IDCT_SIMPLEARMV6 = 0x11 + public const int FF_IDCT_SIMPLEARMV6 = 0x11; + /// FF_IDCT_SIMPLEAUTO = 0x80 + public const int FF_IDCT_SIMPLEAUTO = 0x80; + /// FF_IDCT_SIMPLEMMX = 0x3 + public const int FF_IDCT_SIMPLEMMX = 0x3; + /// FF_IDCT_SIMPLENEON = 0x16 + public const int FF_IDCT_SIMPLENEON = 0x16; + /// FF_IDCT_XVID = 0xe + public const int FF_IDCT_XVID = 0xe; + /// FF_LAMBDA_MAX = (256*128-1) + public const int FF_LAMBDA_MAX = 0x100 * 0x80 - 0x1; + /// FF_LAMBDA_SCALE = (1<<FF_LAMBDA_SHIFT) + public const int FF_LAMBDA_SCALE = 0x1 << FF_LAMBDA_SHIFT; + /// FF_LAMBDA_SHIFT = 7 + public const int FF_LAMBDA_SHIFT = 0x7; + /// FF_LEVEL_UNKNOWN = -0x63 + public const int FF_LEVEL_UNKNOWN = -0x63; + /// FF_LOSS_ALPHA = 0x8 + public const int FF_LOSS_ALPHA = 0x8; + /// FF_LOSS_CHROMA = 0x20 + public const int FF_LOSS_CHROMA = 0x20; + /// FF_LOSS_COLORQUANT = 0x10 + public const int FF_LOSS_COLORQUANT = 0x10; + /// FF_LOSS_COLORSPACE = 0x4 + public const int FF_LOSS_COLORSPACE = 0x4; + /// FF_LOSS_DEPTH = 0x2 + public const int FF_LOSS_DEPTH = 0x2; + /// FF_LOSS_EXCESS_DEPTH = 0x80 + public const int FF_LOSS_EXCESS_DEPTH = 0x80; + /// FF_LOSS_EXCESS_RESOLUTION = 0x40 + public const int FF_LOSS_EXCESS_RESOLUTION = 0x40; + /// FF_LOSS_RESOLUTION = 0x1 + public const int FF_LOSS_RESOLUTION = 0x1; + /// FF_MB_DECISION_BITS = 0x1 + public const int FF_MB_DECISION_BITS = 0x1; + /// FF_MB_DECISION_RD = 0x2 + public const int FF_MB_DECISION_RD = 0x2; + /// FF_MB_DECISION_SIMPLE = 0x0 + public const int FF_MB_DECISION_SIMPLE = 0x0; + /// FF_PROFILE_AAC_ELD = 0x26 + public const int FF_PROFILE_AAC_ELD = 0x26; + /// FF_PROFILE_AAC_HE = 0x4 + public const int FF_PROFILE_AAC_HE = 0x4; + /// FF_PROFILE_AAC_HE_V2 = 0x1c + public const int FF_PROFILE_AAC_HE_V2 = 0x1c; + /// FF_PROFILE_AAC_LD = 0x16 + public const int FF_PROFILE_AAC_LD = 0x16; + /// FF_PROFILE_AAC_LOW = 0x1 + public const int FF_PROFILE_AAC_LOW = 0x1; + /// FF_PROFILE_AAC_LTP = 0x3 + public const int FF_PROFILE_AAC_LTP = 0x3; + /// FF_PROFILE_AAC_MAIN = 0x0 + public const int FF_PROFILE_AAC_MAIN = 0x0; + /// FF_PROFILE_AAC_SSR = 0x2 + public const int FF_PROFILE_AAC_SSR = 0x2; + /// FF_PROFILE_ARIB_PROFILE_A = 0x0 + public const int FF_PROFILE_ARIB_PROFILE_A = 0x0; + /// FF_PROFILE_ARIB_PROFILE_C = 0x1 + public const int FF_PROFILE_ARIB_PROFILE_C = 0x1; + /// FF_PROFILE_AV1_HIGH = 0x1 + public const int FF_PROFILE_AV1_HIGH = 0x1; + /// FF_PROFILE_AV1_MAIN = 0x0 + public const int FF_PROFILE_AV1_MAIN = 0x0; + /// FF_PROFILE_AV1_PROFESSIONAL = 0x2 + public const int FF_PROFILE_AV1_PROFESSIONAL = 0x2; + /// FF_PROFILE_DNXHD = 0x0 + public const int FF_PROFILE_DNXHD = 0x0; + /// FF_PROFILE_DNXHR_444 = 0x5 + public const int FF_PROFILE_DNXHR_444 = 0x5; + /// FF_PROFILE_DNXHR_HQ = 0x3 + public const int FF_PROFILE_DNXHR_HQ = 0x3; + /// FF_PROFILE_DNXHR_HQX = 0x4 + public const int FF_PROFILE_DNXHR_HQX = 0x4; + /// FF_PROFILE_DNXHR_LB = 0x1 + public const int FF_PROFILE_DNXHR_LB = 0x1; + /// FF_PROFILE_DNXHR_SQ = 0x2 + public const int FF_PROFILE_DNXHR_SQ = 0x2; + /// FF_PROFILE_DTS = 0x14 + public const int FF_PROFILE_DTS = 0x14; + /// FF_PROFILE_DTS_96_24 = 0x28 + public const int FF_PROFILE_DTS_96_24 = 0x28; + /// FF_PROFILE_DTS_ES = 0x1e + public const int FF_PROFILE_DTS_ES = 0x1e; + /// FF_PROFILE_DTS_EXPRESS = 0x46 + public const int FF_PROFILE_DTS_EXPRESS = 0x46; + /// FF_PROFILE_DTS_HD_HRA = 0x32 + 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 + public const int FF_PROFILE_H264_CAVLC_444 = 0x2c; + /// FF_PROFILE_H264_CONSTRAINED = 0x1 << 0x9 + public const int FF_PROFILE_H264_CONSTRAINED = 0x1 << 0x9; + /// FF_PROFILE_H264_CONSTRAINED_BASELINE = 0x42 | FF_PROFILE_H264_CONSTRAINED + public const int FF_PROFILE_H264_CONSTRAINED_BASELINE = 0x42 | FF_PROFILE_H264_CONSTRAINED; + /// FF_PROFILE_H264_EXTENDED = 0x58 + public const int FF_PROFILE_H264_EXTENDED = 0x58; + /// FF_PROFILE_H264_HIGH = 0x64 + public const int FF_PROFILE_H264_HIGH = 0x64; + /// FF_PROFILE_H264_HIGH_10 = 0x6e + public const int FF_PROFILE_H264_HIGH_10 = 0x6e; + /// FF_PROFILE_H264_HIGH_10_INTRA = 0x6e | FF_PROFILE_H264_INTRA + public const int FF_PROFILE_H264_HIGH_10_INTRA = 0x6e | FF_PROFILE_H264_INTRA; + /// FF_PROFILE_H264_HIGH_422 = 0x7a + public const int FF_PROFILE_H264_HIGH_422 = 0x7a; + /// FF_PROFILE_H264_HIGH_422_INTRA = 0x7a | FF_PROFILE_H264_INTRA + public const int FF_PROFILE_H264_HIGH_422_INTRA = 0x7a | FF_PROFILE_H264_INTRA; + /// FF_PROFILE_H264_HIGH_444 = 0x90 + public const int FF_PROFILE_H264_HIGH_444 = 0x90; + /// FF_PROFILE_H264_HIGH_444_INTRA = 0xf4 | FF_PROFILE_H264_INTRA + public const int FF_PROFILE_H264_HIGH_444_INTRA = 0xf4 | FF_PROFILE_H264_INTRA; + /// FF_PROFILE_H264_HIGH_444_PREDICTIVE = 0xf4 + public const int FF_PROFILE_H264_HIGH_444_PREDICTIVE = 0xf4; + /// FF_PROFILE_H264_INTRA = 0x1 << 0xb + public const int FF_PROFILE_H264_INTRA = 0x1 << 0xb; + /// FF_PROFILE_H264_MAIN = 0x4d + public const int FF_PROFILE_H264_MAIN = 0x4d; + /// FF_PROFILE_H264_MULTIVIEW_HIGH = 0x76 + public const int FF_PROFILE_H264_MULTIVIEW_HIGH = 0x76; + /// FF_PROFILE_H264_STEREO_HIGH = 0x80 + public const int FF_PROFILE_H264_STEREO_HIGH = 0x80; + /// FF_PROFILE_HEVC_MAIN = 0x1 + public const int FF_PROFILE_HEVC_MAIN = 0x1; + /// FF_PROFILE_HEVC_MAIN_10 = 0x2 + public const int FF_PROFILE_HEVC_MAIN_10 = 0x2; + /// FF_PROFILE_HEVC_MAIN_STILL_PICTURE = 0x3 + 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 + public const int FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 = 0x1; + /// FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 0x2 + public const int FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 = 0x2; + /// FF_PROFILE_JPEG2000_DCINEMA_2K = 0x3 + public const int FF_PROFILE_JPEG2000_DCINEMA_2K = 0x3; + /// FF_PROFILE_JPEG2000_DCINEMA_4K = 0x4 + public const int FF_PROFILE_JPEG2000_DCINEMA_4K = 0x4; + /// FF_PROFILE_KLVA_ASYNC = 0x1 + public const int FF_PROFILE_KLVA_ASYNC = 0x1; + /// FF_PROFILE_KLVA_SYNC = 0x0 + public const int FF_PROFILE_KLVA_SYNC = 0x0; + /// FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT = 0xc0 + public const int FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT = 0xc0; + /// FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT = 0xc1 + public const int FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT = 0xc1; + /// FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS = 0xc3 + public const int FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS = 0xc3; + /// FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT = 0xc2 + public const int FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT = 0xc2; + /// FF_PROFILE_MJPEG_JPEG_LS = 0xf7 + public const int FF_PROFILE_MJPEG_JPEG_LS = 0xf7; + /// FF_PROFILE_MPEG2_422 = 0x0 + public const int FF_PROFILE_MPEG2_422 = 0x0; + /// FF_PROFILE_MPEG2_AAC_HE = 0x83 + public const int FF_PROFILE_MPEG2_AAC_HE = 0x83; + /// FF_PROFILE_MPEG2_AAC_LOW = 0x80 + public const int FF_PROFILE_MPEG2_AAC_LOW = 0x80; + /// FF_PROFILE_MPEG2_HIGH = 0x1 + public const int FF_PROFILE_MPEG2_HIGH = 0x1; + /// FF_PROFILE_MPEG2_MAIN = 0x4 + public const int FF_PROFILE_MPEG2_MAIN = 0x4; + /// FF_PROFILE_MPEG2_SIMPLE = 0x5 + public const int FF_PROFILE_MPEG2_SIMPLE = 0x5; + /// FF_PROFILE_MPEG2_SNR_SCALABLE = 0x3 + public const int FF_PROFILE_MPEG2_SNR_SCALABLE = 0x3; + /// FF_PROFILE_MPEG2_SS = 0x2 + public const int FF_PROFILE_MPEG2_SS = 0x2; + /// FF_PROFILE_MPEG4_ADVANCED_CODING = 0xb + public const int FF_PROFILE_MPEG4_ADVANCED_CODING = 0xb; + /// FF_PROFILE_MPEG4_ADVANCED_CORE = 0xc + public const int FF_PROFILE_MPEG4_ADVANCED_CORE = 0xc; + /// FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 0x9 + public const int FF_PROFILE_MPEG4_ADVANCED_REAL_TIME = 0x9; + /// FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 0xd + public const int FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE = 0xd; + /// FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 0xf + public const int FF_PROFILE_MPEG4_ADVANCED_SIMPLE = 0xf; + /// FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 0x7 + public const int FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE = 0x7; + /// FF_PROFILE_MPEG4_CORE = 0x2 + public const int FF_PROFILE_MPEG4_CORE = 0x2; + /// FF_PROFILE_MPEG4_CORE_SCALABLE = 0xa + public const int FF_PROFILE_MPEG4_CORE_SCALABLE = 0xa; + /// FF_PROFILE_MPEG4_HYBRID = 0x8 + public const int FF_PROFILE_MPEG4_HYBRID = 0x8; + /// FF_PROFILE_MPEG4_MAIN = 0x3 + public const int FF_PROFILE_MPEG4_MAIN = 0x3; + /// FF_PROFILE_MPEG4_N_BIT = 0x4 + public const int FF_PROFILE_MPEG4_N_BIT = 0x4; + /// FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 0x5 + public const int FF_PROFILE_MPEG4_SCALABLE_TEXTURE = 0x5; + /// FF_PROFILE_MPEG4_SIMPLE = 0x0 + public const int FF_PROFILE_MPEG4_SIMPLE = 0x0; + /// FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 0x6 + public const int FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION = 0x6; + /// FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 0x1 + public const int FF_PROFILE_MPEG4_SIMPLE_SCALABLE = 0x1; + /// FF_PROFILE_MPEG4_SIMPLE_STUDIO = 0xe + public const int FF_PROFILE_MPEG4_SIMPLE_STUDIO = 0xe; + /// FF_PROFILE_PRORES_4444 = 0x4 + public const int FF_PROFILE_PRORES_4444 = 0x4; + /// FF_PROFILE_PRORES_HQ = 0x3 + public const int FF_PROFILE_PRORES_HQ = 0x3; + /// FF_PROFILE_PRORES_LT = 0x1 + public const int FF_PROFILE_PRORES_LT = 0x1; + /// FF_PROFILE_PRORES_PROXY = 0x0 + public const int FF_PROFILE_PRORES_PROXY = 0x0; + /// FF_PROFILE_PRORES_STANDARD = 0x2 + public const int FF_PROFILE_PRORES_STANDARD = 0x2; + /// FF_PROFILE_PRORES_XQ = 0x5 + public const int FF_PROFILE_PRORES_XQ = 0x5; + /// FF_PROFILE_RESERVED = -0x64 + 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 + public const int FF_PROFILE_VC1_ADVANCED = 0x3; + /// FF_PROFILE_VC1_COMPLEX = 0x2 + public const int FF_PROFILE_VC1_COMPLEX = 0x2; + /// FF_PROFILE_VC1_MAIN = 0x1 + public const int FF_PROFILE_VC1_MAIN = 0x1; + /// FF_PROFILE_VC1_SIMPLE = 0x0 + public const int FF_PROFILE_VC1_SIMPLE = 0x0; + /// FF_PROFILE_VP9_0 = 0x0 + public const int FF_PROFILE_VP9_0 = 0x0; + /// FF_PROFILE_VP9_1 = 0x1 + public const int FF_PROFILE_VP9_1 = 0x1; + /// FF_PROFILE_VP9_2 = 0x2 + public const int FF_PROFILE_VP9_2 = 0x2; + /// FF_PROFILE_VP9_3 = 0x3 + public const int FF_PROFILE_VP9_3 = 0x3; + /// FF_PROFILE_VVC_MAIN_10 = 0x1 + public const int FF_PROFILE_VVC_MAIN_10 = 0x1; + /// FF_PROFILE_VVC_MAIN_10_444 = 0x21 + public const int FF_PROFILE_VVC_MAIN_10_444 = 0x21; + /// FF_QP2LAMBDA = 118 + public const int FF_QP2LAMBDA = 0x76; + /// FF_QUALITY_SCALE = FF_LAMBDA_SCALE + public const int FF_QUALITY_SCALE = FF_LAMBDA_SCALE; + /// FF_SUB_CHARENC_MODE_AUTOMATIC = 0x0 + public const int FF_SUB_CHARENC_MODE_AUTOMATIC = 0x0; + /// FF_SUB_CHARENC_MODE_DO_NOTHING = -0x1 + public const int FF_SUB_CHARENC_MODE_DO_NOTHING = -0x1; + /// FF_SUB_CHARENC_MODE_IGNORE = 0x2 + public const int FF_SUB_CHARENC_MODE_IGNORE = 0x2; + /// FF_SUB_CHARENC_MODE_PRE_DECODER = 0x1 + public const int FF_SUB_CHARENC_MODE_PRE_DECODER = 0x1; + // public static FFABS = (a) ((a) >= 0 ? (a) : (-(a))); + // public static FFABS64U = (a) ((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a)); + // public static FFABSU = (a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a)); + // public static FFALIGN = x; + // public static FFDIFFSIGN = x; + // public static FFERRTAG = a; + // public static FFMAX = (a,b) ((a) > (b) ? (a) : (b)); + // public static FFMAX3 = a; + // public static FFMIN = (a,b) ((a) > (b) ? (b) : (a)); + // public static FFMIN3 = a; + // public static FFNABS = (a) ((a) <= 0 ? (a) : (-(a))); + // public static FFSIGN = (a) ((a) > 0 ? 1 : -1); + // public static FFSWAP = (type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0); + // public static FFUDIV = (a,b) (((a)>0 ?(a):(a)-(b)+1) / (b)); + // public static FFUMOD = a; + // public static GET_UTF16 = (val, GET_16BIT, ERROR)val = (GET_16BIT);{unsigned int hi = val - 0xD800;if (hi < 0x800) {val = (GET_16BIT) - 0xDC00;if (val > 0x3FFU || hi > 0x3FFU){ERROR}val += (hi<<10) + 0x10000;}}; + // public static GET_UTF8 = (val, GET_BYTE, ERROR)val= (GET_BYTE);{uint32_t top = (val & 128) >> 1;if ((val & 0xc0) == 0x80 || val >= 0xFE){ERROR}while (val & top) {unsigned int tmp = (GET_BYTE) - 128;if(tmp>>6){ERROR}val= (val<<6) + tmp;top <<= 5;}val &= (top << 1) - 1;}; + /// LIBAVCODEC_BUILD = LIBAVCODEC_VERSION_INT + public static readonly int LIBAVCODEC_BUILD = LIBAVCODEC_VERSION_INT; + /// LIBAVCODEC_IDENT = "Lavc" + public const string LIBAVCODEC_IDENT = "Lavc"; + /// LIBAVCODEC_VERSION = AV_VERSION(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO) + public static readonly string LIBAVCODEC_VERSION = AV_VERSION(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO); + /// LIBAVCODEC_VERSION_INT = AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO) + public static readonly int LIBAVCODEC_VERSION_INT = AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO); + /// LIBAVCODEC_VERSION_MAJOR = 61 + public const int LIBAVCODEC_VERSION_MAJOR = 0x3d; + /// LIBAVCODEC_VERSION_MICRO = 0x64 + public const int LIBAVCODEC_VERSION_MICRO = 0x64; + /// LIBAVCODEC_VERSION_MINOR = 0x3 + public const int LIBAVCODEC_VERSION_MINOR = 0x3; + /// LIBAVDEVICE_BUILD = LIBAVDEVICE_VERSION_INT + public static readonly int LIBAVDEVICE_BUILD = LIBAVDEVICE_VERSION_INT; + /// LIBAVDEVICE_IDENT = "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) + public const string LIBAVDEVICE_IDENT = "Lavd"; + /// LIBAVDEVICE_VERSION = AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, LIBAVDEVICE_VERSION_MINOR, LIBAVDEVICE_VERSION_MICRO) + public static readonly string LIBAVDEVICE_VERSION = AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, LIBAVDEVICE_VERSION_MINOR, LIBAVDEVICE_VERSION_MICRO); + /// LIBAVDEVICE_VERSION_INT = AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, LIBAVDEVICE_VERSION_MINOR, LIBAVDEVICE_VERSION_MICRO) + public static readonly int LIBAVDEVICE_VERSION_INT = AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, LIBAVDEVICE_VERSION_MINOR, LIBAVDEVICE_VERSION_MICRO); + /// LIBAVDEVICE_VERSION_MAJOR = 61 + public const int LIBAVDEVICE_VERSION_MAJOR = 0x3d; + /// LIBAVDEVICE_VERSION_MICRO = 100 + public const int LIBAVDEVICE_VERSION_MICRO = 0x64; + /// LIBAVDEVICE_VERSION_MINOR = 1 + public const int LIBAVDEVICE_VERSION_MINOR = 0x1; + /// LIBAVFILTER_BUILD = LIBAVFILTER_VERSION_INT + public static readonly int LIBAVFILTER_BUILD = LIBAVFILTER_VERSION_INT; + /// LIBAVFILTER_IDENT = "Lavfi" + public const string LIBAVFILTER_IDENT = "Lavfi"; + /// LIBAVFILTER_VERSION = AV_VERSION(LIBAVFILTER_VERSION_MAJOR, LIBAVFILTER_VERSION_MINOR, LIBAVFILTER_VERSION_MICRO) + public static readonly string LIBAVFILTER_VERSION = AV_VERSION(LIBAVFILTER_VERSION_MAJOR, LIBAVFILTER_VERSION_MINOR, LIBAVFILTER_VERSION_MICRO); + /// LIBAVFILTER_VERSION_INT = AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, LIBAVFILTER_VERSION_MINOR, LIBAVFILTER_VERSION_MICRO) + public static readonly int LIBAVFILTER_VERSION_INT = AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, LIBAVFILTER_VERSION_MINOR, LIBAVFILTER_VERSION_MICRO); + /// LIBAVFILTER_VERSION_MAJOR = 0xa + public const int LIBAVFILTER_VERSION_MAJOR = 0xa; + /// LIBAVFILTER_VERSION_MICRO = 0x64 + public const int LIBAVFILTER_VERSION_MICRO = 0x64; + /// LIBAVFILTER_VERSION_MINOR = 0x1 + public const int LIBAVFILTER_VERSION_MINOR = 0x1; + /// LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT + public static readonly int LIBAVFORMAT_BUILD = LIBAVFORMAT_VERSION_INT; + /// LIBAVFORMAT_IDENT = "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) + public const string LIBAVFORMAT_IDENT = "Lavf"; + /// LIBAVFORMAT_VERSION = AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO) + public static readonly string LIBAVFORMAT_VERSION = AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO); + /// LIBAVFORMAT_VERSION_INT = AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO) + public static readonly int LIBAVFORMAT_VERSION_INT = AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO); + /// LIBAVFORMAT_VERSION_MAJOR = 61 + public const int LIBAVFORMAT_VERSION_MAJOR = 0x3d; + /// LIBAVFORMAT_VERSION_MICRO = 100 + public const int LIBAVFORMAT_VERSION_MICRO = 0x64; + /// LIBAVFORMAT_VERSION_MINOR = 1 + public const int LIBAVFORMAT_VERSION_MINOR = 0x1; + /// LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT + public static readonly int LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT; + /// LIBAVUTIL_IDENT = "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) + public const string LIBAVUTIL_IDENT = "Lavu"; + /// LIBAVUTIL_VERSION = AV_VERSION(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO) + public static readonly string LIBAVUTIL_VERSION = AV_VERSION(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO); + /// LIBAVUTIL_VERSION_INT = AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO) + public static readonly int LIBAVUTIL_VERSION_INT = AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO); + /// LIBAVUTIL_VERSION_MAJOR = 59 + public const int LIBAVUTIL_VERSION_MAJOR = 0x3b; + /// LIBAVUTIL_VERSION_MICRO = 100 + public const int LIBAVUTIL_VERSION_MICRO = 0x64; + /// LIBAVUTIL_VERSION_MINOR = 8 + public const int LIBAVUTIL_VERSION_MINOR = 0x8; + /// LIBPOSTPROC_BUILD = LIBPOSTPROC_VERSION_INT + public static readonly int LIBPOSTPROC_BUILD = LIBPOSTPROC_VERSION_INT; + /// LIBPOSTPROC_IDENT = "postproc" + public const string LIBPOSTPROC_IDENT = "postproc"; + /// LIBPOSTPROC_VERSION = AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, LIBPOSTPROC_VERSION_MINOR, LIBPOSTPROC_VERSION_MICRO) + public static readonly string LIBPOSTPROC_VERSION = AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, LIBPOSTPROC_VERSION_MINOR, LIBPOSTPROC_VERSION_MICRO); + /// LIBPOSTPROC_VERSION_INT = AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, LIBPOSTPROC_VERSION_MINOR, LIBPOSTPROC_VERSION_MICRO) + public static readonly int LIBPOSTPROC_VERSION_INT = AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, LIBPOSTPROC_VERSION_MINOR, LIBPOSTPROC_VERSION_MICRO); + /// LIBPOSTPROC_VERSION_MAJOR = 0x3a + public const int LIBPOSTPROC_VERSION_MAJOR = 0x3a; + /// LIBPOSTPROC_VERSION_MICRO = 0x64 + public const int LIBPOSTPROC_VERSION_MICRO = 0x64; + /// LIBPOSTPROC_VERSION_MINOR = 0x1 + public const int LIBPOSTPROC_VERSION_MINOR = 0x1; + /// LIBSWRESAMPLE_BUILD = LIBSWRESAMPLE_VERSION_INT + public static readonly int LIBSWRESAMPLE_BUILD = LIBSWRESAMPLE_VERSION_INT; + /// LIBSWRESAMPLE_IDENT = "SwR" + public const string LIBSWRESAMPLE_IDENT = "SwR"; + /// LIBSWRESAMPLE_VERSION = AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, LIBSWRESAMPLE_VERSION_MINOR, LIBSWRESAMPLE_VERSION_MICRO) + public static readonly string LIBSWRESAMPLE_VERSION = AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, LIBSWRESAMPLE_VERSION_MINOR, LIBSWRESAMPLE_VERSION_MICRO); + /// LIBSWRESAMPLE_VERSION_INT = AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, LIBSWRESAMPLE_VERSION_MINOR, LIBSWRESAMPLE_VERSION_MICRO) + public static readonly int LIBSWRESAMPLE_VERSION_INT = AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, LIBSWRESAMPLE_VERSION_MINOR, LIBSWRESAMPLE_VERSION_MICRO); + /// LIBSWRESAMPLE_VERSION_MAJOR = 0x5 + public const int LIBSWRESAMPLE_VERSION_MAJOR = 0x5; + /// LIBSWRESAMPLE_VERSION_MICRO = 0x64 + public const int LIBSWRESAMPLE_VERSION_MICRO = 0x64; + /// LIBSWRESAMPLE_VERSION_MINOR = 0x1 + public const int LIBSWRESAMPLE_VERSION_MINOR = 0x1; + /// LIBSWSCALE_BUILD = LIBSWSCALE_VERSION_INT + public static readonly int LIBSWSCALE_BUILD = LIBSWSCALE_VERSION_INT; + /// LIBSWSCALE_IDENT = "SwS" + public const string LIBSWSCALE_IDENT = "SwS"; + /// LIBSWSCALE_VERSION = AV_VERSION(LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO) + public static readonly string LIBSWSCALE_VERSION = AV_VERSION(LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO); + /// LIBSWSCALE_VERSION_INT = AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO) + public static readonly int LIBSWSCALE_VERSION_INT = AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO); + /// LIBSWSCALE_VERSION_MAJOR = 0x8 + public const int LIBSWSCALE_VERSION_MAJOR = 0x8; + /// LIBSWSCALE_VERSION_MICRO = 0x64 + public const int LIBSWSCALE_VERSION_MICRO = 0x64; + /// LIBSWSCALE_VERSION_MINOR = 0x1 + public const int LIBSWSCALE_VERSION_MINOR = 0x1; + /// 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 + public const int PARSER_FLAG_COMPLETE_FRAMES = 0x1; + /// PARSER_FLAG_FETCHED_OFFSET = 0x4 + public const int PARSER_FLAG_FETCHED_OFFSET = 0x4; + /// PARSER_FLAG_ONCE = 0x2 + public const int PARSER_FLAG_ONCE = 0x2; + /// PARSER_FLAG_USE_CODEC_TS = 0x1000 + public const int PARSER_FLAG_USE_CODEC_TS = 0x1000; + /// PP_CPU_CAPS_3DNOW = 0x40000000 + public const int PP_CPU_CAPS_3DNOW = 0x40000000; + /// PP_CPU_CAPS_ALTIVEC = 0x10000000 + public const int PP_CPU_CAPS_ALTIVEC = 0x10000000; + /// PP_CPU_CAPS_AUTO = 0x80000 + public const int PP_CPU_CAPS_AUTO = 0x80000; + /// PP_CPU_CAPS_MMX = 0x80000000U + public const uint PP_CPU_CAPS_MMX = 0x80000000U; + /// PP_CPU_CAPS_MMX2 = 0x20000000 + public const int PP_CPU_CAPS_MMX2 = 0x20000000; + /// PP_FORMAT = 0x8 + public const int PP_FORMAT = 0x8; + /// PP_FORMAT_411 = 0x2 | PP_FORMAT + public const int PP_FORMAT_411 = 0x2 | PP_FORMAT; + /// PP_FORMAT_420 = 0x11 | PP_FORMAT + public const int PP_FORMAT_420 = 0x11 | PP_FORMAT; + /// PP_FORMAT_422 = 0x1 | PP_FORMAT + public const int PP_FORMAT_422 = 0x1 | PP_FORMAT; + /// PP_FORMAT_440 = 0x10 | PP_FORMAT + public const int PP_FORMAT_440 = 0x10 | PP_FORMAT; + /// PP_FORMAT_444 = 0x0 | PP_FORMAT + public const int PP_FORMAT_444 = 0x0 | PP_FORMAT; + /// PP_PICT_TYPE_QP2 = 0x10 + public const int PP_PICT_TYPE_QP2 = 0x10; + /// PP_QUALITY_MAX = 0x6 + public const int PP_QUALITY_MAX = 0x6; + // public static PUT_UTF16 = (val, tmp, PUT_16BIT){uint32_t in = val;if (in < 0x10000) {tmp = in;PUT_16BIT} else {tmp = 0xD800 | ((in - 0x10000) >> 10);PUT_16BITtmp = 0xDC00 | ((in - 0x10000) & 0x3FF);PUT_16BIT}}; + // public static PUT_UTF8 = (val, tmp, PUT_BYTE){int bytes, shift;uint32_t in = val;if (in < 0x80) {tmp = in;PUT_BYTE} else {bytes = (av_log2(in) + 4) / 5;shift = (bytes - 1) * 6;tmp = (256 - (256 >> bytes)) | (in >> shift);PUT_BYTEwhile (shift >= 6) {shift -= 6;tmp = 0x80 | ((in >> shift) & 0x3f);PUT_BYTE}}}; + // public static ROUNDED_DIV = (a,b) (((a)>=0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)); + // public static RSHIFT = (a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)); + /// SLICE_FLAG_ALLOW_FIELD = 0x2 + public const int SLICE_FLAG_ALLOW_FIELD = 0x2; + /// SLICE_FLAG_ALLOW_PLANE = 0x4 + public const int SLICE_FLAG_ALLOW_PLANE = 0x4; + /// SLICE_FLAG_CODED_ORDER = 0x1 + public const int SLICE_FLAG_CODED_ORDER = 0x1; + /// SWR_FLAG_RESAMPLE = 0x1 + public const int SWR_FLAG_RESAMPLE = 0x1; + /// SWS_ACCURATE_RND = 0x40000 + public const int SWS_ACCURATE_RND = 0x40000; + /// SWS_AREA = 0x20 + public const int SWS_AREA = 0x20; + /// SWS_BICUBIC = 0x4 + public const int SWS_BICUBIC = 0x4; + /// SWS_BICUBLIN = 0x40 + public const int SWS_BICUBLIN = 0x40; + /// SWS_BILINEAR = 0x2 + public const int SWS_BILINEAR = 0x2; + /// SWS_BITEXACT = 0x80000 + public const int SWS_BITEXACT = 0x80000; + /// SWS_CS_BT2020 = 0x9 + public const int SWS_CS_BT2020 = 0x9; + /// SWS_CS_DEFAULT = 0x5 + public const int SWS_CS_DEFAULT = 0x5; + /// SWS_CS_FCC = 0x4 + public const int SWS_CS_FCC = 0x4; + /// SWS_CS_ITU601 = 0x5 + public const int SWS_CS_ITU601 = 0x5; + /// SWS_CS_ITU624 = 0x5 + public const int SWS_CS_ITU624 = 0x5; + /// SWS_CS_ITU709 = 0x1 + public const int SWS_CS_ITU709 = 0x1; + /// SWS_CS_SMPTE170M = 0x5 + public const int SWS_CS_SMPTE170M = 0x5; + /// SWS_CS_SMPTE240M = 0x7 + public const int SWS_CS_SMPTE240M = 0x7; + /// SWS_DIRECT_BGR = 0x8000 + public const int SWS_DIRECT_BGR = 0x8000; + /// SWS_ERROR_DIFFUSION = 0x800000 + public const int SWS_ERROR_DIFFUSION = 0x800000; + /// SWS_FAST_BILINEAR = 0x1 + public const int SWS_FAST_BILINEAR = 0x1; + /// SWS_FULL_CHR_H_INP = 0x4000 + public const int SWS_FULL_CHR_H_INP = 0x4000; + /// SWS_FULL_CHR_H_INT = 0x2000 + public const int SWS_FULL_CHR_H_INT = 0x2000; + /// SWS_GAUSS = 0x80 + public const int SWS_GAUSS = 0x80; + /// SWS_LANCZOS = 0x200 + public const int SWS_LANCZOS = 0x200; + /// SWS_MAX_REDUCE_CUTOFF = 0.002D + public const double SWS_MAX_REDUCE_CUTOFF = 0.002D; + /// SWS_PARAM_DEFAULT = 0x1e240 + public const int SWS_PARAM_DEFAULT = 0x1e240; + /// SWS_POINT = 0x10 + public const int SWS_POINT = 0x10; + /// SWS_PRINT_INFO = 0x1000 + public const int SWS_PRINT_INFO = 0x1000; + /// SWS_SINC = 0x100 + public const int SWS_SINC = 0x100; + /// SWS_SPLINE = 0x400 + public const int SWS_SPLINE = 0x400; + /// SWS_SRC_V_CHR_DROP_MASK = 0x30000 + public const int SWS_SRC_V_CHR_DROP_MASK = 0x30000; + /// SWS_SRC_V_CHR_DROP_SHIFT = 0x10 + public const int SWS_SRC_V_CHR_DROP_SHIFT = 0x10; + /// SWS_X = 0x8 + public const int SWS_X = 0x8; + */ + #endregion + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.macros.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.macros.g.cs.meta new file mode 100644 index 0000000..e3f5e62 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/leviathan.macros.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1156a8d8f5e1b0c4ab423518683a73c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/vectors.g.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/vectors.g.cs new file mode 100644 index 0000000..b4cf709 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/vectors.g.cs @@ -0,0 +1,3723 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ +using System; +using System.Runtime.InteropServices; + +namespace LeviathanVideo.Abstractions +{ + + public static unsafe partial class vectors + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_find_best_stream_delegate(AVFormatContext* @ic, AVMediaType @type, int @wanted_stream_nb, int @related_stream, AVCodec** @decoder_ret, int @flags); + public static av_find_best_stream_delegate av_find_best_stream; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFrame* av_frame_alloc_delegate(); + public static av_frame_alloc_delegate av_frame_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_frame_free_delegate(AVFrame** @frame); + public static av_frame_free_delegate av_frame_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_get_buffer_size_delegate(AVPixelFormat @pix_fmt, int @width, int @height, int @align); + public static av_image_get_buffer_size_delegate av_image_get_buffer_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPacket* av_packet_alloc_delegate(); + public static av_packet_alloc_delegate av_packet_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_free_delegate(AVPacket** @pkt); + public static av_packet_free_delegate av_packet_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_unref_delegate(AVPacket* @pkt); + public static av_packet_unref_delegate av_packet_unref; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_read_frame_delegate(AVFormatContext* @s, AVPacket* @pkt); + public static av_read_frame_delegate av_read_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecContext* avcodec_alloc_context3_delegate(AVCodec* @codec); + public static avcodec_alloc_context3_delegate avcodec_alloc_context3; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avcodec_flush_buffers_delegate(AVCodecContext* @avctx); + public static avcodec_flush_buffers_delegate avcodec_flush_buffers; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avcodec_free_context_delegate(AVCodecContext** @avctx); + public static avcodec_free_context_delegate avcodec_free_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avcodec_get_name_delegate(AVCodecID @id); + public static avcodec_get_name_delegate avcodec_get_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_open2_delegate(AVCodecContext* @avctx, AVCodec* @codec, AVDictionary** @options); + public static avcodec_open2_delegate avcodec_open2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_receive_frame_delegate(AVCodecContext* @avctx, AVFrame* @frame); + public static avcodec_receive_frame_delegate avcodec_receive_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_send_packet_delegate(AVCodecContext* @avctx, AVPacket* @avpkt); + public static avcodec_send_packet_delegate avcodec_send_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFormatContext* avformat_alloc_context_delegate(); + public static avformat_alloc_context_delegate avformat_alloc_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avformat_close_input_delegate(AVFormatContext** @s); + public static avformat_close_input_delegate avformat_close_input; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_find_stream_info_delegate(AVFormatContext* @ic, AVDictionary** @options); + public static avformat_find_stream_info_delegate avformat_find_stream_info; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_open_input_delegate(AVFormatContext** @ps, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, AVInputFormat* @fmt, AVDictionary** @options); + public static avformat_open_input_delegate avformat_open_input; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_seek_file_delegate(AVFormatContext* @s, int @stream_index, long @min_ts, long @ts, long @max_ts, int @flags); + public static avformat_seek_file_delegate avformat_seek_file; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVIOContext* avio_alloc_context_delegate(byte* @buffer, int @buffer_size, int @write_flag, void* @opaque, avio_alloc_context_read_packet_func @read_packet, avio_alloc_context_write_packet_func @write_packet, avio_alloc_context_seek_func @seek); + public static avio_alloc_context_delegate avio_alloc_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_context_free_delegate(AVIOContext** @s); + public static avio_context_free_delegate avio_context_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_malloc_delegate(ulong @size); + public static av_malloc_delegate av_malloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_free_delegate(void* @ptr); + public static av_free_delegate av_free; + + #region unuse code + /* + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_add_index_entry_delegate(AVStream* @st, long @pos, long @timestamp, int @size, int @distance, int @flags); + public static av_add_index_entry_delegate av_add_index_entry; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_add_q_delegate(AVRational @b, AVRational @c); + public static av_add_q_delegate av_add_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_add_stable_delegate(AVRational @ts_tb, long @ts, AVRational @inc_tb, long @inc); + public static av_add_stable_delegate av_add_stable; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_append_packet_delegate(AVIOContext* @s, AVPacket* @pkt, int @size); + public static av_append_packet_delegate av_append_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVAudioFifo* av_audio_fifo_alloc_delegate(AVSampleFormat @sample_fmt, int @channels, int @nb_samples); + public static av_audio_fifo_alloc_delegate av_audio_fifo_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_audio_fifo_drain_delegate(AVAudioFifo* @af, int @nb_samples); + public static av_audio_fifo_drain_delegate av_audio_fifo_drain; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_audio_fifo_free_delegate(AVAudioFifo* @af); + public static av_audio_fifo_free_delegate av_audio_fifo_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_audio_fifo_peek_delegate(AVAudioFifo* @af, void** @data, int @nb_samples); + public static av_audio_fifo_peek_delegate av_audio_fifo_peek; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_audio_fifo_peek_at_delegate(AVAudioFifo* @af, void** @data, int @nb_samples, int @offset); + public static av_audio_fifo_peek_at_delegate av_audio_fifo_peek_at; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_audio_fifo_read_delegate(AVAudioFifo* @af, void** @data, int @nb_samples); + public static av_audio_fifo_read_delegate av_audio_fifo_read; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_audio_fifo_realloc_delegate(AVAudioFifo* @af, int @nb_samples); + public static av_audio_fifo_realloc_delegate av_audio_fifo_realloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_audio_fifo_reset_delegate(AVAudioFifo* @af); + public static av_audio_fifo_reset_delegate av_audio_fifo_reset; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_audio_fifo_size_delegate(AVAudioFifo* @af); + public static av_audio_fifo_size_delegate av_audio_fifo_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_audio_fifo_space_delegate(AVAudioFifo* @af); + public static av_audio_fifo_space_delegate av_audio_fifo_space; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + 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 int av_bsf_alloc_delegate(AVBitStreamFilter* @filter, AVBSFContext** @ctx); + public static av_bsf_alloc_delegate av_bsf_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_bsf_flush_delegate(AVBSFContext* @ctx); + public static av_bsf_flush_delegate av_bsf_flush; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_bsf_free_delegate(AVBSFContext** @ctx); + public static av_bsf_free_delegate av_bsf_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBitStreamFilter* av_bsf_get_by_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_bsf_get_by_name_delegate av_bsf_get_by_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* av_bsf_get_class_delegate(); + public static av_bsf_get_class_delegate av_bsf_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_bsf_get_null_filter_delegate(AVBSFContext** @bsf); + public static av_bsf_get_null_filter_delegate av_bsf_get_null_filter; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_bsf_init_delegate(AVBSFContext* @ctx); + public static av_bsf_init_delegate av_bsf_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBitStreamFilter* av_bsf_iterate_delegate(void** @opaque); + public static av_bsf_iterate_delegate av_bsf_iterate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBSFList* av_bsf_list_alloc_delegate(); + public static av_bsf_list_alloc_delegate av_bsf_list_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_bsf_list_append_delegate(AVBSFList* @lst, AVBSFContext* @bsf); + public static av_bsf_list_append_delegate av_bsf_list_append; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_bsf_list_append2_delegate(AVBSFList* @lst, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @bsf_name, AVDictionary** @options); + public static av_bsf_list_append2_delegate av_bsf_list_append2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_bsf_list_finalize_delegate(AVBSFList** @lst, AVBSFContext** @bsf); + public static av_bsf_list_finalize_delegate av_bsf_list_finalize; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_bsf_list_free_delegate(AVBSFList** @lst); + public static av_bsf_list_free_delegate av_bsf_list_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_bsf_list_parse_str_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @str, AVBSFContext** @bsf); + public static av_bsf_list_parse_str_delegate av_bsf_list_parse_str; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_bsf_receive_packet_delegate(AVBSFContext* @ctx, AVPacket* @pkt); + public static av_bsf_receive_packet_delegate av_bsf_receive_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_bsf_send_packet_delegate(AVBSFContext* @ctx, AVPacket* @pkt); + public static av_bsf_send_packet_delegate av_bsf_send_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_buffer_alloc_delegate(ulong @size); + public static av_buffer_alloc_delegate av_buffer_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_buffer_allocz_delegate(ulong @size); + public static av_buffer_allocz_delegate av_buffer_allocz; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_buffer_create_delegate(byte* @data, ulong @size, av_buffer_create_free_func @free, void* @opaque, int @flags); + public static av_buffer_create_delegate av_buffer_create; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_buffer_default_free_delegate(void* @opaque, byte* @data); + public static av_buffer_default_free_delegate av_buffer_default_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_buffer_get_opaque_delegate(AVBufferRef* @buf); + public static av_buffer_get_opaque_delegate av_buffer_get_opaque; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffer_get_ref_count_delegate(AVBufferRef* @buf); + public static av_buffer_get_ref_count_delegate av_buffer_get_ref_count; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffer_is_writable_delegate(AVBufferRef* @buf); + public static av_buffer_is_writable_delegate av_buffer_is_writable; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffer_make_writable_delegate(AVBufferRef** @buf); + public static av_buffer_make_writable_delegate av_buffer_make_writable; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_buffer_pool_buffer_get_opaque_delegate(AVBufferRef* @ref); + public static av_buffer_pool_buffer_get_opaque_delegate av_buffer_pool_buffer_get_opaque; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_buffer_pool_get_delegate(AVBufferPool* @pool); + public static av_buffer_pool_get_delegate av_buffer_pool_get; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferPool* av_buffer_pool_init_delegate(ulong @size, av_buffer_pool_init_alloc_func @alloc); + public static av_buffer_pool_init_delegate av_buffer_pool_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferPool* av_buffer_pool_init2_delegate(ulong @size, void* @opaque, av_buffer_pool_init2_alloc_func @alloc, av_buffer_pool_init2_pool_free_func @pool_free); + public static av_buffer_pool_init2_delegate av_buffer_pool_init2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_buffer_pool_uninit_delegate(AVBufferPool** @pool); + public static av_buffer_pool_uninit_delegate av_buffer_pool_uninit; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffer_realloc_delegate(AVBufferRef** @buf, ulong @size); + public static av_buffer_realloc_delegate av_buffer_realloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_buffer_ref_delegate(AVBufferRef* @buf); + public static av_buffer_ref_delegate av_buffer_ref; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffer_replace_delegate(AVBufferRef** @dst, AVBufferRef* @src); + public static av_buffer_replace_delegate av_buffer_replace; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_buffer_unref_delegate(AVBufferRef** @buf); + public static av_buffer_unref_delegate av_buffer_unref; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_ch_layout_delegate(AVFilterContext* @ctx, AVChannelLayout* @ch_layout); + public static av_buffersink_get_ch_layout_delegate av_buffersink_get_ch_layout; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_channels_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_channels_delegate av_buffersink_get_channels; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVColorRange av_buffersink_get_color_range_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_color_range_delegate av_buffersink_get_color_range; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVColorSpace av_buffersink_get_colorspace_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_colorspace_delegate av_buffersink_get_colorspace; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_format_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_format_delegate av_buffersink_get_format; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_frame_delegate(AVFilterContext* @ctx, AVFrame* @frame); + public static av_buffersink_get_frame_delegate av_buffersink_get_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_frame_flags_delegate(AVFilterContext* @ctx, AVFrame* @frame, int @flags); + public static av_buffersink_get_frame_flags_delegate av_buffersink_get_frame_flags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_buffersink_get_frame_rate_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_frame_rate_delegate av_buffersink_get_frame_rate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_h_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_h_delegate av_buffersink_get_h; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_buffersink_get_hw_frames_ctx_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_hw_frames_ctx_delegate av_buffersink_get_hw_frames_ctx; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_buffersink_get_sample_aspect_ratio_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_sample_aspect_ratio_delegate av_buffersink_get_sample_aspect_ratio; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_sample_rate_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_sample_rate_delegate av_buffersink_get_sample_rate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_samples_delegate(AVFilterContext* @ctx, AVFrame* @frame, int @nb_samples); + public static av_buffersink_get_samples_delegate av_buffersink_get_samples; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_buffersink_get_time_base_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_time_base_delegate av_buffersink_get_time_base; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVMediaType av_buffersink_get_type_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_type_delegate av_buffersink_get_type; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersink_get_w_delegate(AVFilterContext* @ctx); + public static av_buffersink_get_w_delegate av_buffersink_get_w; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_buffersink_set_frame_size_delegate(AVFilterContext* @ctx, uint @frame_size); + public static av_buffersink_set_frame_size_delegate av_buffersink_set_frame_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersrc_add_frame_delegate(AVFilterContext* @ctx, AVFrame* @frame); + public static av_buffersrc_add_frame_delegate av_buffersrc_add_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersrc_add_frame_flags_delegate(AVFilterContext* @buffer_src, AVFrame* @frame, int @flags); + public static av_buffersrc_add_frame_flags_delegate av_buffersrc_add_frame_flags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersrc_close_delegate(AVFilterContext* @ctx, long @pts, uint @flags); + public static av_buffersrc_close_delegate av_buffersrc_close; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint av_buffersrc_get_nb_failed_requests_delegate(AVFilterContext* @buffer_src); + public static av_buffersrc_get_nb_failed_requests_delegate av_buffersrc_get_nb_failed_requests; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferSrcParameters* av_buffersrc_parameters_alloc_delegate(); + public static av_buffersrc_parameters_alloc_delegate av_buffersrc_parameters_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersrc_parameters_set_delegate(AVFilterContext* @ctx, AVBufferSrcParameters* @param); + public static av_buffersrc_parameters_set_delegate av_buffersrc_parameters_set; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_buffersrc_write_frame_delegate(AVFilterContext* @ctx, AVFrame* @frame); + public static av_buffersrc_write_frame_delegate av_buffersrc_write_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_calloc_delegate(ulong @nmemb, ulong @size); + public static av_calloc_delegate av_calloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_description_delegate(byte* @buf, ulong @buf_size, AVChannel @channel); + public static av_channel_description_delegate av_channel_description; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_channel_description_bprint_delegate(AVBPrint* @bp, AVChannel @channel_id); + public static av_channel_description_bprint_delegate av_channel_description_bprint; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVChannel av_channel_from_string_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_channel_from_string_delegate av_channel_from_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVChannel av_channel_layout_channel_from_index_delegate(AVChannelLayout* @channel_layout, uint @idx); + public static av_channel_layout_channel_from_index_delegate av_channel_layout_channel_from_index; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVChannel av_channel_layout_channel_from_string_delegate(AVChannelLayout* @channel_layout, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_channel_layout_channel_from_string_delegate av_channel_layout_channel_from_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_check_delegate(AVChannelLayout* @channel_layout); + public static av_channel_layout_check_delegate av_channel_layout_check; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_compare_delegate(AVChannelLayout* @chl, AVChannelLayout* @chl1); + public static av_channel_layout_compare_delegate av_channel_layout_compare; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_copy_delegate(AVChannelLayout* @dst, AVChannelLayout* @src); + public static av_channel_layout_copy_delegate av_channel_layout_copy; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_custom_init_delegate(AVChannelLayout* @channel_layout, int @nb_channels); + public static av_channel_layout_custom_init_delegate av_channel_layout_custom_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_channel_layout_default_delegate(AVChannelLayout* @ch_layout, int @nb_channels); + public static av_channel_layout_default_delegate av_channel_layout_default; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_describe_delegate(AVChannelLayout* @channel_layout, byte* @buf, ulong @buf_size); + public static av_channel_layout_describe_delegate av_channel_layout_describe; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_describe_bprint_delegate(AVChannelLayout* @channel_layout, AVBPrint* @bp); + public static av_channel_layout_describe_bprint_delegate av_channel_layout_describe_bprint; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_from_mask_delegate(AVChannelLayout* @channel_layout, ulong @mask); + public static av_channel_layout_from_mask_delegate av_channel_layout_from_mask; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_from_string_delegate(AVChannelLayout* @channel_layout, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @str); + public static av_channel_layout_from_string_delegate av_channel_layout_from_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_index_from_channel_delegate(AVChannelLayout* @channel_layout, AVChannel @channel); + public static av_channel_layout_index_from_channel_delegate av_channel_layout_index_from_channel; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_index_from_string_delegate(AVChannelLayout* @channel_layout, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_channel_layout_index_from_string_delegate av_channel_layout_index_from_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_layout_retype_delegate(AVChannelLayout* @channel_layout, AVChannelOrder @order, int @flags); + public static av_channel_layout_retype_delegate av_channel_layout_retype; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVChannelLayout* av_channel_layout_standard_delegate(void** @opaque); + public static av_channel_layout_standard_delegate av_channel_layout_standard; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate ulong av_channel_layout_subset_delegate(AVChannelLayout* @channel_layout, ulong @mask); + public static av_channel_layout_subset_delegate av_channel_layout_subset; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_channel_layout_uninit_delegate(AVChannelLayout* @channel_layout); + public static av_channel_layout_uninit_delegate av_channel_layout_uninit; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_channel_name_delegate(byte* @buf, ulong @buf_size, AVChannel @channel); + public static av_channel_name_delegate av_channel_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_channel_name_bprint_delegate(AVBPrint* @bp, AVChannel @channel_id); + public static av_channel_name_bprint_delegate av_channel_name_bprint; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_chroma_location_enum_to_pos_delegate(int* @xpos, int* @ypos, AVChromaLocation @pos); + public static av_chroma_location_enum_to_pos_delegate av_chroma_location_enum_to_pos; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_chroma_location_from_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_chroma_location_from_name_delegate av_chroma_location_from_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_chroma_location_name_delegate(AVChromaLocation @location); + public static av_chroma_location_name_delegate av_chroma_location_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVChromaLocation av_chroma_location_pos_to_enum_delegate(int @xpos, int @ypos); + public static av_chroma_location_pos_to_enum_delegate av_chroma_location_pos_to_enum; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecID av_codec_get_id_delegate(AVCodecTag** @tags, uint @tag); + public static av_codec_get_id_delegate av_codec_get_id; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint av_codec_get_tag_delegate(AVCodecTag** @tags, AVCodecID @id); + public static av_codec_get_tag_delegate av_codec_get_tag; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_codec_get_tag2_delegate(AVCodecTag** @tags, AVCodecID @id, uint* @tag); + public static av_codec_get_tag2_delegate av_codec_get_tag2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_codec_is_decoder_delegate(AVCodec* @codec); + public static av_codec_is_decoder_delegate av_codec_is_decoder; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_codec_is_encoder_delegate(AVCodec* @codec); + public static av_codec_is_encoder_delegate av_codec_is_encoder; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodec* av_codec_iterate_delegate(void** @opaque); + public static av_codec_iterate_delegate av_codec_iterate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_color_primaries_from_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_color_primaries_from_name_delegate av_color_primaries_from_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_color_primaries_name_delegate(AVColorPrimaries @primaries); + public static av_color_primaries_name_delegate av_color_primaries_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_color_range_from_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_color_range_from_name_delegate av_color_range_from_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_color_range_name_delegate(AVColorRange @range); + public static av_color_range_name_delegate av_color_range_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_color_space_from_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_color_space_from_name_delegate av_color_space_from_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_color_space_name_delegate(AVColorSpace @space); + public static av_color_space_name_delegate av_color_space_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_color_transfer_from_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_color_transfer_from_name_delegate av_color_transfer_from_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_color_transfer_name_delegate(AVColorTransferCharacteristic @transfer); + public static av_color_transfer_name_delegate av_color_transfer_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_compare_mod_delegate(ulong @a, ulong @b, ulong @mod); + public static av_compare_mod_delegate av_compare_mod; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_compare_ts_delegate(long @ts_a, AVRational @tb_a, long @ts_b, AVRational @tb_b); + public static av_compare_ts_delegate av_compare_ts; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVContentLightMetadata* av_content_light_metadata_alloc_delegate(ulong* @size); + public static av_content_light_metadata_alloc_delegate av_content_light_metadata_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVContentLightMetadata* av_content_light_metadata_create_side_data_delegate(AVFrame* @frame); + public static av_content_light_metadata_create_side_data_delegate av_content_light_metadata_create_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCPBProperties* av_cpb_properties_alloc_delegate(ulong* @size); + public static av_cpb_properties_alloc_delegate av_cpb_properties_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_cpu_count_delegate(); + public static av_cpu_count_delegate av_cpu_count; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_cpu_force_count_delegate(int @count); + public static av_cpu_force_count_delegate av_cpu_force_count; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate ulong av_cpu_max_align_delegate(); + public static av_cpu_max_align_delegate av_cpu_max_align; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_d2q_delegate(double @d, int @max); + public static av_d2q_delegate av_d2q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVD3D11VAContext* av_d3d11va_alloc_context_delegate(); + public static av_d3d11va_alloc_context_delegate av_d3d11va_alloc_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClassCategory av_default_get_category_delegate(void* @ptr); + public static av_default_get_category_delegate av_default_get_category; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_default_item_name_delegate(void* @ctx); + public static av_default_item_name_delegate av_default_item_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVInputFormat* av_demuxer_iterate_delegate(void** @opaque); + public static av_demuxer_iterate_delegate av_demuxer_iterate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dict_copy_delegate(AVDictionary** @dst, AVDictionary* @src, int @flags); + public static av_dict_copy_delegate av_dict_copy; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dict_count_delegate(AVDictionary* @m); + public static av_dict_count_delegate av_dict_count; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_dict_free_delegate(AVDictionary** @m); + public static av_dict_free_delegate av_dict_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVDictionaryEntry* av_dict_get_delegate(AVDictionary* @m, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key, AVDictionaryEntry* @prev, int @flags); + public static av_dict_get_delegate av_dict_get; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dict_get_string_delegate(AVDictionary* @m, byte** @buffer, byte @key_val_sep, byte @pairs_sep); + public static av_dict_get_string_delegate av_dict_get_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVDictionaryEntry* av_dict_iterate_delegate(AVDictionary* @m, AVDictionaryEntry* @prev); + public static av_dict_iterate_delegate av_dict_iterate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dict_parse_string_delegate(AVDictionary** @pm, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @str, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key_val_sep, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @pairs_sep, int @flags); + public static av_dict_parse_string_delegate av_dict_parse_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dict_set_delegate(AVDictionary** @pm, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @value, int @flags); + public static av_dict_set_delegate av_dict_set; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dict_set_int_delegate(AVDictionary** @pm, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key, long @value, int @flags); + public static av_dict_set_int_delegate av_dict_set_int; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_display_matrix_flip_delegate(ref int9 @matrix, int @hflip, int @vflip); + public static av_display_matrix_flip_delegate av_display_matrix_flip; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate double av_display_rotation_get_delegate(in int9 @matrix); + public static av_display_rotation_get_delegate av_display_rotation_get; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_display_rotation_set_delegate(ref int9 @matrix, double @angle); + public static av_display_rotation_set_delegate av_display_rotation_set; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_disposition_from_string_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @disp); + public static av_disposition_from_string_delegate av_disposition_from_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_disposition_to_string_delegate(int @disposition); + public static av_disposition_to_string_delegate av_disposition_to_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_div_q_delegate(AVRational @b, AVRational @c); + public static av_div_q_delegate av_div_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_dump_format_delegate(AVFormatContext* @ic, int @index, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, int @is_output); + public static av_dump_format_delegate av_dump_format; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVDynamicHDRPlus* av_dynamic_hdr_plus_alloc_delegate(ulong* @size); + public static av_dynamic_hdr_plus_alloc_delegate av_dynamic_hdr_plus_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + 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; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_dynarray_add_nofree_delegate(void* @tab_ptr, int* @nb_ptr, void* @elem); + public static av_dynarray_add_nofree_delegate av_dynarray_add_nofree; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_dynarray2_add_delegate(void** @tab_ptr, int* @nb_ptr, ulong @elem_size, byte* @elem_data); + public static av_dynarray2_add_delegate av_dynarray2_add; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_fast_malloc_delegate(void* @ptr, uint* @size, ulong @min_size); + public static av_fast_malloc_delegate av_fast_malloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_fast_mallocz_delegate(void* @ptr, uint* @size, ulong @min_size); + public static av_fast_mallocz_delegate av_fast_mallocz; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_fast_padded_malloc_delegate(void* @ptr, uint* @size, ulong @min_size); + public static av_fast_padded_malloc_delegate av_fast_padded_malloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_fast_padded_mallocz_delegate(void* @ptr, uint* @size, ulong @min_size); + public static av_fast_padded_mallocz_delegate av_fast_padded_mallocz; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_fast_realloc_delegate(void* @ptr, uint* @size, ulong @min_size); + public static av_fast_realloc_delegate av_fast_realloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_file_map_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filename, byte** @bufptr, ulong* @size, int @log_offset, void* @log_ctx); + public static av_file_map_delegate av_file_map; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_file_unmap_delegate(byte* @bufptr, ulong @size); + public static av_file_unmap_delegate av_file_unmap; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_filename_number_test_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filename); + public static av_filename_number_test_delegate av_filename_number_test; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFilter* av_filter_iterate_delegate(void** @opaque); + public static av_filter_iterate_delegate av_filter_iterate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPixelFormat av_find_best_pix_fmt_of_2_delegate(AVPixelFormat @dst_pix_fmt1, AVPixelFormat @dst_pix_fmt2, AVPixelFormat @src_pix_fmt, int @has_alpha, int* @loss_ptr); + public static av_find_best_pix_fmt_of_2_delegate av_find_best_pix_fmt_of_2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_find_default_stream_index_delegate(AVFormatContext* @s); + public static av_find_default_stream_index_delegate av_find_default_stream_index; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVInputFormat* av_find_input_format_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @short_name); + public static av_find_input_format_delegate av_find_input_format; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_find_nearest_q_idx_delegate(AVRational @q, AVRational* @q_list); + public static av_find_nearest_q_idx_delegate av_find_nearest_q_idx; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVProgram* av_find_program_from_stream_delegate(AVFormatContext* @ic, AVProgram* @last, int @s); + public static av_find_program_from_stream_delegate av_find_program_from_stream; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method_delegate(AVFormatContext* @ctx); + public static av_fmt_ctx_get_duration_estimation_method_delegate av_fmt_ctx_get_duration_estimation_method; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_force_cpu_flags_delegate(int @flags); + public static av_force_cpu_flags_delegate av_force_cpu_flags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_format_inject_global_side_data_delegate(AVFormatContext* @s); + public static av_format_inject_global_side_data_delegate av_format_inject_global_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_fourcc_make_string_delegate(byte* @buf, uint @fourcc); + public static av_fourcc_make_string_delegate av_fourcc_make_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_apply_cropping_delegate(AVFrame* @frame, int @flags); + public static av_frame_apply_cropping_delegate av_frame_apply_cropping; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFrame* av_frame_clone_delegate(AVFrame* @src); + public static av_frame_clone_delegate av_frame_clone; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_copy_delegate(AVFrame* @dst, AVFrame* @src); + public static av_frame_copy_delegate av_frame_copy; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_copy_props_delegate(AVFrame* @dst, AVFrame* @src); + public static av_frame_copy_props_delegate av_frame_copy_props; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_get_buffer_delegate(AVFrame* @frame, int @align); + public static av_frame_get_buffer_delegate av_frame_get_buffer; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_frame_get_plane_buffer_delegate(AVFrame* @frame, int @plane); + public static av_frame_get_plane_buffer_delegate av_frame_get_plane_buffer; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFrameSideData* av_frame_get_side_data_delegate(AVFrame* @frame, AVFrameSideDataType @type); + public static av_frame_get_side_data_delegate av_frame_get_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_is_writable_delegate(AVFrame* @frame); + public static av_frame_is_writable_delegate av_frame_is_writable; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_make_writable_delegate(AVFrame* @frame); + public static av_frame_make_writable_delegate av_frame_make_writable; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_frame_move_ref_delegate(AVFrame* @dst, AVFrame* @src); + public static av_frame_move_ref_delegate av_frame_move_ref; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFrameSideData* av_frame_new_side_data_delegate(AVFrame* @frame, AVFrameSideDataType @type, ulong @size); + public static av_frame_new_side_data_delegate av_frame_new_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFrameSideData* av_frame_new_side_data_from_buf_delegate(AVFrame* @frame, AVFrameSideDataType @type, AVBufferRef* @buf); + public static av_frame_new_side_data_from_buf_delegate av_frame_new_side_data_from_buf; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_frame_ref_delegate(AVFrame* @dst, AVFrame* @src); + public static av_frame_ref_delegate av_frame_ref; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + 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)] + public delegate int av_frame_side_data_clone_delegate(AVFrameSideData*** @sd, int* @nb_sd, AVFrameSideData* @src, uint @flags); + public static av_frame_side_data_clone_delegate av_frame_side_data_clone; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_frame_side_data_free_delegate(AVFrameSideData*** @sd, int* @nb_sd); + public static av_frame_side_data_free_delegate av_frame_side_data_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFrameSideData* av_frame_side_data_get_c_delegate(AVFrameSideData** @sd, int @nb_sd, AVFrameSideDataType @type); + public static av_frame_side_data_get_c_delegate av_frame_side_data_get_c; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_frame_side_data_name_delegate(AVFrameSideDataType @type); + public static av_frame_side_data_name_delegate av_frame_side_data_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFrameSideData* av_frame_side_data_new_delegate(AVFrameSideData*** @sd, int* @nb_sd, AVFrameSideDataType @type, ulong @size, uint @flags); + public static av_frame_side_data_new_delegate av_frame_side_data_new; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_frame_unref_delegate(AVFrame* @frame); + public static av_frame_unref_delegate av_frame_unref; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_freep_delegate(void* @ptr); + public static av_freep_delegate av_freep; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_gcd_delegate(long @a, long @b); + public static av_gcd_delegate av_gcd; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_gcd_q_delegate(AVRational @a, AVRational @b, int @max_den, AVRational @def); + public static av_gcd_q_delegate av_gcd_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVSampleFormat av_get_alt_sample_fmt_delegate(AVSampleFormat @sample_fmt, int @planar); + public static av_get_alt_sample_fmt_delegate av_get_alt_sample_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_audio_frame_duration_delegate(AVCodecContext* @avctx, int @frame_bytes); + public static av_get_audio_frame_duration_delegate av_get_audio_frame_duration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_audio_frame_duration2_delegate(AVCodecParameters* @par, int @frame_bytes); + public static av_get_audio_frame_duration2_delegate av_get_audio_frame_duration2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_bits_per_pixel_delegate(AVPixFmtDescriptor* @pixdesc); + public static av_get_bits_per_pixel_delegate av_get_bits_per_pixel; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_bits_per_sample_delegate(AVCodecID @codec_id); + public static av_get_bits_per_sample_delegate av_get_bits_per_sample; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_bytes_per_sample_delegate(AVSampleFormat @sample_fmt); + public static av_get_bytes_per_sample_delegate av_get_bytes_per_sample; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_cpu_flags_delegate(); + public static av_get_cpu_flags_delegate av_get_cpu_flags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_exact_bits_per_sample_delegate(AVCodecID @codec_id); + public static av_get_exact_bits_per_sample_delegate av_get_exact_bits_per_sample; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_frame_filename_delegate(byte* @buf, int @buf_size, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @path, int @number); + public static av_get_frame_filename_delegate av_get_frame_filename; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_frame_filename2_delegate(byte* @buf, int @buf_size, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @path, int @number, int @flags); + public static av_get_frame_filename2_delegate av_get_frame_filename2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_get_media_type_string_delegate(AVMediaType @media_type); + public static av_get_media_type_string_delegate av_get_media_type_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_output_timestamp_delegate(AVFormatContext* @s, int @stream, long* @dts, long* @wall); + public static av_get_output_timestamp_delegate av_get_output_timestamp; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVSampleFormat av_get_packed_sample_fmt_delegate(AVSampleFormat @sample_fmt); + public static av_get_packed_sample_fmt_delegate av_get_packed_sample_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_packet_delegate(AVIOContext* @s, AVPacket* @pkt, int @size); + public static av_get_packet_delegate av_get_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_padded_bits_per_pixel_delegate(AVPixFmtDescriptor* @pixdesc); + public static av_get_padded_bits_per_pixel_delegate av_get_padded_bits_per_pixel; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecID av_get_pcm_codec_delegate(AVSampleFormat @fmt, int @be); + public static av_get_pcm_codec_delegate av_get_pcm_codec; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte av_get_picture_type_char_delegate(AVPictureType @pict_type); + public static av_get_picture_type_char_delegate av_get_picture_type_char; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPixelFormat av_get_pix_fmt_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_get_pix_fmt_delegate av_get_pix_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_get_pix_fmt_loss_delegate(AVPixelFormat @dst_pix_fmt, AVPixelFormat @src_pix_fmt, int @has_alpha); + public static av_get_pix_fmt_loss_delegate av_get_pix_fmt_loss; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_get_pix_fmt_name_delegate(AVPixelFormat @pix_fmt); + public static av_get_pix_fmt_name_delegate av_get_pix_fmt_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_get_pix_fmt_string_delegate(byte* @buf, int @buf_size, AVPixelFormat @pix_fmt); + public static av_get_pix_fmt_string_delegate av_get_pix_fmt_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVSampleFormat av_get_planar_sample_fmt_delegate(AVSampleFormat @sample_fmt); + public static av_get_planar_sample_fmt_delegate av_get_planar_sample_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_get_profile_name_delegate(AVCodec* @codec, int @profile); + public static av_get_profile_name_delegate av_get_profile_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVSampleFormat av_get_sample_fmt_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_get_sample_fmt_delegate av_get_sample_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_get_sample_fmt_name_delegate(AVSampleFormat @sample_fmt); + public static av_get_sample_fmt_name_delegate av_get_sample_fmt_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_get_sample_fmt_string_delegate(byte* @buf, int @buf_size, AVSampleFormat @sample_fmt); + public static av_get_sample_fmt_string_delegate av_get_sample_fmt_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_get_time_base_q_delegate(); + public static av_get_time_base_q_delegate av_get_time_base_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_gettime_delegate(); + public static av_gettime_delegate av_gettime; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_gettime_relative_delegate(); + public static av_gettime_relative_delegate av_gettime_relative; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_gettime_relative_is_monotonic_delegate(); + public static av_gettime_relative_is_monotonic_delegate av_gettime_relative_is_monotonic; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_grow_packet_delegate(AVPacket* @pkt, int @grow_by); + public static av_grow_packet_delegate av_grow_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecID av_guess_codec_delegate(AVOutputFormat* @fmt, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @short_name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filename, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @mime_type, AVMediaType @type); + public static av_guess_codec_delegate av_guess_codec; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVOutputFormat* av_guess_format_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @short_name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filename, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @mime_type); + public static av_guess_format_delegate av_guess_format; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_guess_frame_rate_delegate(AVFormatContext* @ctx, AVStream* @stream, AVFrame* @frame); + public static av_guess_frame_rate_delegate av_guess_frame_rate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_guess_sample_aspect_ratio_delegate(AVFormatContext* @format, AVStream* @stream, AVFrame* @frame); + public static av_guess_sample_aspect_ratio_delegate av_guess_sample_aspect_ratio; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_hex_dump_delegate(_iobuf* @f, byte* @buf, int @size); + public static av_hex_dump_delegate av_hex_dump; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_hex_dump_log_delegate(void* @avcl, int @level, byte* @buf, int @size); + public static av_hex_dump_log_delegate av_hex_dump_log; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_hwdevice_ctx_alloc_delegate(AVHWDeviceType @type); + public static av_hwdevice_ctx_alloc_delegate av_hwdevice_ctx_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwdevice_ctx_create_delegate(AVBufferRef** @device_ctx, AVHWDeviceType @type, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @device, AVDictionary* @opts, int @flags); + public static av_hwdevice_ctx_create_delegate av_hwdevice_ctx_create; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwdevice_ctx_create_derived_delegate(AVBufferRef** @dst_ctx, AVHWDeviceType @type, AVBufferRef* @src_ctx, int @flags); + public static av_hwdevice_ctx_create_derived_delegate av_hwdevice_ctx_create_derived; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwdevice_ctx_create_derived_opts_delegate(AVBufferRef** @dst_ctx, AVHWDeviceType @type, AVBufferRef* @src_ctx, AVDictionary* @options, int @flags); + public static av_hwdevice_ctx_create_derived_opts_delegate av_hwdevice_ctx_create_derived_opts; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwdevice_ctx_init_delegate(AVBufferRef* @ref); + public static av_hwdevice_ctx_init_delegate av_hwdevice_ctx_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVHWDeviceType av_hwdevice_find_type_by_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_hwdevice_find_type_by_name_delegate av_hwdevice_find_type_by_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVHWFramesConstraints* av_hwdevice_get_hwframe_constraints_delegate(AVBufferRef* @ref, void* @hwconfig); + public static av_hwdevice_get_hwframe_constraints_delegate av_hwdevice_get_hwframe_constraints; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_hwdevice_get_type_name_delegate(AVHWDeviceType @type); + public static av_hwdevice_get_type_name_delegate av_hwdevice_get_type_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_hwdevice_hwconfig_alloc_delegate(AVBufferRef* @device_ctx); + public static av_hwdevice_hwconfig_alloc_delegate av_hwdevice_hwconfig_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVHWDeviceType av_hwdevice_iterate_types_delegate(AVHWDeviceType @prev); + public static av_hwdevice_iterate_types_delegate av_hwdevice_iterate_types; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_hwframe_constraints_free_delegate(AVHWFramesConstraints** @constraints); + public static av_hwframe_constraints_free_delegate av_hwframe_constraints_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVBufferRef* av_hwframe_ctx_alloc_delegate(AVBufferRef* @device_ctx); + public static av_hwframe_ctx_alloc_delegate av_hwframe_ctx_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwframe_ctx_create_derived_delegate(AVBufferRef** @derived_frame_ctx, AVPixelFormat @format, AVBufferRef* @derived_device_ctx, AVBufferRef* @source_frame_ctx, int @flags); + public static av_hwframe_ctx_create_derived_delegate av_hwframe_ctx_create_derived; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwframe_ctx_init_delegate(AVBufferRef* @ref); + public static av_hwframe_ctx_init_delegate av_hwframe_ctx_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwframe_get_buffer_delegate(AVBufferRef* @hwframe_ctx, AVFrame* @frame, int @flags); + public static av_hwframe_get_buffer_delegate av_hwframe_get_buffer; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwframe_map_delegate(AVFrame* @dst, AVFrame* @src, int @flags); + public static av_hwframe_map_delegate av_hwframe_map; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwframe_transfer_data_delegate(AVFrame* @dst, AVFrame* @src, int @flags); + public static av_hwframe_transfer_data_delegate av_hwframe_transfer_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_hwframe_transfer_get_formats_delegate(AVBufferRef* @hwframe_ctx, AVHWFrameTransferDirection @dir, AVPixelFormat** @formats, int @flags); + public static av_hwframe_transfer_get_formats_delegate av_hwframe_transfer_get_formats; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_alloc_delegate(ref byte_ptr4 @pointers, ref int4 @linesizes, int @w, int @h, AVPixelFormat @pix_fmt, int @align); + public static av_image_alloc_delegate av_image_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_check_sar_delegate(uint @w, uint @h, AVRational @sar); + public static av_image_check_sar_delegate av_image_check_sar; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_check_size_delegate(uint @w, uint @h, int @log_offset, void* @log_ctx); + public static av_image_check_size_delegate av_image_check_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_check_size2_delegate(uint @w, uint @h, long @max_pixels, AVPixelFormat @pix_fmt, int @log_offset, void* @log_ctx); + 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, 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)] + public delegate void av_image_copy_plane_delegate(byte* @dst, int @dst_linesize, byte* @src, int @src_linesize, int @bytewidth, int @height); + public static av_image_copy_plane_delegate av_image_copy_plane; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_image_copy_plane_uc_from_delegate(byte* @dst, long @dst_linesize, byte* @src, long @src_linesize, long @bytewidth, int @height); + public static av_image_copy_plane_uc_from_delegate av_image_copy_plane_uc_from; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_copy_to_buffer_delegate(byte* @dst, int @dst_size, in byte_ptr4 @src_data, in int4 @src_linesize, AVPixelFormat @pix_fmt, int @width, int @height, int @align); + public static av_image_copy_to_buffer_delegate av_image_copy_to_buffer; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_image_copy_uc_from_delegate(ref byte_ptr4 @dst_data, in long4 @dst_linesizes, in byte_ptr4 @src_data, in long4 @src_linesizes, AVPixelFormat @pix_fmt, int @width, int @height); + public static av_image_copy_uc_from_delegate av_image_copy_uc_from; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_fill_arrays_delegate(ref byte_ptr4 @dst_data, ref int4 @dst_linesize, byte* @src, AVPixelFormat @pix_fmt, int @width, int @height, int @align); + public static av_image_fill_arrays_delegate av_image_fill_arrays; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_fill_black_delegate(ref byte_ptr4 @dst_data, in long4 @dst_linesize, AVPixelFormat @pix_fmt, AVColorRange @range, int @width, int @height); + public static av_image_fill_black_delegate av_image_fill_black; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_fill_color_delegate(ref byte_ptr4 @dst_data, in long4 @dst_linesize, AVPixelFormat @pix_fmt, in uint4 @color, int @width, int @height, int @flags); + public static av_image_fill_color_delegate av_image_fill_color; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_fill_linesizes_delegate(ref int4 @linesizes, AVPixelFormat @pix_fmt, int @width); + public static av_image_fill_linesizes_delegate av_image_fill_linesizes; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_image_fill_max_pixsteps_delegate(ref int4 @max_pixsteps, ref int4 @max_pixstep_comps, AVPixFmtDescriptor* @pixdesc); + public static av_image_fill_max_pixsteps_delegate av_image_fill_max_pixsteps; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_fill_plane_sizes_delegate(ref ulong4 @size, AVPixelFormat @pix_fmt, int @height, in long4 @linesizes); + public static av_image_fill_plane_sizes_delegate av_image_fill_plane_sizes; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_fill_pointers_delegate(ref byte_ptr4 @data, AVPixelFormat @pix_fmt, int @height, byte* @ptr, in int4 @linesizes); + public static av_image_fill_pointers_delegate av_image_fill_pointers; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_image_get_linesize_delegate(AVPixelFormat @pix_fmt, int @width, int @plane); + public static av_image_get_linesize_delegate av_image_get_linesize; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_index_search_timestamp_delegate(AVStream* @st, long @timestamp, int @flags); + public static av_index_search_timestamp_delegate av_index_search_timestamp; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_init_packet_delegate(AVPacket* @pkt); + public static av_init_packet_delegate av_init_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVInputFormat* av_input_audio_device_next_delegate(AVInputFormat* @d); + public static av_input_audio_device_next_delegate av_input_audio_device_next; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVInputFormat* av_input_video_device_next_delegate(AVInputFormat* @d); + public static av_input_video_device_next_delegate av_input_video_device_next; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint av_int_list_length_for_size_delegate(uint @elsize, void* @list, ulong @term); + public static av_int_list_length_for_size_delegate av_int_list_length_for_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_interleaved_write_frame_delegate(AVFormatContext* @s, AVPacket* @pkt); + public static av_interleaved_write_frame_delegate av_interleaved_write_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_interleaved_write_uncoded_frame_delegate(AVFormatContext* @s, int @stream_index, AVFrame* @frame); + public static av_interleaved_write_uncoded_frame_delegate av_interleaved_write_uncoded_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_log_delegate(void* @avcl, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @fmt); + public static av_log_delegate av_log; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_log_default_callback_delegate(void* @avcl, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @fmt, byte* @vl); + public static av_log_default_callback_delegate av_log_default_callback; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_log_format_line_delegate(void* @ptr, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @fmt, byte* @vl, byte* @line, int @line_size, int* @print_prefix); + public static av_log_format_line_delegate av_log_format_line; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_log_format_line2_delegate(void* @ptr, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @fmt, byte* @vl, byte* @line, int @line_size, int* @print_prefix); + public static av_log_format_line2_delegate av_log_format_line2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_log_get_flags_delegate(); + public static av_log_get_flags_delegate av_log_get_flags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_log_get_level_delegate(); + public static av_log_get_level_delegate av_log_get_level; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_log_once_delegate(void* @avcl, int @initial_level, int @subsequent_level, int* @state, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @fmt); + public static av_log_once_delegate av_log_once; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_log_set_callback_delegate(av_log_set_callback_callback_func @callback); + public static av_log_set_callback_delegate av_log_set_callback; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_log_set_flags_delegate(int @arg); + public static av_log_set_flags_delegate av_log_set_flags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_log_set_level_delegate(int @level); + public static av_log_set_level_delegate av_log_set_level; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_log2_delegate(uint @v); + public static av_log2_delegate av_log2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_log2_16bit_delegate(uint @v); + public static av_log2_16bit_delegate av_log2_16bit; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_malloc_array_delegate(ulong @nmemb, ulong @size); + public static av_malloc_array_delegate av_malloc_array; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_mallocz_delegate(ulong @size); + public static av_mallocz_delegate av_mallocz; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVMasteringDisplayMetadata* av_mastering_display_metadata_alloc_delegate(); + public static av_mastering_display_metadata_alloc_delegate av_mastering_display_metadata_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVMasteringDisplayMetadata* av_mastering_display_metadata_create_side_data_delegate(AVFrame* @frame); + public static av_mastering_display_metadata_create_side_data_delegate av_mastering_display_metadata_create_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_match_ext_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filename, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @extensions); + public static av_match_ext_delegate av_match_ext; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_max_alloc_delegate(ulong @max); + public static av_max_alloc_delegate av_max_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_memcpy_backptr_delegate(byte* @dst, int @back, int @cnt); + public static av_memcpy_backptr_delegate av_memcpy_backptr; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_memdup_delegate(void* @p, ulong @size); + public static av_memdup_delegate av_memdup; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_mul_q_delegate(AVRational @b, AVRational @c); + public static av_mul_q_delegate av_mul_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVOutputFormat* av_muxer_iterate_delegate(void** @opaque); + public static av_muxer_iterate_delegate av_muxer_iterate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_nearer_q_delegate(AVRational @q, AVRational @q1, AVRational @q2); + public static av_nearer_q_delegate av_nearer_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_new_packet_delegate(AVPacket* @pkt, int @size); + public static av_new_packet_delegate av_new_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVProgram* av_new_program_delegate(AVFormatContext* @s, int @id); + public static av_new_program_delegate av_new_program; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* av_opt_child_class_iterate_delegate(AVClass* @parent, void** @iter); + public static av_opt_child_class_iterate_delegate av_opt_child_class_iterate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_opt_child_next_delegate(void* @obj, void* @prev); + public static av_opt_child_next_delegate av_opt_child_next; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_copy_delegate(void* @dest, void* @src); + public static av_opt_copy_delegate av_opt_copy; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_eval_double_delegate(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @val, double* @double_out); + public static av_opt_eval_double_delegate av_opt_eval_double; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_eval_flags_delegate(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @val, int* @flags_out); + public static av_opt_eval_flags_delegate av_opt_eval_flags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_eval_float_delegate(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @val, float* @float_out); + public static av_opt_eval_float_delegate av_opt_eval_float; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_eval_int_delegate(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @val, int* @int_out); + public static av_opt_eval_int_delegate av_opt_eval_int; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_eval_int64_delegate(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @val, long* @int64_out); + public static av_opt_eval_int64_delegate av_opt_eval_int64; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_eval_q_delegate(void* @obj, AVOption* @o, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @val, AVRational* @q_out); + public static av_opt_eval_q_delegate av_opt_eval_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVOption* av_opt_find_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @unit, int @opt_flags, int @search_flags); + public static av_opt_find_delegate av_opt_find; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVOption* av_opt_find2_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @unit, int @opt_flags, int @search_flags, void** @target_obj); + public static av_opt_find2_delegate av_opt_find2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_flag_is_set_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @field_name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @flag_name); + public static av_opt_flag_is_set_delegate av_opt_flag_is_set; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_opt_free_delegate(void* @obj); + public static av_opt_free_delegate av_opt_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_opt_freep_ranges_delegate(AVOptionRanges** @ranges); + public static av_opt_freep_ranges_delegate av_opt_freep_ranges; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, byte** @out_val); + public static av_opt_get_delegate av_opt_get; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_chlayout_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, AVChannelLayout* @layout); + public static av_opt_get_chlayout_delegate av_opt_get_chlayout; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_dict_val_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, AVDictionary** @out_val); + public static av_opt_get_dict_val_delegate av_opt_get_dict_val; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_double_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, double* @out_val); + public static av_opt_get_double_delegate av_opt_get_double; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_image_size_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, int* @w_out, int* @h_out); + public static av_opt_get_image_size_delegate av_opt_get_image_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_int_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, long* @out_val); + public static av_opt_get_int_delegate av_opt_get_int; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_key_value_delegate(byte** @ropts, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key_val_sep, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @pairs_sep, uint @flags, byte** @rkey, byte** @rval); + public static av_opt_get_key_value_delegate av_opt_get_key_value; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_pixel_fmt_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, AVPixelFormat* @out_fmt); + public static av_opt_get_pixel_fmt_delegate av_opt_get_pixel_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_q_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, AVRational* @out_val); + public static av_opt_get_q_delegate av_opt_get_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_sample_fmt_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, AVSampleFormat* @out_fmt); + public static av_opt_get_sample_fmt_delegate av_opt_get_sample_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_get_video_rate_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags, AVRational* @out_val); + public static av_opt_get_video_rate_delegate av_opt_get_video_rate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_is_set_to_default_delegate(void* @obj, AVOption* @o); + public static av_opt_is_set_to_default_delegate av_opt_is_set_to_default; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_is_set_to_default_by_name_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @search_flags); + public static av_opt_is_set_to_default_by_name_delegate av_opt_is_set_to_default_by_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVOption* av_opt_next_delegate(void* @obj, AVOption* @prev); + public static av_opt_next_delegate av_opt_next; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_opt_ptr_delegate(AVClass* @avclass, void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static av_opt_ptr_delegate av_opt_ptr; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_query_ranges_delegate(AVOptionRanges** @p0, void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key, int @flags); + public static av_opt_query_ranges_delegate av_opt_query_ranges; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_query_ranges_default_delegate(AVOptionRanges** @p0, void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key, int @flags); + public static av_opt_query_ranges_default_delegate av_opt_query_ranges_default; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_serialize_delegate(void* @obj, int @opt_flags, int @flags, byte** @buffer, byte @key_val_sep, byte @pairs_sep); + public static av_opt_serialize_delegate av_opt_serialize; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @val, int @search_flags); + public static av_opt_set_delegate av_opt_set; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_bin_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, byte* @val, int @size, int @search_flags); + public static av_opt_set_bin_delegate av_opt_set_bin; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_chlayout_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, AVChannelLayout* @layout, int @search_flags); + public static av_opt_set_chlayout_delegate av_opt_set_chlayout; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_opt_set_defaults_delegate(void* @s); + public static av_opt_set_defaults_delegate av_opt_set_defaults; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_opt_set_defaults2_delegate(void* @s, int @mask, int @flags); + public static av_opt_set_defaults2_delegate av_opt_set_defaults2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_dict_delegate(void* @obj, AVDictionary** @options); + public static av_opt_set_dict_delegate av_opt_set_dict; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_dict_val_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, AVDictionary* @val, int @search_flags); + public static av_opt_set_dict_val_delegate av_opt_set_dict_val; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_dict2_delegate(void* @obj, AVDictionary** @options, int @search_flags); + public static av_opt_set_dict2_delegate av_opt_set_dict2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_double_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, double @val, int @search_flags); + public static av_opt_set_double_delegate av_opt_set_double; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_from_string_delegate(void* @ctx, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @opts, byte** @shorthand, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key_val_sep, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @pairs_sep); + public static av_opt_set_from_string_delegate av_opt_set_from_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_image_size_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @w, int @h, int @search_flags); + public static av_opt_set_image_size_delegate av_opt_set_image_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_int_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, long @val, int @search_flags); + public static av_opt_set_int_delegate av_opt_set_int; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_pixel_fmt_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, AVPixelFormat @fmt, int @search_flags); + public static av_opt_set_pixel_fmt_delegate av_opt_set_pixel_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_q_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, AVRational @val, int @search_flags); + public static av_opt_set_q_delegate av_opt_set_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_sample_fmt_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, AVSampleFormat @fmt, int @search_flags); + public static av_opt_set_sample_fmt_delegate av_opt_set_sample_fmt; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_set_video_rate_delegate(void* @obj, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, AVRational @val, int @search_flags); + public static av_opt_set_video_rate_delegate av_opt_set_video_rate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_opt_show2_delegate(void* @obj, void* @av_log_obj, int @req_flags, int @rej_flags); + public static av_opt_show2_delegate av_opt_show2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVOutputFormat* av_output_audio_device_next_delegate(AVOutputFormat* @d); + public static av_output_audio_device_next_delegate av_output_audio_device_next; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVOutputFormat* av_output_video_device_next_delegate(AVOutputFormat* @d); + public static av_output_video_device_next_delegate av_output_video_device_next; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_packet_add_side_data_delegate(AVPacket* @pkt, AVPacketSideDataType @type, byte* @data, ulong @size); + public static av_packet_add_side_data_delegate av_packet_add_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPacket* av_packet_clone_delegate(AVPacket* @src); + public static av_packet_clone_delegate av_packet_clone; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_packet_copy_props_delegate(AVPacket* @dst, AVPacket* @src); + public static av_packet_copy_props_delegate av_packet_copy_props; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_free_side_data_delegate(AVPacket* @pkt); + public static av_packet_free_side_data_delegate av_packet_free_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_packet_from_data_delegate(AVPacket* @pkt, byte* @data, int @size); + public static av_packet_from_data_delegate av_packet_from_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_packet_get_side_data_delegate(AVPacket* @pkt, AVPacketSideDataType @type, ulong* @size); + public static av_packet_get_side_data_delegate av_packet_get_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_packet_make_refcounted_delegate(AVPacket* @pkt); + public static av_packet_make_refcounted_delegate av_packet_make_refcounted; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_packet_make_writable_delegate(AVPacket* @pkt); + public static av_packet_make_writable_delegate av_packet_make_writable; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_move_ref_delegate(AVPacket* @dst, AVPacket* @src); + public static av_packet_move_ref_delegate av_packet_move_ref; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_packet_new_side_data_delegate(AVPacket* @pkt, AVPacketSideDataType @type, ulong @size); + public static av_packet_new_side_data_delegate av_packet_new_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_packet_pack_dictionary_delegate(AVDictionary* @dict, ulong* @size); + public static av_packet_pack_dictionary_delegate av_packet_pack_dictionary; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_packet_ref_delegate(AVPacket* @dst, AVPacket* @src); + public static av_packet_ref_delegate av_packet_ref; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_packet_rescale_ts_delegate(AVPacket* @pkt, AVRational @tb_src, AVRational @tb_dst); + public static av_packet_rescale_ts_delegate av_packet_rescale_ts; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + 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; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_parse_cpu_caps_delegate(uint* @flags, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @s); + public static av_parse_cpu_caps_delegate av_parse_cpu_caps; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_parser_close_delegate(AVCodecParserContext* @s); + public static av_parser_close_delegate av_parser_close; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecParserContext* av_parser_init_delegate(int @codec_id); + public static av_parser_init_delegate av_parser_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecParser* av_parser_iterate_delegate(void** @opaque); + public static av_parser_iterate_delegate av_parser_iterate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_parser_parse2_delegate(AVCodecParserContext* @s, AVCodecContext* @avctx, byte** @poutbuf, int* @poutbuf_size, byte* @buf, int @buf_size, long @pts, long @dts, long @pos); + public static av_parser_parse2_delegate av_parser_parse2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_pix_fmt_count_planes_delegate(AVPixelFormat @pix_fmt); + public static av_pix_fmt_count_planes_delegate av_pix_fmt_count_planes; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPixFmtDescriptor* av_pix_fmt_desc_get_delegate(AVPixelFormat @pix_fmt); + public static av_pix_fmt_desc_get_delegate av_pix_fmt_desc_get; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPixelFormat av_pix_fmt_desc_get_id_delegate(AVPixFmtDescriptor* @desc); + public static av_pix_fmt_desc_get_id_delegate av_pix_fmt_desc_get_id; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPixFmtDescriptor* av_pix_fmt_desc_next_delegate(AVPixFmtDescriptor* @prev); + public static av_pix_fmt_desc_next_delegate av_pix_fmt_desc_next; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_pix_fmt_get_chroma_sub_sample_delegate(AVPixelFormat @pix_fmt, int* @h_shift, int* @v_shift); + public static av_pix_fmt_get_chroma_sub_sample_delegate av_pix_fmt_get_chroma_sub_sample; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPixelFormat av_pix_fmt_swap_endianness_delegate(AVPixelFormat @pix_fmt); + public static av_pix_fmt_swap_endianness_delegate av_pix_fmt_swap_endianness; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_pkt_dump_log2_delegate(void* @avcl, int @level, AVPacket* @pkt, int @dump_payload, AVStream* @st); + public static av_pkt_dump_log2_delegate av_pkt_dump_log2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_pkt_dump2_delegate(_iobuf* @f, AVPacket* @pkt, int @dump_payload, AVStream* @st); + public static av_pkt_dump2_delegate av_pkt_dump2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_probe_input_buffer_delegate(AVIOContext* @pb, AVInputFormat** @fmt, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, void* @logctx, uint @offset, uint @max_probe_size); + public static av_probe_input_buffer_delegate av_probe_input_buffer; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_probe_input_buffer2_delegate(AVIOContext* @pb, AVInputFormat** @fmt, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, void* @logctx, uint @offset, uint @max_probe_size); + public static av_probe_input_buffer2_delegate av_probe_input_buffer2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVInputFormat* av_probe_input_format_delegate(AVProbeData* @pd, int @is_opened); + public static av_probe_input_format_delegate av_probe_input_format; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVInputFormat* av_probe_input_format2_delegate(AVProbeData* @pd, int @is_opened, int* @score_max); + public static av_probe_input_format2_delegate av_probe_input_format2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVInputFormat* av_probe_input_format3_delegate(AVProbeData* @pd, int @is_opened, int* @score_ret); + public static av_probe_input_format3_delegate av_probe_input_format3; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_program_add_stream_index_delegate(AVFormatContext* @ac, int @progid, uint @idx); + public static av_program_add_stream_index_delegate av_program_add_stream_index; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint av_q2intfloat_delegate(AVRational @q); + public static av_q2intfloat_delegate av_q2intfloat; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_read_image_line_delegate(ushort* @dst, in byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @read_pal_component); + public static av_read_image_line_delegate av_read_image_line; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_read_image_line2_delegate(void* @dst, in byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @read_pal_component, int @dst_element_size); + public static av_read_image_line2_delegate av_read_image_line2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_read_pause_delegate(AVFormatContext* @s); + public static av_read_pause_delegate av_read_pause; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_read_play_delegate(AVFormatContext* @s); + public static av_read_play_delegate av_read_play; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_realloc_delegate(void* @ptr, ulong @size); + public static av_realloc_delegate av_realloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_realloc_array_delegate(void* @ptr, ulong @nmemb, ulong @size); + public static av_realloc_array_delegate av_realloc_array; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_realloc_f_delegate(void* @ptr, ulong @nelem, ulong @elsize); + public static av_realloc_f_delegate av_realloc_f; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_reallocp_delegate(void* @ptr, ulong @size); + public static av_reallocp_delegate av_reallocp; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_reallocp_array_delegate(void* @ptr, ulong @nmemb, ulong @size); + public static av_reallocp_array_delegate av_reallocp_array; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_reduce_delegate(int* @dst_num, int* @dst_den, long @num, long @den, long @max); + public static av_reduce_delegate av_reduce; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_rescale_delegate(long @a, long @b, long @c); + public static av_rescale_delegate av_rescale; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_rescale_delta_delegate(AVRational @in_tb, long @in_ts, AVRational @fs_tb, int @duration, long* @last, AVRational @out_tb); + public static av_rescale_delta_delegate av_rescale_delta; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_rescale_q_delegate(long @a, AVRational @bq, AVRational @cq); + public static av_rescale_q_delegate av_rescale_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_rescale_q_rnd_delegate(long @a, AVRational @bq, AVRational @cq, AVRounding @rnd); + public static av_rescale_q_rnd_delegate av_rescale_q_rnd; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long av_rescale_rnd_delegate(long @a, long @b, long @c, AVRounding @rnd); + public static av_rescale_rnd_delegate av_rescale_rnd; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_sample_fmt_is_planar_delegate(AVSampleFormat @sample_fmt); + public static av_sample_fmt_is_planar_delegate av_sample_fmt_is_planar; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_samples_alloc_delegate(byte** @audio_data, int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align); + public static av_samples_alloc_delegate av_samples_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_samples_alloc_array_and_samples_delegate(byte*** @audio_data, int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align); + public static av_samples_alloc_array_and_samples_delegate av_samples_alloc_array_and_samples; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_samples_copy_delegate(byte** @dst, byte** @src, int @dst_offset, int @src_offset, int @nb_samples, int @nb_channels, AVSampleFormat @sample_fmt); + public static av_samples_copy_delegate av_samples_copy; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_samples_fill_arrays_delegate(byte** @audio_data, int* @linesize, byte* @buf, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align); + public static av_samples_fill_arrays_delegate av_samples_fill_arrays; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_samples_get_buffer_size_delegate(int* @linesize, int @nb_channels, int @nb_samples, AVSampleFormat @sample_fmt, int @align); + public static av_samples_get_buffer_size_delegate av_samples_get_buffer_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_samples_set_silence_delegate(byte** @audio_data, int @offset, int @nb_samples, int @nb_channels, AVSampleFormat @sample_fmt); + public static av_samples_set_silence_delegate av_samples_set_silence; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_sdp_create_delegate(AVFormatContext** @ac, int @n_files, byte* @buf, int @size); + public static av_sdp_create_delegate av_sdp_create; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_seek_frame_delegate(AVFormatContext* @s, int @stream_index, long @timestamp, int @flags); + public static av_seek_frame_delegate av_seek_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_set_options_string_delegate(void* @ctx, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @opts, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @key_val_sep, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @pairs_sep); + public static av_set_options_string_delegate av_set_options_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_shrink_packet_delegate(AVPacket* @pkt, int @size); + public static av_shrink_packet_delegate av_shrink_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_size_mult_delegate(ulong @a, ulong @b, ulong* @r); + public static av_size_mult_delegate av_size_mult; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_strdup_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @s); + public static av_strdup_delegate av_strdup; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_stream_add_side_data_delegate(AVStream* @st, AVPacketSideDataType @type, byte* @data, ulong @size); + public static av_stream_add_side_data_delegate av_stream_add_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* av_stream_get_class_delegate(); + public static av_stream_get_class_delegate av_stream_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_stream_get_codec_timebase_delegate(AVStream* @st); + public static av_stream_get_codec_timebase_delegate av_stream_get_codec_timebase; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecParserContext* av_stream_get_parser_delegate(AVStream* @s); + public static av_stream_get_parser_delegate av_stream_get_parser; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_stream_get_side_data_delegate(AVStream* @stream, AVPacketSideDataType @type, ulong* @size); + public static av_stream_get_side_data_delegate av_stream_get_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* av_stream_group_get_class_delegate(); + public static av_stream_group_get_class_delegate av_stream_group_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_stream_new_side_data_delegate(AVStream* @stream, AVPacketSideDataType @type, ulong @size); + public static av_stream_new_side_data_delegate av_stream_new_side_data; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_strerror_delegate(int @errnum, byte* @errbuf, ulong @errbuf_size); + public static av_strerror_delegate av_strerror; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_strndup_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @s, ulong @len); + public static av_strndup_delegate av_strndup; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVRational av_sub_q_delegate(AVRational @b, AVRational @c); + public static av_sub_q_delegate av_sub_q; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_timecode_adjust_ntsc_framenum2_delegate(int @framenum, int @fps); + public static av_timecode_adjust_ntsc_framenum2_delegate av_timecode_adjust_ntsc_framenum2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_timecode_check_frame_rate_delegate(AVRational @rate); + public static av_timecode_check_frame_rate_delegate av_timecode_check_frame_rate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint av_timecode_get_smpte_delegate(AVRational @rate, int @drop, int @hh, int @mm, int @ss, int @ff); + public static av_timecode_get_smpte_delegate av_timecode_get_smpte; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint av_timecode_get_smpte_from_framenum_delegate(AVTimecode* @tc, int @framenum); + public static av_timecode_get_smpte_from_framenum_delegate av_timecode_get_smpte_from_framenum; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_timecode_init_delegate(AVTimecode* @tc, AVRational @rate, int @flags, int @frame_start, void* @log_ctx); + public static av_timecode_init_delegate av_timecode_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_timecode_init_from_components_delegate(AVTimecode* @tc, AVRational @rate, int @flags, int @hh, int @mm, int @ss, int @ff, void* @log_ctx); + public static av_timecode_init_from_components_delegate av_timecode_init_from_components; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_timecode_init_from_string_delegate(AVTimecode* @tc, AVRational @rate, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @str, void* @log_ctx); + public static av_timecode_init_from_string_delegate av_timecode_init_from_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_timecode_make_mpeg_tc_string_delegate(byte* @buf, uint @tc25bit); + public static av_timecode_make_mpeg_tc_string_delegate av_timecode_make_mpeg_tc_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_timecode_make_smpte_tc_string_delegate(byte* @buf, uint @tcsmpte, int @prevent_df); + public static av_timecode_make_smpte_tc_string_delegate av_timecode_make_smpte_tc_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_timecode_make_smpte_tc_string2_delegate(byte* @buf, AVRational @rate, uint @tcsmpte, int @prevent_df, int @skip_field); + public static av_timecode_make_smpte_tc_string2_delegate av_timecode_make_smpte_tc_string2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* av_timecode_make_string_delegate(AVTimecode* @tc, byte* @buf, int @framenum); + public static av_timecode_make_string_delegate av_timecode_make_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_tree_destroy_delegate(AVTreeNode* @t); + public static av_tree_destroy_delegate av_tree_destroy; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_tree_enumerate_delegate(AVTreeNode* @t, void* @opaque, av_tree_enumerate_cmp_func @cmp, av_tree_enumerate_enu_func @enu); + public static av_tree_enumerate_delegate av_tree_enumerate; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_tree_find_delegate(AVTreeNode* @root, void* @key, av_tree_find_cmp_func @cmp, ref void_ptr2 @next); + public static av_tree_find_delegate av_tree_find; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* av_tree_insert_delegate(AVTreeNode** @rootp, void* @key, av_tree_insert_cmp_func @cmp, AVTreeNode** @next); + public static av_tree_insert_delegate av_tree_insert; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVTreeNode* av_tree_node_alloc_delegate(); + public static av_tree_node_alloc_delegate av_tree_node_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_url_split_delegate(byte* @proto, int @proto_size, byte* @authorization, int @authorization_size, byte* @hostname, int @hostname_size, int* @port_ptr, byte* @path, int @path_size, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url); + public static av_url_split_delegate av_url_split; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_usleep_delegate(uint @usec); + public static av_usleep_delegate av_usleep; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string av_version_info_delegate(); + public static av_version_info_delegate av_version_info; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_vlog_delegate(void* @avcl, int @level, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @fmt, byte* @vl); + public static av_vlog_delegate av_vlog; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_write_frame_delegate(AVFormatContext* @s, AVPacket* @pkt); + public static av_write_frame_delegate av_write_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_write_image_line_delegate(ushort* @src, ref byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w); + public static av_write_image_line_delegate av_write_image_line; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void av_write_image_line2_delegate(void* @src, ref byte_ptr4 @data, in int4 @linesize, AVPixFmtDescriptor* @desc, int @x, int @y, int @c, int @w, int @src_element_size); + public static av_write_image_line2_delegate av_write_image_line2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_write_trailer_delegate(AVFormatContext* @s); + public static av_write_trailer_delegate av_write_trailer; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_write_uncoded_frame_delegate(AVFormatContext* @s, int @stream_index, AVFrame* @frame); + public static av_write_uncoded_frame_delegate av_write_uncoded_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int av_write_uncoded_frame_query_delegate(AVFormatContext* @s, int @stream_index); + public static av_write_uncoded_frame_query_delegate av_write_uncoded_frame_query; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint av_xiphlacing_delegate(byte* @s, uint @v); + public static av_xiphlacing_delegate av_xiphlacing; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avcodec_align_dimensions_delegate(AVCodecContext* @s, int* @width, int* @height); + public static avcodec_align_dimensions_delegate avcodec_align_dimensions; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avcodec_align_dimensions2_delegate(AVCodecContext* @s, int* @width, int* @height, ref int8 @linesize_align); + public static avcodec_align_dimensions2_delegate avcodec_align_dimensions2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_close_delegate(AVCodecContext* @avctx); + public static avcodec_close_delegate avcodec_close; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avcodec_configuration_delegate(); + public static avcodec_configuration_delegate avcodec_configuration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_decode_subtitle2_delegate(AVCodecContext* @avctx, AVSubtitle* @sub, int* @got_sub_ptr, AVPacket* @avpkt); + public static avcodec_decode_subtitle2_delegate avcodec_decode_subtitle2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_default_execute_delegate(AVCodecContext* @c, avcodec_default_execute_func_func @func, void* @arg, int* @ret, int @count, int @size); + public static avcodec_default_execute_delegate avcodec_default_execute; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_default_execute2_delegate(AVCodecContext* @c, avcodec_default_execute2_func_func @func, void* @arg, int* @ret, int @count); + public static avcodec_default_execute2_delegate avcodec_default_execute2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_default_get_buffer2_delegate(AVCodecContext* @s, AVFrame* @frame, int @flags); + public static avcodec_default_get_buffer2_delegate avcodec_default_get_buffer2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_default_get_encode_buffer_delegate(AVCodecContext* @s, AVPacket* @pkt, int @flags); + public static avcodec_default_get_encode_buffer_delegate avcodec_default_get_encode_buffer; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPixelFormat avcodec_default_get_format_delegate(AVCodecContext* @s, AVPixelFormat* @fmt); + public static avcodec_default_get_format_delegate avcodec_default_get_format; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecDescriptor* avcodec_descriptor_get_delegate(AVCodecID @id); + public static avcodec_descriptor_get_delegate avcodec_descriptor_get; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecDescriptor* avcodec_descriptor_get_by_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static avcodec_descriptor_get_by_name_delegate avcodec_descriptor_get_by_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecDescriptor* avcodec_descriptor_next_delegate(AVCodecDescriptor* @prev); + public static avcodec_descriptor_next_delegate avcodec_descriptor_next; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_encode_subtitle_delegate(AVCodecContext* @avctx, byte* @buf, int @buf_size, AVSubtitle* @sub); + public static avcodec_encode_subtitle_delegate avcodec_encode_subtitle; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_fill_audio_frame_delegate(AVFrame* @frame, int @nb_channels, AVSampleFormat @sample_fmt, byte* @buf, int @buf_size, int @align); + public static avcodec_fill_audio_frame_delegate avcodec_fill_audio_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVPixelFormat avcodec_find_best_pix_fmt_of_list_delegate(AVPixelFormat* @pix_fmt_list, AVPixelFormat @src_pix_fmt, int @has_alpha, int* @loss_ptr); + public static avcodec_find_best_pix_fmt_of_list_delegate avcodec_find_best_pix_fmt_of_list; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodec* avcodec_find_decoder_delegate(AVCodecID @id); + public static avcodec_find_decoder_delegate avcodec_find_decoder; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodec* avcodec_find_decoder_by_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static avcodec_find_decoder_by_name_delegate avcodec_find_decoder_by_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodec* avcodec_find_encoder_delegate(AVCodecID @id); + public static avcodec_find_encoder_delegate avcodec_find_encoder; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodec* avcodec_find_encoder_by_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static avcodec_find_encoder_by_name_delegate avcodec_find_encoder_by_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* avcodec_get_class_delegate(); + public static avcodec_get_class_delegate avcodec_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecHWConfig* avcodec_get_hw_config_delegate(AVCodec* @codec, int @index); + public static avcodec_get_hw_config_delegate avcodec_get_hw_config; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_get_hw_frames_parameters_delegate(AVCodecContext* @avctx, AVBufferRef* @device_ref, AVPixelFormat @hw_pix_fmt, AVBufferRef** @out_frames_ref); + public static avcodec_get_hw_frames_parameters_delegate avcodec_get_hw_frames_parameters; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* avcodec_get_subtitle_rect_class_delegate(); + public static avcodec_get_subtitle_rect_class_delegate avcodec_get_subtitle_rect_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVMediaType avcodec_get_type_delegate(AVCodecID @codec_id); + public static avcodec_get_type_delegate avcodec_get_type; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_is_open_delegate(AVCodecContext* @s); + public static avcodec_is_open_delegate avcodec_is_open; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avcodec_license_delegate(); + public static avcodec_license_delegate avcodec_license; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecParameters* avcodec_parameters_alloc_delegate(); + public static avcodec_parameters_alloc_delegate avcodec_parameters_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_parameters_copy_delegate(AVCodecParameters* @dst, AVCodecParameters* @src); + public static avcodec_parameters_copy_delegate avcodec_parameters_copy; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avcodec_parameters_free_delegate(AVCodecParameters** @par); + public static avcodec_parameters_free_delegate avcodec_parameters_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_parameters_from_context_delegate(AVCodecParameters* @par, AVCodecContext* @codec); + public static avcodec_parameters_from_context_delegate avcodec_parameters_from_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_parameters_to_context_delegate(AVCodecContext* @codec, AVCodecParameters* @par); + public static avcodec_parameters_to_context_delegate avcodec_parameters_to_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avcodec_pix_fmt_to_codec_tag_delegate(AVPixelFormat @pix_fmt); + public static avcodec_pix_fmt_to_codec_tag_delegate avcodec_pix_fmt_to_codec_tag; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avcodec_profile_name_delegate(AVCodecID @codec_id, int @profile); + public static avcodec_profile_name_delegate avcodec_profile_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_receive_packet_delegate(AVCodecContext* @avctx, AVPacket* @avpkt); + public static avcodec_receive_packet_delegate avcodec_receive_packet; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avcodec_send_frame_delegate(AVCodecContext* @avctx, AVFrame* @frame); + public static avcodec_send_frame_delegate avcodec_send_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avcodec_string_delegate(byte* @buf, int @buf_size, AVCodecContext* @enc, int @encode); + public static avcodec_string_delegate avcodec_string; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avcodec_version_delegate(); + public static avcodec_version_delegate avcodec_version; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avdevice_app_to_dev_control_message_delegate(AVFormatContext* @s, AVAppToDevMessageType @type, void* @data, ulong @data_size); + public static avdevice_app_to_dev_control_message_delegate avdevice_app_to_dev_control_message; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avdevice_configuration_delegate(); + public static avdevice_configuration_delegate avdevice_configuration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avdevice_dev_to_app_control_message_delegate(AVFormatContext* @s, AVDevToAppMessageType @type, void* @data, ulong @data_size); + public static avdevice_dev_to_app_control_message_delegate avdevice_dev_to_app_control_message; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avdevice_free_list_devices_delegate(AVDeviceInfoList** @device_list); + public static avdevice_free_list_devices_delegate avdevice_free_list_devices; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avdevice_license_delegate(); + public static avdevice_license_delegate avdevice_license; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avdevice_list_devices_delegate(AVFormatContext* @s, AVDeviceInfoList** @device_list); + public static avdevice_list_devices_delegate avdevice_list_devices; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avdevice_list_input_sources_delegate(AVInputFormat* @device, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @device_name, AVDictionary* @device_options, AVDeviceInfoList** @device_list); + public static avdevice_list_input_sources_delegate avdevice_list_input_sources; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avdevice_list_output_sinks_delegate(AVOutputFormat* @device, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @device_name, AVDictionary* @device_options, AVDeviceInfoList** @device_list); + public static avdevice_list_output_sinks_delegate avdevice_list_output_sinks; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avdevice_register_all_delegate(); + public static avdevice_register_all_delegate avdevice_register_all; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avdevice_version_delegate(); + public static avdevice_version_delegate avdevice_version; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_config_links_delegate(AVFilterContext* @filter); + public static avfilter_config_links_delegate avfilter_config_links; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avfilter_configuration_delegate(); + public static avfilter_configuration_delegate avfilter_configuration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avfilter_filter_pad_count_delegate(AVFilter* @filter, int @is_output); + public static avfilter_filter_pad_count_delegate avfilter_filter_pad_count; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avfilter_free_delegate(AVFilterContext* @filter); + public static avfilter_free_delegate avfilter_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFilter* avfilter_get_by_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static avfilter_get_by_name_delegate avfilter_get_by_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* avfilter_get_class_delegate(); + public static avfilter_get_class_delegate avfilter_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFilterGraph* avfilter_graph_alloc_delegate(); + public static avfilter_graph_alloc_delegate avfilter_graph_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFilterContext* avfilter_graph_alloc_filter_delegate(AVFilterGraph* @graph, AVFilter* @filter, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static avfilter_graph_alloc_filter_delegate avfilter_graph_alloc_filter; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_config_delegate(AVFilterGraph* @graphctx, void* @log_ctx); + public static avfilter_graph_config_delegate avfilter_graph_config; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_create_filter_delegate(AVFilterContext** @filt_ctx, AVFilter* @filt, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @args, void* @opaque, AVFilterGraph* @graph_ctx); + public static avfilter_graph_create_filter_delegate avfilter_graph_create_filter; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate byte* avfilter_graph_dump_delegate(AVFilterGraph* @graph, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @options); + public static avfilter_graph_dump_delegate avfilter_graph_dump; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avfilter_graph_free_delegate(AVFilterGraph** @graph); + public static avfilter_graph_free_delegate avfilter_graph_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFilterContext* avfilter_graph_get_filter_delegate(AVFilterGraph* @graph, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static avfilter_graph_get_filter_delegate avfilter_graph_get_filter; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_parse_delegate(AVFilterGraph* @graph, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filters, AVFilterInOut* @inputs, AVFilterInOut* @outputs, void* @log_ctx); + public static avfilter_graph_parse_delegate avfilter_graph_parse; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_parse_ptr_delegate(AVFilterGraph* @graph, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filters, AVFilterInOut** @inputs, AVFilterInOut** @outputs, void* @log_ctx); + public static avfilter_graph_parse_ptr_delegate avfilter_graph_parse_ptr; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_parse2_delegate(AVFilterGraph* @graph, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filters, AVFilterInOut** @inputs, AVFilterInOut** @outputs); + public static avfilter_graph_parse2_delegate avfilter_graph_parse2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_queue_command_delegate(AVFilterGraph* @graph, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @target, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @cmd, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @arg, int @flags, double @ts); + public static avfilter_graph_queue_command_delegate avfilter_graph_queue_command; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_request_oldest_delegate(AVFilterGraph* @graph); + public static avfilter_graph_request_oldest_delegate avfilter_graph_request_oldest; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_segment_apply_delegate(AVFilterGraphSegment* @seg, int @flags, AVFilterInOut** @inputs, AVFilterInOut** @outputs); + public static avfilter_graph_segment_apply_delegate avfilter_graph_segment_apply; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_segment_apply_opts_delegate(AVFilterGraphSegment* @seg, int @flags); + public static avfilter_graph_segment_apply_opts_delegate avfilter_graph_segment_apply_opts; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_segment_create_filters_delegate(AVFilterGraphSegment* @seg, int @flags); + public static avfilter_graph_segment_create_filters_delegate avfilter_graph_segment_create_filters; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avfilter_graph_segment_free_delegate(AVFilterGraphSegment** @seg); + public static avfilter_graph_segment_free_delegate avfilter_graph_segment_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_segment_init_delegate(AVFilterGraphSegment* @seg, int @flags); + public static avfilter_graph_segment_init_delegate avfilter_graph_segment_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_segment_link_delegate(AVFilterGraphSegment* @seg, int @flags, AVFilterInOut** @inputs, AVFilterInOut** @outputs); + public static avfilter_graph_segment_link_delegate avfilter_graph_segment_link; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_segment_parse_delegate(AVFilterGraph* @graph, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @graph_str, int @flags, AVFilterGraphSegment** @seg); + public static avfilter_graph_segment_parse_delegate avfilter_graph_segment_parse; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_graph_send_command_delegate(AVFilterGraph* @graph, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @target, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @cmd, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @arg, byte* @res, int @res_len, int @flags); + public static avfilter_graph_send_command_delegate avfilter_graph_send_command; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avfilter_graph_set_auto_convert_delegate(AVFilterGraph* @graph, uint @flags); + public static avfilter_graph_set_auto_convert_delegate avfilter_graph_set_auto_convert; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_init_dict_delegate(AVFilterContext* @ctx, AVDictionary** @options); + public static avfilter_init_dict_delegate avfilter_init_dict; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_init_str_delegate(AVFilterContext* @ctx, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @args); + public static avfilter_init_str_delegate avfilter_init_str; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVFilterInOut* avfilter_inout_alloc_delegate(); + public static avfilter_inout_alloc_delegate avfilter_inout_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avfilter_inout_free_delegate(AVFilterInOut** @inout); + public static avfilter_inout_free_delegate avfilter_inout_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_insert_filter_delegate(AVFilterLink* @link, AVFilterContext* @filt, uint @filt_srcpad_idx, uint @filt_dstpad_idx); + public static avfilter_insert_filter_delegate avfilter_insert_filter; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avfilter_license_delegate(); + public static avfilter_license_delegate avfilter_license; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_link_delegate(AVFilterContext* @src, uint @srcpad, AVFilterContext* @dst, uint @dstpad); + public static avfilter_link_delegate avfilter_link; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avfilter_link_free_delegate(AVFilterLink** @link); + public static avfilter_link_free_delegate avfilter_link_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avfilter_pad_get_name_delegate(AVFilterPad* @pads, int @pad_idx); + public static avfilter_pad_get_name_delegate avfilter_pad_get_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVMediaType avfilter_pad_get_type_delegate(AVFilterPad* @pads, int @pad_idx); + public static avfilter_pad_get_type_delegate avfilter_pad_get_type; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avfilter_process_command_delegate(AVFilterContext* @filter, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @cmd, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @arg, byte* @res, int @res_len, int @flags); + public static avfilter_process_command_delegate avfilter_process_command; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avfilter_version_delegate(); + public static avfilter_version_delegate avfilter_version; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_alloc_output_context2_delegate(AVFormatContext** @ctx, AVOutputFormat* @oformat, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @format_name, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @filename); + public static avformat_alloc_output_context2_delegate avformat_alloc_output_context2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avformat_configuration_delegate(); + public static avformat_configuration_delegate avformat_configuration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_flush_delegate(AVFormatContext* @s); + public static avformat_flush_delegate avformat_flush; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avformat_free_context_delegate(AVFormatContext* @s); + public static avformat_free_context_delegate avformat_free_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* avformat_get_class_delegate(); + public static avformat_get_class_delegate avformat_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecTag* avformat_get_mov_audio_tags_delegate(); + public static avformat_get_mov_audio_tags_delegate avformat_get_mov_audio_tags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecTag* avformat_get_mov_video_tags_delegate(); + public static avformat_get_mov_video_tags_delegate avformat_get_mov_video_tags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecTag* avformat_get_riff_audio_tags_delegate(); + public static avformat_get_riff_audio_tags_delegate avformat_get_riff_audio_tags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVCodecTag* avformat_get_riff_video_tags_delegate(); + public static avformat_get_riff_video_tags_delegate avformat_get_riff_video_tags; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_index_get_entries_count_delegate(AVStream* @st); + public static avformat_index_get_entries_count_delegate avformat_index_get_entries_count; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVIndexEntry* avformat_index_get_entry_delegate(AVStream* @st, int @idx); + public static avformat_index_get_entry_delegate avformat_index_get_entry; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVIndexEntry* avformat_index_get_entry_from_timestamp_delegate(AVStream* @st, long @wanted_timestamp, int @flags); + public static avformat_index_get_entry_from_timestamp_delegate avformat_index_get_entry_from_timestamp; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_init_output_delegate(AVFormatContext* @s, AVDictionary** @options); + public static avformat_init_output_delegate avformat_init_output; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avformat_license_delegate(); + public static avformat_license_delegate avformat_license; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_match_stream_specifier_delegate(AVFormatContext* @s, AVStream* @st, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @spec); + public static avformat_match_stream_specifier_delegate avformat_match_stream_specifier; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_network_deinit_delegate(); + public static avformat_network_deinit_delegate avformat_network_deinit; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_network_init_delegate(); + public static avformat_network_init_delegate avformat_network_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVStream* avformat_new_stream_delegate(AVFormatContext* @s, AVCodec* @c); + public static avformat_new_stream_delegate avformat_new_stream; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_query_codec_delegate(AVOutputFormat* @ofmt, AVCodecID @codec_id, int @std_compliance); + public static avformat_query_codec_delegate avformat_query_codec; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_queue_attached_pictures_delegate(AVFormatContext* @s); + public static avformat_queue_attached_pictures_delegate avformat_queue_attached_pictures; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_stream_group_add_stream_delegate(AVStreamGroup* @stg, AVStream* @st); + public static avformat_stream_group_add_stream_delegate avformat_stream_group_add_stream; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVStreamGroup* avformat_stream_group_create_delegate(AVFormatContext* @s, AVStreamGroupParamsType @type, AVDictionary** @options); + public static avformat_stream_group_create_delegate avformat_stream_group_create; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avformat_stream_group_name_delegate(AVStreamGroupParamsType @type); + public static avformat_stream_group_name_delegate avformat_stream_group_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_transfer_internal_stream_timing_info_delegate(AVOutputFormat* @ofmt, AVStream* @ost, AVStream* @ist, AVTimebaseSource @copy_tb); + public static avformat_transfer_internal_stream_timing_info_delegate avformat_transfer_internal_stream_timing_info; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avformat_version_delegate(); + public static avformat_version_delegate avformat_version; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avformat_write_header_delegate(AVFormatContext* @s, AVDictionary** @options); + public static avformat_write_header_delegate avformat_write_header; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_accept_delegate(AVIOContext* @s, AVIOContext** @c); + public static avio_accept_delegate avio_accept; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_check_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, int @flags); + public static avio_check_delegate avio_check; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_close_delegate(AVIOContext* @s); + public static avio_close_delegate avio_close; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_close_dir_delegate(AVIODirContext** @s); + public static avio_close_dir_delegate avio_close_dir; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_close_dyn_buf_delegate(AVIOContext* @s, byte** @pbuffer); + public static avio_close_dyn_buf_delegate avio_close_dyn_buf; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_closep_delegate(AVIOContext** @s); + public static avio_closep_delegate avio_closep; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avio_enum_protocols_delegate(void** @opaque, int @output); + public static avio_enum_protocols_delegate avio_enum_protocols; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_feof_delegate(AVIOContext* @s); + public static avio_feof_delegate avio_feof; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avio_find_protocol_name_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url); + public static avio_find_protocol_name_delegate avio_find_protocol_name; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_flush_delegate(AVIOContext* @s); + public static avio_flush_delegate avio_flush; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_free_directory_entry_delegate(AVIODirEntry** @entry); + public static avio_free_directory_entry_delegate avio_free_directory_entry; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_get_dyn_buf_delegate(AVIOContext* @s, byte** @pbuffer); + public static avio_get_dyn_buf_delegate avio_get_dyn_buf; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_get_str_delegate(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen); + public static avio_get_str_delegate avio_get_str; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_get_str16be_delegate(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen); + public static avio_get_str16be_delegate avio_get_str16be; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_get_str16le_delegate(AVIOContext* @pb, int @maxlen, byte* @buf, int @buflen); + public static avio_get_str16le_delegate avio_get_str16le; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_handshake_delegate(AVIOContext* @c); + public static avio_handshake_delegate avio_handshake; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_open_delegate(AVIOContext** @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, int @flags); + public static avio_open_delegate avio_open; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_open_dir_delegate(AVIODirContext** @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, AVDictionary** @options); + public static avio_open_dir_delegate avio_open_dir; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_open_dyn_buf_delegate(AVIOContext** @s); + public static avio_open_dyn_buf_delegate avio_open_dyn_buf; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_open2_delegate(AVIOContext** @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @url, int @flags, AVIOInterruptCB* @int_cb, AVDictionary** @options); + public static avio_open2_delegate avio_open2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_pause_delegate(AVIOContext* @h, int @pause); + public static avio_pause_delegate avio_pause; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_print_string_array_delegate(AVIOContext* @s, byte*[] @strings); + public static avio_print_string_array_delegate avio_print_string_array; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_printf_delegate(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @fmt); + public static avio_printf_delegate avio_printf; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* avio_protocol_get_class_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name); + public static avio_protocol_get_class_delegate avio_protocol_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_put_str_delegate(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @str); + public static avio_put_str_delegate avio_put_str; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_put_str16be_delegate(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @str); + public static avio_put_str16be_delegate avio_put_str16be; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_put_str16le_delegate(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @str); + public static avio_put_str16le_delegate avio_put_str16le; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_r8_delegate(AVIOContext* @s); + public static avio_r8_delegate avio_r8; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avio_rb16_delegate(AVIOContext* @s); + public static avio_rb16_delegate avio_rb16; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avio_rb24_delegate(AVIOContext* @s); + public static avio_rb24_delegate avio_rb24; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avio_rb32_delegate(AVIOContext* @s); + public static avio_rb32_delegate avio_rb32; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate ulong avio_rb64_delegate(AVIOContext* @s); + public static avio_rb64_delegate avio_rb64; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_read_delegate(AVIOContext* @s, byte* @buf, int @size); + public static avio_read_delegate avio_read; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_read_dir_delegate(AVIODirContext* @s, AVIODirEntry** @next); + public static avio_read_dir_delegate avio_read_dir; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_read_partial_delegate(AVIOContext* @s, byte* @buf, int @size); + public static avio_read_partial_delegate avio_read_partial; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_read_to_bprint_delegate(AVIOContext* @h, AVBPrint* @pb, ulong @max_size); + public static avio_read_to_bprint_delegate avio_read_to_bprint; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avio_rl16_delegate(AVIOContext* @s); + public static avio_rl16_delegate avio_rl16; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avio_rl24_delegate(AVIOContext* @s); + public static avio_rl24_delegate avio_rl24; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avio_rl32_delegate(AVIOContext* @s); + public static avio_rl32_delegate avio_rl32; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate ulong avio_rl64_delegate(AVIOContext* @s); + public static avio_rl64_delegate avio_rl64; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long avio_seek_delegate(AVIOContext* @s, long @offset, int @whence); + public static avio_seek_delegate avio_seek; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long avio_seek_time_delegate(AVIOContext* @h, int @stream_index, long @timestamp, int @flags); + public static avio_seek_time_delegate avio_seek_time; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long avio_size_delegate(AVIOContext* @s); + public static avio_size_delegate avio_size; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long avio_skip_delegate(AVIOContext* @s, long @offset); + public static avio_skip_delegate avio_skip; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int avio_vprintf_delegate(AVIOContext* @s, +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @fmt, byte* @ap); + public static avio_vprintf_delegate avio_vprintf; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_w8_delegate(AVIOContext* @s, int @b); + public static avio_w8_delegate avio_w8; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_wb16_delegate(AVIOContext* @s, uint @val); + public static avio_wb16_delegate avio_wb16; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_wb24_delegate(AVIOContext* @s, uint @val); + public static avio_wb24_delegate avio_wb24; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_wb32_delegate(AVIOContext* @s, uint @val); + public static avio_wb32_delegate avio_wb32; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_wb64_delegate(AVIOContext* @s, ulong @val); + public static avio_wb64_delegate avio_wb64; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_wl16_delegate(AVIOContext* @s, uint @val); + public static avio_wl16_delegate avio_wl16; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_wl24_delegate(AVIOContext* @s, uint @val); + public static avio_wl24_delegate avio_wl24; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_wl32_delegate(AVIOContext* @s, uint @val); + public static avio_wl32_delegate avio_wl32; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_wl64_delegate(AVIOContext* @s, ulong @val); + public static avio_wl64_delegate avio_wl64; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_write_delegate(AVIOContext* @s, byte* @buf, int @size); + public static avio_write_delegate avio_write; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avio_write_marker_delegate(AVIOContext* @s, long @time, AVIODataMarkerType @type); + public static avio_write_marker_delegate avio_write_marker; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void avsubtitle_free_delegate(AVSubtitle* @sub); + public static avsubtitle_free_delegate avsubtitle_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avutil_configuration_delegate(); + public static avutil_configuration_delegate avutil_configuration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string avutil_license_delegate(); + public static avutil_license_delegate avutil_license; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint avutil_version_delegate(); + public static avutil_version_delegate avutil_version; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string postproc_configuration_delegate(); + public static postproc_configuration_delegate postproc_configuration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string postproc_license_delegate(); + public static postproc_license_delegate postproc_license; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint postproc_version_delegate(); + public static postproc_version_delegate postproc_version; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void pp_free_context_delegate(void* @ppContext); + public static pp_free_context_delegate pp_free_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void pp_free_mode_delegate(void* @mode); + public static pp_free_mode_delegate pp_free_mode; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* pp_get_context_delegate(int @width, int @height, int @flags); + public static pp_get_context_delegate pp_get_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void* pp_get_mode_by_name_and_quality_delegate( +#if NETSTANDARD2_1_OR_GREATER + [MarshalAs(UnmanagedType.LPUTF8Str)] + #else + [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(UTF8Marshaler))] + #endif + string @name, int @quality); + public static pp_get_mode_by_name_and_quality_delegate pp_get_mode_by_name_and_quality; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void pp_postprocess_delegate(in byte_ptr3 @src, in int3 @srcStride, ref byte_ptr3 @dst, in int3 @dstStride, int @horizontalSize, int @verticalSize, sbyte* @QP_store, int @QP_stride, void* @mode, void* @ppContext, int @pict_type); + public static pp_postprocess_delegate pp_postprocess; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate SwrContext* swr_alloc_delegate(); + public static swr_alloc_delegate swr_alloc; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_alloc_set_opts2_delegate(SwrContext** @ps, AVChannelLayout* @out_ch_layout, AVSampleFormat @out_sample_fmt, int @out_sample_rate, AVChannelLayout* @in_ch_layout, AVSampleFormat @in_sample_fmt, int @in_sample_rate, int @log_offset, void* @log_ctx); + public static swr_alloc_set_opts2_delegate swr_alloc_set_opts2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_build_matrix2_delegate(AVChannelLayout* @in_layout, AVChannelLayout* @out_layout, double @center_mix_level, double @surround_mix_level, double @lfe_mix_level, double @maxval, double @rematrix_volume, double* @matrix, long @stride, AVMatrixEncoding @matrix_encoding, void* @log_context); + public static swr_build_matrix2_delegate swr_build_matrix2; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void swr_close_delegate(SwrContext* @s); + public static swr_close_delegate swr_close; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_config_frame_delegate(SwrContext* @swr, AVFrame* @out, AVFrame* @in); + public static swr_config_frame_delegate swr_config_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_convert_delegate(SwrContext* @s, byte** @out, int @out_count, byte** @in, int @in_count); + public static swr_convert_delegate swr_convert; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_convert_frame_delegate(SwrContext* @swr, AVFrame* @output, AVFrame* @input); + public static swr_convert_frame_delegate swr_convert_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_drop_output_delegate(SwrContext* @s, int @count); + public static swr_drop_output_delegate swr_drop_output; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void swr_free_delegate(SwrContext** @s); + public static swr_free_delegate swr_free; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* swr_get_class_delegate(); + public static swr_get_class_delegate swr_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long swr_get_delay_delegate(SwrContext* @s, long @base); + public static swr_get_delay_delegate swr_get_delay; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_get_out_samples_delegate(SwrContext* @s, int @in_samples); + public static swr_get_out_samples_delegate swr_get_out_samples; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_init_delegate(SwrContext* @s); + public static swr_init_delegate swr_init; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_inject_silence_delegate(SwrContext* @s, int @count); + public static swr_inject_silence_delegate swr_inject_silence; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_is_initialized_delegate(SwrContext* @s); + public static swr_is_initialized_delegate swr_is_initialized; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate long swr_next_pts_delegate(SwrContext* @s, long @pts); + public static swr_next_pts_delegate swr_next_pts; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_set_channel_mapping_delegate(SwrContext* @s, int* @channel_map); + public static swr_set_channel_mapping_delegate swr_set_channel_mapping; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_set_compensation_delegate(SwrContext* @s, int @sample_delta, int @compensation_distance); + public static swr_set_compensation_delegate swr_set_compensation; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int swr_set_matrix_delegate(SwrContext* @s, double* @matrix, int @stride); + public static swr_set_matrix_delegate swr_set_matrix; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string swresample_configuration_delegate(); + public static swresample_configuration_delegate swresample_configuration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string swresample_license_delegate(); + public static swresample_license_delegate swresample_license; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint swresample_version_delegate(); + public static swresample_version_delegate swresample_version; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate SwsContext* sws_alloc_context_delegate(); + public static sws_alloc_context_delegate sws_alloc_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate SwsVector* sws_allocVec_delegate(int @length); + public static sws_allocVec_delegate sws_allocVec; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void sws_convertPalette8ToPacked24_delegate(byte* @src, byte* @dst, int @num_pixels, byte* @palette); + public static sws_convertPalette8ToPacked24_delegate sws_convertPalette8ToPacked24; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void sws_convertPalette8ToPacked32_delegate(byte* @src, byte* @dst, int @num_pixels, byte* @palette); + public static sws_convertPalette8ToPacked32_delegate sws_convertPalette8ToPacked32; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void sws_frame_end_delegate(SwsContext* @c); + public static sws_frame_end_delegate sws_frame_end; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_frame_start_delegate(SwsContext* @c, AVFrame* @dst, AVFrame* @src); + public static sws_frame_start_delegate sws_frame_start; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void sws_freeContext_delegate(SwsContext* @swsContext); + public static sws_freeContext_delegate sws_freeContext; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void sws_freeFilter_delegate(SwsFilter* @filter); + public static sws_freeFilter_delegate sws_freeFilter; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void sws_freeVec_delegate(SwsVector* @a); + public static sws_freeVec_delegate sws_freeVec; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate AVClass* sws_get_class_delegate(); + public static sws_get_class_delegate sws_get_class; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate SwsContext* sws_getCachedContext_delegate(SwsContext* @context, int @srcW, int @srcH, AVPixelFormat @srcFormat, int @dstW, int @dstH, AVPixelFormat @dstFormat, int @flags, SwsFilter* @srcFilter, SwsFilter* @dstFilter, double* @param); + public static sws_getCachedContext_delegate sws_getCachedContext; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int* sws_getCoefficients_delegate(int @colorspace); + public static sws_getCoefficients_delegate sws_getCoefficients; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_getColorspaceDetails_delegate(SwsContext* @c, int** @inv_table, int* @srcRange, int** @table, int* @dstRange, int* @brightness, int* @contrast, int* @saturation); + public static sws_getColorspaceDetails_delegate sws_getColorspaceDetails; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate SwsContext* sws_getContext_delegate(int @srcW, int @srcH, AVPixelFormat @srcFormat, int @dstW, int @dstH, AVPixelFormat @dstFormat, int @flags, SwsFilter* @srcFilter, SwsFilter* @dstFilter, double* @param); + public static sws_getContext_delegate sws_getContext; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate SwsFilter* sws_getDefaultFilter_delegate(float @lumaGBlur, float @chromaGBlur, float @lumaSharpen, float @chromaSharpen, float @chromaHShift, float @chromaVShift, int @verbose); + public static sws_getDefaultFilter_delegate sws_getDefaultFilter; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate SwsVector* sws_getGaussianVec_delegate(double @variance, double @quality); + public static sws_getGaussianVec_delegate sws_getGaussianVec; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_init_context_delegate(SwsContext* @sws_context, SwsFilter* @srcFilter, SwsFilter* @dstFilter); + public static sws_init_context_delegate sws_init_context; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_isSupportedEndiannessConversion_delegate(AVPixelFormat @pix_fmt); + public static sws_isSupportedEndiannessConversion_delegate sws_isSupportedEndiannessConversion; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_isSupportedInput_delegate(AVPixelFormat @pix_fmt); + public static sws_isSupportedInput_delegate sws_isSupportedInput; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_isSupportedOutput_delegate(AVPixelFormat @pix_fmt); + public static sws_isSupportedOutput_delegate sws_isSupportedOutput; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void sws_normalizeVec_delegate(SwsVector* @a, double @height); + public static sws_normalizeVec_delegate sws_normalizeVec; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_receive_slice_delegate(SwsContext* @c, uint @slice_start, uint @slice_height); + public static sws_receive_slice_delegate sws_receive_slice; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint sws_receive_slice_alignment_delegate(SwsContext* @c); + public static sws_receive_slice_alignment_delegate sws_receive_slice_alignment; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_scale_delegate(SwsContext* @c, byte*[] @srcSlice, int[] @srcStride, int @srcSliceY, int @srcSliceH, byte*[] @dst, int[] @dstStride); + public static sws_scale_delegate sws_scale; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_scale_frame_delegate(SwsContext* @c, AVFrame* @dst, AVFrame* @src); + public static sws_scale_frame_delegate sws_scale_frame; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void sws_scaleVec_delegate(SwsVector* @a, double @scalar); + public static sws_scaleVec_delegate sws_scaleVec; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_send_slice_delegate(SwsContext* @c, uint @slice_start, uint @slice_height); + public static sws_send_slice_delegate sws_send_slice; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sws_setColorspaceDetails_delegate(SwsContext* @c, in int4 @inv_table, int @srcRange, in int4 @table, int @dstRange, int @brightness, int @contrast, int @saturation); + public static sws_setColorspaceDetails_delegate sws_setColorspaceDetails; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string swscale_configuration_delegate(); + public static swscale_configuration_delegate swscale_configuration; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ConstCharPtrMarshaler))] + public delegate string swscale_license_delegate(); + public static swscale_license_delegate swscale_license; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate uint swscale_version_delegate(); + public static swscale_version_delegate swscale_version; + */ + #endregion + } +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/vectors.g.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/vectors.g.cs.meta new file mode 100644 index 0000000..be800e5 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/Core/vectors.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a9ba0e5ea12d414b922e04da0d8f224 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android.meta new file mode 100644 index 0000000..6d8ef72 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1798e75878e264647a9f38b7a694542c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a.meta new file mode 100644 index 0000000..84edeac --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0472c50f0c01884c8341ae655a7a45f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavcodec.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavcodec.so new file mode 100644 index 0000000..4109216 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavcodec.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavcodec.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavcodec.so.meta new file mode 100644 index 0000000..5622498 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavcodec.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: d349bdd529bf1384581da0acce9d9cf3 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: ARM64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavformat.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavformat.so new file mode 100644 index 0000000..95842f1 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavformat.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavformat.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavformat.so.meta new file mode 100644 index 0000000..f99220e --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavformat.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: da40082fb7afc814a880157ff135c348 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: ARM64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavutil.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavutil.so new file mode 100644 index 0000000..fb2409d Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavutil.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavutil.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavutil.so.meta new file mode 100644 index 0000000..d29eb29 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/arm64-v8a/libavutil.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: 5a590fa83370f1b43aded6dd0418dfb8 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: ARM64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a.meta new file mode 100644 index 0000000..c911685 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5f2c55beab072af43adbb43c9090cb33 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavcodec.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavcodec.so new file mode 100644 index 0000000..cf03312 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavcodec.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavcodec.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavcodec.so.meta new file mode 100644 index 0000000..75610a0 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavcodec.so.meta @@ -0,0 +1,67 @@ +fileFormatVersion: 2 +guid: c5e0a9f6ab078aa4b8d1cd2e0ed2e318 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavformat.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavformat.so new file mode 100644 index 0000000..b66e71f Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavformat.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavformat.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavformat.so.meta new file mode 100644 index 0000000..7db4f1a --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavformat.so.meta @@ -0,0 +1,67 @@ +fileFormatVersion: 2 +guid: 49e15e07e8602b941b3d18e5abffaa29 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavutil.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavutil.so new file mode 100644 index 0000000..9387e59 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavutil.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavutil.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavutil.so.meta new file mode 100644 index 0000000..f396b84 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/armeabi-v7a/libavutil.so.meta @@ -0,0 +1,67 @@ +fileFormatVersion: 2 +guid: 46b4457b8ae0fe541bec45c4933cd4a9 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86.meta new file mode 100644 index 0000000..f158680 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f0cc0aea8eaabd4fa01decdabdb378d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavcodec.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavcodec.so new file mode 100644 index 0000000..a0b92da Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavcodec.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavcodec.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavcodec.so.meta new file mode 100644 index 0000000..dbda79d --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavcodec.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: 6b623314619024a4f8397da099579e7b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: X86 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavformat.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavformat.so new file mode 100644 index 0000000..2d593f4 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavformat.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavformat.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavformat.so.meta new file mode 100644 index 0000000..ec442b9 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavformat.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: b12057dc023f6204791722a99fe1e136 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: X86 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavutil.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavutil.so new file mode 100644 index 0000000..39e4fe8 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavutil.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavutil.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavutil.so.meta new file mode 100644 index 0000000..a1659ad --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86/libavutil.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: 5c4eb621215eaac4493ccaf301c98092 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: X86 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64.meta new file mode 100644 index 0000000..446308c --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 01fc22b120dc2154489b6763f8b67a14 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavcodec.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavcodec.so new file mode 100644 index 0000000..819184d Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavcodec.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavcodec.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavcodec.so.meta new file mode 100644 index 0000000..d2ab3b4 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavcodec.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: b2cd264a94ddf5543bbc08419f909738 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: X86_64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavformat.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavformat.so new file mode 100644 index 0000000..4e70e90 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavformat.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavformat.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavformat.so.meta new file mode 100644 index 0000000..3a7ed3d --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavformat.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: 7a6ace9d32e3e1c4da47afe4e70e6a51 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: X86_64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavutil.so b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavutil.so new file mode 100644 index 0000000..2dd0cfa Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavutil.so differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavutil.so.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavutil.so.meta new file mode 100644 index 0000000..b138186 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/android/x86_64/libavutil.so.meta @@ -0,0 +1,71 @@ +fileFormatVersion: 2 +guid: 2dde4bb3706cbae4cb9d27bb84c0bc2a +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 0 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Android: Android + second: + enabled: 1 + settings: + AndroidSharedLibraryType: Executable + CPU: X86_64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios.meta new file mode 100644 index 0000000..f07bc22 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7abe18c33e45106409484ecf638961e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavcodec.a b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavcodec.a new file mode 100644 index 0000000..c2f0c7f Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavcodec.a differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavcodec.a.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavcodec.a.meta new file mode 100644 index 0000000..e40e70c --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavcodec.a.meta @@ -0,0 +1,81 @@ +fileFormatVersion: 2 +guid: 1321dae2bbb2203448be993b522bc5ca +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavformat.a b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavformat.a new file mode 100644 index 0000000..42705a0 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavformat.a differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavformat.a.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavformat.a.meta new file mode 100644 index 0000000..fe8ba8b --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavformat.a.meta @@ -0,0 +1,81 @@ +fileFormatVersion: 2 +guid: 2a8f0aa76f9a4ac4982a0b5bb54fb699 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavutil.a b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavutil.a new file mode 100644 index 0000000..69fb692 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavutil.a differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavutil.a.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavutil.a.meta new file mode 100644 index 0000000..b3da0a1 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/ios/libavutil.a.meta @@ -0,0 +1,81 @@ +fileFormatVersion: 2 +guid: e1a867319cb2d1e45af6dd4d7af86f52 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CPU: ARM64 + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64.meta new file mode 100644 index 0000000..4c28534 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93270d16fc4e3a543b873d501f4b8298 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avcodec-61.dll b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avcodec-61.dll new file mode 100644 index 0000000..cae99a9 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avcodec-61.dll differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avcodec-61.dll.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avcodec-61.dll.meta new file mode 100644 index 0000000..9a3ebff --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avcodec-61.dll.meta @@ -0,0 +1,82 @@ +fileFormatVersion: 2 +guid: 94013bd364da14843a3c0450deba42de +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 1 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 0 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: Windows + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avformat-61.dll b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avformat-61.dll new file mode 100644 index 0000000..128db61 Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avformat-61.dll differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avformat-61.dll.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avformat-61.dll.meta new file mode 100644 index 0000000..c977153 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avformat-61.dll.meta @@ -0,0 +1,82 @@ +fileFormatVersion: 2 +guid: 9aa4aaf564c6f004fbd39c77d01b26df +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 1 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: Windows + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avutil-59.dll b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avutil-59.dll new file mode 100644 index 0000000..72001af Binary files /dev/null and b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avutil-59.dll differ diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avutil-59.dll.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avutil-59.dll.meta new file mode 100644 index 0000000..36dcf83 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Plugins/win64/avutil-59.dll.meta @@ -0,0 +1,82 @@ +fileFormatVersion: 2 +guid: 00de4b8f1465be04eb184dd902c12dcf +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 1 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude WebGL: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: Windows + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime.meta new file mode 100644 index 0000000..3476b60 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a84f8bfdcd4feb499f3fb62f7e4cdf8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/ILeviathanDecoder.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/ILeviathanDecoder.cs new file mode 100644 index 0000000..605da43 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/ILeviathanDecoder.cs @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ + +using System; +using LeviathanVideo.Abstractions; +using Unity.Collections; + +/// +/// Leviathan视频解码器接口 +/// +internal unsafe interface ILeviathanDecoder : IDisposable +{ + // 事件 + event Action OnFirstFrameDecoded; + // 属性 + long FrameCount { get; } + double FrameInterval { get; } + string CodecName { get; } + long Duration { get; } + long DecodedFrameIndex { get; } + AVFrame* VideoFrame { get; } + bool IsLooping { get; set; } + + // 方法 + int Init(NativeArray fileData, int beginFrameIndex = 1, bool syncDecodeFirstFrame = true, bool fastDecode = true); + int InternalPlay(int beginFrameIndex = 1, bool syncDecodeFirstFrame = true); + int DecodeNextFrame(); + void InternalStop(); + void Seek(double ms); + void SeekToFrame(long frame); + void Pause(bool pause); + ref long GetDecodedFrameIndexRef(); + + // 微信平台特有方法(其他平台提供空实现) + int GetDecoderStatus(); + + // 优化的分步显示方法 + /// + /// 将视频帧数据复制到纹理(需要在信号保护下执行) + /// + void CopyFrameDataToTextures(UnityEngine.Texture2D[] textures); + + /// + /// 将纹理数据应用到GPU(可以和下一帧解码并行) + /// + void ApplyTextures(UnityEngine.Texture2D[] textures); +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/ILeviathanDecoder.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/ILeviathanDecoder.cs.meta new file mode 100644 index 0000000..7bf8fd7 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/ILeviathanDecoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3aa07cec7daa4b94abd02bcd26cec3ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Leviathan.Runtime.asmdef b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Leviathan.Runtime.asmdef new file mode 100644 index 0000000..73e0443 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Leviathan.Runtime.asmdef @@ -0,0 +1,16 @@ +{ + "name": "Leviathan.Runtime", + "rootNamespace": "", + "references": [ + "GUID:f1d67e105160e074c99d37c9215900e1" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Leviathan.Runtime.asmdef.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Leviathan.Runtime.asmdef.meta new file mode 100644 index 0000000..35569ca --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Leviathan.Runtime.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cb496f7121888314e838e8d8fd3425e6 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanLogConfig.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanLogConfig.cs new file mode 100644 index 0000000..4a8b065 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanLogConfig.cs @@ -0,0 +1,149 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/10/29 +// Module Describe: Leviathan日志配置类 +//----------------------------------------------------------------*/ + +using System.Runtime.InteropServices; +using UnityEngine; + +//****************************************************************** +// 日志配置类 +//****************************************************************** +public static class LeviathanLogConfig +{ + // 日志开关 + private static bool _enableWorkerManagerLog = false; + private static bool _enableWorkerVideoLog = false; + private static bool _enableWorkerDecoderLog = false; + private static bool _enableSoftwareDecoderLog = false; + private static bool _enableVideoDecoderLog = false; + private static bool _enableAllLog = false; + + // 公开属性 + public static bool EnableWorkerManagerLog + { + get => _enableWorkerManagerLog; + set + { + _enableWorkerManagerLog = value; + UpdateJSLogConfig(); + } + } + + public static bool EnableWorkerVideoLog + { + get => _enableWorkerVideoLog; + set + { + _enableWorkerVideoLog = value; + UpdateJSLogConfig(); + } + } + + public static bool EnableWorkerDecoderLog + { + get => _enableWorkerDecoderLog; + set + { + _enableWorkerDecoderLog = value; + UpdateJSLogConfig(); + } + } + + public static bool EnableSoftwareDecoderLog + { + get => _enableSoftwareDecoderLog; + set => _enableSoftwareDecoderLog = value; + } + + public static bool EnableVideoDecoderLog + { + get => _enableVideoDecoderLog; + set => _enableVideoDecoderLog = value; + } + + public static bool EnableAllLog + { + get => _enableAllLog; + set + { + _enableAllLog = value; + UpdateJSLogConfig(); + } + } + +#if UNITY_WEBGL && !UNITY_EDITOR + [DllImport("__Internal")] + private static extern void SetLeviathanLogConfig(bool workerManager, bool workerVideo, bool workerDecoder, bool all); +#endif + + // 更新JS端的日志配置 + private static void UpdateJSLogConfig() + { +#if UNITY_WEBGL && !UNITY_EDITOR + try + { + SetLeviathanLogConfig(_enableWorkerManagerLog, _enableWorkerVideoLog, _enableWorkerDecoderLog, _enableAllLog); + } + catch (System.Exception e) + { + Debug.LogWarning($"[LeviathanLogConfig] 更新JS日志配置失败: {e.Message}"); + } +#endif + } + + // 便捷方法:开启所有日志 + public static void EnableAll() + { + EnableAllLog = true; + } + + // 便捷方法:关闭所有日志 + public static void DisableAll() + { + EnableAllLog = false; + EnableWorkerManagerLog = false; + EnableWorkerVideoLog = false; + EnableWorkerDecoderLog = false; + EnableSoftwareDecoderLog = false; + EnableVideoDecoderLog = false; + } + + // C#端日志辅助方法 + public static void Log(string module, object message) + { + if (!ShouldLog(module)) return; + Debug.Log($"[Leviathan{module}] {message}"); + } + + public static void LogWarning(string module, object message) + { + if (!ShouldLog(module)) return; + Debug.LogWarning($"[Leviathan{module}] {message}"); + } + + public static void LogError(string module, object message) + { + if (!ShouldLog(module)) return; + Debug.LogError($"[Leviathan{module}] {message}"); + } + + private static bool ShouldLog(string module) + { + if (_enableAllLog) return true; + + return module switch + { + "WorkerManager" => _enableWorkerManagerLog, + "WorkerVideo" => _enableWorkerVideoLog, + "WorkerDecoder" => _enableWorkerDecoderLog, + "SoftwareDecoder" => _enableSoftwareDecoderLog, + "VideoDecoder" => _enableVideoDecoderLog, + _ => false + }; + } +} + diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanLogConfig.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanLogConfig.cs.meta new file mode 100644 index 0000000..9817ce8 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanLogConfig.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 52a41d7bdc4a88241888a81be912b716 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideo3DRenderer.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideo3DRenderer.cs new file mode 100644 index 0000000..eeeaac1 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideo3DRenderer.cs @@ -0,0 +1,301 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: 3D MeshRenderer 视频渲染组件 +//----------------------------------------------------------------*/ + +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +/// +/// 3D MeshRenderer 视频渲染组件 +/// 继承自 LeviathanVideoDecoderBase,用于在 3D 物体(如 Cube、Plane)上显示视频 +/// +[RequireComponent(typeof(MeshRenderer))] +public unsafe class LeviathanVideo3DRenderer : LeviathanVideoDecoderBase +{ + private static readonly int MainTexIdx = Shader.PropertyToID("_MainTex"); + + [Header("3D Renderer Settings")] + [SerializeField] + [Tooltip("是否翻转Y轴UV,用于修正不同模型的UV方向")] + private bool _reverseY = true; + + [SerializeField] + [Tooltip("材质所在的索引(用于多材质渲染器)")] + private int _materialIndex = 0; + + private Material _material; + + private new static void Log(string message) + { + LeviathanLogConfig.Log("Video3DRenderer", message); + } + + private new static void LogWarning(string message) + { + LeviathanLogConfig.LogWarning("Video3DRenderer", message); + } + + private new static void LogError(string message) + { + LeviathanLogConfig.LogError("Video3DRenderer", message); + } + + /// + /// 启用渲染目标 + /// + protected override void OnEnableRenderTarget() + { + MeshRenderer meshRenderer = GetComponent(); + if (meshRenderer) + { + meshRenderer.enabled = true; + } + } + + /// + /// 禁用渲染目标 + /// + protected override void OnDisableRenderTarget() + { + MeshRenderer meshRenderer = GetComponent(); + if (meshRenderer) + { + meshRenderer.enabled = false; + } + } + + /// + /// 更新渲染目标尺寸 + /// 3D渲染器不需要调整尺寸,由模型本身决定 + /// + protected override void OnUpdateRenderTargetSize() + { + // 3D渲染器不需要像UI那样自动调整尺寸 + // 尺寸由模型本身决定 + } + + /// + /// 初始化材质 + /// + protected override void OnInitMaterial() + { + MeshRenderer meshRenderer = GetComponent(); + if (meshRenderer) + { + UpdateMeshMaterial(meshRenderer); + } + } + + /// + /// 更新材质 + /// + protected override void OnUpdateMaterial() + { + MeshRenderer meshRenderer = GetComponent(); + if (meshRenderer) + { + UpdateMeshMaterial(meshRenderer); + } + } + + protected void UpdateMeshMaterial(MeshRenderer meshRenderer) + { + if (_textures == null || _textures.Length < 3) return; + + // 创建新材质或更新现有材质 + Material newMaterial; + switch (_alphaType) + { + case PlayAlphaType.RightSide: + newMaterial = new Material(Shader.Find("LeviathanVideo/YUV420P_3D_Alpha_Right")); + newMaterial.SetFloat(ValidWidthRatioIdx, (float)_videoValidWidth / _videoWidth); + break; + case PlayAlphaType.BottomSide: + newMaterial = new Material(Shader.Find("LeviathanVideo/YUV420P_3D_Alpha_Bottom")); + break; + case PlayAlphaType.ChromaKey: + newMaterial = new Material(Shader.Find("LeviathanVideo/YUV420P_3D_ChromaKey")); + break; + case PlayAlphaType.None: + default: + newMaterial = new Material(Shader.Find("LeviathanVideo/YUV420P_3D")); + break; + } + + // 设置纹理 + newMaterial.SetTexture(MainTexIdx, _textures[0]); + newMaterial.SetTexture(UTexIdx, _textures[1]); + newMaterial.SetTexture(VTexIdx, _textures[2]); + + // 设置Y轴翻转 + newMaterial.SetFloat("_ReverseY", _reverseY ? 1 : 0); + + // 清理旧材质 + if (_material != null) + { + Destroy(_material); + } + _material = newMaterial; + + // 应用材质到渲染器 + var materials = meshRenderer.materials; + if (_materialIndex >= 0 && _materialIndex < materials.Length) + { + materials[_materialIndex] = newMaterial; + meshRenderer.materials = materials; + } + else + { + meshRenderer.material = newMaterial; + } + } + + protected override void OnDestroy() + { + base.OnDestroy(); + + // 清理材质 + if (_material != null) + { + Destroy(_material); + _material = null; + } + } + + /// + /// 设置是否翻转Y轴 + /// + public void SetReverseY(bool reverseY) + { + _reverseY = reverseY; + if (_material != null) + { + _material.SetFloat("_ReverseY", _reverseY ? 1 : 0); + } + } + + /// + /// 设置材质索引 + /// + public void SetMaterialIndex(int index) + { + _materialIndex = index; + if (_textures != null && _textures.Length > 0) + { + OnUpdateMaterial(); + } + } + +#if UNITY_EDITOR + private void OnValidate() + { + // 使用 delayCall 避免在 OnValidate 中调用 SendMessage 相关操作 + var currentBytesFile = bytesFile; + var lastBytesFile = _lastBytesFile; + UnityEditor.EditorApplication.delayCall += () => + { + if (this == null) return; + + SetAlphaType(_alphaType); + + // 检测 bytesFile 是否发生变化 + if (currentBytesFile != lastBytesFile) + { + _lastBytesFile = currentBytesFile; + if (IsPlaying && currentBytesFile != null) + { + Log($"编辑器中检测到 bytesFile 变化,自动播放新视频"); + Stop(); + Play(); + } + } + }; + } +#endif +} + +#if UNITY_EDITOR +[CustomEditor(typeof(LeviathanVideo3DRenderer))] +public class LeviathanVideo3DRendererEditor : Editor +{ + // 格式化时间:秒转换为 HH:MM:SS.mmm 格式 + private static string FormatTimeSeconds(double totalSeconds) + { + int hours = (int)(totalSeconds / 3600); + int minutes = (int)((totalSeconds % 3600) / 60); + int seconds = (int)(totalSeconds % 60); + int milliseconds = (int)((totalSeconds % 1) * 1000); + return $"{hours:D2}:{minutes:D2}:{seconds:D2}.{milliseconds:D3}"; + } + + // 格式化时间:微秒转换为 HH:MM:SS.mmm 格式 + private static string FormatTimeMicroseconds(long microseconds) + { + return FormatTimeSeconds(microseconds / 1000000.0); + } + + public override void OnInspectorGUI() + { + DrawDefaultInspector(); + var mono = (LeviathanVideo3DRenderer)target; + + // Display video dimensions as read-only fields + EditorGUI.BeginDisabledGroup(true); + EditorGUILayout.TextField("帧数", $"{mono.PlayFrameIndex} / {mono.FrameCount}"); + // FrameInterval 单位是秒,Duration 单位是微秒 + EditorGUILayout.TextField("播放时间", FormatTimeSeconds(mono.PlayFrameIndex * mono.FrameInterval)); + EditorGUILayout.TextField("总时间", FormatTimeMicroseconds(mono.Duration)); + EditorGUILayout.TextField("FPS", mono.FrameInterval > 0 ? $"{1.0 / mono.FrameInterval:F2}" : "0"); + EditorGUILayout.TextField("纹理尺寸", $"{mono.VideoWidth} × {mono.VideoHeight}"); + EditorGUILayout.TextField("视频有效尺寸", $"{mono.VideoValidWidth} × {mono.VideoHeight}"); + EditorGUI.EndDisabledGroup(); + + { + bool oldValue = mono.IsPlaying; + // 绘制checkbox + bool newValue = EditorGUILayout.Toggle("isPlaying", oldValue); + + // 如果用户切换了checkbox + if (oldValue != newValue) + { + if (newValue) + { + mono.Play(); + } + else + { + mono.Stop(); + } + EditorUtility.SetDirty(target); + } + } + { + bool oldValue = mono.IsPause; + // 绘制checkbox + bool newValue = EditorGUILayout.Toggle("isPause", oldValue); + + // 如果用户切换了checkbox + if (oldValue != newValue) + { + if (newValue) + { + mono.Pause(); + } + else + { + mono.Resume(); + } + EditorUtility.SetDirty(target); + } + } + this.Repaint(); + } +} +#endif + diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideo3DRenderer.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideo3DRenderer.cs.meta new file mode 100644 index 0000000..e301be8 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideo3DRenderer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee83c3bdcef32f449a94eec49cdf005c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoder.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoder.cs new file mode 100644 index 0000000..7c521f2 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoder.cs @@ -0,0 +1,366 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: UI RawImage 视频渲染组件 +//----------------------------------------------------------------*/ + +using UnityEngine; +using UnityEngine.UI; +#if UNITY_EDITOR +using UnityEditor; +#endif + +/// +/// UI RawImage 视频渲染组件 +/// 继承自 LeviathanVideoDecoderBase,用于在 UI RawImage 上显示视频 +/// +/// +[RequireComponent(typeof(RawImage))] +public unsafe class LeviathanVideoDecoder : LeviathanVideoDecoderBase +{ + private static readonly int ChromaKeyColorId = Shader.PropertyToID("_KeyColor"); + private static readonly int ChromaKeyCutoffId = Shader.PropertyToID("_ColorCutoff"); + private static readonly int ChromaKeyColorFeatheringId = Shader.PropertyToID("_ColorFeathering"); + private static readonly int ChromaKeyMaskFeatheringId = Shader.PropertyToID("_MaskFeathering"); + private static readonly int ChromaKeySharpeningId = Shader.PropertyToID("_Sharpening"); + + private Material ChromaKeyMaterial + { + get + { + if (_alphaType != PlayAlphaType.ChromaKey) return null; + var rawImage = GetComponent(); + if (rawImage == null || rawImage.material == null) return null; + return rawImage.material.HasProperty(ChromaKeyColorId) ? rawImage.material : null; + } + } + + public void SetChromaKeyColor(Color color) + { + var mat = ChromaKeyMaterial; + if (mat != null) mat.SetColor(ChromaKeyColorId, color); + } + + public Color GetChromaKeyColor() + { + var mat = ChromaKeyMaterial; + return mat != null ? mat.GetColor(ChromaKeyColorId) : Color.green; + } + + public void SetChromaKeyCutoff(float value) + { + var mat = ChromaKeyMaterial; + if (mat != null) mat.SetFloat(ChromaKeyCutoffId, Mathf.Clamp01(value)); + } + + public float GetChromaKeyCutoff() + { + var mat = ChromaKeyMaterial; + return mat != null ? mat.GetFloat(ChromaKeyCutoffId) : 0.2f; + } + + public void SetChromaKeyColorFeathering(float value) + { + var mat = ChromaKeyMaterial; + if (mat != null) mat.SetFloat(ChromaKeyColorFeatheringId, Mathf.Clamp01(value)); + } + + public float GetChromaKeyColorFeathering() + { + var mat = ChromaKeyMaterial; + return mat != null ? mat.GetFloat(ChromaKeyColorFeatheringId) : 0.33f; + } + + public void SetChromaKeyMaskFeathering(float value) + { + var mat = ChromaKeyMaterial; + if (mat != null) mat.SetFloat(ChromaKeyMaskFeatheringId, Mathf.Clamp01(value)); + } + + public float GetChromaKeyMaskFeathering() + { + var mat = ChromaKeyMaterial; + return mat != null ? mat.GetFloat(ChromaKeyMaskFeatheringId) : 1f; + } + + public void SetChromaKeySharpening(float value) + { + var mat = ChromaKeyMaterial; + if (mat != null) mat.SetFloat(ChromaKeySharpeningId, Mathf.Clamp01(value)); + } + + public float GetChromaKeySharpening() + { + var mat = ChromaKeyMaterial; + return mat != null ? mat.GetFloat(ChromaKeySharpeningId) : 0.5f; + } + + public void SetChromaKeyParams(Color keyColor, float cutoff, float colorFeathering, float maskFeathering, float sharpening) + { + var mat = ChromaKeyMaterial; + if (mat == null) return; + mat.SetColor(ChromaKeyColorId, keyColor); + mat.SetFloat(ChromaKeyCutoffId, Mathf.Clamp01(cutoff)); + mat.SetFloat(ChromaKeyColorFeatheringId, Mathf.Clamp01(colorFeathering)); + mat.SetFloat(ChromaKeyMaskFeatheringId, Mathf.Clamp01(maskFeathering)); + mat.SetFloat(ChromaKeySharpeningId, Mathf.Clamp01(sharpening)); + } + + private new static void Log(string message) + { + LeviathanLogConfig.Log("VideoDecoder", message); + } + + private new static void LogWarning(string message) + { + LeviathanLogConfig.LogWarning("VideoDecoder", message); + } + + private new static void LogError(string message) + { + LeviathanLogConfig.LogError("VideoDecoder", message); + } + + /// + /// 启用渲染目标 + /// + protected override void OnEnableRenderTarget() + { + RawImage rawImage = GetComponent(); + if (rawImage) + { + rawImage.enabled = true; + } + } + + /// + /// 禁用渲染目标 + /// + protected override void OnDisableRenderTarget() + { + RawImage rawImage = GetComponent(); + if (rawImage) + { + rawImage.enabled = false; + } + } + + /// + /// 更新渲染目标尺寸 + /// + protected override void OnUpdateRenderTargetSize() + { + RawImage rawImage = GetComponent(); + if (rawImage) + { + UpdateImageSize(rawImage); + } + } + + /// + /// 初始化材质 + /// + protected override void OnInitMaterial() + { + RawImage rawImage = GetComponent(); + if (rawImage) + { + rawImage.texture = _textures[0]; + UpdateImageMaterial(rawImage); + } + } + + /// + /// 更新材质 + /// + protected override void OnUpdateMaterial() + { + RawImage rawImage = GetComponent(); + if (rawImage) + { + UpdateImageMaterial(rawImage); + } + } + + protected void UpdateImageSize(RawImage rawImage) + { + if (!disableAutoSize) + { + var videoFrame = VideoFrame; + if (videoFrame != null && videoFrame->width > 0) + { + rawImage.SetNativeSize(); + rawImage.rectTransform.sizeDelta = _alphaType switch + { + PlayAlphaType.RightSide => new Vector2(videoFrame->width * 0.5f, videoFrame->height), + PlayAlphaType.BottomSide => new Vector2(videoFrame->width, videoFrame->height * 0.5f), + _ => new Vector2(videoFrame->width, videoFrame->height) + }; + } + } + rawImage.uvRect = new Rect(0, 0, _alphaType == PlayAlphaType.RightSide ? 1 : (float)_videoValidWidth / _videoWidth, 1); + } + + protected void UpdateImageMaterial(RawImage rawImage) + { + // 软件解码器使用YUV纹理,需要YUV420P着色器 + Material newMaterial; + switch (_alphaType) + { + case PlayAlphaType.RightSide: + newMaterial = new Material(Shader.Find("LeviathanVideo/YUV420P_Alpha_Right")); + newMaterial.SetFloat(ValidWidthRatioIdx, (float)_videoValidWidth / _videoWidth); + break; + case PlayAlphaType.BottomSide: + newMaterial = new Material(Shader.Find("LeviathanVideo/YUV420P_Alpha_Bottom")); + break; + case PlayAlphaType.ChromaKey: + newMaterial = new Material(Shader.Find("LeviathanVideo/YUV420P_ChromaKey")); + break; + case PlayAlphaType.None: + default: + newMaterial = new Material(Shader.Find("LeviathanVideo/YUV420P")); + break; + } + newMaterial.SetTexture(UTexIdx, _textures[1]); + newMaterial.SetTexture(VTexIdx, _textures[2]); + rawImage.material = newMaterial; + } + +#if UNITY_EDITOR + private void OnValidate() + { + // 使用 delayCall 避免在 OnValidate 中调用 SendMessage 相关操作 + var currentBytesFile = bytesFile; + var lastBytesFile = _lastBytesFile; + UnityEditor.EditorApplication.delayCall += () => + { + if (this == null) return; + + SetAlphaType(_alphaType); + + // 检测 bytesFile 是否发生变化 + if (currentBytesFile != lastBytesFile) + { + _lastBytesFile = currentBytesFile; + if (IsPlaying && currentBytesFile != null) + { + Log($"编辑器中检测到 bytesFile 变化,自动播放新视频"); + Stop(); + Play(); + } + } + }; + } +#endif +} + +#if UNITY_EDITOR +[CustomEditor(typeof(LeviathanVideoDecoder))] +public class LeviathanVideoDecoderEditor : Editor +{ + // 格式化时间:秒转换为 HH:MM:SS.mmm 格式 + private static string FormatTimeSeconds(double totalSeconds) + { + int hours = (int)(totalSeconds / 3600); + int minutes = (int)((totalSeconds % 3600) / 60); + int seconds = (int)(totalSeconds % 60); + int milliseconds = (int)((totalSeconds % 1) * 1000); + return $"{hours:D2}:{minutes:D2}:{seconds:D2}.{milliseconds:D3}"; + } + + // 格式化时间:微秒转换为 HH:MM:SS.mmm 格式 + private static string FormatTimeMicroseconds(long microseconds) + { + return FormatTimeSeconds(microseconds / 1000000.0); + } + + public override void OnInspectorGUI() + { + DrawDefaultInspector(); + var mono = (LeviathanVideoDecoder)target; + + // Display video dimensions as read-only fields + EditorGUI.BeginDisabledGroup(true); + EditorGUILayout.TextField("帧数", $"{mono.PlayFrameIndex} / {mono.FrameCount}"); + // FrameInterval 单位是秒,Duration 单位是微秒 + EditorGUILayout.TextField("播放时间", FormatTimeSeconds(mono.PlayFrameIndex * mono.FrameInterval)); + EditorGUILayout.TextField("总时间", FormatTimeMicroseconds(mono.Duration)); + EditorGUILayout.TextField("FPS", mono.FrameInterval > 0 ? $"{1.0 / mono.FrameInterval:F2}" : "0"); + EditorGUILayout.TextField("纹理尺寸", $"{mono.VideoWidth} × {mono.VideoHeight}"); + EditorGUILayout.TextField("视频有效尺寸", $"{mono.VideoValidWidth} × {mono.VideoHeight}"); + EditorGUI.EndDisabledGroup(); + + { + bool oldValue = mono.IsPlaying; + // 绘制checkbox + bool newValue = EditorGUILayout.Toggle("isPlaying", oldValue); + + // 如果用户切换了checkbox + if (oldValue != newValue) + { + if (newValue) + { + mono.Play(); + } + else + { + mono.Stop(); + } + EditorUtility.SetDirty(target); + } + } + { + bool oldValue = mono.IsPause; + // 绘制checkbox + bool newValue = EditorGUILayout.Toggle("isPause", oldValue); + + // 如果用户切换了checkbox + if (oldValue != newValue) + { + if (newValue) + { + mono.Pause(); + } + else + { + mono.Resume(); + } + EditorUtility.SetDirty(target); + } + } + + if (mono.AlphaType == LeviathanVideoDecoderBase.PlayAlphaType.ChromaKey) + { + DrawChromaKeyParameters(mono); + } + + this.Repaint(); + } + + private void DrawChromaKeyParameters(LeviathanVideoDecoder mono) + { + var rawImage = mono.GetComponent(); + if (rawImage == null || rawImage.material == null) return; + if (!rawImage.material.HasProperty(Shader.PropertyToID("_KeyColor"))) return; + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("ChromaKey 参数", EditorStyles.boldLabel); + + EditorGUI.BeginChangeCheck(); + + Color keyColor = EditorGUILayout.ColorField("KeyColor", mono.GetChromaKeyColor()); + float cutoff = EditorGUILayout.Slider("Cutoff", mono.GetChromaKeyCutoff(), 0f, 1f); + float colorFeathering = EditorGUILayout.Slider("ColorFeathering", mono.GetChromaKeyColorFeathering(), 0f, 1f); + float maskFeathering = EditorGUILayout.Slider("MaskFeathering", mono.GetChromaKeyMaskFeathering(), 0f, 1f); + float sharpening = EditorGUILayout.Slider("Sharpening", mono.GetChromaKeySharpening(), 0f, 1f); + + if (EditorGUI.EndChangeCheck()) + { + mono.SetChromaKeyParams(keyColor, cutoff, colorFeathering, maskFeathering, sharpening); + } + } +} +#endif diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoder.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoder.cs.meta new file mode 100644 index 0000000..9a29c0a --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56ffe7905c6ea984184ed1b60a985acd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoderBase.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoderBase.cs new file mode 100644 index 0000000..3eb7852 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoderBase.cs @@ -0,0 +1,927 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: 视频解码器抽象基类 +//----------------------------------------------------------------*/ + +using System.Threading; +using UnityEngine; +using Unity.Collections; +#if UNITY_WEBGL && !UNITY_EDITOR +using System.Runtime.InteropServices; +#endif + +/// +/// 视频解码器抽象基类 +/// 包含解码逻辑、播放控制、多线程解码等公共功能 +/// 子类需要实现具体的渲染逻辑 +/// +public abstract unsafe class LeviathanVideoDecoderBase : MonoBehaviour +{ + protected static readonly int ValidWidthRatioIdx = Shader.PropertyToID("_ValidWidthRatio"); + protected static readonly int UTexIdx = Shader.PropertyToID("_UTex"); + protected static readonly int VTexIdx = Shader.PropertyToID("_VTex"); + protected static readonly int AlphaYTexIdx = Shader.PropertyToID("_AYTex"); + protected static readonly int AlphaUTexIdx = Shader.PropertyToID("_AUTex"); + +#if UNITY_WEBGL && !UNITY_EDITOR + [DllImport("__Internal")] + private static extern bool IsWechatMiniGameEnvironment(); +#endif + + // 日志辅助方法 + protected static void Log(string message) + { + LeviathanLogConfig.Log("VideoDecoderBase", message); + } + + protected static void LogWarning(string message) + { + LeviathanLogConfig.LogWarning("VideoDecoderBase", message); + } + + protected static void LogError(string message) + { + LeviathanLogConfig.LogError("VideoDecoderBase", message); + } + + /// + /// 静态构造函数 - 在类首次使用时执行平台检测 + /// + static LeviathanVideoDecoderBase() + { +#if UNITY_WEBGL && !UNITY_EDITOR + try + { + IsWCGame = IsWechatMiniGameEnvironment(); + Log($"微信小游戏平台静态检测: {IsWCGame}"); + } + catch (System.Exception e) + { + LogError($"微信小游戏平台静态检测异常: {e}"); + IsWCGame = false; + } +#else + IsWCGame = false; +#endif + } + + // [LabelText("视频文件(.bytes)")] + public TextAsset bytesFile; + +#if UNITY_EDITOR + [System.NonSerialized] + protected TextAsset _lastBytesFile; +#endif + + private ILeviathanDecoder _decoder; + + /// + /// 获取当前视频帧指针(子类使用) + /// + protected LeviathanVideo.Abstractions.AVFrame* VideoFrame => _decoder != null ? _decoder.VideoFrame : null; + +#if !UNITY_2022_1_OR_NEWER + // Unity 2020/2021 兼容:保存数据副本以供解码器使用 + protected NativeArray _videoDataBuffer; + protected bool _hasVideoDataBuffer = false; +#endif + + // 平台检测 + public static bool IsWCGame = false; + + protected const int TextureCount = 3; + protected Texture2D[] _textures; + protected double _timeAccumulated; + protected double _frameInterval; + public double FrameInterval => _frameInterval; + protected bool _needInitTexture = true; + + protected bool _needApplyTexture = false; + + // 是否为多线程解码 + protected bool _isMultithreadedDecode; + // 多线程相关 + protected Thread _decodeThread; + // 帧状态:0=允许解码下一帧, 1=帧已准备好等待显示 + protected long _hasFrameReady; + + protected volatile bool _isPlaying; + public bool IsPlaying => _isPlaying; + + protected bool _isPause; + public bool IsPause => _isPause; + + // 销毁状态标志(防止销毁期间的异步操作继续执行) + protected bool _isDestroying = false; + + // 第一帧回调待执行标志(用于从子线程安全地在主线程执行回调) + protected volatile bool _pendingFirstFrameCallback = false; + + // ==区间循环专用 + + // 每次播放到End, 跳转到的frame + protected long _loopBeginFrameIndex = -1; + public long LoopBeginFrameIndex => _loopBeginFrameIndex; + + protected long _loopEndFrameIndex = -1; + public long LoopEndFrameIndex => _loopEndFrameIndex; + + // 是否正在循环seek中(防止SeekToFrame被多次调用) + protected volatile bool _isLoopSeeking = false; + + protected string _codecName = ""; + + // 总时长 微秒 + protected long _duration; + public long Duration => _duration; + + protected int _videoWidth; + public int VideoWidth => _videoWidth; + + protected int _videoHeight; + public int VideoHeight => _videoHeight; + + protected int _videoValidWidth; + public int VideoValidWidth => _videoValidWidth; + + public long PlayFrameIndex => _playFrameIndex; + protected long _playFrameIndex; + + // 总帧数 + protected long _frameCount; + public long FrameCount => _frameCount; + + protected float _playSpeed = 1.0f; + + public enum PlayAlphaType + { + None = 0, + RightSide = 1, + BottomSide = 2, + ChromaKey = 3, + } + + public PlayAlphaType AlphaType + { + get => _alphaType; + set + { + if (_alphaType != value) + { + SetAlphaType(value); + } + } + } + + [SerializeField] + protected bool disableAutoSize; + [SerializeField] + protected bool autoPlayOnStart; + + public bool DisableAutoSize + { + get => disableAutoSize; + set => disableAutoSize = value; + } + + [SerializeField] + protected bool _isLooping = true; + + public bool IsLooping => _isLooping; + + /// + /// 播放完成回调事件(非循环播放时触发) + /// + public System.Action OnPlayCompleted; + + /// + /// 首帧渲染完毕回调事件 + /// 无论同步或异步解码首帧模式都会触发 + /// + public System.Action OnFirstFrameRendered; + + [SerializeField] + protected PlayAlphaType _alphaType = PlayAlphaType.None; + + // 上次应用的alphaType,用于检测是否需要更新材质 + protected PlayAlphaType _lastAppliedAlphaType = PlayAlphaType.None; + + protected virtual void Start() + { + if (autoPlayOnStart && bytesFile) + Play(); + } + + /// + /// 第一帧解码完成回调(由解码器触发,可能在子线程中调用) + /// 设置标志位,实际处理在主线程的 Update 中执行 + /// + protected virtual void OnFirstFrameDecodedCallback() + { + _pendingFirstFrameCallback = true; + } + + /// + /// 处理第一帧解码完成的实际逻辑(必须在主线程调用) + /// 子类需要重写此方法来处理渲染目标的显示 + /// + protected virtual void HandleFirstFrameDecoded() + { + // 先更新纹理,确保显示的是新视频的第一帧 + DisplayFrame(); + + // 子类负责启用渲染目标 + OnEnableRenderTarget(); + + // 触发首帧渲染完毕回调 + OnFirstFrameRendered?.Invoke(); + } + + /// + /// 启用渲染目标(子类实现) + /// + protected abstract void OnEnableRenderTarget(); + + /// + /// 禁用渲染目标(子类实现) + /// + protected abstract void OnDisableRenderTarget(); + + protected virtual void OnDestroy() + { + Log("开始销毁,清理所有资源"); + + // 立即设置销毁标志,阻止任何新的操作 + _isDestroying = true; + + _isPlaying = false; + + // 强制同步停止,避免异步操作 + try + { + InternalStopSync(); + } + catch (System.Exception e) + { + LogWarning($"同步停止时出现异常: {e.Message}"); + } + + // Release textures + if (_textures != null && _textures.Length > 0) + { + foreach (var tex in _textures) + { + if (tex) Destroy(tex); + } + } + _textures = null; + } + + /// + /// 播放视频 + /// + /// 视频文件 + /// 播放透明度 + /// 是否多线程解码 + /// 开始播放的帧索引 + /// 是否同步解码第一帧, 区别在于是否当前帧就能立马看到视频, 会耗时10ms + /// 是否启用快速解码(跳过环路滤波器),默认开启以提升性能 + /// 返回值: 0表示成功, 其他表示错误码 + public int PlayVideo(TextAsset fileData, PlayAlphaType playAlpha, bool multithreadedDecode, int beginFrameIndex = 1, bool syncDecodeFirstFrame = true, bool fastDecode = true) + { + // 如果正在销毁,立即返回 + if (_isDestroying) + { + LogWarning("PlayVideo: 组件正在销毁,取消播放"); + return -1; + } + + if (fileData == null) + { + return -1; + } + var ret = 0; + if (_isPlaying) return ret; + + _playFrameIndex = 0; + _timeAccumulated = 0; + _isLoopSeeking = false; + + _alphaType = playAlpha; + +#if UNITY_WEBGL + // webGL不支持c#多线程 + _isMultithreadedDecode = false; +#else + _isMultithreadedDecode = multithreadedDecode; +#endif + + // 根据平台选择解码器 + if (IsWCGame) + { + OnDisableRenderTarget(); + // 创建新的decoder - 使用Worker版本 + var workerDecoder = new LeviathanWorkerDecoder(); + workerDecoder.IsLooping = _isLooping; // 设置循环播放状态 + _decoder = workerDecoder; + Log($"[PlayWithData] 创建新的微信小游戏Worker解码器 (静态检测: {IsWCGame}, 循环播放: {_isLooping})"); + } + else + { + // 只有同步解码第一帧时才立即启用,否则等待第一帧解码完成后再启用 + if (syncDecodeFirstFrame) + { + OnEnableRenderTarget(); + } + else + { + OnDisableRenderTarget(); + } + _decoder = new LeviathanSoftwareDecoder(); + Log($"[PlayWithData] 使用软件解码器 (静态检测: {IsWCGame})"); + } + _needInitTexture = true; + + // 订阅第一帧回调事件 + _decoder.OnFirstFrameDecoded += OnFirstFrameDecodedCallback; + + // 初始化解码器 + bytesFile = fileData; +#if UNITY_EDITOR + _lastBytesFile = bytesFile; +#endif +#if UNITY_2022_1_OR_NEWER + ret = _decoder.Init(fileData.GetData(), beginFrameIndex, syncDecodeFirstFrame, fastDecode); +#else + // Unity 2020/2021: 创建持久的数据副本供解码器使用 + if (_hasVideoDataBuffer) + { + _videoDataBuffer.Dispose(); + } + _videoDataBuffer = new NativeArray(fileData.bytes, Allocator.Persistent); + _hasVideoDataBuffer = true; + ret = _decoder.Init(_videoDataBuffer, beginFrameIndex, syncDecodeFirstFrame, fastDecode); +#endif + + _frameCount = _decoder.FrameCount; + _loopBeginFrameIndex = beginFrameIndex; + _loopEndFrameIndex = _frameCount; + _duration = _decoder.Duration; + _frameInterval = _decoder.FrameInterval; + _codecName = _decoder.CodecName; + + if (ret != 0) + { + LogError($"DecodeNextFrame ret: {ret}"); + } + + OnUpdateRenderTargetSize(); + + // 只有同步解码第一帧时才立即显示,否则等待第一帧解码完成后在 HandleFirstFrameDecoded 中显示 + if (syncDecodeFirstFrame) + { + DisplayFrame(); + // 同步模式下立即触发首帧渲染完毕回调 + OnFirstFrameRendered?.Invoke(); + } + + if (_isMultithreadedDecode) + { + // 多线程模式 + Interlocked.Exchange(ref _hasFrameReady, 1); // 第一帧已准备好 + _isPlaying = true; + _isPause = false; + _decodeThread = new Thread(DecodeThreadFunction); +#if UNITY_EDITOR + _decodeThread.Name = $"{nameof(LeviathanVideoDecoderBase)}.{nameof(DecodeThreadFunction)}"; +#endif + _decodeThread.Start(); + } + else + { + // 单线程模式 + _isPlaying = true; + _isPause = false; + } + return ret; + } + + /// + /// 更新渲染目标尺寸(子类实现) + /// + protected abstract void OnUpdateRenderTargetSize(); + + protected void InternalStop() + { + if (!_isPlaying) return; + + // 立即设置状态,防止重复调用 + _isPlaying = false; + + // 其他平台的同步停止逻辑 + InternalStopSync(); + } + + // 同步停止方法(非微信平台) + protected void InternalStopSync() + { + // 重置第一帧回调标志,避免旧视频的回调影响新视频 + _pendingFirstFrameCallback = false; + _needApplyTexture = false; + _isPause = false; + + if (_isMultithreadedDecode) + { + if (_decodeThread != null && _decodeThread.IsAlive) + { + _decodeThread.Join(1000); // 添加超时避免死锁 + if (_decodeThread.IsAlive) + { + // 强制终止线程 + _decodeThread.Abort(); + } + } + _decodeThread = null; + } + + // 其他平台正常销毁decoder + if (_decoder != null) + { + _decoder.OnFirstFrameDecoded -= OnFirstFrameDecodedCallback; + _decoder.InternalStop(); + _decoder.Dispose(); + _decoder = null; + } + +#if !UNITY_2022_1_OR_NEWER + // Unity 2020/2021: 释放数据缓冲区 + if (_hasVideoDataBuffer) + { + _videoDataBuffer.Dispose(); + _hasVideoDataBuffer = false; + } +#endif + + OnDisableRenderTarget(); + } + + // 主线程 + protected virtual void Update() + { + // 如果正在销毁,立即返回 + if (_isDestroying) return; + + // 处理第一帧回调(从子线程安全地在主线程执行) + if (_pendingFirstFrameCallback) + { + _pendingFirstFrameCallback = false; + HandleFirstFrameDecoded(); + } + + if (_isPause) return; + if (!_isPlaying) return; + +#if UNITY_WEBGL && !UNITY_EDITOR + _timeAccumulated += 1.0 / Application.targetFrameRate * _playSpeed; +#else + _timeAccumulated += Time.deltaTime * _playSpeed; +#endif + if (_isMultithreadedDecode) + { + // 多线程模式 + if (_timeAccumulated >= _frameInterval) + { + // 检查是否有新帧准备好 + if (Interlocked.Read(ref _hasFrameReady) > 0) + { + // 复制帧数据到纹理(不立即Apply) + DisplayFrame(applyImmediately: false); + + _timeAccumulated -= _frameInterval; + + // DisplayFrame 完成后,通知解码线程可以解码下一帧 + Interlocked.Exchange(ref _hasFrameReady, 0); + } + + if (_timeAccumulated > _frameInterval * 3) + { + _timeAccumulated = _frameInterval; + } + } + } + else + { + // 单线程模式 + if (IsWCGame) + { + // Worker解码器:每次Update解码一帧 + if (_decoder.DecodeNextFrame() == 0) + { + DisplayFrame(applyImmediately: false); + } + } + else + { + // 每次Update最多解码一帧,不追帧 + if (_timeAccumulated >= _frameInterval) + { + if (_decoder.DecodeNextFrame() == 0) + { + _timeAccumulated -= _frameInterval; + + long currentFrame = _decoder.DecodedFrameIndex; + if (currentFrame >= _loopEndFrameIndex) + { + if (_isLooping) + { + SeekToFrame(_loopBeginFrameIndex); + } + } + + DisplayFrame(applyImmediately: false); + } + + if (_timeAccumulated > _frameInterval * 3) + { + _timeAccumulated = _frameInterval; + } + } + } + if (_playFrameIndex >= _loopEndFrameIndex && !_isLooping) + { + Pause(); + OnPlayCompleted?.Invoke(); + } + } + } + + protected virtual void LateUpdate() + { + if (_needApplyTexture) { + _needApplyTexture = false; + if (_decoder != null && _textures != null) + { + DisplayFrameApply(); + } + } + } + + + // 解码线程(仅多线程模式) + protected void DecodeThreadFunction() + { + try + { + while (_isPlaying) + { + if (!_isPause) + { + // 等待主线程显示完当前帧(_hasFrameReady == 0 表示允许解码下一帧) + while (Interlocked.Read(ref _hasFrameReady) != 0 && _isPlaying) + { + Thread.Sleep(1); + } + if (!_isPlaying) break; + + // 解码下一帧 + if (_decoder.DecodeNextFrame() == 0) + { + // 解码成功,通知主线程帧已准备好 + Interlocked.Exchange(ref _hasFrameReady, 1); + } + + if (_playFrameIndex >= _loopEndFrameIndex && !_isLoopSeeking) + { + if (_isLooping) + { + _isLoopSeeking = true; + SeekToFrame(_loopBeginFrameIndex); + // Seek后继续解码,_hasFrameReady 保持为 1,等待主线程显示 + } + else + { + _isPause = true; + Interlocked.Exchange(ref _hasFrameReady, 1); + // 触发播放完成回调 + OnPlayCompleted?.Invoke(); + } + } + } + else + { + Thread.Sleep(5); + } + } + } + catch (ThreadAbortException) + { + Thread.ResetAbort(); + } + } + + // 初始化纹理 + protected virtual void InitTextures() + { + if (_textures != null && _textures.Length > 0) + { + Destroy(_textures[0]); + Destroy(_textures[1]); + Destroy(_textures[2]); + } + var videoFrame = _decoder.VideoFrame; + // 软件解码器使用YUV格式 + _textures = new Texture2D[TextureCount]; + _textures[0] = new Texture2D(videoFrame->linesize[0], videoFrame->height, TextureFormat.Alpha8, false); + _textures[1] = new Texture2D(videoFrame->linesize[1], videoFrame->height / 2, TextureFormat.Alpha8, false); + _textures[2] = new Texture2D(videoFrame->linesize[2], videoFrame->height / 2, TextureFormat.Alpha8, false); + _textures[0].wrapMode = TextureWrapMode.Clamp; + _textures[1].wrapMode = TextureWrapMode.Clamp; + _textures[2].wrapMode = TextureWrapMode.Clamp; + + _videoValidWidth = videoFrame->width; + _videoWidth = videoFrame->linesize[0]; + _videoHeight = videoFrame->height; + + OnInitMaterial(); + OnUpdateRenderTargetSize(); + } + + /// + /// 初始化材质(子类实现) + /// + protected abstract void OnInitMaterial(); + + /// + /// 更新纹理 + /// + /// 是否立即Apply上传到GPU。false时只复制数据,可以稍后调用DisplayFrameApply + protected virtual void DisplayFrame(bool applyImmediately = true) + { + var videoFrame = _decoder.VideoFrame; + if (videoFrame->linesize[0] <= 0) return; + + // 检查纹理是否需要重新创建 + if (_textures == null || _textures[0].width != videoFrame->linesize[0] || _textures[0].height != videoFrame->height) + { + InitTextures(); + _lastAppliedAlphaType = _alphaType; + _needInitTexture = false; + + if (_decoder is LeviathanWorkerDecoder workerDecoder) + { + workerDecoder.SetTextureIds(_textures); + } + } + else if (_needInitTexture) + { + // 只在alphaType变化时才更新材质 + if (_alphaType != _lastAppliedAlphaType) + { + OnInitMaterial(); + _lastAppliedAlphaType = _alphaType; + } + // 如果是Worker版本,将纹理ID传递给JSLIB + if (_decoder is LeviathanWorkerDecoder workerDecoder) + { + workerDecoder.SetTextureIds(_textures); + } + _needInitTexture = false; + } + + // 复制帧数据到纹理(需要保护_videoFrame) + _decoder.CopyFrameDataToTextures(_textures); + + // 根据参数决定是否立即Apply + if (applyImmediately) + { + _decoder.ApplyTextures(_textures); + _needApplyTexture = false; // 立即Apply后,清除延迟标志 + } + else + { + _needApplyTexture = true; // 延迟Apply,设置标志在LateUpdate中执行 + } + + // 更新播放帧索引 + if (_isMultithreadedDecode) + { + _playFrameIndex = Interlocked.Read(ref _decoder.GetDecodedFrameIndexRef()); + } + else + { + _playFrameIndex = _decoder.DecodedFrameIndex; + } + + // 重置循环seek标志 + _isLoopSeeking = false; + } + + /// + /// 将纹理数据上传到GPU(可与下一帧解码并行) + /// 配合 DisplayFrame(false) 使用,实现分步显示优化 + /// + protected virtual void DisplayFrameApply() + { + _decoder.ApplyTextures(_textures); + } + + // 跳转到指定时间点 + public void Seek(double ms) + { + _decoder.Seek(ms); + } + + // 跳转到指定帧 + public void SeekToFrame(long frame) + { + _decoder.SeekToFrame(frame); + } + + public void SetPlaySpeed(float speed) + { + _playSpeed = speed; + } + + public virtual void SetAlphaType(PlayAlphaType alphaTypeValue) + { + _alphaType = alphaTypeValue; + if (_textures == null || _textures.Length <= 0) return; + OnUpdateMaterial(); + _lastAppliedAlphaType = _alphaType; + OnUpdateRenderTargetSize(); + } + + /// + /// 更新材质(子类实现) + /// + protected abstract void OnUpdateMaterial(); + + public void SetLooping(bool isLooping) + { + _isLooping = isLooping; + + // 如果是微信小游戏平台,设置解码器的循环播放状态 + if (IsWCGame) + { + _decoder.IsLooping = isLooping; + } + + if (_isLooping && _isPause) + { + Resume(); + } + } + + /// + /// 设置循环播放区间, 帧数范围为 1 ~ FrameCount + /// + /// 开始帧索引 + /// 结束帧索引 + public void SetLoopingFrame(long beginFrame, long endFrame) + { + _loopBeginFrameIndex = beginFrame; + _loopEndFrameIndex = endFrame; + } + + /// + /// 切换视频 + /// + /// 视频文件 + /// 播放透明度 + /// 是否多线程解码 + /// 开始播放的帧索引 + /// 是否同步解码第一帧, 区别在于是否当前帧就能立马看到视频, 会耗时10ms + /// 是否启用快速解码(跳过环路滤波器),默认开启以提升性能 + /// 返回值: true表示成功, false表示失败 + public bool ChangeVideo(TextAsset fileData, PlayAlphaType playAlpha, bool multithreadedDecode, int beginFrameIndex = 1, bool syncDecodeFirstFrame = true, bool fastDecode = true) + { + // 如果不同步解码第一帧,先隐藏渲染目标避免显示旧帧 + if (!syncDecodeFirstFrame) + { + OnDisableRenderTarget(); + } + return ChangeVideoSync(fileData, playAlpha, multithreadedDecode, beginFrameIndex, syncDecodeFirstFrame, fastDecode); + } + + protected bool ChangeVideoSync(TextAsset fileData, PlayAlphaType playAlpha, bool multithreadedDecode, int beginFrameIndex = 1, bool syncDecodeFirstFrame = true, bool fastDecode = true) + { + Log("开始同步切换视频"); + + try + { + // 同步停止当前视频 + StopVideoSync(); + + // 同步播放新视频 + int result = PlayVideoSync(fileData, playAlpha, multithreadedDecode, beginFrameIndex, syncDecodeFirstFrame, fastDecode); + + if (result != 0) + { + LogError($"同步播放视频失败,错误码: {result}"); + return false; + } + + Log("同步切换视频完成"); + return true; + } + catch (System.Exception e) + { + LogError($"同步切换视频异常: {e.Message}"); + return false; + } + } + + protected void StopVideoSync() + { + // 立即禁用渲染目标显示,避免显示旧帧 + OnDisableRenderTarget(); + + if (_isPlaying) + { + if (_isPlaying) + { + InternalStop(); + } + + // 同步等待停止操作完成 + int maxWaitCount = 1000; // 最多等待1000次循环 + int waitCount = 0; + + while ((_isPlaying) && waitCount < maxWaitCount) + { + // 在同步模式下,我们不能使用yield,所以使用Thread.Sleep进行短暂等待 + Thread.Sleep(1); + waitCount++; + } + + if (waitCount >= maxWaitCount) + { + LogWarning("同步停止视频超时,继续执行后续操作"); + } + else + { + Log($"视频同步停止完成,等待了 {waitCount} 次循环"); + } + } + } + + protected int PlayVideoSync(TextAsset fileData, PlayAlphaType playAlpha, bool multithreadedDecode, int beginFrameIndex = 1, bool syncDecodeFirstFrame = true, bool fastDecode = true) + { + // 播放新视频 + int result; + if (fileData != null) + { + // 使用文件数据播放 + result = PlayVideo(fileData, playAlpha, multithreadedDecode, beginFrameIndex, syncDecodeFirstFrame, fastDecode); + Log($"同步切换到视频资源: {fileData.name}"); + } + else + { + LogError("没有提供有效的视频源"); + return -1; + } + + if (result != 0) + { + LogError($"同步播放视频失败,错误码: {result}"); + return result; + } + + return result; + } + + internal void Play() + { + if (!Application.isPlaying) return; + if (bytesFile == null) return; + PlayVideo(bytesFile, _alphaType, true); + } + + public void Stop() + { + if (!Application.isPlaying) return; + InternalStop(); + } + + public void Pause() + { + if (!Application.isPlaying) return; + _isPause = true; + + // 调用解码器的暂停方法 + _decoder?.Pause(true); + } + + public void Resume() + { + if (!Application.isPlaying) return; + _isPause = false; + + // 调用解码器的恢复方法 + _decoder?.Pause(false); + } +} + diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoderBase.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoderBase.cs.meta new file mode 100644 index 0000000..8b0761b --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/LeviathanVideoDecoderBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5515e1e1db39d4348a3a57571c7bc460 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform.meta new file mode 100644 index 0000000..39b895d --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: edd271292fe97374fa02eaba7183c305 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanSoftwareDecoder.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanSoftwareDecoder.cs new file mode 100644 index 0000000..51698b4 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanSoftwareDecoder.cs @@ -0,0 +1,590 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/04/11 +// Module Describe: +//----------------------------------------------------------------*/ + +//****************************************************************** +// CPU软解码 +// 适用平台 +// Editor +// Windows +// MacOS +// Android +// iOS +// WebGL +//****************************************************************** + +// #define ENABLE_COPY_NATIVE_DATA //复制Native数据到托管内存 + +#if UNITY_WEBGL +#else +#define ENABLE_AV_MALLOC //使用AV_MALLOC分配内存 +#endif + +using System; +using System.Threading; +using LeviathanVideo.Abstractions; +using LeviathanVideo.Bindings.Linked; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using UnityEngine; +using System.Runtime.InteropServices; +using AOT; + +internal unsafe class LeviathanSoftwareDecoder : ILeviathanDecoder +{ + // 日志辅助方法 + private static void Log(string message) + { + LeviathanLogConfig.Log("SoftwareDecoder", message); + } + + private static void LogWarning(string message) + { + LeviathanLogConfig.LogWarning("SoftwareDecoder", message); + } + + private static void LogError(string message) + { + LeviathanLogConfig.LogError("SoftwareDecoder", message); + } + + // 事件实现 + public event Action OnFirstFrameDecoded; + private AVFormatContext* _pFormatContext; + private AVCodecContext* _pVideoContext; + + private int _videoStreamIndex; + private AVFrame* _videoFrame; + private AVPacket* _packet; + + private AVIOContext* _pAvioCtx; + private byte* _avioCtxBuffer; + private BufferData _bufferData; + private GCHandle _bdHandle; + +#if ENABLE_AV_MALLOC +#else + private GCHandle _hAvioBuffer; +#endif +#if ENABLE_COPY_NATIVE_DATA + private IntPtr _unmanagedPtr; +#endif + + // 私有字段 + private long _frameCount; + private double _frameInterval; + private string _codecName = ""; + private long _duration; + private long _decodedFrameIndex; + private bool _firstFrameDecoded = false; + + // 线程安全锁 - 保护 Seek 和 Decode 操作不并发执行 + private readonly object _codecLock = new object(); + + // 实现接口属性 + public long FrameCount => _frameCount; + public double FrameInterval => _frameInterval; + public string CodecName => _codecName; + public long Duration => _duration; + public long DecodedFrameIndex => _decodedFrameIndex; + public AVFrame* VideoFrame => _videoFrame; + + // 循环播放属性(软件解码器不需要特殊处理) + public bool IsLooping { get; set; } = false; + + // 快速解码模式(跳过环路滤波器) + private bool _fastDecode = true; + + + [StructLayout(LayoutKind.Sequential)] + private struct BufferData + { + public byte* ptr; + public byte* originPtr; + public ulong size; + public ulong totalSize; + } + + [MonoPInvokeCallback(typeof(avio_alloc_context_read_packet))] + private static int ReadPacket(void* opaque, byte* buf, int bufSize) + { + BufferData* bd = (BufferData*)opaque; + bufSize = (int)Math.Min(bd->size, (ulong)bufSize); + + if (bufSize <= 0) + return leviathan.AVERROR_EOF; + + // Buffer.MemoryCopy(bd->ptr, buf, bufSize, bufSize); + UnsafeUtility.MemCpy(buf, bd->ptr, bufSize); + bd->ptr += bufSize; + bd->size -= (ulong)bufSize; + + return bufSize; + } + + [MonoPInvokeCallback(typeof(avio_alloc_context_seek))] + private static long SeekPacket(void* opaque, long offset, int whence) + { + BufferData* bd = (BufferData*)opaque; + switch (whence) + { + case 0: //SEEK_SET + if (offset < 0 || (ulong)offset > bd->totalSize) + return leviathan.AVERROR_Enum(leviathan.EINVAL); + bd->ptr = bd->originPtr + offset; + bd->size = bd->totalSize - (ulong)offset; + return offset; + + case 1: //SEEK_CUR + long newPos = bd->ptr - bd->originPtr + offset; + if (newPos < 0 || (ulong)newPos > bd->totalSize) + return leviathan.AVERROR_Enum(leviathan.EINVAL); + bd->ptr += offset; + bd->size = bd->totalSize - (ulong)newPos; + return newPos; + + case 2: //SEEK_END + long endPos = (long)bd->totalSize + offset; + if (endPos < 0 || endPos > (long)bd->totalSize) + return leviathan.AVERROR_Enum(leviathan.EINVAL); + bd->ptr = bd->originPtr + endPos; + bd->size = bd->totalSize - (ulong)endPos; + return endPos; + + default: + return leviathan.AVERROR_Enum(leviathan.EINVAL); + } + } + + + public int Init(NativeArray fileData, int beginFrameIndex = 1, bool syncDecodeFirstFrame = true, bool fastDecode = true) + { + LinkedBindings.Initialize(); + _fastDecode = fastDecode; + var ret = 0; + var src = fileData.GetUnsafeReadOnlyPtr(); + +#if ENABLE_COPY_NATIVE_DATA + _unmanagedPtr = Marshal.AllocHGlobal(fileData.Length); + var dst = _unmanagedPtr.ToPointer(); + UnsafeUtility.MemCpy(dst, src, fileData.Length); + src = dst; +#endif + + ulong bufferSize = (ulong)fileData.Length; + + _bufferData = new BufferData + { + originPtr = (byte*)src, // 初始化原始指针 + ptr = (byte*)src, + size = bufferSize, + totalSize = bufferSize + }; + _bdHandle = GCHandle.Alloc(_bufferData, GCHandleType.Pinned); + + avio_alloc_context_read_packet readCallback = ReadPacket; + avio_alloc_context_seek seekCallback = SeekPacket; + + // 为AVIOContext分配缓冲区 + const int avioCtxBufferSize = 4096; +#if ENABLE_AV_MALLOC + _avioCtxBuffer = (byte*)leviathan.av_malloc(avioCtxBufferSize); + + // 分配AVIOContext并将其与AVFormatContext关联 + _pAvioCtx = leviathan.avio_alloc_context( + _avioCtxBuffer, + avioCtxBufferSize, + 0, // 不可写 + (void*)_bdHandle.AddrOfPinnedObject(), + readCallback, + null, // 无写回调 + seekCallback + ); +#else + // wasm无法直接使用av_malloc + int alignment = 64; + byte[] avioBufferManaged = new byte[avioCtxBufferSize + alignment - 1]; + _hAvioBuffer = GCHandle.Alloc(avioBufferManaged, GCHandleType.Pinned); + IntPtr avioBufferPtr = _hAvioBuffer.AddrOfPinnedObject(); + // 调整指针到对齐地址 + IntPtr alignedPtr = new IntPtr((avioBufferPtr.ToInt64() + alignment - 1) & ~(alignment - 1)); + + // 分配AVIOContext并将其与AVFormatContext关联 + _pAvioCtx = leviathan.avio_alloc_context( + (byte*)alignedPtr, + avioCtxBufferSize, + 0, // 不可写 + (void*)_bdHandle.AddrOfPinnedObject(), + readCallback, + null, // 无写回调 + seekCallback + ); +#endif + if (_pAvioCtx == null) + { + ret = leviathan.AVERROR_Enum(leviathan.ENOMEM); + LogError("无法分配AVIO上下文"); + return ret; + } + + _pFormatContext = leviathan.avformat_alloc_context(); + _pFormatContext->pb = _pAvioCtx; + var pFormatContext = _pFormatContext; + ret = leviathan.avformat_open_input(&pFormatContext, null, null, null); + if (ret != 0) + { + LogError($"avformat_open_input failed: {ret}"); + return ret; + } + if (_pFormatContext == null) + { + return ret; + } + + return InternalPlay(beginFrameIndex, syncDecodeFirstFrame); + } + + public int InternalPlay(int beginFrameIndex = 1, bool syncDecodeFirstFrame = true) + { + leviathan.avformat_find_stream_info(_pFormatContext, null); + AVCodec* videoCodec = null; + _videoStreamIndex = leviathan.av_find_best_stream(_pFormatContext, AVMediaType.AVMEDIA_TYPE_VIDEO, -1, -1, &videoCodec, 0); + // 获取视频流信息 + AVStream* videoStream = _pFormatContext->streams[_videoStreamIndex]; + // 计算帧间隔 + AVRational frameRate = videoStream->r_frame_rate; + double fps = leviathan.av_q2d(frameRate); + _frameInterval = 1.0 / fps; + + _pVideoContext = leviathan.avcodec_alloc_context3(videoCodec); + +#if UNITY_EDITOR + _codecName = leviathan.avcodec_get_name(videoCodec->id); +#endif + if (videoCodec == null) + { + LogError("videoCodec is null"); + return 1; + } + _pVideoContext->thread_count = 0; + _pVideoContext->thread_type = leviathan.FF_THREAD_FRAME | leviathan.FF_THREAD_SLICE; + + // 根据 fastDecode 参数决定是否跳过环路滤波器以提升解码速度 + if (_fastDecode) + { + _pVideoContext->skip_loop_filter = (AVDiscard)48; //AVDISCARD_ALL + } + + // Debug.Log($"{_pVideoContext->codec_id} {_frameInterval} {_pFormatContext->duration}"); + leviathan.avcodec_open2(_pVideoContext, videoCodec, null); + + _duration = _pFormatContext->duration; + + if (_pFormatContext->streams[_videoStreamIndex]->nb_frames > 0) + { + _frameCount = _pFormatContext->streams[_videoStreamIndex]->nb_frames; + } + else + { + var dur = _duration / 1000.0 * leviathan.av_q2d(videoStream->time_base); + int frNum = frameRate.num; + int frDen = frameRate.den; + if (dur > 0 && frNum > 0 && frDen > 0) + { + _frameCount = (long)(dur * frNum / frDen); + } + } + // Debug.Log($"frameCount: {_frameCount}"); + + _videoFrame = leviathan.av_frame_alloc(); + _packet = leviathan.av_packet_alloc(); + + if (beginFrameIndex > 1) + { + SeekToFrame(beginFrameIndex); + } + + if (syncDecodeFirstFrame) + { + // 第一帧同步解码 + int ret = DecodeNextFrame(); + if (ret != 0) + { + LogError($"DecodeNextFrame ret: {ret}"); + } + } + + return 0; + } + + + public int DecodeNextFrame() + { + lock (_codecLock) + { + if (_pVideoContext == null || _pFormatContext == null) + return -1; + + return DecodeNextFrameInternal(); + } + } + + private int DecodeNextFrameInternal() + { + var flushSent = false; + while (true) + { + var error = leviathan.avcodec_receive_frame(_pVideoContext, _videoFrame); + if (error == 0) + { + long frameIndex = 1; + if (_frameInterval > 0) + { + var timeBase = _pFormatContext->streams[_videoStreamIndex]->time_base; + double frameTime = _videoFrame->pts * leviathan.av_q2d(timeBase); + frameIndex = (long)(frameTime / _frameInterval + 0.1) + 1; + } + Interlocked.Exchange(ref _decodedFrameIndex, frameIndex); + + // 触发第一帧回调 + if (!_firstFrameDecoded) + { + _firstFrameDecoded = true; + OnFirstFrameDecoded?.Invoke(); + } + + return 0; + } + + if (error == leviathan.AVERROR_Enum(leviathan.EAGAIN)) + { + if (flushSent) + { + // 已发送过flush,无更多数据 + return 1; + } + + error = leviathan.av_read_frame(_pFormatContext, _packet); + if (error < 0) + { + if (error == leviathan.AVERROR_EOF) + { + // 发送flush packet以取出解码器中剩余帧 + error = leviathan.avcodec_send_packet(_pVideoContext, null); + flushSent = true; + if (error < 0 && error != leviathan.AVERROR_Enum(leviathan.EAGAIN)) + { + return 2; + } + continue; + } + else + { + // 其他错误,继续尝试读取 + continue; + } + } + + if (_packet->stream_index == _videoStreamIndex) + { + error = leviathan.avcodec_send_packet(_pVideoContext, _packet); + if (error < 0) + { + leviathan.av_packet_unref(_packet); + if (error == leviathan.AVERROR_Enum(leviathan.EAGAIN)) + { + // 解码器需要先输出帧,继续循环处理 + continue; + } + else + { + return 3; + } + } + } + leviathan.av_packet_unref(_packet); + } + else if (error == leviathan.AVERROR_EOF) + { + // 解码器已无更多帧 + return 4; + } + else + { + // 其他错误 + return error; + } + } + } + + public void InternalStop() + { + lock (_codecLock) + { + // Release resources + var pVideoContext = _pVideoContext; + var pFormatContext = _pFormatContext; + var videoFrame = _videoFrame; + var packet = _packet; + if (_pVideoContext != null) leviathan.avcodec_free_context(&pVideoContext); + if (_pFormatContext != null) leviathan.avformat_close_input(&pFormatContext); + if (_videoFrame != null) leviathan.av_frame_free(&videoFrame); + if (_packet != null) leviathan.av_packet_free(&packet); + + _pVideoContext = null; + _pFormatContext = null; + _videoFrame = null; + _packet = null; + } + + if (_pAvioCtx != null) + { +#if ENABLE_AV_MALLOC + leviathan.av_free(_pAvioCtx->buffer); +#else + _pAvioCtx->buffer = null; // 关键:阻止 FFmpeg 调用 av_free + if (_hAvioBuffer.IsAllocated) + { + _hAvioBuffer.Free(); + } +#endif + var pAvioCtx = _pAvioCtx; + leviathan.avio_context_free(&pAvioCtx); + _pAvioCtx = null; + } + + if (_bdHandle.IsAllocated) + { + _bdHandle.Free(); + } + _bdHandle = default; +#if ENABLE_COPY_NATIVE_DATA + if (_unmanagedPtr != IntPtr.Zero) + { + Marshal.FreeHGlobal(_unmanagedPtr); + } + _unmanagedPtr = default; +#endif + } + + public void Dispose() + { + InternalStop(); + } + + // 跳转到指定时间点 + public void Seek(double ms) + { + lock (_codecLock) + { + if (_pVideoContext == null || _pFormatContext == null) + return; + + long targetFrame = (long)(_frameInterval * ms); + // Debug.Log("Seek to " + targetFrame + "(" + ms + "ms)"); + leviathan.avformat_seek_file(_pFormatContext, _videoStreamIndex, Int64.MinValue, targetFrame, Int64.MaxValue, leviathan.AVSEEK_FLAG_FRAME); + leviathan.avcodec_flush_buffers(_pVideoContext); + } + } + + // 跳转到指定帧 + public void SeekToFrame(long frame) + { + lock (_codecLock) + { + if (_pVideoContext == null || _pFormatContext == null) + return; + + long pts = _pFormatContext->streams[_videoStreamIndex]->duration / _frameCount * frame - 1; + leviathan.avformat_seek_file(_pFormatContext, _videoStreamIndex, Int64.MinValue, pts, Int64.MaxValue, leviathan.AVSEEK_FLAG_FRAME); + leviathan.avcodec_flush_buffers(_pVideoContext); + } + } + + // 获取decodedFrameIndex的引用,用于Interlocked操作 + public ref long GetDecodedFrameIndexRef() + { + return ref _decodedFrameIndex; + } + + // 暂停/恢复播放的空方法(软件解码器不需要特殊处理) + public void Pause(bool pause) + { + // 软件解码器的暂停由LeviathanVideoDecoder的_isPause标志控制 + // 这里不需要额外的实现 + } + + // 微信平台特有方法的空实现 + public int GetDecoderStatus() + { + // 软件解码器始终返回已启动状态 + return 2; + } + + // 将视频帧数据复制到纹理(需要在信号保护下执行,访问_videoFrame) + public void CopyFrameDataToTextures(UnityEngine.Texture2D[] textures) + { + const int TextureCount = 3; + + if (textures == null || textures.Length < TextureCount) return; + + // 更新YUV纹理 - 只做SetPixelData,不做Apply + for (uint i = 0; i < TextureCount; i++) + { + if (_videoFrame->data[i] == null || textures[i] == null) continue; + + var nativeArray = Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray( + _videoFrame->data[i], + textures[i].width * textures[i].height, + Unity.Collections.Allocator.None + ); + + try + { +#if ENABLE_UNITY_COLLECTIONS_CHECKS + Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref nativeArray, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.Create()); +#endif + // 只复制数据到纹理的CPU缓冲区,不上传到GPU + textures[i].SetPixelData(nativeArray, 0); +#if ENABLE_UNITY_COLLECTIONS_CHECKS + Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.Release(Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetAtomicSafetyHandle(nativeArray)); +#endif + } + catch (UnityException) + { + + } + finally + { + nativeArray.Dispose(); + } + } + } + + // 将纹理数据应用到GPU(可以和下一帧解码并行执行) + public void ApplyTextures(UnityEngine.Texture2D[] textures) + { + const int TextureCount = 3; + + if (textures == null || textures.Length < TextureCount) return; + + // 将CPU数据上传到GPU - 不需要访问_videoFrame + for (uint i = 0; i < TextureCount; i++) + { + if (textures[i] == null) continue; + + try + { + textures[i].Apply(false, false); + } + catch (UnityException) + { + + } + } + } +} diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanSoftwareDecoder.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanSoftwareDecoder.cs.meta new file mode 100644 index 0000000..fcb4347 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanSoftwareDecoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8483db06286d50244a0f52a17aa423e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanWorkerDecoder.cs b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanWorkerDecoder.cs new file mode 100644 index 0000000..33c2e79 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanWorkerDecoder.cs @@ -0,0 +1,1046 @@ +/*---------------------------------------------------------------- +// Copyright (C) 2025 Beijing All rights reserved. +// +// Author: huachangmiao +// Create Date: 2025/10/29 +// Module Describe: Unity微信小程序Worker版本解码器 +//----------------------------------------------------------------*/ +// #define ENABLE_LOG //启用日志 + +using System; +using System.Runtime.InteropServices; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using UnityEngine; +using LeviathanVideo.Abstractions; + + +//****************************************************************** +// 微信小游戏Worker解码器 +//****************************************************************** + +internal unsafe class LeviathanWorkerDecoder : ILeviathanDecoder +{ + // 日志辅助方法 + private static void Log(string message) + { + LeviathanLogConfig.Log("WorkerDecoder", message); + } + + private static void LogWarning(string message) + { + LeviathanLogConfig.LogWarning("WorkerDecoder", message); + } + + private static void LogError(string message) + { + LeviathanLogConfig.LogError("WorkerDecoder", message); + } + + // 事件实现 + public event Action OnFirstFrameDecoded; +#if UNITY_WEBGL + // JavaScript接口声明 - 对应jslib中的方法 + [DllImport("__Internal")] + private static extern void InitializeLeviathanWorkerSystem(); + + [DllImport("__Internal")] + private static extern int CreateWorkerVideoInstance(); + + [DllImport("__Internal")] + private static extern bool SetWorkerVideoData(int instanceId, byte[] data, int dataSize); + + [DllImport("__Internal")] + private static extern bool PrepareWorkerVideo(int instanceId, bool fastDecode); + + [DllImport("__Internal")] + private static extern bool PlayWorkerVideo(int instanceId); + + [DllImport("__Internal")] + private static extern bool PauseWorkerVideo(int instanceId); + + [DllImport("__Internal")] + private static extern bool ResumeWorkerVideo(int instanceId); + + [DllImport("__Internal")] + private static extern bool StopWorkerVideo(int instanceId); + + [DllImport("__Internal")] + private static extern bool UpdateWorkerVideo(int instanceId, float deltaTime); + + [DllImport("__Internal")] + private static extern bool DestroyWorkerVideo(int instanceId); + + [DllImport("__Internal")] + private static extern void SetWorkerVideoStatusCallback(int instanceId, System.Action callback); + + [DllImport("__Internal")] + private static extern void SetWorkerVideoFirstFrameDisplayCallback(int instanceId, System.Action callback); + + // 改进的静态回调方法,支持实例ID参数 +#if UNITY_WEBGL && !UNITY_EDITOR + [AOT.MonoPInvokeCallback(typeof(System.Action))] +#endif + private static void StaticOnStatusChanged(int instanceId, int status) + { + // 直接通过instanceId查找对应的实例 + if (_instances.ContainsKey(instanceId)) + { + var instance = _instances[instanceId]; + if (instance != null && instance._isInitialized && !instance._isDisposing) + { + instance.HandleStatusChanged(status); + } + } + else + { + LogWarning($"状态回调: 未找到实例ID {instanceId}"); + } + } + +#if UNITY_WEBGL && !UNITY_EDITOR + [AOT.MonoPInvokeCallback(typeof(System.Action))] +#endif + private static void StaticOnFirstFrameDisplay(int instanceId) + { + // 直接通过instanceId查找对应的实例 + if (_instances.ContainsKey(instanceId)) + { + var instance = _instances[instanceId]; + if (instance != null && instance._isInitialized && !instance._isDisposing) + { + instance.HandleFirstFrameDisplay(); + } + } + else + { + LogWarning($"首帧回调: 未找到实例ID {instanceId}"); + } + } + + [DllImport("__Internal")] + private static extern int GetWorkerVideoFrameCount(int instanceId); + + [DllImport("__Internal")] + private static extern long GetWorkerVideoDuration(int instanceId); + + [DllImport("__Internal")] + private static extern int GetWorkerVideoWidth(int instanceId); + + [DllImport("__Internal")] + private static extern int GetWorkerVideoHeight(int instanceId); + + [DllImport("__Internal")] + private static extern int GetWorkerVideoYTextureWidth(int instanceId); + + [DllImport("__Internal")] + private static extern int GetWorkerVideoYTextureHeight(int instanceId); + + [DllImport("__Internal")] + private static extern int GetWorkerVideoUVTextureWidth(int instanceId); + + [DllImport("__Internal")] + private static extern int GetWorkerVideoUVTextureHeight(int instanceId); + + [DllImport("__Internal")] + private static extern void SetWorkerVideoTextureId(int instanceId, string type, int textureId); + + [DllImport("__Internal")] + private static extern int GetWorkerVideoCurrentFrameIndex(int instanceId); + + [DllImport("__Internal")] + private static extern bool SeekWorkerVideo(int instanceId, float timeMs); + + [DllImport("__Internal")] + private static extern bool SeekWorkerVideoToFrame(int instanceId, int frameIndex); + + [DllImport("__Internal")] + private static extern bool SetWorkerVideoPlaySpeed(int instanceId, float speed); + + [DllImport("__Internal")] + private static extern bool SetWorkerVideoLooping(int instanceId, bool isLooping); + + [DllImport("__Internal")] + private static extern bool SetWorkerVideoAlphaType(int instanceId, int alphaType); + + // 纹理上传相关接口 + [DllImport("__Internal")] + private static extern System.IntPtr GetWorkerVideoSharedYBuffer(int instanceId); + + [DllImport("__Internal")] + private static extern System.IntPtr GetWorkerVideoSharedUBuffer(int instanceId); + + [DllImport("__Internal")] + private static extern System.IntPtr GetWorkerVideoSharedVBuffer(int instanceId); + + [DllImport("__Internal")] + private static extern int GetWorkerVideoSharedBufferSize(int instanceId, string type); + + [DllImport("__Internal")] + private static extern bool NotifyWorkerVideoTextureReady(int instanceId); + + // 获取WASM内存指针接口(已废弃,保留用于向后兼容) + [DllImport("__Internal")] + private static extern System.IntPtr GetWorkerVideoWasmYBufferPtr(int instanceId); + + [DllImport("__Internal")] + private static extern System.IntPtr GetWorkerVideoWasmUBufferPtr(int instanceId); + + [DllImport("__Internal")] + private static extern System.IntPtr GetWorkerVideoWasmVBufferPtr(int instanceId); + + // 检查是否使用JS端GPU纹理上传(所有平台都使用) + [DllImport("__Internal")] + private static extern bool IsWorkerVideoUsingJSTextureUpload(int instanceId); +#endif + + // 私有字段 + private long _frameCount; + private double _frameInterval; + private string _codecName = "worker_decoder"; + private long _duration; + private long _decodedFrameIndex; + private AVFrame* _videoFrame; + private bool _isLooping = false; + private bool _fastDecode = true; // 快速解码开关 + +#if UNITY_WEBGL + // 销毁标志(防止销毁期间的回调继续执行) + private bool _isDisposing = false; + + private int _instanceId = -1; + private bool _isInitialized = false; + private NativeArray _videoData; + private bool _isWorkerSystemReady = false; + + // 实例管理 + private static System.Collections.Generic.Dictionary _instances = + new System.Collections.Generic.Dictionary(); + + // 帧数据缓存 + private int _currentFrameWidth = 0; + private int _currentFrameHeight = 0; + private System.IntPtr _currentFrameData = System.IntPtr.Zero; + + // 内存共享缓冲区管理 + private System.IntPtr _sharedYBuffer = System.IntPtr.Zero; + private System.IntPtr _sharedUBuffer = System.IntPtr.Zero; + private System.IntPtr _sharedVBuffer = System.IntPtr.Zero; + private int _sharedYBufferSize = 0; + private int _sharedUBufferSize = 0; + private int _sharedVBufferSize = 0; + private bool _sharedBuffersInitialized = false; + private UnityEngine.Texture2D[] _textureReferences = null; + + // 帧上传追踪(避免重复上传同一帧) + private long _lastUploadedFrameIndex = -1; + + // 是否使用JS端GPU纹理上传(所有平台都使用) + private bool _useJSTextureUpload = false; + + // 视频状态枚举 + private enum VideoStatus + { + Initialized = 0, + Prepared = 1, + Playing = 2, + Paused = 3, + Stopped = 4, + Error = 5 + } + + // 当前视频状态 + private VideoStatus _currentStatus = VideoStatus.Initialized; + + // 静态初始化标志 + private static bool _systemInitialized = false; +#endif + + // 实现接口属性 + public long FrameCount => _frameCount; + public double FrameInterval => _frameInterval; + public string CodecName => _codecName; + public long Duration => _duration; + public long DecodedFrameIndex => _decodedFrameIndex; + public AVFrame* VideoFrame => _videoFrame; + + // 循环播放属性 + public bool IsLooping + { + get => _isLooping; + set + { + _isLooping = value; +#if UNITY_WEBGL + if (_instanceId >= 0 && _isWorkerSystemReady && _isInitialized) + { + SetWorkerVideoLooping(_instanceId, _isLooping); + } + else + { + Log($"循环播放设置延迟到初始化完成后: {_isLooping}"); + } +#endif + } + } + + public LeviathanWorkerDecoder() + { + // 分配AVFrame结构 + _videoFrame = (AVFrame*)Marshal.AllocHGlobal(sizeof(AVFrame)); + *_videoFrame = new AVFrame(); + + // 初始化Worker系统 + InitializeWorkerSystem(); + } + + private void InitializeWorkerSystem() + { +#if UNITY_WEBGL + try + { + // 确保系统只初始化一次 + if (!_systemInitialized) + { + Log("初始化Worker系统..."); + InitializeLeviathanWorkerSystem(); +#if ENABLE_LOG + LeviathanLogConfig.EnableAll(); +#endif + _systemInitialized = true; + _isWorkerSystemReady = true; + Log("Worker系统初始化完成"); + } + else + { + _isWorkerSystemReady = true; + Log("Worker系统已经初始化"); + } + } + catch (Exception e) + { + LogError($"Worker系统初始化异常: {e.Message}"); + _isWorkerSystemReady = false; + } +#endif + } + +#if UNITY_WEBGL + // 状态回调处理(实例方法) + private void HandleStatusChanged(int status) + { + // 如果正在销毁,忽略所有状态变更 + if (_isDisposing) + { + return; + } + + _currentStatus = (VideoStatus)status; + Log($"实例{_instanceId}状态变更: {_currentStatus}"); + + // 根据状态更新内部数据 + switch (_currentStatus) + { + case VideoStatus.Prepared: + // 视频准备完成,更新视频信息 + UpdateVideoInfo(); + break; + case VideoStatus.Error: + LogError($"实例{_instanceId}视频播放出错"); + break; + } + } + + private void HandleFirstFrameDisplay() + { + // 如果正在销毁,忽略首帧回调 + if (_isDisposing) + { + return; + } + + Log($"实例{_instanceId}首帧显示"); + // 触发第一帧回调 + OnFirstFrameDecoded?.Invoke(); + } +#endif + + private void UpdateVideoInfo() + { +#if UNITY_WEBGL + if (_instanceId >= 0) + { + _frameCount = GetWorkerVideoFrameCount(_instanceId); + _duration = GetWorkerVideoDuration(_instanceId); + _currentFrameWidth = GetWorkerVideoWidth(_instanceId); + _currentFrameHeight = GetWorkerVideoHeight(_instanceId); + + // 获取纹理尺寸信息 + int yTextureWidth = GetWorkerVideoYTextureWidth(_instanceId); + int yTextureHeight = GetWorkerVideoYTextureHeight(_instanceId); + int uvTextureWidth = GetWorkerVideoUVTextureWidth(_instanceId); + int uvTextureHeight = GetWorkerVideoUVTextureHeight(_instanceId); + + // 更新AVFrame信息 + if (_videoFrame != null) + { + _videoFrame->width = _currentFrameWidth; + _videoFrame->height = _currentFrameHeight; + + // 设置linesize信息 - 这是关键修复 + _videoFrame->linesize[0] = yTextureWidth; // Y平面的linesize + _videoFrame->linesize[1] = uvTextureWidth; // U平面的linesize + _videoFrame->linesize[2] = uvTextureWidth; // V平面的linesize + + Log($"更新视频信息: {_currentFrameWidth}x{_currentFrameHeight}, Y纹理: {yTextureWidth}x{yTextureHeight}, UV纹理: {uvTextureWidth}x{uvTextureHeight}"); + } + + // 计算帧间隔 + if (_frameCount > 0 && _duration > 0) + { + _frameInterval = (double)_duration / _frameCount / 1000000.0; // 转换为秒 + } + + // 初始化共享缓冲区 + InitializeSharedBuffers(); + + Log($"视频信息更新: {_currentFrameWidth}x{_currentFrameHeight}, 帧数: {_frameCount}, 时长: {_duration}"); + } +#endif + } + + private void InitializeSharedBuffers() + { +#if UNITY_WEBGL + if (_instanceId < 0 || _sharedBuffersInitialized) + { + return; + } + + try + { + // 检查是否使用JS端GPU纹理上传 + _useJSTextureUpload = IsWorkerVideoUsingJSTextureUpload(_instanceId); + + // 获取共享缓冲区指针和大小 + _sharedYBuffer = GetWorkerVideoSharedYBuffer(_instanceId); + _sharedUBuffer = GetWorkerVideoSharedUBuffer(_instanceId); + _sharedVBuffer = GetWorkerVideoSharedVBuffer(_instanceId); + + _sharedYBufferSize = GetWorkerVideoSharedBufferSize(_instanceId, "Y"); + _sharedUBufferSize = GetWorkerVideoSharedBufferSize(_instanceId, "U"); + _sharedVBufferSize = GetWorkerVideoSharedBufferSize(_instanceId, "V"); + + if (_sharedYBuffer != System.IntPtr.Zero && _sharedUBuffer != System.IntPtr.Zero && _sharedVBuffer != System.IntPtr.Zero) + { + _sharedBuffersInitialized = true; + Log($"共享缓冲区初始化成功: Y({_sharedYBufferSize}), U({_sharedUBufferSize}), V({_sharedVBufferSize})"); + } + else + { + if (_useJSTextureUpload) + { + Log($"使用JS端GPU纹理上传,跳过C#端纹理处理"); + } + else + { + LogWarning($"共享缓冲区不可用,使用传统纹理上传方式"); + } + _sharedBuffersInitialized = true; // 设置为true以启用纹理上传逻辑 + } + } + catch (System.Exception e) + { + LogError($"初始化共享缓冲区异常: {e.Message}"); + } +#endif + } + + public void SetTextureIds(UnityEngine.Texture2D[] textures) + { +#if UNITY_WEBGL + if (_instanceId < 0 || textures == null || textures.Length < 3) + { + LogError("SetTextureIds: 参数无效"); + return; + } + + try + { + // 获取纹理的Native指针作为ID + int yTextureId = (int)textures[0].GetNativeTexturePtr(); + int uTextureId = (int)textures[1].GetNativeTexturePtr(); + int vTextureId = (int)textures[2].GetNativeTexturePtr(); + + // 传递给JSLIB + SetWorkerVideoTextureId(_instanceId, "Y", yTextureId); + SetWorkerVideoTextureId(_instanceId, "U", uTextureId); + SetWorkerVideoTextureId(_instanceId, "V", vTextureId); + + Log($"设置纹理ID成功: Y({yTextureId}), U({uTextureId}), V({vTextureId})"); + + // 如果共享缓冲区已初始化,开始纹理上传处理 + if (_sharedBuffersInitialized) + { + StartTextureUploadProcessing(textures); + } + } + catch (System.Exception e) + { + LogError($"SetTextureIds异常: {e.Message}"); + } +#endif + } + + private void StartTextureUploadProcessing(UnityEngine.Texture2D[] textures) + { +#if UNITY_WEBGL + if (!_sharedBuffersInitialized || textures == null || textures.Length < 3) + { + return; + } + + // 存储纹理引用,在DecodeNextFrame中处理纹理上传 + _textureReferences = textures; + Log($"纹理上传处理已启动,纹理数量: {textures.Length}"); +#endif + } + + + private unsafe void UploadTextureFromSharedBuffer(UnityEngine.Texture2D[] textures) + { +#if UNITY_WEBGL + if (!_sharedBuffersInitialized || textures == null || textures.Length < 3) + { + return; + } + + // 使用JS端GPU纹理上传,C#端不需要处理 + if (_useJSTextureUpload) + { + return; + } + + try + { + // 获取纹理尺寸 + int yWidth = GetWorkerVideoYTextureWidth(_instanceId); + int yHeight = GetWorkerVideoYTextureHeight(_instanceId); + int uvWidth = GetWorkerVideoUVTextureWidth(_instanceId); + int uvHeight = GetWorkerVideoUVTextureHeight(_instanceId); + + int ySize = yWidth * yHeight; + int uvSize = uvWidth * uvHeight; + + // 检查是否有共享缓冲区(已废弃,保留用于向后兼容) + if (_sharedYBuffer != System.IntPtr.Zero && _sharedUBuffer != System.IntPtr.Zero && _sharedVBuffer != System.IntPtr.Zero) + { + if (_sharedYBufferSize > 0) + { + NativeArray yData = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray( + (void*)_sharedYBuffer, _sharedYBufferSize, Allocator.None); + +#if ENABLE_UNITY_COLLECTIONS_CHECKS + NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref yData, AtomicSafetyHandle.Create()); +#endif + textures[0].SetPixelData(yData, 0); + } + + if (_sharedUBufferSize > 0) + { + NativeArray uData = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray( + (void*)_sharedUBuffer, _sharedUBufferSize, Allocator.None); + +#if ENABLE_UNITY_COLLECTIONS_CHECKS + NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref uData, AtomicSafetyHandle.Create()); +#endif + textures[1].SetPixelData(uData, 0); + } + + if (_sharedVBufferSize > 0) + { + NativeArray vData = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray( + (void*)_sharedVBuffer, _sharedVBufferSize, Allocator.None); + +#if ENABLE_UNITY_COLLECTIONS_CHECKS + NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref vData, AtomicSafetyHandle.Create()); +#endif + textures[2].SetPixelData(vData, 0); + } + + // 注意:不在这里调用Apply,统一在LateUpdate的DisplayFrameApply中执行 + // 这样可以让所有视频对象在同一时机上传GPU,减少CPU/GPU切换 + } + } + catch (System.Exception e) + { + LogError($"纹理上传失败: {e.Message}"); + } +#endif + } + + public int Init(NativeArray fileData, int beginFrameIndex = 1, bool syncDecodeFirstFrame = true, bool fastDecode = true) + { +#if UNITY_WEBGL + _videoData = fileData; +#endif + _fastDecode = fastDecode; + return InternalPlay(beginFrameIndex, syncDecodeFirstFrame); + } + + + public int InternalPlay(int beginFrameIndex = 1, bool syncDecodeFirstFrame = true) + { +#if UNITY_WEBGL + try + { + // 检查Worker系统是否准备就绪 + if (!_isWorkerSystemReady) + { + LogError("Worker系统未准备就绪,无法创建解码器"); + return -1; + } + + // 创建Worker视频实例 + _instanceId = CreateWorkerVideoInstance(); + if (_instanceId < 0) + { + LogError("创建Worker视频实例失败"); + return -1; + } + + // 注册实例 + _instances[_instanceId] = this; + + // 先设置改进的静态回调(传递instanceId参数),确保在数据处理前回调已就绪 + SetWorkerVideoStatusCallback(_instanceId, StaticOnStatusChanged); + SetWorkerVideoFirstFrameDisplayCallback(_instanceId, StaticOnFirstFrameDisplay); + + Log($"实例{_instanceId}回调设置完成,开始设置视频数据"); + + // 设置视频数据 + if (_videoData.IsCreated && _videoData.Length > 0) + { + // 将NativeArray转换为byte[] + byte[] dataArray = _videoData.ToArray(); + Log($"准备设置视频数据,大小: {dataArray.Length} bytes"); + bool setDataResult = SetWorkerVideoData(_instanceId, dataArray, dataArray.Length); + if (!setDataResult) + { + LogError("设置视频数据失败"); + return -1; + } + Log($"视频数据设置成功"); + } + else + { + LogError("视频数据无效"); + return -1; + } + + // 准备视频 + bool prepareResult = PrepareWorkerVideo(_instanceId, _fastDecode); + if (!prepareResult) + { + LogError("准备视频失败"); + return -1; + } + + // 开始播放 + bool playResult = PlayWorkerVideo(_instanceId); + if (!playResult) + { + LogError("开始播放失败"); + return -1; + } + + // 设置循环播放状态(在播放开始后设置) + if (_isLooping) + { + SetWorkerVideoLooping(_instanceId, _isLooping); + } + + if (beginFrameIndex > 1) + { + SeekToFrame(beginFrameIndex); + } + + _isInitialized = true; + _lastUploadedFrameIndex = -1; // 重置帧上传追踪 + Log($"Worker解码器初始化成功,ID: {_instanceId}, 数据大小: {_videoData.Length} bytes"); + return 0; + } + catch (Exception e) + { + LogError($"Worker解码器初始化异常: {e.Message}"); + return -1; + } +#else + return 0; +#endif + } + + public int DecodeNextFrame() + { +#if UNITY_WEBGL + // 如果正在销毁,立即返回 + if (_isDisposing) + { + return -1; + } + + if (!_isInitialized || _instanceId < 0 || !_isWorkerSystemReady) + { + return -1; + } + + // 只有在Playing状态时才执行Update + if (_currentStatus != VideoStatus.Playing) + { + // 非播放状态,返回0表示没有新帧但不是错误 + return 0; + } + + // Worker版本通过Update方法获取帧数据 + float deltaTime = Time.deltaTime * 1000; // 转换为毫秒 + bool updateResult = UpdateWorkerVideo(_instanceId, deltaTime); + + if (updateResult) + { + // 更新当前帧索引 + _decodedFrameIndex = GetWorkerVideoCurrentFrameIndex(_instanceId); + + // 只有当帧索引发生变化时,才上传新的纹理数据(避免重复上传同一帧) + if (_decodedFrameIndex != _lastUploadedFrameIndex && + _textureReferences != null && + _sharedBuffersInitialized) + { + try + { + UploadTextureFromSharedBuffer(_textureReferences); + _lastUploadedFrameIndex = _decodedFrameIndex; + // 注意:现在使用基于FPS的帧率控制,JS端会自动触发下一帧 + // 不需要再调用NotifyWorkerVideoTextureReady + } + catch (System.Exception e) + { + LogError($"DecodeNextFrame纹理上传异常: {e.Message}"); + } + } + + return 0; + } + else + { + return -1; + } +#else + return 0; +#endif + } + + public void InternalStop() + { +#if UNITY_WEBGL + // 如果正在销毁,跳过Stop调用(Dispose会处理) + if (_isDisposing) + { + Log($"实例{_instanceId}正在销毁,跳过InternalStop"); + return; + } + + if (_instanceId >= 0) + { + // 立即更新状态,防止DecodeNextFrame继续调用UpdateWorkerVideo + _currentStatus = VideoStatus.Stopped; + Log($"实例{_instanceId}状态立即设置为Stopped"); + + StopWorkerVideo(_instanceId); + } + _currentFrameData = System.IntPtr.Zero; + _lastUploadedFrameIndex = -1; // 重置帧上传追踪 +#endif + } + + + public int InternalRestart(NativeArray newData) + { +#if UNITY_WEBGL + if (_instanceId >= 0 && _isInitialized) + { + // 先停止当前播放 + StopWorkerVideo(_instanceId); + + // 清理旧的帧数据 + _currentFrameData = System.IntPtr.Zero; + _currentFrameWidth = 0; + _currentFrameHeight = 0; + _decodedFrameIndex = 0; + _lastUploadedFrameIndex = -1; // 重置帧上传追踪 + + // 重置AVFrame信息 + if (_videoFrame != null) + { + _videoFrame->width = 0; + _videoFrame->height = 0; + _videoFrame->linesize[0] = 0; + _videoFrame->linesize[1] = 0; + _videoFrame->linesize[2] = 0; + _videoFrame->pts = 0; + } + + _videoData = newData; + Log($"Worker解码器重启: 清理旧帧数据,新数据大小: {newData.Length} bytes"); + + // 设置新的视频数据 + byte[] dataArray = _videoData.ToArray(); + bool setDataResult = SetWorkerVideoData(_instanceId, dataArray, dataArray.Length); + if (!setDataResult) + { + LogError("重启时设置视频数据失败"); + return -1; + } + + // 重新准备和播放 + bool prepareResult = PrepareWorkerVideo(_instanceId, _fastDecode); + if (!prepareResult) + { + LogError("重启时准备视频失败"); + return -1; + } + + bool playResult = PlayWorkerVideo(_instanceId); + if (!playResult) + { + LogError("重启时开始播放失败"); + return -1; + } + + return 0; + } + else + { + // 如果decoder未初始化,重新创建 + Log($"Worker解码器重新创建: 数据大小: {newData.Length} bytes"); + _videoData = newData; + return InternalPlay(); + } +#else + return 0; +#endif + } + + public void Seek(double ms) + { +#if UNITY_WEBGL + if (_isInitialized && _instanceId >= 0 && _isWorkerSystemReady) + { + SeekWorkerVideo(_instanceId, (float)ms); + _lastUploadedFrameIndex = -1; // Seek后重置帧上传追踪,确保下一帧会被上传 + } +#endif + } + + public void SeekToFrame(long frame) + { +#if UNITY_WEBGL + if (_isInitialized && _instanceId >= 0 && _isWorkerSystemReady) + { + SeekWorkerVideoToFrame(_instanceId, (int)frame); + _lastUploadedFrameIndex = -1; // Seek后重置帧上传追踪,确保下一帧会被上传 + } +#endif + } + + // 获取当前帧的数据指针 + public System.IntPtr GetCurrentFrameDataPtr() + { +#if UNITY_WEBGL + return _currentFrameData; +#else + return System.IntPtr.Zero; +#endif + } + + // 获取当前帧尺寸 + public void GetCurrentFrameSize(out int width, out int height) + { +#if UNITY_WEBGL + width = _currentFrameWidth; + height = _currentFrameHeight; +#else + width = 0; + height = 0; +#endif + } + + // 获取解码器状态 + public int GetDecoderStatus() + { +#if UNITY_WEBGL + if (_instanceId >= 0 && _isWorkerSystemReady) + { + // 根据当前状态返回对应的状态码 + switch (_currentStatus) + { + case VideoStatus.Initialized: + return 0; // 停止状态 + case VideoStatus.Prepared: + return 1; // 准备中 + case VideoStatus.Playing: + return 2; // 播放中 + case VideoStatus.Paused: + return 1; // 暂停状态 + case VideoStatus.Stopped: + return 0; // 停止状态 + case VideoStatus.Error: + return -1; // 错误状态 + default: + return -1; + } + } + return -1; +#else + return 2; // 非WebGL平台默认返回已启动状态 +#endif + } + + // 等待解码器启动完成 + public bool WaitForStartComplete(float timeoutSeconds = 5.0f) + { +#if UNITY_WEBGL + if (_instanceId < 0 || !_isWorkerSystemReady) return false; + + float startTime = Time.time; + while (Time.time - startTime < timeoutSeconds) + { + int status = GetDecoderStatus(); + if (status == 2) // 已启动 + { + return true; + } + else if (status == -1) // 错误 + { + return false; + } + // 状态为0(停止)或1(启动中)时继续等待 + } + return false; // 超时 +#else + return true; // 非WebGL平台直接返回成功 +#endif + } + + public ref long GetDecodedFrameIndexRef() + { + return ref _decodedFrameIndex; + } + + // 暂停/恢复播放的公共方法 + public void Pause(bool pause) + { +#if UNITY_WEBGL + if (_instanceId >= 0 && _isWorkerSystemReady) + { + if (pause) + { + // 立即更新状态为暂停 + _currentStatus = VideoStatus.Paused; + Log($"实例{_instanceId}状态立即设置为Paused"); + PauseWorkerVideo(_instanceId); + } + else + { + // 恢复播放时,状态会通过Worker回调更新为Playing + ResumeWorkerVideo(_instanceId); + } + } +#endif + } + + public void CopyFrameDataToTextures(UnityEngine.Texture2D[] textures) + { + // Worker解码器在UploadTextureFromSharedBuffer中已经调用了SetPixelData + // 这里不需要额外操作 + } + + public void ApplyTextures(UnityEngine.Texture2D[] textures) + { +#if UNITY_WEBGL + // 使用JS端GPU纹理上传,C#端不需要调用Apply + if (_useJSTextureUpload) + { + return; + } + + // 统一在LateUpdate中执行Apply,避免多个视频对象频繁切换CPU/GPU + if (textures != null && textures.Length >= 3) + { + if (_sharedYBufferSize > 0) textures[0].Apply(false, false); + if (_sharedUBufferSize > 0) textures[1].Apply(false, false); + if (_sharedVBufferSize > 0) textures[2].Apply(false, false); + } +#endif + } + + public void Dispose() + { +#if UNITY_WEBGL + // 立即设置销毁标志,防止任何回调或异步操作继续执行 + _isDisposing = true; + + if (_instanceId >= 0) + { + // 立即更新状态,防止DecodeNextFrame继续调用UpdateWorkerVideo + _currentStatus = VideoStatus.Stopped; + Log($"实例{_instanceId}状态立即设置为Stopped (Dispose)"); + + // 从实例字典中移除,防止回调访问 + _instances.Remove(_instanceId); + + // 销毁Worker视频实例(这会发送DESTROY消息到worker,清理WASM资源) + DestroyWorkerVideo(_instanceId); + _instanceId = -1; + } + _isInitialized = false; + _isWorkerSystemReady = false; + _currentFrameData = System.IntPtr.Zero; + + // 【修复内存泄漏】清理SharedBuffer指针引用 + _sharedYBuffer = System.IntPtr.Zero; + _sharedUBuffer = System.IntPtr.Zero; + _sharedVBuffer = System.IntPtr.Zero; + _sharedBuffersInitialized = false; + + // 【修复内存泄漏】清理纹理引用 + _textureReferences = null; + + // 【修复内存泄漏】重置帧追踪 + _lastUploadedFrameIndex = -1; + + // 清理视频数据 + if (_videoData.IsCreated) + { + _videoData.Dispose(); + } + + // 清理定时器 + if (_statusCheckTimer != null) + { + _statusCheckTimer.Dispose(); + _statusCheckTimer = null; + } +#endif + if (_videoFrame != null) + { + Marshal.FreeHGlobal((System.IntPtr)_videoFrame); + _videoFrame = null; + } + } + + // 状态检查相关 + private System.Threading.Timer _statusCheckTimer; + + + private void ___unuseFunction() { OnFirstFrameDecoded?.Invoke(); } +} diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanWorkerDecoder.cs.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanWorkerDecoder.cs.meta new file mode 100644 index 0000000..0744084 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Platform/LeviathanWorkerDecoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 373be47a4cbf74440b38b8262a3b7ded +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader.meta new file mode 100644 index 0000000..2846056 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e114e8876509a14b8fae1de0eef5764 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P.shader b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P.shader new file mode 100644 index 0000000..ace4103 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P.shader @@ -0,0 +1,175 @@ +Shader "LeviathanVideo/YUV420P" +{ + Properties + { + [PerRendererData] _MainTex ("YTexture", 2D) = "white" {} + _UTex("UTexture",2D)="white"{} + _VTex("VTexture",2D)="white"{} + [Toggle]_ReverseY("Reverse Y",Float)=1 + + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + #if UNITY_VERSION < 202100 + inline half3 UIGammaToLinear(half3 value) + { + return value * (value * (value * 0.305306011h + 0.682171111h) + 0.012522878h); + } + #endif + + //Rec.709 + static const half3x3 YUV_TO_RGB = half3x3( + 1.16438, 1.16438, 1.16438, + 0.0, -0.21325, 2.11240, + 1.79274, -0.53291, 0.0 + ); + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + float4 mask : TEXCOORD2; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex,_UTex,_VTex; + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + float4 _MainTex_ST; + float _UIMaskSoftnessX; + float _UIMaskSoftnessY; + int _UIVertexColorAlwaysGammaSpace; + half _ReverseY; + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + float4 vPosition = UnityObjectToClipPos(v.vertex); + OUT.worldPosition = v.vertex; + OUT.vertex = vPosition; + + float2 pixelSize = vPosition.w; + pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + + float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + if (_ReverseY>0) + { + OUT.texcoord.y=1- OUT.texcoord.y; + } + OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + + + if (_UIVertexColorAlwaysGammaSpace) + { + if(!IsGammaSpace()) + { + v.color.rgb = UIGammaToLinear(v.color.rgb); + } + } + + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + //Round up the alpha color coming from the interpolator (to 1.0/256.0 steps) + //The incoming alpha could have numerical instability, which makes it very sensible to + //HDR color transparency blend, when it blends with the world's texture. + const half alphaPrecision = half(0xff); + const half invAlphaPrecision = half(1.0 / alphaPrecision); + IN.color.a = round(IN.color.a * alphaPrecision) * invAlphaPrecision; + half3 c = 0; + c.r = (tex2D(_MainTex, IN.texcoord)).a-(16/255.0); + c.g = (tex2D(_UTex, IN.texcoord) ).a-(128/255.0); + c.b = (tex2D(_VTex, IN.texcoord) ).a-(128/255.0); + c=mul(c,YUV_TO_RGB); + + half4 color = half4(c,IN.color.a); + color.rgb = saturate(color*_Color); +#ifdef UNITY_COLORSPACE_GAMMA +#else + color.rgb = pow(color.rgb, 2.2); +#endif + + #ifdef UNITY_UI_CLIP_RECT + half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); + color.a *= m.x * m.y; + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (color.a - 0.001); + #endif + + return color * IN.color; + } + ENDCG + } + } +} diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P.shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P.shader.meta new file mode 100644 index 0000000..5067ee1 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: beb8b637c3a75a24aa0de903c96638e1 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D.shader b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D.shader new file mode 100644 index 0000000..1c36289 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D.shader @@ -0,0 +1,106 @@ +Shader "LeviathanVideo/YUV420P_3D" +{ + Properties + { + _MainTex ("YTexture", 2D) = "white" {} + _UTex("UTexture",2D)="white"{} + _VTex("VTexture",2D)="white"{} + [Toggle]_ReverseY("Reverse Y",Float)=1 + + _Color ("Tint", Color) = (1,1,1,1) + + [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull Mode", Float) = 2 + [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Float) = 1 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + } + + Cull [_Cull] + Lighting Off + ZWrite [_ZWrite] + ZTest [_ZTest] + Blend SrcAlpha OneMinusSrcAlpha + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + + //Rec.709 + static const half3x3 YUV_TO_RGB = half3x3( + 1.16438, 1.16438, 1.16438, + 0.0, -0.21325, 2.11240, + 1.79274, -0.53291, 0.0 + ); + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex,_UTex,_VTex; + fixed4 _Color; + float4 _MainTex_ST; + half _ReverseY; + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + OUT.vertex = UnityObjectToClipPos(v.vertex); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + if (_ReverseY > 0) + { + OUT.texcoord.y = 1 - OUT.texcoord.y; + } + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + half3 c = 0; + c.r = (tex2D(_MainTex, IN.texcoord)).a - (16/255.0); + c.g = (tex2D(_UTex, IN.texcoord)).a - (128/255.0); + c.b = (tex2D(_VTex, IN.texcoord)).a - (128/255.0); + c = mul(c, YUV_TO_RGB); + + half4 color = half4(c, IN.color.a); + color.rgb = saturate(color * _Color); +#ifdef UNITY_COLORSPACE_GAMMA +#else + color.rgb = pow(color.rgb, 2.2); +#endif + + return color * IN.color; + } + ENDCG + } + } +} + diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D.shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D.shader.meta new file mode 100644 index 0000000..cad6885 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a815bdc14ea584c4b82c5cf38992fc18 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Bottom.shader b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Bottom.shader new file mode 100644 index 0000000..ca8a6a4 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Bottom.shader @@ -0,0 +1,121 @@ +Shader "LeviathanVideo/YUV420P_3D_Alpha_Bottom" +{ + Properties + { + _MainTex ("YTexture", 2D) = "white" {} + _UTex("UTexture",2D)="white"{} + _VTex("VTexture",2D)="white"{} + [Toggle]_ReverseY("Reverse Y",Float)=1 + + _Color ("Tint", Color) = (1,1,1,1) + + [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull Mode", Float) = 2 + [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Float) = 1 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + } + + Cull [_Cull] + Lighting Off + ZWrite [_ZWrite] + ZTest [_ZTest] + Blend SrcAlpha OneMinusSrcAlpha + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + + //Rec.709 + static const half3x3 YUV_TO_RGB = half3x3( + 1.16438, 1.16438, 1.16438, + 0.0, -0.21325, 2.11240, + 1.79274, -0.53291, 0.0 + ); + static const float FLOAT_16_255 = 16.0 / 255.0; + static const float FLOAT_128_255 = 128.0 / 255.0; + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex,_UTex,_VTex; + fixed4 _Color; + float4 _MainTex_ST; + half _ReverseY; + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + OUT.vertex = UnityObjectToClipPos(v.vertex); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + if (_ReverseY > 0) + { + OUT.texcoord.y = 1 - OUT.texcoord.y; + } + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + half3 c = 0; + half2 uv = IN.texcoord; + // 上半部分是颜色,下半部分是Alpha + half2 uv1 = half2(uv.x, uv.y * 0.5); + half2 uv2 = half2(uv.x, uv.y * 0.5 + 0.5); + + c.r = tex2D(_MainTex, uv1).a - FLOAT_16_255; + c.g = tex2D(_UTex, uv1).a - FLOAT_128_255; + c.b = tex2D(_VTex, uv1).a - FLOAT_128_255; + c = mul(c, YUV_TO_RGB); + + half3 ca = 0; + ca.r = tex2D(_MainTex, uv2).a - FLOAT_16_255; + ca.g = tex2D(_UTex, uv2).a - FLOAT_128_255; + ca.b = 1; + ca = mul(ca, YUV_TO_RGB); + c /= clamp(ca.b, 0.01, 1); + c = saturate(c); + + half4 color = half4(c, ca.b); +#ifdef UNITY_COLORSPACE_GAMMA +#else + color.rgb = pow(color.rgb, 2.2); +#endif + color.rgb = color.rgb * _Color.rgb; + + return color * IN.color; + } + ENDCG + } + } +} + diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Bottom.shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Bottom.shader.meta new file mode 100644 index 0000000..c516093 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Bottom.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9944e974099a00445a9a47d663f3223f +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Right.shader b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Right.shader new file mode 100644 index 0000000..a56163b --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Right.shader @@ -0,0 +1,123 @@ +Shader "LeviathanVideo/YUV420P_3D_Alpha_Right" +{ + Properties + { + _MainTex ("YTexture", 2D) = "white" {} + _UTex("UTexture",2D)="white"{} + _VTex("VTexture",2D)="white"{} + [Toggle]_ReverseY("Reverse Y",Float)=1 + + _Color ("Tint", Color) = (1,1,1,1) + _ValidWidthRatio ("ValidWidthRatio", Float) = 1 + + [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull Mode", Float) = 2 + [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Float) = 1 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + } + + Cull [_Cull] + Lighting Off + ZWrite [_ZWrite] + ZTest [_ZTest] + Blend SrcAlpha OneMinusSrcAlpha + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + + //Rec.709 + static const half3x3 YUV_TO_RGB = half3x3( + 1.16438, 1.16438, 1.16438, + 0.0, -0.21325, 2.11240, + 1.79274, -0.53291, 0.0 + ); + static const float FLOAT_16_255 = 16.0 / 255.0; + static const float FLOAT_128_255 = 128.0 / 255.0; + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex,_UTex,_VTex; + fixed4 _Color; + float4 _MainTex_ST; + float _ValidWidthRatio; + half _ReverseY; + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + OUT.vertex = UnityObjectToClipPos(v.vertex); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + if (_ReverseY > 0) + { + OUT.texcoord.y = 1 - OUT.texcoord.y; + } + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + half3 c = 0; + half2 uv = IN.texcoord; + half ratio = 0.5 * _ValidWidthRatio; + half2 uv1 = half2(uv.x * ratio, uv.y); + half2 uv2 = half2(uv.x * ratio + ratio, uv.y); + + c.r = tex2D(_MainTex, uv1).a - FLOAT_16_255; + c.g = tex2D(_UTex, uv1).a - FLOAT_128_255; + c.b = tex2D(_VTex, uv1).a - FLOAT_128_255; + c = mul(c, YUV_TO_RGB); + + half3 ca = 0; + ca.r = tex2D(_MainTex, uv2).a - FLOAT_16_255; + ca.g = tex2D(_UTex, uv2).a - FLOAT_128_255; + ca.b = 1; + ca = mul(ca, YUV_TO_RGB); + c /= clamp(ca.b, 0.01, 1); + c = saturate(c); + + half4 color = half4(c, ca.b); +#ifdef UNITY_COLORSPACE_GAMMA +#else + color.rgb = pow(color.rgb, 2.2); +#endif + color.rgb = color.rgb * _Color.rgb; + + return color * IN.color; + } + ENDCG + } + } +} + diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Right.shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Right.shader.meta new file mode 100644 index 0000000..0e32fc7 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_Alpha_Right.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0b0f65a064460c54b93e5f72956880b9 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_ChromaKey.shader b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_ChromaKey.shader new file mode 100644 index 0000000..66205e3 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_ChromaKey.shader @@ -0,0 +1,184 @@ +Shader "LeviathanVideo/YUV420P_3D_ChromaKey" +{ + Properties + { + _MainTex ("YTexture", 2D) = "white" {} + _UTex("UTexture",2D)="white"{} + _VTex("VTexture",2D)="white"{} + [Toggle]_ReverseY("Reverse Y",Float)=1 + + _Color ("Tint", Color) = (1,1,1,1) + + _KeyColor("KeyColor", Color) = (0,1,0,0) + _ColorCutoff("Cutoff", Range(0, 1)) = 0.2 + _ColorFeathering("ColorFeathering", Range(0, 1)) = 0.33 + _MaskFeathering("MaskFeathering", Range(0, 1)) = 1 + _Sharpening("Sharpening", Range(0, 1)) = 0.5 + + [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull Mode", Float) = 2 + [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Float) = 1 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + } + + Cull [_Cull] + Lighting Off + ZWrite [_ZWrite] + ZTest [_ZTest] + Blend SrcAlpha OneMinusSrcAlpha + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + + //Rec.709 + static const half3x3 YUV_TO_RGB = half3x3( + 1.16438, 1.16438, 1.16438, + 0.0, -0.21325, 2.11240, + 1.79274, -0.53291, 0.0 + ); + static const float FLOAT_16_255 = 16.0 / 255.0; + static const float FLOAT_128_255 = 128.0 / 255.0; + + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex,_UTex,_VTex; + fixed4 _Color; + float4 _MainTex_ST; + half _ReverseY; + + float4 _MainTex_TexelSize; + float4 _KeyColor; + float _ColorCutoff; + float _ColorFeathering; + float _MaskFeathering; + float _Sharpening; + + float rgb2y(float3 c) + { + return (0.299*c.r + 0.587*c.g + 0.114*c.b); + } + + float rgb2cb(float3 c) + { + return (0.5 + -0.168736*c.r - 0.331264*c.g + 0.5*c.b); + } + + float rgb2cr(float3 c) + { + return (0.5 + 0.5*c.r - 0.418688*c.g - 0.081312*c.b); + } + + float colorclose(float Cb_p, float Cr_p, float Cb_key, float Cr_key, float tola, float tolb) + { + float temp = (Cb_key-Cb_p)*(Cb_key-Cb_p)+(Cr_key-Cr_p)*(Cr_key-Cr_p); + float tola2 = tola*tola; + float tolb2 = tolb*tolb; + if (temp < tola2) return (0); + if (temp < tolb2) return (temp-tola2)/(tolb2-tola2); + return (1); + } + + half3 getRGB(sampler2D tex1, sampler2D tex2, sampler2D tex3, float2 uv) + { + half3 c = 0; + c.r = tex2D(tex1, uv).a - FLOAT_16_255; + c.g = tex2D(tex2, uv).a - FLOAT_128_255; + c.b = tex2D(tex3, uv).a - FLOAT_128_255; + c = mul(c, YUV_TO_RGB); + return c; + } + + float maskedTex2D(sampler2D tex1, sampler2D tex2, sampler2D tex3, float2 uv) + { + float4 color = float4(getRGB(tex1, tex2, tex3, uv), 1.0); + + // Chroma key to CYK conversion + float key_cb = rgb2cb(_KeyColor.rgb); + float key_cr = rgb2cr(_KeyColor.rgb); + float pix_cb = rgb2cb(color.rgb); + float pix_cr = rgb2cr(color.rgb); + + return colorclose(pix_cb, pix_cr, key_cb, key_cr, _ColorCutoff, _ColorFeathering); + } + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + OUT.vertex = UnityObjectToClipPos(v.vertex); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + if (_ReverseY > 0) + { + OUT.texcoord.y = 1 - OUT.texcoord.y; + } + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + half4 color = half4(getRGB(_MainTex, _UTex, _VTex, IN.texcoord), IN.color.a); + color.rgb = saturate(color * _Color); +#ifdef UNITY_COLORSPACE_GAMMA +#else + color.rgb = pow(color.rgb, 2.2); +#endif + + // Get pixel width + float2 pixelWidth = float2(1.0 / _MainTex_TexelSize.z, 0); + float2 pixelHeight = float2(0, 1.0 / _MainTex_TexelSize.w); + + // Unfeathered mask + float mask = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord); + + // Feathering & smoothing + float c = mask; + float r = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord + pixelWidth); + float l = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord - pixelWidth); + float d = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord + pixelHeight); + float u = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord - pixelHeight); + float rd = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord + pixelWidth + pixelHeight) * .707; + float dl = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord - pixelWidth + pixelHeight) * .707; + float lu = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord - pixelHeight - pixelWidth) * .707; + float ur = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord + pixelWidth - pixelHeight) * .707; + float blurContribution = (r + l + d + u + rd + dl + lu + ur + c) * 0.12774655; + float smoothedMask = smoothstep(_Sharpening, 1, lerp(c, blurContribution, _MaskFeathering)); + float4 result = color * smoothedMask; + + return float4(result.xyz, smoothedMask) * IN.color; + } + ENDCG + } + } +} + diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_ChromaKey.shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_ChromaKey.shader.meta new file mode 100644 index 0000000..1119de4 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_3D_ChromaKey.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4f3d30338e3677045a6f721dedfee089 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Bottom.shader b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Bottom.shader new file mode 100644 index 0000000..d79e401 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Bottom.shader @@ -0,0 +1,188 @@ +Shader "LeviathanVideo/YUV420P_Alpha_Bottom" +{ + Properties + { + [PerRendererData] _MainTex ("YTexture", 2D) = "white" {} + _UTex("UTexture",2D)="white"{} + _VTex("VTexture",2D)="white"{} + [Toggle]_ReverseY("Reverse Y",Float)=1 + + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + #if UNITY_VERSION < 202100 + inline half3 UIGammaToLinear(half3 value) + { + return value * (value * (value * 0.305306011h + 0.682171111h) + 0.012522878h); + } + #endif + + //Rec.709 + static const half3x3 YUV_TO_RGB = half3x3( + 1.16438, 1.16438, 1.16438, + 0.0, -0.21325, 2.11240, + 1.79274, -0.53291, 0.0 + ); + static const float FLOAT_16_255 = 16.0 / 255.0; + static const float FLOAT_128_255 = 128.0 / 255.0; + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + float4 mask : TEXCOORD2; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex,_UTex,_VTex; + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + float4 _MainTex_ST; + float _UIMaskSoftnessX; + float _UIMaskSoftnessY; + int _UIVertexColorAlwaysGammaSpace; + half _ReverseY; + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + float4 vPosition = UnityObjectToClipPos(v.vertex); + OUT.worldPosition = v.vertex; + OUT.vertex = vPosition; + + float2 pixelSize = vPosition.w; + pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + + float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + if (_ReverseY>0) + { + OUT.texcoord.y=1- OUT.texcoord.y; + } + OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + + + if (_UIVertexColorAlwaysGammaSpace) + { + if(!IsGammaSpace()) + { + v.color.rgb = UIGammaToLinear(v.color.rgb); + } + } + + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + //Round up the alpha color coming from the interpolator (to 1.0/256.0 steps) + //The incoming alpha could have numerical instability, which makes it very sensible to + //HDR color transparency blend, when it blends with the world's texture. + + const half alphaPrecision = half(0xff); + const half invAlphaPrecision = half(1.0 / alphaPrecision); + IN.color.a = round(IN.color.a * alphaPrecision) * invAlphaPrecision; + half3 c = 0; + half2 uv=IN.texcoord; + half2 uv1=half2(uv.x,uv.y*0.5); + half2 uv2=half2(uv.x,uv.y*0.5+0.5); + + c.r = tex2D(_MainTex, uv1).a - FLOAT_16_255; + c.g = tex2D(_UTex,uv1).a - FLOAT_128_255; + c.b = tex2D(_VTex, uv1).a - FLOAT_128_255; + c=mul(c,YUV_TO_RGB); + + half3 ca=0; + ca.r = tex2D(_MainTex, uv2).a - FLOAT_16_255; + ca.g = tex2D(_UTex, uv2).a - FLOAT_128_255; + ca.b = 1; + ca=mul(ca,YUV_TO_RGB); + c/=clamp(ca.b,0.01,1); + c=saturate(c); + half4 color = half4(c,ca.b); +#ifdef UNITY_COLORSPACE_GAMMA +#else + color.rgb = pow(color.rgb, 2.2); +#endif + color.rgb = color.rgb*_Color.rgb; + + #ifdef UNITY_UI_CLIP_RECT + half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); + color.a *= m.x * m.y; + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (color.a - 0.001); + #endif + + return color * IN.color; + } + ENDCG + } + } +} diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Bottom.shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Bottom.shader.meta new file mode 100644 index 0000000..18d731c --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Bottom.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7cb92b36c7d519d4a8aea09d292561be +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Right.shader b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Right.shader new file mode 100644 index 0000000..026e5ae --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Right.shader @@ -0,0 +1,191 @@ +Shader "LeviathanVideo/YUV420P_Alpha_Right" +{ + Properties + { + [PerRendererData] _MainTex ("YTexture", 2D) = "white" {} + _UTex("UTexture",2D)="white"{} + _VTex("VTexture",2D)="white"{} + [Toggle]_ReverseY("Reverse Y",Float)=1 + + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + _ValidWidthRatio ("ValidWidthRatio", Float) = 1 + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + #if UNITY_VERSION < 202100 + inline half3 UIGammaToLinear(half3 value) + { + return value * (value * (value * 0.305306011h + 0.682171111h) + 0.012522878h); + } + #endif + + //Rec.709 + static const half3x3 YUV_TO_RGB = half3x3( + 1.16438, 1.16438, 1.16438, + 0.0, -0.21325, 2.11240, + 1.79274, -0.53291, 0.0 + ); + static const float FLOAT_16_255 = 16.0 / 255.0; + static const float FLOAT_128_255 = 128.0 / 255.0; + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + float4 mask : TEXCOORD2; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex,_UTex,_VTex; + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + float4 _MainTex_ST; + float _UIMaskSoftnessX; + float _UIMaskSoftnessY; + float _ValidWidthRatio; + int _UIVertexColorAlwaysGammaSpace; + half _ReverseY; + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + float4 vPosition = UnityObjectToClipPos(v.vertex); + OUT.worldPosition = v.vertex; + OUT.vertex = vPosition; + + float2 pixelSize = vPosition.w; + pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + + float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + if (_ReverseY>0) + { + OUT.texcoord.y=1- OUT.texcoord.y; + } + OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + + + if (_UIVertexColorAlwaysGammaSpace) + { + if(!IsGammaSpace()) + { + v.color.rgb = UIGammaToLinear(v.color.rgb); + } + } + + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + //Round up the alpha color coming from the interpolator (to 1.0/256.0 steps) + //The incoming alpha could have numerical instability, which makes it very sensible to + //HDR color transparency blend, when it blends with the world's texture. + + const half alphaPrecision = half(0xff); + const half invAlphaPrecision = half(1.0 / alphaPrecision); + IN.color.a = round(IN.color.a * alphaPrecision) * invAlphaPrecision; + half3 c = 0; + half2 uv=IN.texcoord; + half ratio = 0.5 * _ValidWidthRatio; + half2 uv1=half2(uv.x*ratio,uv.y); + half2 uv2=half2(uv.x*ratio+ratio,uv.y); + + c.r = tex2D(_MainTex, uv1).a - FLOAT_16_255; + c.g = tex2D(_UTex,uv1).a - FLOAT_128_255; + c.b = tex2D(_VTex, uv1).a - FLOAT_128_255; + c=mul(c,YUV_TO_RGB); + + half3 ca=0; + ca.r = tex2D(_MainTex, uv2).a - FLOAT_16_255; + ca.g = tex2D(_UTex, uv2).a - FLOAT_128_255; + ca.b = 1; + ca=mul(ca,YUV_TO_RGB); + c/=clamp(ca.b,0.01,1); + c=saturate(c); + half4 color = half4(c,ca.b); +#ifdef UNITY_COLORSPACE_GAMMA +#else + color.rgb = pow(color.rgb, 2.2); +#endif + color.rgb = color.rgb*_Color.rgb; + + #ifdef UNITY_UI_CLIP_RECT + half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); + color.a *= m.x * m.y; + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (color.a - 0.001); + #endif + + return color * IN.color; + } + ENDCG + } + } +} diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Right.shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Right.shader.meta new file mode 100644 index 0000000..9bea87a --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_Alpha_Right.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 527483c5bc98511428b82fedf30210a6 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_ChromaKey.shader b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_ChromaKey.shader new file mode 100644 index 0000000..a9b674f --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_ChromaKey.shader @@ -0,0 +1,265 @@ +Shader "LeviathanVideo/YUV420P_ChromaKey" +{ + Properties + { + [PerRendererData] _MainTex ("YTexture", 2D) = "white" {} + _UTex("UTexture",2D)="white"{} + _VTex("VTexture",2D)="white"{} + [Toggle]_ReverseY("Reverse Y",Float)=1 + + _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + + _KeyColor("KeyColor", Color) = (0,1,0,0) + _ColorCutoff("Cutoff", Range(0, 1)) = 0.2 + _ColorFeathering("ColorFeathering", Range(0, 1)) = 0.33 + _MaskFeathering("MaskFeathering", Range(0, 1)) = 1 + _Sharpening("Sharpening", Range(0, 1)) = 0.5 + + // despill 滤镜主要是处理前景由于蓝色或者绿色背景映射的光,比如我们在摄影棚拍摄绿色背景的图片的时候,有的时候会发现人物身上会反射有绿光,此时可以这个滤镜进行处理。 + // _Despill("DespillStrength", Range(0, 1)) = 1 + // _DespillLuminanceAdd("DespillLuminanceAdd", Range(0, 1)) = 0.2 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Blend SrcAlpha OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + Name "Default" + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile_local _ UNITY_UI_CLIP_RECT + #pragma multi_compile_local _ UNITY_UI_ALPHACLIP + + #if UNITY_VERSION < 202100 + inline half3 UIGammaToLinear(half3 value) + { + return value * (value * (value * 0.305306011h + 0.682171111h) + 0.012522878h); + } + #endif + + //Rec.709 + static const half3x3 YUV_TO_RGB = half3x3( + 1.16438, 1.16438, 1.16438, + 0.0, -0.21325, 2.11240, + 1.79274, -0.53291, 0.0 + ); + static const float FLOAT_16_255 = 16.0 / 255.0; + static const float FLOAT_128_255 = 128.0 / 255.0; + struct appdata_t + { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 worldPosition : TEXCOORD1; + float4 mask : TEXCOORD2; + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex,_UTex,_VTex; + fixed4 _Color; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + float4 _MainTex_ST; + float _UIMaskSoftnessX; + float _UIMaskSoftnessY; + int _UIVertexColorAlwaysGammaSpace; + half _ReverseY; + + float4 _MainTex_TexelSize; + float4 _KeyColor; + float _ColorCutoff; + float _ColorFeathering; + float _MaskFeathering; + float _Sharpening; + // float _Despill; + // float _DespillLuminanceAdd; + + float rgb2y(float3 c) + { + return (0.299*c.r + 0.587*c.g + 0.114*c.b); + } + + float rgb2cb(float3 c) + { + return (0.5 + -0.168736*c.r - 0.331264*c.g + 0.5*c.b); + } + + float rgb2cr(float3 c) + { + return (0.5 + 0.5*c.r - 0.418688*c.g - 0.081312*c.b); + } + + float colorclose(float Cb_p, float Cr_p, float Cb_key, float Cr_key, float tola, float tolb) + { + float temp = (Cb_key-Cb_p)*(Cb_key-Cb_p)+(Cr_key-Cr_p)*(Cr_key-Cr_p); + float tola2 = tola*tola; + float tolb2 = tolb*tolb; + if (temp < tola2) return (0); + if (temp < tolb2) return (temp-tola2)/(tolb2-tola2); + return (1); + } + + + half3 getRGB(sampler2D tex1, sampler2D tex2, sampler2D tex3, float2 uv) + { + half3 c = 0; + c.r = tex2D(tex1, uv).a - FLOAT_16_255; + c.g = tex2D(tex2, uv).a - FLOAT_128_255; + c.b = tex2D(tex3, uv).a - FLOAT_128_255; + c=mul(c, YUV_TO_RGB); + return c; + } + + float maskedTex2D(sampler2D tex1, sampler2D tex2, sampler2D tex3, float2 uv) + { + float4 color = float4(getRGB(tex1, tex2, tex3, uv), 1.0); + + // Chroma key to CYK conversion + float key_cb = rgb2cb(_KeyColor.rgb); + float key_cr = rgb2cr(_KeyColor.rgb); + float pix_cb = rgb2cb(color.rgb); + float pix_cr = rgb2cr(color.rgb); + + return colorclose(pix_cb, pix_cr, key_cb, key_cr, _ColorCutoff, _ColorFeathering); + } + + + v2f vert(appdata_t v) + { + v2f OUT; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + float4 vPosition = UnityObjectToClipPos(v.vertex); + OUT.worldPosition = v.vertex; + OUT.vertex = vPosition; + + float2 pixelSize = vPosition.w; + pixelSize /= float2(1, 1) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + + float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + float2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + OUT.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex); + if (_ReverseY>0) + { + OUT.texcoord.y=1- OUT.texcoord.y; + } + OUT.mask = float4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + + + if (_UIVertexColorAlwaysGammaSpace) + { + if(!IsGammaSpace()) + { + v.color.rgb = UIGammaToLinear(v.color.rgb); + } + } + + OUT.color = v.color * _Color; + return OUT; + } + + fixed4 frag(v2f IN) : SV_Target + { + const half alphaPrecision = half(0xff); + const half invAlphaPrecision = half(1.0 / alphaPrecision); + IN.color.a = round(IN.color.a * alphaPrecision) * invAlphaPrecision; + + half4 color = half4(getRGB(_MainTex, _UTex, _VTex, IN.texcoord), IN.color.a); + color.rgb = saturate(color*_Color); +#ifdef UNITY_COLORSPACE_GAMMA +#else + color.rgb = pow(color.rgb, 2.2); +#endif + + // Get pixel width + float2 pixelWidth = float2(1.0 / _MainTex_TexelSize.z, 0); + float2 pixelHeight = float2(0, 1.0 / _MainTex_TexelSize.w); + + // Unfeathered mask + float mask = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord); + + // Feathering & smoothing + float c = mask; + float r = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord + pixelWidth); + float l = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord - pixelWidth); + float d = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord + pixelHeight); + float u = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord - pixelHeight); + float rd = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord + pixelWidth + pixelHeight) * .707; + float dl = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord - pixelWidth + pixelHeight) * .707; + float lu = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord - pixelHeight - pixelWidth) * .707; + float ur = maskedTex2D(_MainTex, _UTex, _VTex, IN.texcoord + pixelWidth - pixelHeight) * .707; + float blurContribution = (r + l + d + u + rd + dl + lu + ur + c) * 0.12774655; + float smoothedMask = smoothstep(_Sharpening, 1, lerp(c, blurContribution, _MaskFeathering)); + float4 result = color * smoothedMask; + + // Despill + // float v = (2*result.b+result.r)/4; + // if(result.g > v) result.g = lerp(result.g, v, _Despill); + // float4 dif = (color - result); + // float desaturatedDif = rgb2y(dif.xyz); + // result += lerp(0, desaturatedDif, _DespillLuminanceAdd); + + #ifdef UNITY_UI_CLIP_RECT + half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); + smoothedMask *= m.x * m.y; + #endif + + #ifdef UNITY_UI_ALPHACLIP + clip (smoothedMask - 0.001); + #endif + + return float4(result.xyz, smoothedMask) * IN.color; + } + ENDCG + } + } +} diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_ChromaKey.shader.meta b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_ChromaKey.shader.meta new file mode 100644 index 0000000..ade4c93 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/Shader/YUV420P_ChromaKey.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c036bf8d3c966a94ca7dec96182b86b5 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/package.json b/sdk-intergration/LocalPackages/LeviathanVideo/package.json new file mode 100644 index 0000000..7d9e4aa --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/package.json @@ -0,0 +1,7 @@ +{ + "name": "com.tuyoo.leviathan.video", + "displayName": "Tuyoo Leviathan Video", + "description": "", + "version": "1.0.0", + "unity": "2022.3" +} \ No newline at end of file diff --git a/sdk-intergration/LocalPackages/LeviathanVideo/package.json.meta b/sdk-intergration/LocalPackages/LeviathanVideo/package.json.meta new file mode 100644 index 0000000..c599576 --- /dev/null +++ b/sdk-intergration/LocalPackages/LeviathanVideo/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 82d7eef3219005843967c5cd4db6307a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/sdk-intergration/Packages/manifest.json b/sdk-intergration/Packages/manifest.json index 9e4515f..e1bb17a 100644 --- a/sdk-intergration/Packages/manifest.json +++ b/sdk-intergration/Packages/manifest.json @@ -2,6 +2,7 @@ "dependencies": { "com.github.skistua.unity-vimeditor": "https://gitee.com/b166er/unity-vimeditor.git", "com.neuecc.unirx": "file:../LocalPackages/com.neuecc.unirx", + "com.tuyoo.leviathan.video": "file:../LocalPackages/LeviathanVideo", "com.playfab": "file:../LocalPackages/PlayFabSDK", "com.unity.addressables": "1.22.3", "com.unity.collab-proxy": "2.7.1", diff --git a/sdk-intergration/Packages/packages-lock.json b/sdk-intergration/Packages/packages-lock.json index 21bd15e..e0ddaad 100644 --- a/sdk-intergration/Packages/packages-lock.json +++ b/sdk-intergration/Packages/packages-lock.json @@ -13,6 +13,12 @@ "source": "local", "dependencies": {} }, + "com.tuyoo.leviathan.video": { + "version": "file:../LocalPackages/LeviathanVideo", + "depth": 0, + "source": "local", + "dependencies": {} + }, "com.playfab": { "version": "file:../LocalPackages/PlayFabSDK", "depth": 0,