Remove the deprecated OMX and MMAL HWA

This commit is contained in:
nyanmisaka 2022-03-05 21:47:59 +08:00
parent fab5f37e0e
commit bfc27e494b
3 changed files with 7 additions and 76 deletions

View File

@ -84,7 +84,6 @@ namespace MediaBrowser.Controller.MediaEncoding
{ "vaapi", hwEncoder + "_vaapi" },
{ "videotoolbox", hwEncoder + "_videotoolbox" },
{ "v4l2m2m", hwEncoder + "_v4l2m2m" },
{ "omx", hwEncoder + "_omx" },
};
if (!string.IsNullOrEmpty(hwType)
@ -1581,10 +1580,8 @@ namespace MediaBrowser.Controller.MediaEncoding
if (!string.IsNullOrEmpty(profile))
{
if (!string.Equals(videoEncoder, "h264_omx", StringComparison.OrdinalIgnoreCase)
&& !string.Equals(videoEncoder, "h264_v4l2m2m", StringComparison.OrdinalIgnoreCase))
if (!string.Equals(videoEncoder, "h264_v4l2m2m", StringComparison.OrdinalIgnoreCase))
{
// not supported by h264_omx
param += " -profile:v:0 " + profile;
}
}
@ -1623,8 +1620,7 @@ namespace MediaBrowser.Controller.MediaEncoding
// NVENC cannot adjust the given level, just throw an error.
// level option may cause corrupted frames on AMD VAAPI.
}
else if (!string.Equals(videoEncoder, "h264_omx", StringComparison.OrdinalIgnoreCase)
|| !string.Equals(videoEncoder, "libx265", StringComparison.OrdinalIgnoreCase))
else if (!string.Equals(videoEncoder, "libx265", StringComparison.OrdinalIgnoreCase))
{
param += " -level " + level;
}
@ -4284,11 +4280,6 @@ namespace MediaBrowser.Controller.MediaEncoding
{
return GetVideotoolboxVidDecoder(state, options, videoStream, bitDepth);
}
if (string.Equals(options.HardwareAccelerationType, "omx", StringComparison.OrdinalIgnoreCase))
{
return GetOmxVidDecoder(state, options, videoStream, bitDepth);
}
}
var whichCodec = videoStream.Codec;
@ -4764,43 +4755,6 @@ namespace MediaBrowser.Controller.MediaEncoding
return null;
}
public string GetOmxVidDecoder(EncodingJobInfo state, EncodingOptions options, MediaStream videoStream, int bitDepth)
{
if (!OperatingSystem.IsLinux()
|| !string.Equals(options.HardwareAccelerationType, "omx", StringComparison.OrdinalIgnoreCase))
{
return null;
}
var is8bitSwFormatsOmx = string.Equals("yuv420p", videoStream.PixelFormat, StringComparison.OrdinalIgnoreCase);
if (is8bitSwFormatsOmx)
{
if (string.Equals("avc", videoStream.Codec, StringComparison.OrdinalIgnoreCase)
|| string.Equals("h264", videoStream.Codec, StringComparison.OrdinalIgnoreCase))
{
return GetHwDecoderName(options, "h264", "mmal", "h264", bitDepth);
}
if (string.Equals("mpeg2video", videoStream.Codec, StringComparison.OrdinalIgnoreCase))
{
return GetHwDecoderName(options, "mpeg2", "mmal", "mpeg2video", bitDepth);
}
if (string.Equals("mpeg4", videoStream.Codec, StringComparison.OrdinalIgnoreCase))
{
return GetHwDecoderName(options, "mpeg4", "mmal", "mpeg4", bitDepth);
}
if (string.Equals("vc1", videoStream.Codec, StringComparison.OrdinalIgnoreCase))
{
return GetHwDecoderName(options, "vc1", "mmal", "vc1", bitDepth);
}
}
return null;
}
/// <summary>
/// Gets the number of threads.
/// </summary>

View File

@ -44,18 +44,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
"mpeg4_cuvid",
"vp8_cuvid",
"vp9_cuvid",
"av1_cuvid",
"h264_mmal",
"mpeg2_mmal",
"mpeg4_mmal",
"vc1_mmal",
"h264_opencl",
"hevc_opencl",
"mpeg2_opencl",
"mpeg4_opencl",
"vp8_opencl",
"vp9_opencl",
"vc1_opencl"
"av1_cuvid"
};
private static readonly string[] _requiredEncoders = new[]
@ -82,8 +71,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
"hevc_nvenc",
"h264_vaapi",
"hevc_vaapi",
"h264_omx",
"hevc_omx",
"h264_v4l2m2m",
"h264_videotoolbox",
"hevc_videotoolbox"

View File

@ -21,28 +21,18 @@
NVENC = 2,
/// <summary>
/// OpenMax OMX.
/// Video4Linux2 V4L2.
/// </summary>
OMX = 3,
/// <summary>
/// Exynos V4L2 MFC.
/// </summary>
V4L2M2M = 4,
/// <summary>
/// MediaCodec Android.
/// </summary>
MediaCodec = 5,
V4L2M2M = 3,
/// <summary>
/// Video Acceleration API (VAAPI).
/// </summary>
VAAPI = 6,
VAAPI = 4,
/// <summary>
/// Video ToolBox.
/// </summary>
VideoToolBox = 7
VideoToolBox = 5
}
}