mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-13 12:51:16 +00:00
rtsp-stream: add functions to get rtp and rtcp multicast sockets
Change-Id: Iddfe6e0bd250cb0159096d5eba9e4202d22b56db https://bugzilla.gnome.org/show_bug.cgi?id=788340
This commit is contained in:
parent
c9605cc5e1
commit
51d670f73b
2 changed files with 72 additions and 0 deletions
|
@ -3545,6 +3545,70 @@ gst_rtsp_stream_get_rtcp_socket (GstRTSPStream * stream, GSocketFamily family)
|
|||
return socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_rtsp_stream_get_rtp_multicast_socket:
|
||||
* @stream: a #GstRTSPStream
|
||||
* @family: the socket family
|
||||
*
|
||||
* Get the multicast RTP socket from @stream for a @family.
|
||||
*
|
||||
* Returns: (transfer full) (nullable): the multicast RTP socket or %NULL if no
|
||||
* socket could be allocated for @family. Unref after usage
|
||||
*/
|
||||
GSocket *
|
||||
gst_rtsp_stream_get_rtp_multicast_socket (GstRTSPStream * stream, GSocketFamily family)
|
||||
{
|
||||
GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream);
|
||||
GSocket *socket;
|
||||
const gchar *name;
|
||||
|
||||
g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL);
|
||||
g_return_val_if_fail (family == G_SOCKET_FAMILY_IPV4 ||
|
||||
family == G_SOCKET_FAMILY_IPV6, NULL);
|
||||
g_return_val_if_fail (priv->mcast_udpsink[0], NULL);
|
||||
|
||||
if (family == G_SOCKET_FAMILY_IPV6)
|
||||
name = "socket-v6";
|
||||
else
|
||||
name = "socket";
|
||||
|
||||
g_object_get (priv->mcast_udpsink[0], name, &socket, NULL);
|
||||
|
||||
return socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_rtsp_stream_get_rtcp_multicast_socket:
|
||||
* @stream: a #GstRTSPStream
|
||||
* @family: the socket family
|
||||
*
|
||||
* Get the multicast RTCP socket from @stream for a @family.
|
||||
*
|
||||
* Returns: (transfer full) (nullable): the multicast RTCP socket or %NULL if no
|
||||
* socket could be allocated for @family. Unref after usage
|
||||
*/
|
||||
GSocket *
|
||||
gst_rtsp_stream_get_rtcp_multicast_socket (GstRTSPStream * stream, GSocketFamily family)
|
||||
{
|
||||
GstRTSPStreamPrivate *priv = GST_RTSP_STREAM_GET_PRIVATE (stream);
|
||||
GSocket *socket;
|
||||
const gchar *name;
|
||||
|
||||
g_return_val_if_fail (GST_IS_RTSP_STREAM (stream), NULL);
|
||||
g_return_val_if_fail (family == G_SOCKET_FAMILY_IPV4 ||
|
||||
family == G_SOCKET_FAMILY_IPV6, NULL);
|
||||
g_return_val_if_fail (priv->mcast_udpsink[1], NULL);
|
||||
|
||||
if (family == G_SOCKET_FAMILY_IPV6)
|
||||
name = "socket-v6";
|
||||
else
|
||||
name = "socket";
|
||||
|
||||
g_object_get (priv->mcast_udpsink[1], name, &socket, NULL);
|
||||
|
||||
return socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_rtsp_stream_set_seqnum:
|
||||
* @stream: a #GstRTSPStream
|
||||
|
|
|
@ -219,6 +219,14 @@ GST_EXPORT
|
|||
GSocket * gst_rtsp_stream_get_rtcp_socket (GstRTSPStream *stream,
|
||||
GSocketFamily family);
|
||||
|
||||
GST_EXPORT
|
||||
GSocket * gst_rtsp_stream_get_rtp_multicast_socket (GstRTSPStream *stream,
|
||||
GSocketFamily family);
|
||||
|
||||
GST_EXPORT
|
||||
GSocket * gst_rtsp_stream_get_rtcp_multicast_socket (GstRTSPStream *stream,
|
||||
GSocketFamily family);
|
||||
|
||||
GST_EXPORT
|
||||
gboolean gst_rtsp_stream_update_crypto (GstRTSPStream * stream,
|
||||
guint ssrc, GstCaps * crypto);
|
||||
|
|
Loading…
Reference in a new issue