webrtcbin
title: webrtcbin
Hierarchy
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBin ╰──webrtcbin
Implemented interfaces
Factory details
Authors: – Matthew Waters
Classification: – Filter/Network/WebRTC
Rank – primary
Plugin – webrtc
Package – GStreamer Bad Plug-ins
Pad Templates
Signals
on-data-channel
on_data_channel_callback (GstElement * object, GstWebRTCDataChannel * channel, gpointer udata)
def on_data_channel_callback (object, channel, udata):
#python callback for the 'on-data-channel' signal
function on_data_channel_callback(object: GstElement * object, channel: GstWebRTCDataChannel * channel, udata: gpointer udata): {
// javascript callback for the 'on-data-channel' signal
}
Flags: Run Last
on-ice-candidate
on_ice_candidate_callback (GstElement * object, guint mline_index, gchararray candidate, gpointer udata)
def on_ice_candidate_callback (object, mline_index, candidate, udata):
#python callback for the 'on-ice-candidate' signal
function on_ice_candidate_callback(object: GstElement * object, mline_index: guint mline_index, candidate: gchararray candidate, udata: gpointer udata): {
// javascript callback for the 'on-ice-candidate' signal
}
Parameters:
object
–
the webrtcbin
mline_index
–
the index of the media description in the SDP
candidate
–
the ICE candidate
udata
–
Flags: Run Last
on-negotiation-needed
on_negotiation_needed_callback (GstElement * object, gpointer udata)
def on_negotiation_needed_callback (object, udata):
#python callback for the 'on-negotiation-needed' signal
function on_negotiation_needed_callback(object: GstElement * object, udata: gpointer udata): {
// javascript callback for the 'on-negotiation-needed' signal
}
Flags: Run Last
on-new-transceiver
on_new_transceiver_callback (GstElement * object, GstWebRTCRTPTransceiver * candidate, gpointer udata)
def on_new_transceiver_callback (object, candidate, udata):
#python callback for the 'on-new-transceiver' signal
function on_new_transceiver_callback(object: GstElement * object, candidate: GstWebRTCRTPTransceiver * candidate, udata: gpointer udata): {
// javascript callback for the 'on-new-transceiver' signal
}
Parameters:
object
–
the webrtcbin
candidate
–
the new GstWebRTCRTPTransceiver
udata
–
Flags: Run Last
prepare-data-channel
prepare_data_channel_callback (GstElement * object, GstWebRTCDataChannel * channel, gboolean is_local, gpointer udata)
def prepare_data_channel_callback (object, channel, is_local, udata):
#python callback for the 'prepare-data-channel' signal
function prepare_data_channel_callback(object: GstElement * object, channel: GstWebRTCDataChannel * channel, is_local: gboolean is_local, udata: gpointer udata): {
// javascript callback for the 'prepare-data-channel' signal
}
Allows data-channel consumers to configure signal handlers on a newly created data-channel, before any data or state change has been notified.
Parameters:
channel
–
the new GstWebRTCDataChannel
is_local
–
Whether this channel is local or remote
udata
–
Flags: Run Last
Since : 1.22
Action Signals
add-ice-candidate
g_signal_emit_by_name (object, "add-ice-candidate", mline_index, ice-candidate);
ret = object.emit ("add-ice-candidate", mline_index, ice-candidate)
let ret = object.emit ("add-ice-candidate", mline_index, ice-candidate);
Parameters:
the webrtcbin
the index of the media description in the SDP
an ice candidate or NULL/"" to mark that no more candidates will arrive
add-transceiver
g_signal_emit_by_name (object, "add-transceiver", direction, caps, &ret);
ret = object.emit ("add-transceiver", direction, caps)
let ret = object.emit ("add-transceiver", direction, caps);
Parameters:
the webrtcbin
the direction of the new transceiver
the codec preferences for this transceiver
the new GstWebRTCRTPTransceiver
add-turn-server
g_signal_emit_by_name (object, "add-turn-server", uri, &ret);
ret = object.emit ("add-turn-server", uri)
let ret = object.emit ("add-turn-server", uri);
Add a turn server to obtain ICE candidates from
Parameters:
The uri of the server of the form turn(s)://username:password@host:port
create-answer
g_signal_emit_by_name (object, "create-answer", options, promise);
ret = object.emit ("create-answer", options, promise)
let ret = object.emit ("create-answer", options, promise);
create-data-channel
g_signal_emit_by_name (param_0, "create-data-channel", arg0, arg1, &ret);
ret = param_0.emit ("create-data-channel", arg0, arg1)
let ret = param_0.emit ("create-data-channel", arg0, arg1);
Parameters:
create-offer
g_signal_emit_by_name (object, "create-offer", options, promise);
ret = object.emit ("create-offer", options, promise)
let ret = object.emit ("create-offer", options, promise);
get-stats
g_signal_emit_by_name (object, "get-stats", pad, promise);
ret = object.emit ("get-stats", pad, promise)
let ret = object.emit ("get-stats", pad, promise);
The promise will contain the result of retrieving the session statistics. The structure will be named 'application/x-webrtc-stats and contain the following based on the webrtc-stats spec available from https://www.w3.org/TR/webrtc-stats/. As the webrtc-stats spec is a draft and is constantly changing these statistics may be changed to fit with the latest spec.
Each field key is a unique identifier for each RTCStats (https://www.w3.org/TR/webrtc/#rtcstats-dictionary) value (another GstStructure) in the RTCStatsReport (https://www.w3.org/TR/webrtc/#rtcstatsreport-object). Each supported field in the RTCStats subclass is outlined below.
Each statistics structure contains the following values as defined by the RTCStats dictionary (https://www.w3.org/TR/webrtc/#rtcstats-dictionary).
"timestamp" G_TYPE_DOUBLE timestamp the statistics were generated "type" GST_TYPE_WEBRTC_STATS_TYPE the type of statistics reported "id" G_TYPE_STRING unique identifier
RTCCodecStats supported fields (https://w3c.github.io/webrtc-stats/#codec-dict*)
"payload-type" G_TYPE_UINT the rtp payload number in use "clock-rate" G_TYPE_UINT the rtp clock-rate
RTCRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#streamstats-dict*)
"ssrc" G_TYPE_STRING the rtp sequence src in use "transport-id" G_TYPE_STRING identifier for the associated RTCTransportStats for this stream "codec-id" G_TYPE_STRING identifier for the associated RTCCodecStats for this stream
RTCReceivedStreamStats supported fields (https://w3c.github.io/webrtc-stats/#receivedrtpstats-dict*)
"packets-received" G_TYPE_UINT64 number of packets received (only for local inbound) "packets-lost" G_TYPE_INT64 number of packets lost "packets-discarded" G_TYPE_UINT64 number of packets discarded "packets-repaired" G_TYPE_UINT64 number of packets repaired "jitter" G_TYPE_DOUBLE packet jitter measured in seconds
RTCInboundRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*)
"remote-id" G_TYPE_STRING identifier for the associated RTCRemoteOutboundRTPStreamStats "bytes-received" G_TYPE_UINT64 number of bytes received (only for local inbound) "packets-duplicated" G_TYPE_UINT64 number of packets duplicated "fir-count" G_TYPE_UINT FIR packets sent by the receiver "pli-count" G_TYPE_UINT PLI packets sent by the receiver "nack-count" G_TYPE_UINT NACK packets sent by the receiver
RTCRemoteInboundRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#remoteinboundrtpstats-dict*)
"local-id" G_TYPE_STRING identifier for the associated RTCOutboundRTPSTreamStats "round-trip-time" G_TYPE_DOUBLE round trip time of packets measured in seconds "fraction-lost" G_TYPE_DOUBLE fraction packet loss
RTCSentRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#sentrtpstats-dict*)
"packets-sent" G_TYPE_UINT64 number of packets sent (only for local outbound) "bytes-sent" G_TYPE_UINT64 number of packets sent (only for local outbound)
RTCOutboundRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*)
"remote-id" G_TYPE_STRING identifier for the associated RTCRemoteInboundRTPSTreamStats (optional since 1.22) "fir-count" G_TYPE_UINT FIR packets received by the sender "pli-count" G_TYPE_UINT PLI packets received by the sender "nack-count" G_TYPE_UINT NACK packets received by the sender
RTCRemoteOutboundRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#remoteoutboundrtpstats-dict*)
"local-id" G_TYPE_STRING identifier for the associated RTCInboundRTPSTreamStats "remote-timestamp" G_TYPE_DOUBLE remote timestamp the statistics were sent by the remote
RTCIceCandidateStats supported fields (https://www.w3.org/TR/webrtc-stats/#icecandidate-dict*) (Since: 1.22)
"transport-id" G_TYPE_STRING identifier for the associated RTCTransportStats for this stream "address" G_TYPE_STRING address of the candidate, allowing for IPv4, IPv6 and FQDNs "port" G_TYPE_UINT port number of the candidate "candidate-type" G_TYPE_STRING RTCIceCandidateType "priority" G_TYPE_UINT64 calculated as defined in RFC 5245 "protocol" G_TYPE_STRING Either "udp" or "tcp". Based on the "transport" defined in RFC 5245 "relay-protocol" G_TYPE_STRING protocol used by the endpoint to communicate with the TURN server. Only present for local candidates. Either "udp", "tcp" or "tls" "url" G_TYPE_STRING URL of the ICE server from which the candidate was obtained. Only present for local candidates
RTCIceCandidatePairStats supported fields (https://www.w3.org/TR/webrtc-stats/#candidatepair-dict*) (Since: 1.22)
"local-candidate-id" G_TYPE_STRING unique identifier that is associated to the object that was inspected to produce the RTCIceCandidateStats for the local candidate associated with this candidate pair. "remote-candidate-id" G_TYPE_STRING unique identifier that is associated to the object that was inspected to produce the RTCIceCandidateStats for the remote candidate associated with this candidate pair.
get-transceiver
g_signal_emit_by_name (object, "get-transceiver", idx, &ret);
ret = object.emit ("get-transceiver", idx)
let ret = object.emit ("get-transceiver", idx);
the GstWebRTCRTPTransceiver, or NULL
Since : 1.16
get-transceivers
g_signal_emit_by_name (object, "get-transceivers", &ret);
ret = object.emit ("get-transceivers")
let ret = object.emit ("get-transceivers");
Parameters:
the webrtcbin
set-local-description
g_signal_emit_by_name (object, "set-local-description", desc, promise);
ret = object.emit ("set-local-description", desc, promise)
let ret = object.emit ("set-local-description", desc, promise);
set-remote-description
g_signal_emit_by_name (object, "set-remote-description", desc, promise);
ret = object.emit ("set-remote-description", desc, promise)
let ret = object.emit ("set-remote-description", desc, promise);
Properties
bundle-policy
“bundle-policy” GstWebRTCBundlePolicy *
The policy to apply for bundling
Flags : Read / Write
Default value : none (0)
connection-state
“connection-state” GstWebRTCPeerConnectionState *
The overall connection state of this element
Flags : Read
Default value : new (0)
current-local-description
“current-local-description” GstWebRTCSessionDescription *
The local description that was successfully negotiated the last time the connection transitioned into the stable state
Flags : Read
current-remote-description
“current-remote-description” GstWebRTCSessionDescription *
The last remote description that was successfully negotiated the last time the connection transitioned into the stable state plus any remote candidates that have been supplied via addIceCandidate since the offer or answer was created
Flags : Read
ice-connection-state
“ice-connection-state” GstWebRTCICEConnectionState *
The collective connection state of all ICETransport's
Flags : Read
Default value : new (0)
ice-gathering-state
“ice-gathering-state” GstWebRTCICEGatheringState *
The collective gathering state of all ICETransport's
Flags : Read
Default value : new (0)
ice-transport-policy
“ice-transport-policy” GstWebRTCICETransportPolicy *
The policy to apply for ICE transport
Flags : Read / Write
Default value : all (0)
latency
“latency” guint
Default duration to buffer in the jitterbuffers (in ms)
Flags : Read / Write
Default value : 200
local-description
“local-description” GstWebRTCSessionDescription *
The local SDP description in use for this connection. Favours a pending description over the current description
Flags : Read
pending-local-description
“pending-local-description” GstWebRTCSessionDescription *
The local description that is in the process of being negotiated plus any local candidates that have been generated by the ICE Agent since the offer or answer was created
Flags : Read
pending-remote-description
“pending-remote-description” GstWebRTCSessionDescription *
The remote description that is in the process of being negotiated, complete with any remote candidates that have been supplied via addIceCandidate since the offer or answer was created
Flags : Read
remote-description
“remote-description” GstWebRTCSessionDescription *
The remote SDP description to use for this connection. Favours a pending description over the current description
Flags : Read
signaling-state
“signaling-state” GstWebRTCSignalingState *
The signaling state of this element
Flags : Read
Default value : stable (0)
stun-server
“stun-server” gchararray
The STUN server of the form stun://hostname:port
Flags : Read / Write
Default value : NULL
turn-server
“turn-server” gchararray
The TURN server of the form turn(s)://username:password@host:port. This is a convenience property, use if you wish to use multiple TURN servers
Flags : Read / Write
Default value : NULL
GstWebRTCBinPad
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstPad ╰──GstProxyPad ╰──GstGhostPad ╰──GstWebRTCBinPad
Properties
transceiver
“transceiver” GstWebRTCRTPTransceiver *
Transceiver associated with this pad
Flags : Read
Action Signals
add-local-ip-address
g_signal_emit_by_name (object, "add-local-ip-address", address, &ret);
ret = object.emit ("add-local-ip-address", address)
let ret = object.emit ("add-local-ip-address", address);
Add a local IP address to use for ICE candidate gathering. If none are supplied, they will be discovered automatically. Calling this signal stops automatic ICE gathering.
whether the address could be added.
Properties
agent
“agent” NiceAgent *
ICE agent in use by this object. WARNING! Accessing this property may have disastrous consequences for the operation of webrtcbin. Other ICE implementations may not have the same interface.
Flags : Read
ice-tcp
“ice-tcp” gboolean
Whether the agent should use ICE-TCP when gathering candidates
Flags : Read / Write
Default value : true
ice-udp
“ice-udp” gboolean
Whether the agent should use ICE-UDP when gathering candidates
Flags : Read / Write
Default value : true
max-rtp-port
“max-rtp-port” guint
Maximum port for local rtp port range. min-rtp-port must be <= max-rtp-port
Flags : Read / Write / Construct
Default value : 65535
min-rtp-port
“min-rtp-port” guint
Minimum port for local rtp port range. min-rtp-port must be <= max-rtp-port
Flags : Read / Write
Default value : 0
The results of the search are