Files
ersatztv/ErsatzTV.FFmpeg/Format/AvailablePixelFormats.cs
T
Jason DoveandGitHub c02b83d0d6 code cleanup (#743)
* update tools

* run code cleanup

* update dependencies
2022-04-19 17:47:18 -05:00

23 lines
835 B
C#

using Microsoft.Extensions.Logging;
namespace ErsatzTV.FFmpeg.Format;
public static class AvailablePixelFormats
{
public static Option<IPixelFormat> ForPixelFormat(string pixelFormat, ILogger logger) =>
pixelFormat switch
{
PixelFormat.YUV420P => new PixelFormatYuv420P(),
PixelFormat.YUV420P10LE => new PixelFormatYuv420P10Le(),
PixelFormat.YUVJ420P => new PixelFormatYuvJ420P(),
PixelFormat.YUV444P => new PixelFormatYuv444P(),
_ => LogUnknownPixelFormat(pixelFormat, logger)
};
private static Option<IPixelFormat> LogUnknownPixelFormat(string pixelFormat, ILogger logger)
{
logger.LogWarning("Unexpected pixel format {PixelFormat} may have playback issues", pixelFormat);
return Option<IPixelFormat>.None;
}
}