mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
subtitleoverlay: Consider all caps for overlays, not just the first.
Check all supported caps on the overlay video pad, not just the first of (possibly) many.
This commit is contained in:
parent
b04675a1dc
commit
968e28a818
1 changed files with 17 additions and 14 deletions
|
@ -225,8 +225,9 @@ _is_video_pad (GstPad * pad, gboolean * hw_accelerated)
|
|||
{
|
||||
GstPad *peer = gst_pad_get_peer (pad);
|
||||
GstCaps *caps;
|
||||
gboolean ret;
|
||||
gboolean ret = FALSE;
|
||||
const gchar *name;
|
||||
guint i;
|
||||
|
||||
if (peer) {
|
||||
caps = gst_pad_get_current_caps (peer);
|
||||
|
@ -238,21 +239,23 @@ _is_video_pad (GstPad * pad, gboolean * hw_accelerated)
|
|||
caps = gst_pad_query_caps (pad, NULL);
|
||||
}
|
||||
|
||||
name = gst_structure_get_name (gst_caps_get_structure (caps, 0));
|
||||
if (g_str_equal (name, "video/x-raw")) {
|
||||
ret = TRUE;
|
||||
if (hw_accelerated)
|
||||
*hw_accelerated = FALSE;
|
||||
for (i = 0; i < gst_caps_get_size (caps) && ret == FALSE; i++) {
|
||||
name = gst_structure_get_name (gst_caps_get_structure (caps, i));
|
||||
if (g_str_equal (name, "video/x-raw")) {
|
||||
ret = TRUE;
|
||||
if (hw_accelerated)
|
||||
*hw_accelerated = FALSE;
|
||||
|
||||
} else if (g_str_has_prefix (name, "video/x-surface")) {
|
||||
ret = TRUE;
|
||||
if (hw_accelerated)
|
||||
*hw_accelerated = TRUE;
|
||||
} else {
|
||||
} else if (g_str_has_prefix (name, "video/x-surface")) {
|
||||
ret = TRUE;
|
||||
if (hw_accelerated)
|
||||
*hw_accelerated = TRUE;
|
||||
} else {
|
||||
|
||||
ret = FALSE;
|
||||
if (hw_accelerated)
|
||||
*hw_accelerated = FALSE;
|
||||
ret = FALSE;
|
||||
if (hw_accelerated)
|
||||
*hw_accelerated = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
gst_caps_unref (caps);
|
||||
|
|
Loading…
Reference in a new issue