subtitleoverlay: Check for memory capsfeature on video/x-raw

Don't assume that video/x-raw caps means buffers are mappable
or can be processed by videoconvert and friends. Only plug
those converters for real system memory, and treat other
memory capsfeatures as hardware surfaces

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7741>
This commit is contained in:
Jan Schmidt 2024-10-25 21:46:45 +11:00 committed by GStreamer Marge Bot
parent 9046e60aa7
commit c02d41c259

View file

@ -272,11 +272,18 @@ _is_video_pad (GstPad * pad, gboolean * hw_accelerated)
for (i = 0; i < gst_caps_get_size (caps) && !ret; i++) { for (i = 0; i < gst_caps_get_size (caps) && !ret; i++) {
name = gst_structure_get_name (gst_caps_get_structure (caps, i)); name = gst_structure_get_name (gst_caps_get_structure (caps, i));
GstCapsFeatures *features = gst_caps_get_features (caps, i);
if (g_str_equal (name, "video/x-raw")) { if (g_str_equal (name, "video/x-raw")) {
ret = TRUE; ret = TRUE;
if (hw_accelerated) if (hw_accelerated) {
*hw_accelerated = FALSE; if (gst_caps_features_contains (features,
GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY)) {
*hw_accelerated = FALSE;
} else {
*hw_accelerated = TRUE;
}
}
} else if (g_str_has_prefix (name, "video/x-surface")) { } else if (g_str_has_prefix (name, "video/x-surface")) {
ret = TRUE; ret = TRUE;
if (hw_accelerated) if (hw_accelerated)