avvideenc,avvidedec: Filtering hardware en/decoder by flag

... instead of filtering them by hardcoded string compare.
This commit is contained in:
Seungha Yang 2019-10-25 01:09:08 +09:00
parent 80c8c05457
commit 30d0674e7d
2 changed files with 22 additions and 32 deletions

View file

@ -2341,6 +2341,22 @@ gst_ffmpegviddec_register (GstPlugin * plugin)
continue;
}
/* Skip hardware or hybrid (hardware with software fallback) */
if ((in_plugin->capabilities & AV_CODEC_CAP_HARDWARE) ==
AV_CODEC_CAP_HARDWARE) {
GST_DEBUG
("Ignoring hardware decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
if ((in_plugin->capabilities & AV_CODEC_CAP_HYBRID) == AV_CODEC_CAP_HYBRID) {
GST_DEBUG
("Ignoring hybrid decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
/* No vdpau plugins until we can figure out how to properly use them
* outside of ffmpeg. */
if (g_str_has_suffix (in_plugin->name, "_vdpau")) {
@ -2371,20 +2387,6 @@ gst_ffmpegviddec_register (GstPlugin * plugin)
continue;
}
if (g_str_has_suffix (in_plugin->name, "_cuvid")) {
GST_DEBUG
("Ignoring CUVID decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
if (g_str_has_suffix (in_plugin->name, "_v4l2m2m")) {
GST_DEBUG
("Ignoring V4L2 mem-to-mem decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
GST_DEBUG ("Trying plugin %s [%s]", in_plugin->name, in_plugin->long_name);
/* no codecs for which we're GUARANTEED to have better alternatives */

View file

@ -932,30 +932,18 @@ gst_ffmpegvidenc_register (GstPlugin * plugin)
continue;
}
if (strstr (in_plugin->name, "vaapi")) {
/* Skip hardware or hybrid (hardware with software fallback) */
if ((in_plugin->capabilities & AV_CODEC_CAP_HARDWARE) ==
AV_CODEC_CAP_HARDWARE) {
GST_DEBUG
("Ignoring VAAPI encoder %s. We can't handle this outside of ffmpeg",
("Ignoring hardware encoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
if (strstr (in_plugin->name, "nvenc")) {
if ((in_plugin->capabilities & AV_CODEC_CAP_HYBRID) == AV_CODEC_CAP_HYBRID) {
GST_DEBUG
("Ignoring nvenc encoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
if (g_str_has_suffix (in_plugin->name, "_qsv")) {
GST_DEBUG
("Ignoring qsv encoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
if (g_str_has_suffix (in_plugin->name, "_v4l2m2m")) {
GST_DEBUG
("Ignoring V4L2 mem-to-mem encoder %s. We can't handle this outside of ffmpeg",
("Ignoring hybrid encoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}