Files
ersatztv/ErsatzTV.FFmpeg/Decoder/DecoderVaapi.cs
T
Jason DoveandGitHub 70c4036dc9 fix ten bit source and destination with segmenter v2 (#1633)
* fix software and vaapi 10 bit content

* fix nvidia 10 bit content

* some qsv improvements
2024-03-04 15:29:45 -06:00

25 lines
839 B
C#

using ErsatzTV.FFmpeg.Format;
namespace ErsatzTV.FFmpeg.Decoder;
public class DecoderVaapi : DecoderBase
{
protected override FrameDataLocation OutputFrameDataLocation => FrameDataLocation.Hardware;
public override string Name => "implicit_vaapi";
public override string[] InputOptions(InputFile inputFile) =>
new[] { "-hwaccel_output_format", "vaapi" };
public override FrameState NextState(FrameState currentState)
{
FrameState nextState = base.NextState(currentState);
return currentState.PixelFormat.Match(
pixelFormat => pixelFormat.BitDepth == 8
? nextState with { PixelFormat = new PixelFormatNv12(pixelFormat.Name) }
: nextState with { PixelFormat = new PixelFormatVaapi(pixelFormat.Name, 10) },
() => nextState);
}
}