mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
subtitleoverlay: Return ANY caps for the GET_CAPS query
subtitleoverlay handles any caps, not just the ones for which a subtitle parser/renderer exist. It will just ignore any unsupported streams instead of causing an error. https://bugzilla.gnome.org/show_bug.cgi?id=688476
This commit is contained in:
parent
9084bc151b
commit
383f58b0ed
1 changed files with 4 additions and 21 deletions
|
@ -1936,23 +1936,12 @@ gst_subtitle_overlay_subtitle_sink_chain (GstPad * pad, GstObject * parent,
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_subtitle_overlay_subtitle_sink_getcaps (GstPad * pad, GstCaps * filter)
|
gst_subtitle_overlay_subtitle_sink_getcaps (GstPad * pad, GstCaps * filter)
|
||||||
{
|
{
|
||||||
GstSubtitleOverlay *self = GST_SUBTITLE_OVERLAY (gst_pad_get_parent (pad));
|
|
||||||
GstCaps *ret;
|
GstCaps *ret;
|
||||||
|
|
||||||
g_mutex_lock (&self->factories_lock);
|
if (filter)
|
||||||
if (G_UNLIKELY (!gst_subtitle_overlay_update_factory_list (self)))
|
ret = gst_caps_ref (filter);
|
||||||
ret = gst_caps_new_empty ();
|
|
||||||
else if (filter)
|
|
||||||
ret =
|
|
||||||
gst_caps_intersect_full (filter, self->factory_caps,
|
|
||||||
GST_CAPS_INTERSECT_FIRST);
|
|
||||||
else
|
else
|
||||||
ret = gst_caps_ref (self->factory_caps);
|
ret = gst_caps_new_any ();
|
||||||
g_mutex_unlock (&self->factories_lock);
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pad, "Returning subtitle caps %" GST_PTR_FORMAT, ret);
|
|
||||||
|
|
||||||
gst_object_unref (self);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2189,13 +2178,7 @@ gst_subtitle_overlay_subtitle_sink_query (GstPad * pad, GstObject * parent,
|
||||||
switch (GST_QUERY_TYPE (query)) {
|
switch (GST_QUERY_TYPE (query)) {
|
||||||
case GST_QUERY_ACCEPT_CAPS:
|
case GST_QUERY_ACCEPT_CAPS:
|
||||||
{
|
{
|
||||||
GstCaps *caps, *othercaps;
|
gst_query_set_accept_caps_result (query, TRUE);
|
||||||
|
|
||||||
gst_query_parse_accept_caps (query, &caps);
|
|
||||||
othercaps = gst_subtitle_overlay_subtitle_sink_getcaps (pad, NULL);
|
|
||||||
ret = gst_caps_is_subset (caps, othercaps);
|
|
||||||
gst_caps_unref (othercaps);
|
|
||||||
gst_query_set_accept_caps_result (query, ret);
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue