From d196308ee9cd9bab3413c8577b34f47dbcd0bab5 Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Tue, 12 Oct 2021 18:39:51 -0500 Subject: [PATCH] fix ffmpeg profile editing (#421) --- .../FFmpegProfiles/Commands/CreateFFmpegProfile.cs | 3 +++ .../FFmpegProfiles/Commands/CreateFFmpegProfileHandler.cs | 2 ++ .../FFmpegProfiles/Commands/UpdateFFmpegProfile.cs | 3 +++ .../FFmpegProfiles/Commands/UpdateFFmpegProfileHandler.cs | 2 ++ ErsatzTV/Pages/FFmpegEditor.razor | 2 +- ErsatzTV/ViewModels/FFmpegProfileEditViewModel.cs | 4 ++++ 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ErsatzTV.Application/FFmpegProfiles/Commands/CreateFFmpegProfile.cs b/ErsatzTV.Application/FFmpegProfiles/Commands/CreateFFmpegProfile.cs index 7d05ec499..9aa344442 100644 --- a/ErsatzTV.Application/FFmpegProfiles/Commands/CreateFFmpegProfile.cs +++ b/ErsatzTV.Application/FFmpegProfiles/Commands/CreateFFmpegProfile.cs @@ -1,5 +1,6 @@ using ErsatzTV.Core; using ErsatzTV.Core.Domain; +using ErsatzTV.Core.FFmpeg; using LanguageExt; using MediatR; @@ -10,6 +11,8 @@ namespace ErsatzTV.Application.FFmpegProfiles.Commands int ThreadCount, bool Transcode, HardwareAccelerationKind HardwareAcceleration, + VaapiDriver VaapiDriver, + string VaapiDevice, int ResolutionId, bool NormalizeVideo, string VideoCodec, diff --git a/ErsatzTV.Application/FFmpegProfiles/Commands/CreateFFmpegProfileHandler.cs b/ErsatzTV.Application/FFmpegProfiles/Commands/CreateFFmpegProfileHandler.cs index 5096b4076..027da071b 100644 --- a/ErsatzTV.Application/FFmpegProfiles/Commands/CreateFFmpegProfileHandler.cs +++ b/ErsatzTV.Application/FFmpegProfiles/Commands/CreateFFmpegProfileHandler.cs @@ -45,6 +45,8 @@ namespace ErsatzTV.Application.FFmpegProfiles.Commands ThreadCount = threadCount, Transcode = request.Transcode, HardwareAcceleration = request.HardwareAcceleration, + VaapiDriver = request.VaapiDriver, + VaapiDevice = request.VaapiDevice, ResolutionId = resolutionId, NormalizeVideo = request.NormalizeVideo, VideoCodec = request.VideoCodec, diff --git a/ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegProfile.cs b/ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegProfile.cs index 8463b2670..4aff96a7a 100644 --- a/ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegProfile.cs +++ b/ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegProfile.cs @@ -1,5 +1,6 @@ using ErsatzTV.Core; using ErsatzTV.Core.Domain; +using ErsatzTV.Core.FFmpeg; using LanguageExt; using MediatR; @@ -11,6 +12,8 @@ namespace ErsatzTV.Application.FFmpegProfiles.Commands int ThreadCount, bool Transcode, HardwareAccelerationKind HardwareAcceleration, + VaapiDriver VaapiDriver, + string VaapiDevice, int ResolutionId, bool NormalizeVideo, string VideoCodec, diff --git a/ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegProfileHandler.cs b/ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegProfileHandler.cs index 748ba33d1..8f1381169 100644 --- a/ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegProfileHandler.cs +++ b/ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegProfileHandler.cs @@ -36,6 +36,8 @@ namespace ErsatzTV.Application.FFmpegProfiles.Commands p.ThreadCount = update.ThreadCount; p.Transcode = update.Transcode; p.HardwareAcceleration = update.HardwareAcceleration; + p.VaapiDriver = update.VaapiDriver; + p.VaapiDevice = update.VaapiDevice; p.ResolutionId = update.ResolutionId; p.NormalizeVideo = update.Transcode && update.NormalizeVideo; p.VideoCodec = update.VideoCodec; diff --git a/ErsatzTV/Pages/FFmpegEditor.razor b/ErsatzTV/Pages/FFmpegEditor.razor index 410f4f668..8f967159f 100644 --- a/ErsatzTV/Pages/FFmpegEditor.razor +++ b/ErsatzTV/Pages/FFmpegEditor.razor @@ -153,7 +153,7 @@ vaapiDevices = new List { "/dev/dri/renderD128" }; } - _vaapiDevices = vaapiDevices; + _vaapiDevices = vaapiDevices.OrderBy(s => s).ToList(); } private bool IsEdit => Id != 0; diff --git a/ErsatzTV/ViewModels/FFmpegProfileEditViewModel.cs b/ErsatzTV/ViewModels/FFmpegProfileEditViewModel.cs index 6930b9a63..4fd8e07b2 100644 --- a/ErsatzTV/ViewModels/FFmpegProfileEditViewModel.cs +++ b/ErsatzTV/ViewModels/FFmpegProfileEditViewModel.cs @@ -61,6 +61,8 @@ namespace ErsatzTV.ViewModels ThreadCount, Transcode, HardwareAcceleration, + VaapiDriver, + VaapiDevice, Resolution.Id, NormalizeVideo, VideoCodec, @@ -82,6 +84,8 @@ namespace ErsatzTV.ViewModels ThreadCount, Transcode, HardwareAcceleration, + VaapiDriver, + VaapiDevice, Resolution.Id, NormalizeVideo, VideoCodec,