sdpsink2

sdpsink2 is a network sink that sends RTP streams and writes the SDP session description describing them to the file named by location, an sdp:// URI such as sdp:///path/to/session.sdp. It can be combined with RTP payloaders to send RTP sessions, and a receiver such as sdpsrc2 or sdpdemux2 can start the session from the written SDP without any out-of-band configuration.

sdpsink2 is a bin with request sink pads named sink_%u, one per RTP stream. The destination of a stream is configured with the dest-ip and dest-port pad properties, which are mutable in READY. dest-port is required, and without rtcp-mux a destination port of 65535 is rejected: RTCP would be sent to the RTP destination port itself. If dest-ip is unset, the stream is sent to the default multicast group 239.1.2.1. The number of the pad is also the index of its media line in the session description. The first caps on a pad define its media line, later caps have to describe the same payload types: different ones send EOS on the pad and are rejected so that upstream sees the negotiation failure.

The session description is built once the element is running and every pad has negotiated caps. It is written to location if set, and is also available in the read-only sdp property, whose notify signal tells when it becomes available. The SDP is built from the session-name, session-description, session-id and session-version properties. The source-address property is used as the SDP origin address. If unset it is derived automatically: an address of one of the multicast-iface interfaces, or the source address the routing gives for the stream destinations. All streams of a session have to use the same address family, as the session has a single origin address.

The internal rtpsend and rtprecv elements and the per-stream UDP elements (udpsink2-rtp-<id>, udpsrc2-rtcp-<id>, udpsrc2-rtcp-mux-<id>, udpsink2-rtcp-<id>) are added to the bin with stable names, depending on the RTCP mode and rtcp-mux, and can be retrieved with gst_bin_get_by_name or the GstChildProxy interface.

By default RTCP is sent and received. With rtcp-mode set to sendonly or sendrecv, RTCP is sent to the RTP destination port + 1, or to the same port if rtcp-mux is set. With recvonly or sendrecv, RTCP is also received: on the session RTCP port, the RTP destination port + 1 for multicast or the port announced in the session's a=rtcp attribute, or on the RTP port if rtcp-mux is set. sendrecv sends its RTCP from that same socket. The rtp-profile property selects RTP/AVP or RTP/AVPF. By default multicast loopback is disabled, so local receivers on the same host do not receive the streams and the sender does not receive its own RTCP: set multicast-loopback to true for local testing.

Examples

 gst-launch-1.0 -v audiotestsrc is-live=true ! audio/x-raw,format=S16BE,rate=8000,channels=1 ! rtpL16pay2 ! sdpsink2 location=sdp:///tmp/session.sdp sink_0::dest-ip=127.0.0.1 sink_0::dest-port=5004

A pipeline sending L16 audio to localhost and writing the session description, e.g. to be received by sdpsrc2 location=sdp:///tmp/session.sdp.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBin
                    ╰──sdpsink2

Implemented interfaces

Factory details

Authors: – Sebastian Dröge

Classification: – Sink/Network

Rank – none

Plugin – sdp

Package – gst-plugin-sdp

Pad Templates

sink_%u

application/x-rtp:

Presence – request

Direction – sink

Object type – GstSdpSinkPad


Properties

location

“location” gchararray

Location to write the SDP of the session to, as an sdp:// URI such as sdp:///path/to/file.sdp. If unset, the SDP is only available in the sdp property

Flags : Read / Write

Default value : NULL


multicast-iface

“multicast-iface” gchararray

Comma-separated list of network interfaces to use for multicast

Flags : Read / Write

Default value : NULL


multicast-loopback

“multicast-loopback” gboolean

Enable multicast loopback so that local receivers on the same host receive the streams; needed for local testing

Flags : Read / Write

Default value : false


rtcp-mode

“rtcp-mode” GstSdpRtcpMode *

Whether to send and/or receive RTCP

Flags : Read / Write

Default value : sendrecv (3)


rtcp-mux

“rtcp-mux” gboolean

Send and receive RTCP on the same port as RTP (a=rtcp-mux)

Flags : Read / Write

Default value : false


rtp-profile

“rtp-profile” GstSdpRtpProfile *

Profile of the RTP session

Flags : Read / Write

Default value : avp (0)


sdp

“sdp” gchararray

SDP of the session, available once all pads have negotiated caps. Read-only, the notify signal tells when it is available

Flags : Read

Default value : NULL


session-description

“session-description” gchararray

Description of the session

Flags : Read / Write

Default value : NULL


session-id

“session-id” guint64

Session ID of the session, i.e. the session ID of the SDP o= line. 0 generates a random one

Flags : Read / Write

Default value : 0


session-name

“session-name” gchararray

Name of the session

Flags : Read / Write

Default value : GStreamer SDP session


session-version

“session-version” guint64

Session version of the session, i.e. the session version of the SDP o= line

Flags : Read / Write

Default value : 0


source-address

“source-address” gchararray

Source address of the session, used as the SDP origin address. If unset, it is derived from the multicast interfaces or the routing to the stream destinations

Flags : Read / Write

Default value : NULL


Named constants

GstSdpRtpProfile

Members

avp (0) – RTP/AVP
avpf (1) – RTP/AVPF

The results of the search are