## webrtcbin webrtcbin |

## Properties

GstWebRTCPeerConnectionState | connection-state | Read
GstWebRTCICEConnectionState | ice-connection-state | Read
GstWebRTCICEGatheringState | ice-gathering-state | Read
GstWebRTCSessionDescription * | local-description | Read / Write
GstWebRTCSessionDescription * | remote-description | Read / Write
GstWebRTCSignalingState | signaling-state | Read
gchar * | stun-server | Read / Write
gchar * | turn-server | Read / Write
GstWebRTCBundlePolicy | bundle-policy | Read / Write
GstWebRTCICETransportPolicy | ice-transport-policy | Read / Write

## Signals

void | add-ice-candidate | Action
GstWebRTCRTPTransceiver* | add-transceiver | Action
void | create-answer | Action
void | create-offer | Action
void | get-stats | Action
GArray* | get-transceivers | Action
void | on-ice-candidate | Run Last
void | on-negotiation-needed | Run Last
void | set-local-description | Action
void | set-remote-description | Action
gboolean | add-turn-server | Action
GstWebRTCDataChannel* | create-data-channel | Action
void | on-data-channel | Run Last
void | on-new-transceiver | Run Last
GstWebRTCRTPTransceiver* | get-transceiver | Action

## Types and Values

| GstWebRTCBin

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBin
                        ╰── GstWebRTCBin

## Implemented Interfaces

GstWebRTCBin implements GstChildProxy.

## Description

## Synopsis

### Element Information

plugin | webrtc
author | Matthew Waters <matthew@centricular.com>
class | Filter/Network/WebRTC

### Element Pads

name | sink_%u
direction | sink
presence | request
details | application/x-rtp

name | src_%u
direction | source
presence | sometimes
details | application/x-rtp

## Functions

## Types and Values

### GstWebRTCBin

    typedef struct _GstWebRTCBin GstWebRTCBin;

## Property Details

### The `“connection-state”` property

      “connection-state”         GstWebRTCPeerConnectionState

The overall connection state of this element.

Flags: Read

Default value: GST_WEBRTC_PEER_CONNECTION_STATE_NEW

### The `“ice-connection-state”` property

      “ice-connection-state”     GstWebRTCICEConnectionState

The collective connection state of all ICETransport's.

Flags: Read

Default value: GST_WEBRTC_ICE_CONNECTION_STATE_NEW

### The `“ice-gathering-state”` property

      “ice-gathering-state”      GstWebRTCICEGatheringState

The collective gathering state of all ICETransport's.

Flags: Read

Default value: GST_WEBRTC_ICE_GATHERING_STATE_NEW

### The `“local-description”` property

      “local-description”        GstWebRTCSessionDescription *

The local SDP description to use for this connection.

Flags: Read / Write

### The `“remote-description”` property

      “remote-description”       GstWebRTCSessionDescription *

The remote SDP description to use for this connection.

Flags: Read / Write

### The `“signaling-state”` property

      “signaling-state”          GstWebRTCSignalingState

The signaling state of this element.

Flags: Read

Default value: GST_WEBRTC_SIGNALING_STATE_STABLE

### The `“stun-server”` property

      “stun-server”              gchar *

The STUN server of the form stun://hostname:port.

Flags: Read / Write

Default value: NULL

### The `“turn-server”` property

      “turn-server”              gchar *

The TURN server of the form turn(s)://username:password@host:port. This is a convenience property, use #GstWebRTCBin::add-turn-server if you wish to use multiple TURN servers.

Flags: Read / Write

Default value: NULL

### The `“bundle-policy”` property

      “bundle-policy”            GstWebRTCBundlePolicy

The policy to apply for bundling.

Flags: Read / Write

Default value: GST_WEBRTC_BUNDLE_POLICY_NONE

### The `“ice-transport-policy”` property

      “ice-transport-policy”     GstWebRTCICETransportPolicy

The policy to apply for ICE transport.

Flags: Read / Write

Default value: GST_WEBRTC_ICE_TRANSPORT_POLICY_ALL

## Signal Details

### The `“add-ice-candidate”` signal

    void
    user_function (GstWebRTCBin *object,
                   guint         mline_index,
                   gchar        *ice-candidate,
                   gpointer      user_data)

#### Parameters

object | the GstWebRtcBin |
mline_index | the index of the media description in the SDP |
ice-candidate | an ice candidate |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“add-transceiver”` signal

    GstWebRTCRTPTransceiver*
    user_function (GstWebRTCBin                    *object,
                   GstWebRTCRTPTransceiverDirection direction,
                   GstCaps                         *caps,
                   gpointer                         user_data)

#### Parameters

object | the GstWebRtcBin |
direction | the direction of the new transceiver |
caps | the codec preferences for this transceiver. | [allow none]
user_data | user data set when the signal handler was connected. |

#### Returns

the new GstWebRTCRTPTransceiver

Flags: Action

### The `“create-answer”` signal

    void
    user_function (GstWebRTCBin *object,
                   GstStructure *options,
                   GstPromise   *promise,
                   gpointer      user_data)

#### Parameters

object | the GstWebRtcBin |
options | create-answer options |
promise | a GstPromise which will contain the answer |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“create-offer”` signal

    void
    user_function (GstWebRTCBin *object,
                   GstStructure *options,
                   GstPromise   *promise,
                   gpointer      user_data)

#### Parameters

object | the GstWebRtcBin |
options | create-offer options |
promise | a GstPromise which will contain the offer |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“get-stats”` signal

    void
    user_function (GstWebRTCBin *object,
                   GstPad       *pad,
                   GstPromise   *promise,
                   gpointer      user_data)

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 identifer 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 | the GstWebRtcBin |
pad | A GstPad to get the stats for, or `NULL` for all. | [nullable]
promise | a GstPromise for the result |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“get-transceivers”` signal

    GArray*
    user_function (GstWebRTCBin *object,
                   gpointer      user_data)

#### Parameters

object | the GstWebRtcBin |
user_data | user data set when the signal handler was connected. |

#### Returns

a GArray of GstWebRTCRTPTransceivers

Flags: Action

### The `“on-ice-candidate”` signal

    void
    user_function (GstWebRTCBin *object,
                   guint         mline_index,
                   gchar        *candidate,
                   gpointer      user_data)

#### Parameters

object | the GstWebRtcBin |
mline_index | the index of the media description in the SDP |
candidate | the ICE candidate |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“on-negotiation-needed”` signal

    void
    user_function (GstWebRTCBin *object,
                   gpointer      user_data)

#### Parameters

object | the GstWebRtcBin |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“set-local-description”` signal

    void
    user_function (GstWebRTCBin                *object,
                   GstWebRTCSessionDescription *desc,
                   GstPromise                  *promise,
                   gpointer                     user_data)

#### Parameters

object | the GstWebRtcBin |
desc | a GstWebRTCSessionDescription description |
promise | a GstPromise to be notified when it's set. | [nullable]
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“set-remote-description”` signal

    void
    user_function (GstWebRTCBin                *object,
                   GstWebRTCSessionDescription *desc,
                   GstPromise                  *promise,
                   gpointer                     user_data)

#### Parameters

object | the GstWebRtcBin |
desc | a GstWebRTCSessionDescription description |
promise | a GstPromise to be notified when it's set. | [nullable]
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“add-turn-server”` signal

    gboolean
    user_function (GstWebRTCBin *object,
                   gchar        *uri,
                   gpointer      user_data)

Add a turn server to obtain ICE candidates from

#### Parameters

object | the GstWebRtcBin |
uri | The uri of the server of the form turn(s)://username:password`host` :port |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“create-data-channel”` signal

    GstWebRTCDataChannel*
    user_function (GstWebRTCBin *gstwebrtcbin,
                   gchar        *arg1,
                   GstStructure *arg2,
                   gpointer      user_data)

Flags: Action

### The `“on-data-channel”` signal

    void
    user_function (GstWebRTCBin         *object,
                   GstWebRTCDataChannel *candidate,
                   gpointer              user_data)

#### Parameters

object | the GstWebRtcBin |
candidate | the new GstWebRTCDataChannel |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“on-new-transceiver”` signal

    void
    user_function (GstWebRTCBin            *object,
                   GstWebRTCRTPTransceiver *candidate,
                   gpointer                 user_data)

#### Parameters

object | the GstWebRtcBin |
candidate | the new GstWebRTCRTPTransceiver |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“get-transceiver”` signal

    GstWebRTCRTPTransceiver*
    user_function (GstWebRTCBin *object,
                   gint          idx,
                   gpointer      user_data)

#### Parameters

object | the GstWebRtcBin |
idx | The index of the transceiver |
user_data | user data set when the signal handler was connected. |

#### Returns

the GstWebRTCRTPTransceiver, or `NULL`

Flags: Action

Since: 1.16