* upgrade sdk * fix warnings in ersatztv.ffmpeg * fix warnings in ersatztv.core * fix warnings in ersatztv.infrastructure * fix warnings in ersatztv.application * disable analysis for migrations projects * fix warnings in ersatztv.scanner * fix warnings in ersatztv * upgrade project framework * update github actions and dockerfiles
28 lines
895 B
C#
28 lines
895 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 =>
|
|
{
|
|
return pixelFormat.BitDepth == 8
|
|
? nextState with { PixelFormat = new PixelFormatNv12(pixelFormat.Name) }
|
|
: nextState with { PixelFormat = new PixelFormatVaapi(pixelFormat.Name) };
|
|
},
|
|
() => nextState);
|
|
}
|
|
}
|