mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-23 17:14:23 +00:00
Nobody checks the return value of gst_pad_connect. This patch renames gst_pad_connect to gst_pad_try_connect and mak...
Original commit message from CVS: Nobody checks the return value of gst_pad_connect. This patch renames gst_pad_connect to gst_pad_try_connect and makes gst_pad_connect return void.
This commit is contained in:
parent
d4fba8438b
commit
75a30f1f61
3 changed files with 23 additions and 3 deletions
|
@ -187,7 +187,7 @@ gst_autoplug_pads_autoplug_func (GstElement *src, GstPad *pad, GstElement *sink)
|
||||||
if (state == GST_STATE_PLAYING)
|
if (state == GST_STATE_PLAYING)
|
||||||
gst_element_set_state (GST_ELEMENT (gst_element_get_parent (src)), GST_STATE_PAUSED);
|
gst_element_set_state (GST_ELEMENT (gst_element_get_parent (src)), GST_STATE_PAUSED);
|
||||||
|
|
||||||
if ((connected = gst_pad_connect (pad, sinkpad))) {
|
if ((connected = gst_pad_try_connect (pad, sinkpad))) {
|
||||||
if (state == GST_STATE_PLAYING)
|
if (state == GST_STATE_PLAYING)
|
||||||
gst_element_set_state (GST_ELEMENT (gst_element_get_parent (src)), GST_STATE_PLAYING);
|
gst_element_set_state (GST_ELEMENT (gst_element_get_parent (src)), GST_STATE_PLAYING);
|
||||||
break;
|
break;
|
||||||
|
|
21
gst/gstpad.c
21
gst/gstpad.c
|
@ -555,9 +555,28 @@ gst_pad_disconnect (GstPad *srcpad,
|
||||||
*
|
*
|
||||||
* Returns: TRUE if the pad could be connected
|
* Returns: TRUE if the pad could be connected
|
||||||
*/
|
*/
|
||||||
gboolean
|
void
|
||||||
gst_pad_connect (GstPad *srcpad,
|
gst_pad_connect (GstPad *srcpad,
|
||||||
GstPad *sinkpad)
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_pad_try_connect:
|
||||||
|
* @srcpad: the source pad to connect
|
||||||
|
* @sinkpad: the sink pad to connect
|
||||||
|
*
|
||||||
|
* Connects the source pad to the sink pad.
|
||||||
|
*
|
||||||
|
* Returns: TRUE if the pad could be connected
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_pad_try_connect (GstPad *srcpad,
|
||||||
|
GstPad *sinkpad)
|
||||||
{
|
{
|
||||||
GstRealPad *realsrc, *realsink;
|
GstRealPad *realsrc, *realsink;
|
||||||
gboolean negotiated = FALSE;
|
gboolean negotiated = FALSE;
|
||||||
|
|
|
@ -336,7 +336,8 @@ GstPad* gst_pad_get_peer (GstPad *pad);
|
||||||
|
|
||||||
GstBufferPool* gst_pad_get_bufferpool (GstPad *pad);
|
GstBufferPool* gst_pad_get_bufferpool (GstPad *pad);
|
||||||
|
|
||||||
gboolean gst_pad_connect (GstPad *srcpad, GstPad *sinkpad);
|
gboolean gst_pad_try_connect (GstPad *srcpad, GstPad *sinkpad);
|
||||||
|
void gst_pad_connect (GstPad *srcpad, GstPad *sinkpad);
|
||||||
void gst_pad_disconnect (GstPad *srcpad, GstPad *sinkpad);
|
void gst_pad_disconnect (GstPad *srcpad, GstPad *sinkpad);
|
||||||
|
|
||||||
gboolean gst_pad_renegotiate (GstPad *pad);
|
gboolean gst_pad_renegotiate (GstPad *pad);
|
||||||
|
|
Loading…
Reference in a new issue