|
|
|
|
@ -6,14 +6,27 @@ public class DeinterlaceVaapiFilter : BaseFilter
@@ -6,14 +6,27 @@ public class DeinterlaceVaapiFilter : BaseFilter
|
|
|
|
|
|
|
|
|
|
public DeinterlaceVaapiFilter(FrameState currentState) => _currentState = currentState; |
|
|
|
|
|
|
|
|
|
private static string GetDeinterlaceFilter() |
|
|
|
|
{ |
|
|
|
|
string? modeEnv = System.Environment.GetEnvironmentVariable("VAAPI_DEINT_MODE"); |
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(modeEnv) && int.TryParse(modeEnv, out int mode)) |
|
|
|
|
{ |
|
|
|
|
return $"deinterlace_vaapi=mode={mode}"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// No mode specified - let driver pick default
|
|
|
|
|
return "deinterlace_vaapi"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string Filter => |
|
|
|
|
_currentState.FrameDataLocation == FrameDataLocation.Hardware |
|
|
|
|
? "deinterlace_vaapi" |
|
|
|
|
: "format=nv12|p010le|vaapi,hwupload,deinterlace_vaapi"; |
|
|
|
|
? GetDeinterlaceFilter() |
|
|
|
|
: $"format=nv12|p010le|vaapi,hwupload,{GetDeinterlaceFilter()}"; |
|
|
|
|
|
|
|
|
|
public override FrameState NextState(FrameState currentState) => currentState with |
|
|
|
|
{ |
|
|
|
|
Deinterlaced = true, |
|
|
|
|
FrameDataLocation = FrameDataLocation.Hardware |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |