# webrtcbin

title: webrtcbin

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBin
                        ╰──webrtcbin

## Implemented interfaces

    GstChildProxy

## Factory details

Authors: – Matthew Waters

Classification: – `Filter/Network/WebRTC`

Rank – primary

Plugin – webrtc

Package – GStreamer Bad Plug-ins

## Pad Templates

### `sink_%u`

    application/x-rtp:

Presence – request

Direction – sink

Object type – GstWebRTCBinPad

### `src_%u`

    application/x-rtp:

Presence – sometimes

Direction – src

Object type – GstPad

## Signals

### on-data-channel

    on_data_channel_callback (GstElement * object,
                              GstWebRTCDataChannel * candidate,
                              gpointer udata)

    def on_data_channel_callback (object, candidate, udata):
        #python callback for the 'on-data-channel' signal

    function on_data_channel_callback(object: GstElement * object, candidate: GstWebRTCDataChannel * candidate, udata: gpointer udata): {
        // javascript callback for the 'on-data-channel' signal
    }

Parameters:

`object` –

the

`candidate` –

the new `GstWebRTCDataChannel`

`udata` –
No description available

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` –
No description available

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
    }

Parameters:

`object` –

the webrtcbin

`udata` –
No description available

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` –
No description available

Flags: Run Last

## 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:

`object` (GstElement *) –

the webrtcbin

`mline_index` (guint) –

the index of the media description in the SDP

`ice-candidate` (gchararray) –

an ice candidate or NULL/"" to mark that no more candidates will arrive

Flags: Run Last / Action

### 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:

`object` (GstElement *) –

the webrtcbin

`direction` (GstWebRTCRTPTransceiverDirection *) –

the direction of the new transceiver

`caps` (GstCaps *) –

the codec preferences for this transceiver

Returns (GstWebRTCRTPTransceiver *) –

the new GstWebRTCRTPTransceiver

Flags: Run Last / Action

### 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:

`object` (GstElement *) –

the

`uri` (gchararray) –

The uri of the server of the form turn(s)://username:password@host:port

Returns (gboolean) –
No description available

Flags: Run Last / Action

### 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);

Parameters:

`object` (GstElement *) –

the webrtcbin

`options` (GstStructure *) –

create-answer options

`promise` (GstPromise *) –

a GstPromise which will contain the answer

Flags: Run Last / Action

### 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:

`param_0` (GstElement *) –
No description available
`arg0` (gchararray) –
No description available
`arg1` (GstStructure *) –
No description available
Returns (GstWebRTCDataChannel *) –
No description available

Flags: Run Last / Action

### 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);

Parameters:

`object` (GstElement *) –

the webrtcbin

`options` (GstStructure *) –

create-offer options

`promise` (GstPromise *) –

a GstPromise which will contain the offer

Flags: Run Last / Action

### 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 "fir-count" G_TYPE_UINT FIR requests received by the sender (only for local statistics) "pli-count" G_TYPE_UINT PLI requests received by the sender (only for local statistics) "nack-count" G_TYPE_UINT NACK requests received by the sender (only for local statistics)

RTCReceivedStreamStats supported fields (https://w3c.github.io/webrtc-stats/#receivedrtpstats-dict*)

"packets-received" G_TYPE_UINT64 number of packets received (only for local inbound) "bytes-received" G_TYPE_UINT64 number of bytes received (only for local inbound) "packets-lost" G_TYPE_UINT number of packets lost "jitter" G_TYPE_DOUBLE packet jitter measured in secondss

RTCInboundRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*)

"remote-id" G_TYPE_STRING identifier for the associated RTCRemoteOutboundRTPStreamStats

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

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

RTCRemoteOutboundRTPStreamStats supported fields (https://w3c.github.io/webrtc-stats/#remoteoutboundrtpstats-dict*)

"local-id" G_TYPE_STRING identifier for the associated RTCInboundRTPSTreamStats

Parameters:

`object` (GstElement *) –

the webrtcbin

`pad` (GstPad *) –

A GstPad to get the stats for, or NULL for all

`promise` (GstPromise *) –

a GstPromise for the result

Flags: Run Last / Action

### 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);

Parameters:

`object` (GstElement *) –

the

`idx` (gint) –

The index of the transceiver

Returns (GstWebRTCRTPTransceiver *) –

the GstWebRTCRTPTransceiver, or NULL

Flags: Run Last / Action

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:

`object` (GstElement *) –

the webrtcbin

Returns (GArray *) –

a GArray of GstWebRTCRTPTransceiver

Flags: Run Last / Action

### 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);

Parameters:

`object` (GstElement *) –

the

`desc` (GstWebRTCSessionDescription *) –

a GstWebRTCSessionDescription description

`promise` (GstPromise *) –

a GstPromise to be notified when it's set

Flags: Run Last / Action

### 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);

Parameters:

`object` (GstElement *) –

the

`desc` (GstWebRTCSessionDescription *) –

a GstWebRTCSessionDescription description

`promise` (GstPromise *) –

a GstPromise to be notified when it's set

Flags: Run Last / Action

## 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-agent

    “ice-agent” GstWebRTCICE *

The WebRTC ICE agent

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

## GstWebRTCICE

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstWebRTCICE

### 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.

Parameters:

`object` (GstElement *) –

the GstWebRTCICE

`address` (gchararray) –

The local IP address

Returns (gboolean) –

whether the address could be added.

Flags: Run Last / Action

### 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