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

* run code cleanup

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

35 lines
1.0 KiB
C#

using ErsatzTV.FFmpeg.Format;
namespace ErsatzTV.FFmpeg.Filter;
public class HardwareDownloadFilter : BaseFilter
{
private readonly FrameState _currentState;
public HardwareDownloadFilter(FrameState currentState) => _currentState = currentState;
public override string Filter
{
get
{
string hwdownload = string.Empty;
if (_currentState.FrameDataLocation == FrameDataLocation.Hardware)
{
hwdownload = "hwdownload";
foreach (IPixelFormat pixelFormat in _currentState.PixelFormat)
{
if (!string.IsNullOrWhiteSpace(pixelFormat.FFmpegName))
{
hwdownload = $"hwdownload,format={pixelFormat.FFmpegName}";
}
}
}
return hwdownload;
}
}
public override FrameState NextState(FrameState currentState) =>
currentState with { FrameDataLocation = FrameDataLocation.Software };
}