| Top |
The GstRTSPStream object manages the data transport for one stream. It is created from a payloader element and a source pad that produce the RTP packets for the stream.
With gst_rtsp_stream_join_bin() the streaming elements are added to the bin
and rtpbin. gst_rtsp_stream_leave_bin() removes the elements again.
The GstRTSPStream will use the configured addresspool, as set with
gst_rtsp_stream_set_address_pool(), to allocate multicast addresses for the
stream. With gst_rtsp_stream_get_multicast_address() you can get the
configured address.
With gst_rtsp_stream_get_server_port() you can get the port that the server
will use to receive RTCP. This is the part that the clients will use to send
RTCP to.
With gst_rtsp_stream_add_transport() destinations can be added where the
stream should be sent to. Use gst_rtsp_stream_remove_transport() to remove
the destination again.
Last reviewed on 2013-07-16 (1.0.0)
GstRTSPStream * gst_rtsp_stream_new (guint idx,GstElement *payloader,GstPad *srcpad);
Create a new media stream with index idx
that handles RTP data on
srcpad
and has a payloader element payloader
.
guint
gst_rtsp_stream_get_index (GstRTSPStream *stream);
Get the stream index.
Return: the stream index.
GstPad *
gst_rtsp_stream_get_srcpad (GstRTSPStream *stream);
Get the srcpad associated with stream
.
gchar *
gst_rtsp_stream_get_control (GstRTSPStream *stream);
Get the control string to identify this stream.
void gst_rtsp_stream_set_control (GstRTSPStream *stream,const gchar *control);
Set the control string in stream
.
gboolean gst_rtsp_stream_has_control (GstRTSPStream *stream,const gchar *control);
Check if stream
has the control string control
.
guint
gst_rtsp_stream_get_mtu (GstRTSPStream *stream);
Get the configured MTU in the payloader of stream
.
void gst_rtsp_stream_set_mtu (GstRTSPStream *stream,guint mtu);
Configure the mtu in the payloader of stream
to mtu
.
gint
gst_rtsp_stream_get_dscp_qos (GstRTSPStream *stream);
Get the configured DSCP QoS in of the outgoing sockets.
void gst_rtsp_stream_set_dscp_qos (GstRTSPStream *stream,gint dscp_qos);
Configure the dscp qos of the outgoing sockets to dscp_qos
.
GstRTSPLowerTrans
gst_rtsp_stream_get_protocols (GstRTSPStream *stream);
Get the allowed protocols of stream
.
void gst_rtsp_stream_set_protocols (GstRTSPStream *stream,GstRTSPLowerTrans protocols);
Configure the allowed lower transport for stream
.
GstRTSPAddressPool *
gst_rtsp_stream_get_address_pool (GstRTSPStream *stream);
Get the GstRTSPAddressPool used as the address pool of stream
.
void gst_rtsp_stream_set_address_pool (GstRTSPStream *stream,GstRTSPAddressPool *pool);
configure pool
to be used as the address pool of stream
.
GstRTSPAddress * gst_rtsp_stream_reserve_address (GstRTSPStream *stream,const gchar *address,guint port,guint n_ports,guint ttl);
Reserve address
and port
as the address and port of stream
.
the GstRTSPAddress of stream
or NULL when the address could be
reserved. gst_rtsp_address_free() after usage.
gboolean gst_rtsp_stream_join_bin (GstRTSPStream *stream,GstBin *bin,GstElement *rtpbin,GstState state);
Join the GstBin bin
that contains the element rtpbin
.
stream
will link to rtpbin
, which must be inside bin
. The elements
added to bin
will be set to the state given in state
.
stream |
||
bin |
a GstBin to join. |
[transfer none] |
rtpbin |
a rtpbin element in |
[transfer none] |
state |
the target state of the new elements |
gboolean gst_rtsp_stream_leave_bin (GstRTSPStream *stream,GstBin *bin,GstElement *rtpbin);
Remove the elements of stream
from bin
.
Return: TRUE on success.
void gst_rtsp_stream_get_server_port (GstRTSPStream *stream,GstRTSPRange *server_port,GSocketFamily family);
Fill server_port
with the port pair used by the server. This function can
only be called when stream
has been joined.
GstRTSPAddress * gst_rtsp_stream_get_multicast_address (GstRTSPStream *stream,GSocketFamily family);
Get the multicast address of stream
for family
.
the GstRTSPAddress of stream
or NULL when no
address could be allocated. gst_rtsp_address_free() after usage.
[transfer full]
GObject *
gst_rtsp_stream_get_rtpsession (GstRTSPStream *stream);
Get the RTP session of this stream.
void gst_rtsp_stream_get_ssrc (GstRTSPStream *stream,guint *ssrc);
Get the SSRC used by the RTP session of this stream. This function can only
be called when stream
has been joined.
gboolean gst_rtsp_stream_get_rtpinfo (GstRTSPStream *stream,guint *rtptime,guint *seq,guint *clock_rate,GstClockTime *running_time);
Retrieve the current rtptime, seq and running-time. This is used to construct a RTPInfo reply header.
GstCaps *
gst_rtsp_stream_get_caps (GstRTSPStream *stream);
Retrieve the current caps of stream
.
GstFlowReturn gst_rtsp_stream_recv_rtcp (GstRTSPStream *stream,GstBuffer *buffer);
Handle an RTCP buffer for the stream. This method is usually called when a message has been received from a client using the TCP transport.
This function takes ownership of buffer
.
GstFlowReturn gst_rtsp_stream_recv_rtp (GstRTSPStream *stream,GstBuffer *buffer);
Handle an RTP buffer for the stream. This method is usually called when a message has been received from a client using the TCP transport.
This function takes ownership of buffer
.
gboolean gst_rtsp_stream_add_transport (GstRTSPStream *stream,GstRTSPStreamTransport *trans);
Add the transport in trans
to stream
. The media of stream
will
then also be send to the values configured in trans
.
stream
must be joined to a bin.
trans
must contain a valid GstRTSPTransport.
gboolean gst_rtsp_stream_remove_transport (GstRTSPStream *stream,GstRTSPStreamTransport *trans);
Remove the transport in trans
from stream
. The media of stream
will
not be sent to the values configured in trans
.
stream
must be joined to a bin.
trans
must contain a valid GstRTSPTransport.
GSocket * gst_rtsp_stream_get_rtp_socket (GstRTSPStream *stream,GSocketFamily family);
Get the RTP socket from stream
for a family
.
stream
must be joined to a bin.
the RTP socket or NULL if no socket could be
allocated for family
. Unref after usage.
[transfer full]
GSocket * gst_rtsp_stream_get_rtcp_socket (GstRTSPStream *stream,GSocketFamily family);
Get the RTCP socket from stream
for a family
.
stream
must be joined to a bin.
the RTCP socket or NULL if no socket could be
allocated for family
. Unref after usage.
[transfer full]
GstRTSPFilterResult (*GstRTSPStreamTransportFilterFunc) (GstRTSPStream *stream,GstRTSPStreamTransport *trans,gpointer user_data);
This function will be called by the gst_rtsp_stream_transport_filter(). An
implementation should return a value of GstRTSPFilterResult.
When this function returns GST_RTSP_FILTER_REMOVE, trans
will be removed
from stream
.
A return value of GST_RTSP_FILTER_KEEP will leave trans
untouched in
stream
.
A value of GST_RTSP_FILTER_REF will add trans
to the result GList of
gst_rtsp_stream_transport_filter().
stream |
a GstRTSPStream object |
|
trans |
a GstRTSPStreamTransport in |
|
user_data |
user data that has been given to |
GList * gst_rtsp_stream_transport_filter (GstRTSPStream *stream,GstRTSPStreamTransportFilterFunc func,gpointer user_data);
Call func
for each transport managed by stream
. The result value of func
determines what happens to the transport. func
will be called with stream
locked so no further actions on stream
can be performed from func
.
If func
returns GST_RTSP_FILTER_REMOVE, the transport will be removed from
stream
.
If func
returns GST_RTSP_FILTER_KEEP, the transport will remain in stream
.
If func
returns GST_RTSP_FILTER_REF, the transport will remain in stream
but
will also be added with an additional ref to the result GList of this
function..
When func
is NULL, GST_RTSP_FILTER_REF will be assumed for each transport.
stream |
||
func |
a callback. |
[scope call][allow-none] |
user_data |
user data passed to |
[closure] |
a GList with all
transports for which func
returned GST_RTSP_FILTER_REF. After usage, each
element in the GList should be unreffed before the list is freed.
[element-type GstRTSPStreamTransport][transfer full]