* Boston, MA 02110-1301, USA.
*/
-#include <string.h>
#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
#include <gio/gio.h>
g_mutex_lock (&priv->lock);
if ((result = g_strdup (priv->control)) == NULL)
- result = g_strdup_printf ("stream=%d", priv->idx);
+ result = g_strdup_printf ("stream=%u", priv->idx);
g_mutex_unlock (&priv->lock);
return result;
}
/**
+ * gst_rtsp_stream_has_control:
+ * @stream: a #GstRTSPStream
+ * @control: a control string
+ *
+ * Check if @stream has the control string @control.
+ *
+ * Returns: %TRUE is @stream has @control as the control string
+ */
+gboolean
+gst_rtsp_stream_has_control (GstRTSPStream * stream, const gchar * control)
+{
+ GstRTSPStreamPrivate *priv;
+ gboolean res;
+
+ g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), FALSE);
+
+ priv = stream->priv;
+
+ g_mutex_lock (&priv->lock);
+ if (priv->control)
+ res = g_strcmp0 (priv->control, control);
+ else {
+ guint streamid;
+ sscanf (control, "stream=%u", &streamid);
+ res = (streamid == priv->idx);
+ }
+ g_mutex_unlock (&priv->lock);
+
+ return res;
+}
+
+/**
* gst_rtsp_stream_set_mtu:
* @stream: a #GstRTSPStream
* @mtu: a new MTU
GstElement * rtpbin, GstState state)
{
GstRTSPStreamPrivate *priv;
- gint i, idx;
+ gint i;
+ guint idx;
gchar *name;
GstPad *pad, *teepad, *queuepad, *selpad;
GstPadLinkReturn ret;
/* create a session with the same index as the stream */
idx = priv->idx;
- GST_INFO ("stream %p joining bin as session %d", stream, idx);
+ GST_INFO ("stream %p joining bin as session %u", stream, idx);
if (!alloc_ports (stream))
goto no_ports;
no_ports:
{
g_mutex_unlock (&priv->lock);
- GST_WARNING ("failed to allocate ports %d", idx);
+ GST_WARNING ("failed to allocate ports %u", idx);
return FALSE;
}
link_failed:
{
- GST_WARNING ("failed to link stream %d", idx);
+ GST_WARNING ("failed to link stream %u", idx);
gst_object_unref (priv->send_rtp_sink);
priv->send_rtp_sink = NULL;
g_mutex_unlock (&priv->lock);