Top |
gboolean | do-lost | Read / Write |
guint | latency | Read / Write |
GstStructure * | sdes | Read / Write |
gboolean | ignore-pt | Read / Write |
gboolean | autoremove | Read / Write |
RTPJitterBufferMode | buffer-mode | Read / Write |
gboolean | ntp-sync | Read / Write |
gboolean | use-pipeline-clock | Read / Write |
GstRTCPSync | rtcp-sync | Read / Write |
guint | rtcp-sync-interval | Read / Write |
gboolean | drop-on-latency | Read / Write |
gboolean | do-sync-event | Read / Write |
gboolean | do-retransmission | Read / Write |
GstRTPProfile | rtp-profile | Read / Write |
GstRtpNtpTimeSource | ntp-time-source | Read / Write |
guint | max-dropout-time | Read / Write |
guint | max-misorder-time | Read / Write |
gint | max-rtcp-rtp-time-diff | Read / Write |
gboolean | rtcp-sync-send-time | Read / Write |
gboolean | rfc7273-sync | Read / Write |
guint | max-streams | Read / Write |
void | clear-pt-map | Action |
RTPSession* | get-internal-session | Action |
void | on-bye-ssrc | Run Last |
void | on-bye-timeout | Run Last |
void | on-new-ssrc | Run Last |
void | on-npt-stop | Run Last |
void | on-sender-timeout | Run Last |
void | on-ssrc-active | Run Last |
void | on-ssrc-collision | Run Last |
void | on-ssrc-sdes | Run Last |
void | on-ssrc-validated | Run Last |
void | on-timeout | Run Last |
GstCaps* | request-pt-map | Run Last |
void | reset-sync | Action |
void | payload-type-change | Run Last |
void | new-jitterbuffer | Run Last |
GstElement* | request-aux-receiver | Run Last |
GstElement* | request-aux-sender | Run Last |
GstElement* | request-rtcp-decoder | Run Last |
GstElement* | request-rtcp-encoder | Run Last |
GstElement* | request-rtp-decoder | Run Last |
GstElement* | request-rtp-encoder | Run Last |
void | on-new-sender-ssrc | Run Last |
void | on-sender-ssrc-active | Run Last |
GstElement* | get-session | Action |
GObject ╰── GInitiallyUnowned ╰── GstObject ╰── GstElement ╰── GstBin ╰── GstRtpBin
RTP bin combines the functions of GstRtpSession, GstRtpSsrcDemux, GstRtpJitterBuffer and GstRtpPtDemux in one element. It allows for multiple RTP sessions that will be synchronized together using RTCP SR packets.
GstRtpBin is configured with a number of request pads that define the functionality that is activated, similar to the GstRtpSession element.
To use GstRtpBin as an RTP receiver, request a recv_rtp_sink_%u pad. The session number must be specified in the pad name. Data received on the recv_rtp_sink_%u pad will be processed in the GstRtpSession manager and after being validated forwarded on GstRtpSsrcDemux element. Each RTP stream is demuxed based on the SSRC and send to a GstRtpJitterBuffer. After the packets are released from the jitterbuffer, they will be forwarded to a GstRtpPtDemux element. The GstRtpPtDemux element will demux the packets based on the payload type and will create a unique pad recv_rtp_src_%u_%u_%u on rtpbin with the session number, SSRC and payload type respectively as the pad name.
To also use GstRtpBin as an RTCP receiver, request a recv_rtcp_sink_%u pad. The session number must be specified in the pad name.
If you want the session manager to generate and send RTCP packets, request the send_rtcp_src_%u pad with the session number in the pad name. Packet pushed on this pad contain SR/RR RTCP reports that should be sent to all participants in the session.
To use GstRtpBin as a sender, request a send_rtp_sink_%u pad, which will automatically create a send_rtp_src_%u pad. If the session number is not provided, the pad from the lowest available session will be returned. The session manager will modify the SSRC in the RTP packets to its own SSRC and wil forward the packets on the send_rtp_src_%u pad after updating its internal state.
The session manager needs the clock-rate of the payload types it is handling and will signal the “request-pt-map” signal when it needs such a mapping. One can clear the cached values with the “clear-pt-map” signal.
Access to the internal statistics of rtpbin is provided with the get-internal-session property. This action signal gives access to the RTPSession object which further provides action signals to retrieve the internal source and other sources.
GstRtpBin also has signals (“request-rtp-encoder”, “request-rtp-decoder”, “request-rtcp-encoder” and “request-rtp-decoder”) to dynamically request for RTP and RTCP encoders and decoders in order to support SRTP. The encoders must provide the pads rtp_sink_%u and rtp_src_%u for RTP and rtcp_sink_%u and rtcp_src_%u for RTCP. The session number will be used in the pad name. The decoders must provide rtp_sink and rtp_src for RTP and rtcp_sink and rtcp_src for RTCP. The decoders will be placed before the GstRtpSession element, thus they must support SSRC demuxing internally.
GstRtpBin has signals (“request-aux-sender” and “request-aux-receiver” to dynamically request an element that can be used to create or merge additional RTP streams. AUX elements are needed to implement FEC or retransmission (such as RFC 4588). An AUX sender must have one sink_%u pad that matches the sessionid in the signal and it should have 1 or more src_%u pads. For each src_%\u pad, a session will be made (if needed) and the pad will be linked to the session send_rtp_sink pad. Each session will then expose its source pad as send_rtp_src_%u on GstRtpBin. An AUX receiver has 1 src_%u pad that much match the sessionid in the signal and 1 or more sink_%u pads. A session will be made for each sink_%u pad when the corresponding recv_rtp_sink_%u pad is requested on GstRtpBin.
1 2 |
gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp, ..." ! .recv_rtp_sink_0 \ rtpbin ! rtptheoradepay ! theoradec ! xvimagesink |
1 2 3 4 5 6 7 8 9 |
gst-launch-1.0 rtpbin name=rtpbin \ v4l2src ! videoconvert ! ffenc_h263 ! rtph263ppay ! rtpbin.send_rtp_sink_0 \ rtpbin.send_rtp_src_0 ! udpsink port=5000 \ rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false \ udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 \ audiotestsrc ! amrnbenc ! rtpamrpay ! rtpbin.send_rtp_sink_1 \ rtpbin.send_rtp_src_1 ! udpsink port=5002 \ rtpbin.send_rtcp_src_1 ! udpsink port=5003 sync=false async=false \ udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1 |
1 2 3 4 5 6 7 8 9 10 11 |
gst-launch-1.0 -v rtpbin name=rtpbin \ udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H263-1998" \ port=5000 ! rtpbin.recv_rtp_sink_0 \ rtpbin. ! rtph263pdepay ! ffdec_h263 ! xvimagesink \ udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \ rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false \ udpsrc caps="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)AMR,encoding-params=(string)1,octet-align=(string)1" \ port=5002 ! rtpbin.recv_rtp_sink_1 \ rtpbin. ! rtpamrdepay ! amrnbdec ! alsasink \ udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \ rtpbin.send_rtcp_src_1 ! udpsink port=5007 sync=false async=false |
plugin |
rtpmanager |
author |
Wim Taymans <wim.taymans@gmail.com> |
class |
Filter/Network/RTP |
name |
recv_rtcp_sink_%u |
direction |
sink |
presence |
request |
details |
application/x-rtcp |
application/x-srtcp |
name |
recv_rtp_sink_%u |
direction |
sink |
presence |
request |
details |
application/x-rtp |
application/x-srtp |
name |
send_rtp_sink_%u |
direction |
sink |
presence |
request |
details |
application/x-rtp |
name |
recv_rtp_src_%u_%u_%u |
direction |
source |
presence |
sometimes |
details |
application/x-rtp |
name |
send_rtp_src_%u |
direction |
source |
presence |
sometimes |
details |
application/x-rtp |
application/x-srtp |
name |
send_rtcp_src_%u |
direction |
source |
presence |
request |
details |
application/x-rtcp |
application/x-srtcp |
“do-lost”
property “do-lost” gboolean
Send an event downstream when a packet is lost.
Flags: Read / Write
Default value: FALSE
“latency”
property “latency” guint
Default amount of ms to buffer in the jitterbuffers.
Flags: Read / Write
Default value: 200
“ignore-pt”
property “ignore-pt” gboolean
Do not demultiplex based on PT values.
Flags: Read / Write
Default value: FALSE
“autoremove”
property “autoremove” gboolean
Automatically remove timed out sources.
Flags: Read / Write
Default value: FALSE
“buffer-mode”
property “buffer-mode” RTPJitterBufferMode
Control the buffering and timestamping mode used by the jitterbuffer.
Flags: Read / Write
Default value: Slave receiver to sender clock
“ntp-sync”
property “ntp-sync” gboolean
Set the NTP time from the sender reports as the running-time on the buffers. When both the sender and receiver have sychronized running-time, i.e. when the clock and base-time is shared between the receivers and the and the senders, this option can be used to synchronize receivers on multiple machines.
Flags: Read / Write
Default value: FALSE
“use-pipeline-clock”
property “use-pipeline-clock” gboolean
Use the pipeline running-time to set the NTP time in the RTCP SR messages (DEPRECATED: Use ntp-time-source property).
Flags: Read / Write
Default value: FALSE
“rtcp-sync”
property “rtcp-sync” GstRTCPSync
If not synchronizing (directly) to the NTP clock, determines how to sync the various streams.
Flags: Read / Write
Default value: always
“rtcp-sync-interval”
property “rtcp-sync-interval” guint
Determines how often to sync streams using RTCP data.
Flags: Read / Write
Default value: 0
“drop-on-latency”
property “drop-on-latency” gboolean
Tells the jitterbuffer to never exceed the given latency in size.
Flags: Read / Write
Default value: FALSE
“do-sync-event”
property “do-sync-event” gboolean
Send event downstream when a stream is synchronized to the sender.
Flags: Read / Write
Default value: FALSE
“do-retransmission”
property “do-retransmission” gboolean
Enables RTP retransmission on all streams. To control retransmission on a per-SSRC basis, connect to the “new-jitterbuffer” signal and set the “do-retransmission” property on the GstRtpJitterBuffer object instead.
Flags: Read / Write
Default value: FALSE
“rtp-profile”
property “rtp-profile” GstRTPProfile
Sets the default RTP profile of newly created RTP sessions. The profile can be changed afterwards on a per-session basis.
Flags: Read / Write
Default value: GST_RTP_PROFILE_AVP
“ntp-time-source”
property “ntp-time-source” GstRtpNtpTimeSource
NTP time source for RTCP packets.
Flags: Read / Write
Default value: NTP time based on realtime clock
“max-dropout-time”
property “max-dropout-time” guint
The maximum time (milliseconds) of missing packets tolerated.
Flags: Read / Write
Default value: 60000
“max-misorder-time”
property “max-misorder-time” guint
The maximum time (milliseconds) of misordered packets tolerated.
Flags: Read / Write
Default value: 2000
“max-rtcp-rtp-time-diff”
property “max-rtcp-rtp-time-diff” gint
Maximum amount of time in ms that the RTP time in RTCP SRs is allowed to be ahead (-1 disabled).
Flags: Read / Write
Allowed values: >= G_MAXULONG
Default value: 1000
“rtcp-sync-send-time”
property “rtcp-sync-send-time” gboolean
Use send time or capture time for RTCP sync (TRUE = send time, FALSE = capture time).
Flags: Read / Write
Default value: TRUE
“rfc7273-sync”
property “rfc7273-sync” gboolean
Synchronize received streams to the RFC7273 clock (requires clock and offset to be provided).
Flags: Read / Write
Default value: FALSE
“clear-pt-map”
signalvoid user_function (GstRtpBin *rtpbin, gpointer user_data)
Clear all previously cached pt-mapping obtained with “request-pt-map”.
rtpbin |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“get-internal-session”
signalRTPSession* user_function (GstRtpBin *rtpbin, guint id, gpointer user_data)
Request the internal RTPSession object as GObject in session id
.
rtpbin |
the object which received the signal |
|
id |
the session id |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“on-bye-ssrc”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify of an SSRC that became inactive because of a BYE packet.
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-bye-timeout”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify of an SSRC that has timed out because of BYE
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-new-ssrc”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify of a new SSRC that entered session
.
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-npt-stop”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify that SSRC sender has sent data up to the configured NPT stop time.
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-sender-timeout”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify of a sender SSRC that has timed out and became a receiver
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-ssrc-active”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify of a SSRC that is active, i.e., sending RTCP.
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-ssrc-collision”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify when we have an SSRC collision
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-ssrc-sdes”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify of a SSRC that is active, i.e., sending RTCP.
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-ssrc-validated”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify of a new SSRC that became validated.
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“on-timeout”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
Notify of an SSRC that has timed out
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“request-pt-map”
signalGstCaps* user_function (GstRtpBin *rtpbin, guint session, guint pt, gpointer user_data)
Request the payload type as GstCaps for pt
in session
.
rtpbin |
the object which received the signal |
|
session |
the session |
|
pt |
the pt |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“reset-sync”
signalvoid user_function (GstRtpBin *rtpbin, gpointer user_data)
Reset all currently configured lip-sync parameters and require new SR packets for all streams before lip-sync is attempted again.
rtpbin |
the object which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“payload-type-change”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint pt, gpointer user_data)
Signal that the current payload type changed to pt
in session
.
rtpbin |
the object which received the signal |
|
session |
the session |
|
pt |
the pt |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“new-jitterbuffer”
signalvoid user_function (GstRtpBin *rtpbin, GstElement *jitterbuffer, guint session, guint ssrc, gpointer user_data)
Notify that a new jitterbuffer
was created for session
and ssrc
.
This signal can, for example, be used to configure jitterbuffer
.
rtpbin |
the object which received the signal |
|
jitterbuffer |
the new jitterbuffer |
|
session |
the session |
|
ssrc |
the SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.4
“request-aux-receiver”
signalGstElement* user_function (GstRtpBin *rtpbin, guint session, gpointer user_data)
Request an AUX receiver element for the given session
. The AUX
element will be added to the bin.
If no handler is connected, no AUX element will be used.
rtpbin |
the object which received the signal |
|
session |
the session |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.4
“request-aux-sender”
signalGstElement* user_function (GstRtpBin *rtpbin, guint session, gpointer user_data)
Request an AUX sender element for the given session
. The AUX
element will be added to the bin.
If no handler is connected, no AUX element will be used.
rtpbin |
the object which received the signal |
|
session |
the session |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.4
“request-rtcp-decoder”
signalGstElement* user_function (GstRtpBin *rtpbin, guint session, gpointer user_data)
Request an RTCP decoder element for the given session
. The decoder
element will be added to the bin if not previously added.
If no handler is connected, no encoder will be used.
rtpbin |
the object which received the signal |
|
session |
the session |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.4
“request-rtcp-encoder”
signalGstElement* user_function (GstRtpBin *rtpbin, guint session, gpointer user_data)
Request an RTCP encoder element for the given session
. The encoder
element will be added to the bin if not previously added.
If no handler is connected, no encoder will be used.
rtpbin |
the object which received the signal |
|
session |
the session |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.4
“request-rtp-decoder”
signalGstElement* user_function (GstRtpBin *rtpbin, guint session, gpointer user_data)
Request an RTP decoder element for the given session
. The decoder
element will be added to the bin if not previously added.
If no handler is connected, no encoder will be used.
rtpbin |
the object which received the signal |
|
session |
the session |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.4
“request-rtp-encoder”
signalGstElement* user_function (GstRtpBin *rtpbin, guint session, gpointer user_data)
Request an RTP encoder element for the given session
. The encoder
element will be added to the bin if not previously added.
If no handler is connected, no encoder will be used.
rtpbin |
the object which received the signal |
|
session |
the session |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.4
“on-new-sender-ssrc”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the sender SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.8
“on-sender-ssrc-active”
signalvoid user_function (GstRtpBin *rtpbin, guint session, guint ssrc, gpointer user_data)
rtpbin |
the object which received the signal |
|
session |
the session |
|
ssrc |
the sender SSRC |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 1.8
“get-session”
signalGstElement* user_function (GstRtpBin *rtpbin, guint id, gpointer user_data)
Request the related GstRtpSession as GstElement related with session id
.
rtpbin |
the object which received the signal |
|
id |
the session id |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
Since: 1.8