/* prepare will also lock the two pads */
result = gst_pad_link_prepare (srcpad, sinkpad, flags);
- if (G_UNLIKELY (result != GST_PAD_LINK_OK))
+ if (G_UNLIKELY (result != GST_PAD_LINK_OK)) {
+ GST_CAT_INFO (GST_CAT_PADS, "link between %s:%s and %s:%s failed: %s",
+ GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad),
+ gst_pad_link_get_name (result));
goto done;
+ }
/* must set peers before calling the link function */
GST_PAD_PEER (srcpad) = sinkpad;
* The EOS event will pause the task associated with @pad before it is forwarded
* to all internally linked pads,
*
- * The the event is sent to all pads internally linked to @pad. This function
+ * The event is sent to all pads internally linked to @pad. This function
* takes ownership of @event.
*
* Returns: %TRUE if the event was sent successfully.
query_latency_default_fold (const GValue * item, GValue * ret,
gpointer user_data)
{
- GstPad *pad = g_value_get_object (item);
+ GstPad *pad = g_value_get_object (item), *peer;
LatencyFoldData *fold_data = user_data;
GstQuery *query;
- gboolean res;
+ gboolean res = FALSE;
query = gst_query_new_latency ();
- res = gst_pad_peer_query (pad, query);
+
+ peer = gst_pad_get_peer (pad);
+ if (peer) {
+ res = gst_pad_peer_query (pad, query);
+ } else {
+ GST_LOG_OBJECT (pad, "No peer pad found, ignoring this pad");
+ }
if (res) {
gboolean live;
fold_data->live = TRUE;
}
- } else {
+ } else if (peer) {
GST_DEBUG_OBJECT (pad, "latency query failed");
g_value_set_boolean (ret, FALSE);
}
+
gst_query_unref (query);
+ if (peer)
+ gst_object_unref (peer);
return TRUE;
}
GstPadProbeType type, flags;
GstPadProbeCallback callback;
GstPadProbeReturn ret;
+ gpointer original_data;
/* if we have called this callback, do nothing */
if (PROBE_COOKIE (hook) == data->cookie) {
flags = hook->flags >> G_HOOK_FLAG_USER_SHIFT;
type = info->type;
+ original_data = info->data;
/* one of the data types for non-idle probes */
if ((type & GST_PAD_PROBE_TYPE_IDLE) == 0
GST_OBJECT_LOCK (pad);
+ if (original_data != NULL && info->data == NULL) {
+ GST_DEBUG_OBJECT (pad, "data item in pad probe info was dropped");
+ info->type = GST_PAD_PROBE_TYPE_INVALID;
+ data->dropped = TRUE;
+ }
+
switch (ret) {
case GST_PAD_PROBE_REMOVE:
/* remove the probe */
GstBuffer *buffer;
GstFlowReturn ret;
- GST_INFO_OBJECT (pad, "chaining each group in list as a merged buffer");
+ GST_INFO_OBJECT (pad, "chaining each buffer in list individually");
len = gst_buffer_list_length (list);
GST_OBJECT_UNLOCK (pad);
pad->ABI.abi.last_flowret =
ret == GST_FLOW_CUSTOM_SUCCESS ? GST_FLOW_OK : ret;
- gst_mini_object_unref (GST_MINI_OBJECT_CAST (data));
+ if (data != NULL)
+ gst_mini_object_unref (GST_MINI_OBJECT_CAST (data));
switch (ret) {
case GST_FLOW_CUSTOM_SUCCESS: