Files
ersatztv/ErsatzTV.FFmpeg/Format/AvailablePixelFormats.cs
T
Jason DoveandGitHub c96b800b52 ffmpeg lib fixes (#633)
* try to fix vaapi inconsistencies

* log unexpected data

* vaapi fixes

* disable 444 test

* add qsv deinterlace filter; qsv fixes

* add videotoolbox acceleration
2022-02-14 22:01:26 -06:00

26 lines
870 B
C#

using LanguageExt;
using Microsoft.Extensions.Logging;
namespace ErsatzTV.FFmpeg.Format;
public static class AvailablePixelFormats
{
public static Option<IPixelFormat> ForPixelFormat(string pixelFormat, ILogger logger)
{
return 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;
}
}