webrtcsink
webrtcsink
is an element that can be used to serve media streams
to multiple consumers through WebRTC.
It uses a signaller that implements the protocol supported by the default signalling server we additionally provide, take a look at the subclasses of GstBaseWebRTCSink for other supported protocols, or implement your own.
See the documentation of the plugin for more information on features and usage.
Hierarchy
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBin ╰──GstBaseWebRTCSink ╰──webrtcsink
Implemented interfaces
Factory details
Authors: – Mathieu Duponchelle
Classification: – Sink/Network/WebRTC
Rank – none
Plugin – rswebrtc
Package – gst-plugin-webrtc
Pad Templates
video_%u
video/x-raw:
video/x-raw(memory:CUDAMemory):
video/x-raw(memory:GLMemory):
video/x-raw(memory:NVMM):
video/x-raw(memory:D3D11Memory):
video/x-vp8:
video/x-h264:
video/x-vp9:
video/x-h265:
GstBaseWebRTCSink
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBin ╰──GstBaseWebRTCSink
Base class for WebRTC sinks to implement and provide their own protocol for.
Signals
consumer-added
consumer_added_callback (GstElement * param_0, gchararray arg0, GstElement * arg1, gpointer udata)
def consumer_added_callback (param_0, arg0, arg1, udata):
#python callback for the 'consumer-added' signal
function consumer_added_callback(param_0: GstElement * param_0, arg0: gchararray arg0, arg1: GstElement * arg1, udata: gpointer udata): {
// javascript callback for the 'consumer-added' signal
}
Parameters:
param_0
–
arg0
–
arg1
–
udata
–
Flags: Run Last
consumer-pipeline-created
consumer_pipeline_created_callback (GstElement * param_0, gchararray arg0, GstPipeline * arg1, gpointer udata)
def consumer_pipeline_created_callback (param_0, arg0, arg1, udata):
#python callback for the 'consumer-pipeline-created' signal
function consumer_pipeline_created_callback(param_0: GstElement * param_0, arg0: gchararray arg0, arg1: GstPipeline * arg1, udata: gpointer udata): {
// javascript callback for the 'consumer-pipeline-created' signal
}
Parameters:
param_0
–
arg0
–
arg1
–
udata
–
Flags: Run Last
consumer-removed
consumer_removed_callback (GstElement * param_0, gchararray arg0, GstElement * arg1, gpointer udata)
def consumer_removed_callback (param_0, arg0, arg1, udata):
#python callback for the 'consumer-removed' signal
function consumer_removed_callback(param_0: GstElement * param_0, arg0: gchararray arg0, arg1: GstElement * arg1, udata: gpointer udata): {
// javascript callback for the 'consumer-removed' signal
}
Parameters:
param_0
–
arg0
–
arg1
–
udata
–
Flags: Run Last
encoder-setup
gboolean encoder_setup_callback (GstElement * param_0, gchararray arg0, gchararray arg1, GstElement * arg2, gpointer udata)
def encoder_setup_callback (param_0, arg0, arg1, arg2, udata):
#python callback for the 'encoder-setup' signal
function encoder_setup_callback(param_0: GstElement * param_0, arg0: gchararray arg0, arg1: gchararray arg1, arg2: GstElement * arg2, udata: gpointer udata): {
// javascript callback for the 'encoder-setup' signal
}
Parameters:
param_0
–
arg0
–
arg1
–
arg2
–
udata
–
Flags: Run Last
request-encoded-filter
GstElement * request_encoded_filter_callback (GstElement * param_0, gchararray arg0, gchararray arg1, GstCaps * arg2, gpointer udata)
def request_encoded_filter_callback (param_0, arg0, arg1, arg2, udata):
#python callback for the 'request-encoded-filter' signal
function request_encoded_filter_callback(param_0: GstElement * param_0, arg0: gchararray arg0, arg1: gchararray arg1, arg2: GstCaps * arg2, udata: gpointer udata): {
// javascript callback for the 'request-encoded-filter' signal
}
Parameters:
param_0
–
arg0
–
arg1
–
arg2
–
udata
–
Flags: Run Last
Action Signals
get-sessions
g_signal_emit_by_name (param_0, "get-sessions", &ret);
ret = param_0.emit ("get-sessions")
let ret = param_0.emit ("get-sessions");
Parameters:
Properties
audio-caps
“audio-caps” GstCaps *
Governs what audio codecs will be proposed
Flags : Read / Write
Default value :
audio/x-opus
congestion-control
“congestion-control” Web-rtcsink-congestion-control *
Defines how congestion is controlled, if at all
Flags : Read / Write
Default value : gcc (2)
do-fec
“do-fec” gboolean
Whether the element should negotiate and send FEC data
Flags : Read / Write
Default value : true
do-retransmission
“do-retransmission” gboolean
Whether the element should offer to honor retransmission requests
Flags : Read / Write
Default value : true
ice-transport-policy
“ice-transport-policy” GstWebRTCICETransportPolicy *
The policy to apply for ICE transport
Flags : Read / Write
Default value : all (0)
max-bitrate
“max-bitrate” guint
Maximum bitrate to use (in bit/sec) when computing it through the congestion control algorithm
Flags : Read / Write
Default value : 8192000
min-bitrate
“min-bitrate” guint
Minimal bitrate to use (in bit/sec) when computing it through the congestion control algorithm
Flags : Read / Write
Default value : 1000
signaller
“signaller” GstRSWebRTCSignallableIface *
The Signallable object to use to handle WebRTC Signalling
Flags : Read
start-bitrate
“start-bitrate” guint
Start bitrate to use (in bit/sec)
Flags : Read / Write
Default value : 2048000
stats
“stats” GstStructure *
Statistics for the current consumers
Flags : Read
Default value :
application/x-webrtcsink-stats;
stun-server
“stun-server” gchararray
The STUN server of the form stun://hostname:port
Flags : Read / Write
Default value : stun://stun.l.google.com:19302
turn-servers
“turn-servers” GstValueArray *
The TURN servers of the form <"turn(s)://username:password@host:port", "turn(s)://username1:password1@host1:port1">
Flags : Read / Write
video-caps
“video-caps” GstCaps *
Governs what video codecs will be proposed
Flags : Read / Write
Default value :
video/x-vp8; video/x-h264; video/x-vp9; video/x-h265
Named constants
Web-rtcsink-congestion-control
Members
disabled
(0) – Disabled: no congestion control is applied
homegrown
(1) – Homegrown: simple sender-side heuristic
gcc
(2) – Google Congestion Control algorithm
GstRSWebRTCSignallableIface
GInterface ╰──GstRSWebRTCSignallableIface
Interface that WebRTC elements can implement their own protocol with.
Signals
consumer-added
consumer_added_callback (GstElement * self, gchararray peer_id, GstElement * webrtcbin, gpointer udata)
def consumer_added_callback (self, peer_id, webrtcbin, udata):
#python callback for the 'consumer-added' signal
function consumer_added_callback(self: GstElement * self, peer_id: gchararray peer_id, webrtcbin: GstElement * webrtcbin, udata: gpointer udata): {
// javascript callback for the 'consumer-added' signal
}
This signal can be used to tweak webrtcbin, creating a data channel for example.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
peer_id
–
Id of the consumer
webrtcbin
–
The internal WebRTCBin element
udata
–
Flags: Run Last
deprecated :
1.24: Use webrtcbin-ready
instead
consumer-removed
consumer_removed_callback (GstElement * consumer_id, gchararray webrtcbin, GstElement * arg1, gpointer udata)
def consumer_removed_callback (consumer_id, webrtcbin, arg1, udata):
#python callback for the 'consumer-removed' signal
function consumer_removed_callback(consumer_id: GstElement * consumer_id, webrtcbin: gchararray webrtcbin, arg1: GstElement * arg1, udata: gpointer udata): {
// javascript callback for the 'consumer-removed' signal
}
This signal is emitted right after the connection with a consumer has been dropped.
Parameters:
consumer_id
–
Identifier of the consumer that was removed
webrtcbin
–
The webrtcbin connected to the newly removed consumer
arg1
–
udata
–
Flags: Run Last
end-session
gboolean end_session_callback (GstElement * self, gchararray session-id, gpointer udata)
def end_session_callback (self, session-id, udata):
#python callback for the 'end-session' signal
function end_session_callback(self: GstElement * self, session-id: gchararray session-id, udata: gpointer udata): {
// javascript callback for the 'end-session' signal
}
Notify the signaller that a session should be ended.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
session-id
–
The ID of the session that should be ended
udata
–
Flags: Run Last
error
error_callback (GstElement * self, gchararray error, gpointer udata)
def error_callback (self, error, udata):
#python callback for the 'error' signal
function error_callback(self: GstElement * self, error: gchararray error, udata: gpointer udata): {
// javascript callback for the 'error' signal
}
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
error
–
The error message as a string
udata
–
Flags: Run Last
producer-added
producer_added_callback (GstElement * self, gchararray producer_id, GstStructure * meta, gboolean new_connection, gpointer udata)
def producer_added_callback (self, producer_id, meta, new_connection, udata):
#python callback for the 'producer-added' signal
function producer_added_callback(self: GstElement * self, producer_id: gchararray producer_id, meta: GstStructure * meta, new_connection: gboolean new_connection, udata: gpointer udata): {
// javascript callback for the 'producer-added' signal
}
Some producing peer is available to produce a WebRTC stream.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
producer_id
–
The ID of the available producer
meta
–
The metadata structure of the producer
new_connection
–
true if the producer has just connected to the signalling server or false if it was already running before starting the client
udata
–
Flags: Run Last
producer-removed
producer_removed_callback (GstElement * self, gchararray producer_id, GstStructure * meta, gpointer udata)
def producer_removed_callback (self, producer_id, meta, udata):
#python callback for the 'producer-removed' signal
function producer_removed_callback(self: GstElement * self, producer_id: gchararray producer_id, meta: GstStructure * meta, udata: gpointer udata): {
// javascript callback for the 'producer-removed' signal
}
Some producing peer has stopped producing streams.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
producer_id
–
The ID of the producer that is not available anymore
meta
–
The metadata structure of the producer
udata
–
Flags: Run Last
request-meta
GstStructure * request_meta_callback (GstElement * self, gpointer udata)
def request_meta_callback (self, udata):
#python callback for the 'request-meta' signal
function request_meta_callback(self: GstElement * self, udata: gpointer udata): {
// javascript callback for the 'request-meta' signal
}
The signaller requests a meta about the peer using it
Return: The metadata about the peer represented by the signaller
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
udata
–
Flags: Run Last
send-ice
gboolean send_ice_callback (GstElement * self, gchararray session_id, gchararray candidate, guint sdp_m_line_index, gchararray sdp_mid, gpointer udata)
def send_ice_callback (self, session_id, candidate, sdp_m_line_index, sdp_mid, udata):
#python callback for the 'send-ice' signal
function send_ice_callback(self: GstElement * self, session_id: gchararray session_id, candidate: gchararray candidate, sdp_m_line_index: guint sdp_m_line_index, sdp_mid: gchararray sdp_mid, udata: gpointer udata): {
// javascript callback for the 'send-ice' signal
}
Send candidate to the peer.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
session_id
–
Id of the session being described
candidate
–
The ICE candidate description to send to the peer
sdp_m_line_index
–
The M-line of the session description this candidate applies to
sdp_mid
–
The MID this candidate applies to
udata
–
Flags: Run Last
send-session-description
gboolean send_session_description_callback (GstElement * self, gchararray session_id, GstWebRTCSessionDescription * description, gpointer udata)
def send_session_description_callback (self, session_id, description, udata):
#python callback for the 'send-session-description' signal
function send_session_description_callback(self: GstElement * self, session_id: gchararray session_id, description: GstWebRTCSessionDescription * description, udata: gpointer udata): {
// javascript callback for the 'send-session-description' signal
}
Send description to the peer.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
session_id
–
Id of the session being described
description
–
The WebRTC session description to send to the peer
udata
–
Flags: Run Last
session-requested
session_requested_callback (GstElement * self, gchararray session_id, gchararray peer_id, GstWebRTCSessionDescription * arg2, gpointer udata)
def session_requested_callback (self, session_id, peer_id, arg2, udata):
#python callback for the 'session-requested' signal
function session_requested_callback(self: GstElement * self, session_id: gchararray session_id, peer_id: gchararray peer_id, arg2: GstWebRTCSessionDescription * arg2, udata: gpointer udata): {
// javascript callback for the 'session-requested' signal
}
Notify the underlying webrtc object that a session has been requested from the peer.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
session_id
–
The ID of the producer that was added
peer_id
–
The ID of the consumer peer who wants to initiate a session
arg2
–
udata
–
Flags: Run Last
session-started
session_started_callback (GstElement * self, gchararray arg0, gchararray arg1, gpointer udata)
def session_started_callback (self, arg0, arg1, udata):
#python callback for the 'session-started' signal
function session_started_callback(self: GstElement * self, arg0: gchararray arg0, arg1: gchararray arg1, udata: gpointer udata): {
// javascript callback for the 'session-started' signal
}
Notify the underlying webrtc object that a session has started.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
arg0
–
arg1
–
udata
–
Flags: Run Last
webrtcbin-ready
webrtcbin_ready_callback (GstElement * self, gchararray peer_id, GstElement * webrtcbin, gpointer udata)
def webrtcbin_ready_callback (self, peer_id, webrtcbin, udata):
#python callback for the 'webrtcbin-ready' signal
function webrtcbin_ready_callback(self: GstElement * self, peer_id: gchararray peer_id, webrtcbin: GstElement * webrtcbin, udata: gpointer udata): {
// javascript callback for the 'webrtcbin-ready' signal
}
This signal can be used to tweak webrtcbin, creating a data channel for example.
Parameters:
self
–
The object implementing GstRSWebRTCSignallableIface
peer_id
–
Id of the consumer/producer
webrtcbin
–
The internal WebRTCBin element
udata
–
Flags: Run Last
Action Signals
handle-ice
g_signal_emit_by_name (self, "handle-ice", session_id, sdp_m_line_index, sdp_mid, candidate);
ret = self.emit ("handle-ice", session_id, sdp_m_line_index, sdp_mid, candidate)
let ret = self.emit ("handle-ice", session_id, sdp_m_line_index, sdp_mid, candidate);
Notify the underlying webrtc object of an ICE candidate.
Parameters:
The object implementing GstRSWebRTCSignallableIface
Id of the session the ice information is about
The mlineindex of the ice candidate
Media ID of the ice candidate
Information about the candidate
session-description
g_signal_emit_by_name (self, "session-description", session_id, description);
ret = self.emit ("session-description", session_id, description)
let ret = self.emit ("session-description", session_id, description);
Notify the underlying webrtc object of a received session description
Parameters:
The object implementing GstRSWebRTCSignallableIface
Id of the session being described
The WebRTC session description
session-ended
g_signal_emit_by_name (self, "session-ended", session-id, &ret);
ret = self.emit ("session-ended", session-id)
let ret = self.emit ("session-ended", session-id);
Notify the underlying webrtc object that a session has ended.
shutdown
g_signal_emit_by_name (self, "shutdown");
ret = self.emit ("shutdown")
let ret = self.emit ("shutdown");
Parameters:
The object implementing GstRSWebRTCSignallableIface
start
g_signal_emit_by_name (self, "start", &ret);
ret = self.emit ("start")
let ret = self.emit ("start");
Starts the signaller, connecting it to the signalling server.
Parameters:
The object implementing GstRSWebRTCSignallableIface
stop
g_signal_emit_by_name (self, "stop", &ret);
ret = self.emit ("stop")
let ret = self.emit ("stop");
Stops the signaller, disconnecting it to the signalling server.
Parameters:
The object implementing GstRSWebRTCSignallableIface
The results of the search are