webrtcbin

webrtcbin

Properties

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

Signals

Types and Values

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 in use for this connection. Favours a pending description over the current description.

Flags: Read


The “remote-description” property

  “remote-description”       GstWebRTCSessionDescription *

The remote SDP description to use for this connection. Favours a pending description over the current description.

Flags: Read


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 “current-local-description” property

  “current-local-description” GstWebRTCSessionDescription *

The local description that was successfully negotiated the last time the connection transitioned into the stable state.

Flags: Read


The “current-remote-description” property

  “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


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


The “pending-local-description” property

  “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


The “pending-remote-description” property

  “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

Signal Details

The “add-ice-candidate” signal

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

Parameters

object

the webrtcbin

 

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 webrtcbin

 

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 webrtcbin

 

options

create-answer options.

[nullable]

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 webrtcbin

 

options

create-offer options.

[nullable]

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 webrtcbin

 

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 webrtcbin

 

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 webrtcbin

 

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 webrtcbin

 

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 “on-new-transceiver” signal

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

Parameters

object

the webrtcbin

 

candidate

the new GstWebRTCRTPTransceiver

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


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:passwordhost :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 “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.

[transfer full]

Flags: Action

Since: 1.16


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