mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
add temporary diagnostic code
Original commit message from CVS: add temporary diagnostic code
This commit is contained in:
parent
68cecc8700
commit
3aa927ac2f
2 changed files with 27 additions and 3 deletions
27
gst/gstpad.c
27
gst/gstpad.c
|
@ -24,6 +24,7 @@
|
|||
#include "gst_private.h"
|
||||
|
||||
#include "gstpad.h"
|
||||
#include "gstutils.h"
|
||||
#include "gstelement.h"
|
||||
#include "gsttype.h"
|
||||
#include "gstbin.h"
|
||||
|
@ -554,15 +555,35 @@ gst_pad_disconnect (GstPad *srcpad,
|
|||
* @sinkpad: the sink pad to connect
|
||||
*
|
||||
* Connects the source pad to the sink pad.
|
||||
*
|
||||
* You shouldn't use this API in a real application because the
|
||||
* failure mode dumps detailed diagnostics to stderr. A professional
|
||||
* application should always use gst_pad_try_connect and check
|
||||
* the return code.
|
||||
*
|
||||
* This API will probably be moved out of the main gstreamer library.
|
||||
*/
|
||||
void
|
||||
gst_pad_connect (GstPad *srcpad,
|
||||
GstPad *sinkpad)
|
||||
{
|
||||
if (!gst_pad_try_connect (srcpad, sinkpad))
|
||||
g_critical ("couldn't connect %s:%s and %s:%s",
|
||||
GST_DEBUG_PAD_NAME (srcpad),
|
||||
GST_DEBUG_PAD_NAME (sinkpad));
|
||||
{
|
||||
GString *buf;
|
||||
|
||||
buf = g_string_new (NULL);
|
||||
g_string_printf (buf, "\nCouldn't connect %s:%s and %s:%s -- details:\n",
|
||||
GST_DEBUG_PAD_NAME (srcpad),
|
||||
GST_DEBUG_PAD_NAME (sinkpad));
|
||||
gst_print_pad_caps (buf, 2, srcpad);
|
||||
gst_print_pad_caps (buf, 2, sinkpad);
|
||||
|
||||
g_critical (buf->str,
|
||||
GST_DEBUG_PAD_NAME (srcpad),
|
||||
GST_DEBUG_PAD_NAME (sinkpad));
|
||||
|
||||
g_string_free (buf, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,6 +44,9 @@ void gst_util_set_object_arg (GObject *object, const gchar *name, const gchar
|
|||
|
||||
void gst_util_dump_mem (guchar *mem, guint size);
|
||||
|
||||
|
||||
void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
|
Loading…
Reference in a new issue