summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSeungha Yang <seungha.yang@navercorp.com>2019-10-25 01:09:08 +0900
committerSeungha Yang <seungha.yang@navercorp.com>2019-10-25 19:48:15 +0900
commit30d0674e7dea5e5af0a39193b960ce0aa59b3f37 (patch)
tree2df96bab7aa5a295c7ef861765617f3efbfda3c5 /ext
parent80c8c05457d1a7ba37a15b7150e6797dd4dac8e1 (diff)
downloadgst-libav-30d0674e7dea5e5af0a39193b960ce0aa59b3f37.tar.gz
avvideenc,avvidedec: Filtering hardware en/decoder by flag
... instead of filtering them by hardcoded string compare.
Diffstat (limited to 'ext')
-rw-r--r--ext/libav/gstavviddec.c30
-rw-r--r--ext/libav/gstavvidenc.c24
2 files changed, 22 insertions, 32 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
index f04a338..ab911af 100644
--- a/ext/libav/gstavviddec.c
+++ b/ext/libav/gstavviddec.c
@@ -2341,46 +2341,48 @@ gst_ffmpegviddec_register (GstPlugin * plugin)
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")) {
+ /* Skip hardware or hybrid (hardware with software fallback) */
+ if ((in_plugin->capabilities & AV_CODEC_CAP_HARDWARE) ==
+ AV_CODEC_CAP_HARDWARE) {
GST_DEBUG
- ("Ignoring VDPAU decoder %s. We can't handle this outside of ffmpeg",
+ ("Ignoring hardware decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
- if (g_str_has_suffix (in_plugin->name, "_xvmc")) {
+ if ((in_plugin->capabilities & AV_CODEC_CAP_HYBRID) == AV_CODEC_CAP_HYBRID) {
GST_DEBUG
- ("Ignoring XVMC decoder %s. We can't handle this outside of ffmpeg",
+ ("Ignoring hybrid decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
- if (strstr (in_plugin->name, "vaapi")) {
+ /* 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")) {
GST_DEBUG
- ("Ignoring VAAPI decoder %s. We can't handle this outside of ffmpeg",
+ ("Ignoring VDPAU decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
- if (g_str_has_suffix (in_plugin->name, "_qsv")) {
+ if (g_str_has_suffix (in_plugin->name, "_xvmc")) {
GST_DEBUG
- ("Ignoring qsv decoder %s. We can't handle this outside of ffmpeg",
+ ("Ignoring XVMC decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
- if (g_str_has_suffix (in_plugin->name, "_cuvid")) {
+ if (strstr (in_plugin->name, "vaapi")) {
GST_DEBUG
- ("Ignoring CUVID decoder %s. We can't handle this outside of ffmpeg",
+ ("Ignoring VAAPI decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
- if (g_str_has_suffix (in_plugin->name, "_v4l2m2m")) {
+ if (g_str_has_suffix (in_plugin->name, "_qsv")) {
GST_DEBUG
- ("Ignoring V4L2 mem-to-mem decoder %s. We can't handle this outside of ffmpeg",
+ ("Ignoring qsv decoder %s. We can't handle this outside of ffmpeg",
in_plugin->name);
continue;
}
diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c
index 8211de2..ca38d27 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;
}