mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
typefind: Allow caps query in "have-type" signal handlers
If an application calls gst_pad_query_caps from its "have-type" signal handler, then the query fails because typefind->caps has not been set yet. This patch sets typefind->caps in the object method handler, before the signal handlers are called. https://bugzilla.gnome.org/show_bug.cgi?id=763491
This commit is contained in:
parent
b6859ed71f
commit
20859af3f2
1 changed files with 9 additions and 3 deletions
|
@ -203,9 +203,6 @@ gst_type_find_element_have_type (GstTypeFindElement * typefind,
|
|||
event = gst_event_new_caps (caps);
|
||||
}
|
||||
|
||||
if (typefind->caps)
|
||||
gst_caps_unref (typefind->caps);
|
||||
typefind->caps = gst_caps_ref (caps);
|
||||
GST_OBJECT_UNLOCK (typefind);
|
||||
|
||||
gst_pad_push_event (typefind->src, event);
|
||||
|
@ -217,6 +214,15 @@ gst_type_find_element_emit_have_type (GstTypeFindElement * typefind,
|
|||
{
|
||||
GstEvent *event;
|
||||
|
||||
/* Update caps field immediatly so that caps queries and properties can be
|
||||
* honored in all "have-type" signal handlers.
|
||||
*/
|
||||
GST_OBJECT_LOCK (typefind);
|
||||
if (typefind->caps)
|
||||
gst_caps_unref (typefind->caps);
|
||||
typefind->caps = gst_caps_ref (caps);
|
||||
GST_OBJECT_UNLOCK (typefind);
|
||||
|
||||
/* Only store the caps event at this point. We give signal handlers
|
||||
* the chance to look at the caps before they are sent downstream.
|
||||
* They are only forwarded downstream later in the default signal
|
||||
|
|
Loading…
Reference in a new issue