diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index f04a33864f..ab911af9e2 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -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 */ diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c index 8211de2bc6..ca38d27198 100644 --- a/ext/libav/gstavvidenc.c +++ b/ext/libav/gstavvidenc.c @@ -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; }