GST_PTR_FORMAT " to apply to srcpad", out_caps);
if (!gst_pad_has_current_caps (trans->srcpad))
- gst_pad_push_event (trans->srcpad, gst_event_new_caps (out_caps));
+ if (!gst_pad_set_caps (trans->srcpad, out_caps))
+ ret = GST_FLOW_NOT_NEGOTIATED;
gst_caps_unref (out_caps);
} else {
gchar *caps_str = gst_caps_to_string (out_caps);
typefind->caps = gst_caps_ref (caps);
GST_OBJECT_UNLOCK (typefind);
- gst_pad_push_event (typefind->src, gst_event_new_caps (caps));
+ gst_pad_set_caps (typefind->src, caps);
}
static void
* activation might happen from the streaming thread. */
gst_pad_pause_task (typefind->sink);
res = gst_pad_activate_mode (typefind->sink, mode, active);
- if (typefind->caps) {
+ if (res && typefind->caps) {
GstCaps *caps;
GST_OBJECT_LOCK (typefind);
caps = gst_caps_ref (typefind->caps);
GST_OBJECT_UNLOCK (typefind);
- gst_pad_push_event (typefind->src, gst_event_new_caps (caps));
+ res = gst_pad_set_caps (typefind->src, caps);
gst_caps_unref (caps);
}
break;