using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using FFmpeg.AutoGen;
namespace ADOFAIRenderer.Data;
///
/// Video codec of the output. The encoder implementation (hardware or software) is chosen at run time from the
/// encoders available for the codec (VideoEncoder, GPUUtil.GetPrioritizedEncoders).
/// Values: H264 (H.264 / AVC), H265 (H.265 / HEVC), VP9, AV1, VVC (H.266).
/// The audio codec paired with each value is given by CodecUtil.AudioCodecMatch.
///
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum Codec
{
H264, H265, VP9, AV1, VVC
}
/// Audio codec choice and supported sample rates per video codec.
internal static class CodecUtil
{
/// Audio codec encoded together with each video codec (AAC for H.264/H.265, Opus for the others).
public static readonly Dictionary AudioCodecMatch = new()
{
[Codec.H264] = AVCodecID.AV_CODEC_ID_AAC,
[Codec.H265] = AVCodecID.AV_CODEC_ID_AAC,
[Codec.VP9] = AVCodecID.AV_CODEC_ID_OPUS,
[Codec.AV1] = AVCodecID.AV_CODEC_ID_OPUS,
[Codec.VVC] = AVCodecID.AV_CODEC_ID_OPUS
};
///
/// Output sample rates (Hz) the mod allows per audio codec. RenderManager.SetupPlay replaces a configured rate that
/// is not in the list with 48000 Hz.
///
public static readonly Dictionary> AvailableSampleRate = new()
{
[AVCodecID.AV_CODEC_ID_AAC] = new List { 44100, 48000, 96000 },
[AVCodecID.AV_CODEC_ID_OPUS] = new List { 48000 }
};
}