Commit 1894293d authored by Matthew Waters's avatar Matthew Waters 🐨

webrtcbin: an element that handles the transport aspects of webrtc connections

SDP's are generated and consumed according to the W3C PeerConnection API
available from https://www.w3.org/TR/webrtc/

The SDP is either created initially from the connected
sink pads/attached transceivers as in the case of generating an offer or
intersected with the connected sink pads/attached transceivers as in
the case for creating an answer.  In both cases, the rtp payloaded streams
sent by the peer are exposed as separate src pads.

The implementation supports trickle ICE, RTCP muxing, reduced size RTCP.

With contributions from:
Nirbheek Chauhan <nirbheek@centricular.com>
Mathieu Duponchelle <mathieu@centricular.com>
Edward Hervey <edward@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=792523
parent 94a7bf9e
......@@ -46,6 +46,8 @@ Makefile
tmp-orc.c
gst*orc.h
/gst-libs/gst/*/*-enumtypes.[ch]
/tests/check/orc
/tests/check/media/
/tests/check/libs/player
......@@ -71,6 +73,9 @@ gst*orc.h
/tests/examples/opencv/gstfacedetect_test
/tests/examples/playout
/tests/examples/waylandsink/gtkwaylandsink
/tests/examples/webrtc/webrtc
/tests/examples/webrtc/webrtcbidirectional
/tests/examples/webrtc/webrtcswap
Build
*.user
......
......@@ -2425,6 +2425,16 @@ AG_GST_CHECK_FEATURE(WEBRTCDSP, [WebRTC Audio Processing], webrtcdsp, [
AC_LANG_POP([C++])
])
dnl *** WebRTC ***
translit(dnm, m, l) AM_CONDITIONAL(USE_WEBRTC, true)
AG_GST_CHECK_FEATURE(WEBRTC, [WebRTC], webrtc, [
AG_GST_PKG_CHECK_MODULES(GST_SDP, gstreamer-sdp-1.0)
PKG_CHECK_MODULES(NICE, nice >= 0.1, [
HAVE_WEBRTC="yes" ], [
HAVE_WEBRTC="no"
])
])
else
dnl not building plugins with external dependencies,
......@@ -2501,6 +2511,7 @@ AM_CONDITIONAL(USE_RTMP, false)
AM_CONDITIONAL(USE_TELETEXTDEC, false)
AM_CONDITIONAL(USE_UVCH264, false)
AM_CONDITIONAL(USE_WEBP, false)
AM_CONDITIONAL(USE_WEBRTC, false)
AM_CONDITIONAL(USE_WEBRTCDSP, false)
AM_CONDITIONAL(USE_OPENH264, false)
AM_CONDITIONAL(USE_X265, false)
......@@ -2676,6 +2687,7 @@ gst-libs/gst/codecparsers/Makefile
gst-libs/gst/mpegts/Makefile
gst-libs/gst/uridownloader/Makefile
gst-libs/gst/wayland/Makefile
gst-libs/gst/webrtc/Makefile
gst-libs/gst/player/Makefile
gst-libs/gst/video/Makefile
gst-libs/gst/audio/Makefile
......@@ -2724,6 +2736,7 @@ tests/examples/mxf/Makefile
tests/examples/opencv/Makefile
tests/examples/uvch264/Makefile
tests/examples/waylandsink/Makefile
tests/examples/webrtc/Makefile
tests/icles/Makefile
ext/voamrwbenc/Makefile
ext/voaacenc/Makefile
......@@ -2793,6 +2806,7 @@ ext/webp/Makefile
ext/x265/Makefile
ext/zbar/Makefile
ext/dtls/Makefile
ext/webrtc/Makefile
ext/webrtcdsp/Makefile
ext/ttml/Makefile
po/Makefile.in
......@@ -2813,6 +2827,8 @@ pkgconfig/gstreamer-player.pc
pkgconfig/gstreamer-player-uninstalled.pc
pkgconfig/gstreamer-wayland.pc
pkgconfig/gstreamer-wayland-uninstalled.pc
pkgconfig/gstreamer-webrtc.pc
pkgconfig/gstreamer-webrtc-uninstalled.pc
pkgconfig/gstreamer-bad-video.pc
pkgconfig/gstreamer-bad-video-uninstalled.pc
pkgconfig/gstreamer-bad-audio.pc
......
......@@ -61,6 +61,7 @@ GTKDOC_LIBS = \
$(top_builddir)/gst-libs/gst/insertbin/libgstinsertbin-@GST_API_VERSION@.la \
$(top_builddir)/gst-libs/gst/mpegts/libgstmpegts-@GST_API_VERSION@.la \
$(top_builddir)/gst-libs/gst/player/libgstplayer-@GST_API_VERSION@.la \
$(top_builddir)/gst-libs/gst/webrtc/libgstwebrtc-@GST_API_VERSION@.la \
$(GST_BASE_LIBS)
# If you need to override some of the declarations, place them in this file
......
......@@ -73,6 +73,16 @@
<xi:include href="xml/gstplayer-visualization.xml"/>
</chapter>
<chapter id="webrtc">
<title>WebRTC Library</title>
<xi:include href="xml/gstwebrtc-dtlstransport.xml"/>
<xi:include href="xml/gstwebrtc-icetransport.xml"/>
<xi:include href="xml/gstwebrtc-receiver.xml"/>
<xi:include href="xml/gstwebrtc-sender.xml"/>
<xi:include href="xml/gstwebrtc-sessiondescription.xml"/>
<xi:include href="xml/gstwebrtc-transceiver.xml"/>
</chapter>
<chapter>
<title>Interfaces</title>
<xi:include href="xml/gstphotography.xml" />
......
......@@ -1065,3 +1065,104 @@ GstPlayerSubtitleInfoClass
gst_player_subtitle_info_get_type
</SECTION>
<SECTION>
<FILE>gstwebrtc-dtlstransport</FILE>
GstWebRTCDTLSTransportState
gst_webrtc_dtls_transport_new
<SUBSECTION Standard>
GST_TYPE_WEBRTC_DTLS_TRANSPORT
gst_webrtc_dtls_transport_get_type
GstWebRTCDTLSTransport
GST_WEBRTC_DTLS_TRANSPORT
GST_IS_WEBRTC_DTLS_TRANSPORT
GstWebRTCDTLSTransportClass
GST_WEBRTC_DTLS_TRANSPORT_CLASS
GST_WEBRTC_DTLS_TRANSPORT_GET_CLASS
GST_IS_WEBRTC_DTLS_TRANSPORT_CLASS
</SECTION>
<SECTION>
<FILE>gstwebrtc-icetransport</FILE>
GstWebRTCIceRole
GstWebRTCICEConnectionState
GstWebRTCICEGatheringState
<SUBSECTION Standard>
GST_TYPE_WEBRTC_ICE_TRANSPORT
gst_webrtc_ice_transport_get_type
GstWebRTCICETransport
GST_WEBRTC_ICE_TRANSPORT
GST_IS_WEBRTC_ICE_TRANSPORT
GstWebRTCICETransportClass
GST_WEBRTC_ICE_TRANSPORT_CLASS
GST_WEBRTC_ICE_TRANSPORT_GET_CLASS
GST_IS_WEBRTC_ICE_TRANSPORT_CLASS
</SECTION>
<SECTION>
<FILE>gstwebrtc-receiver</FILE>
gst_webrtc_rtp_receiver_new
gst_webrtc_rtp_receiver_get_parameters
gst_webrtc_rtp_receiver_set_parameters
gst_webrtc_rtp_receiver_set_rtcp_transport
gst_webrtc_rtp_receiver_set_transport
<SUBSECTION Standard>
GST_TYPE_WEBRTC_RTP_RECEIVER
gst_webrtc_rtp_receiver_get_type
GstWebRTCRTPReceiver
GST_WEBRTC_RTP_RECEIVER
GST_IS_WEBRTC_RTP_RECEIVER
GstWebRTCRTPReceiverClass
GST_WEBRTC_RTP_RECEIVER_CLASS
GST_WEBRTC_RTP_RECEIVER_GET_CLASS
GST_IS_WEBRTC_RTP_RECEIVER_CLASS
</SECTION>
<SECTION>
<FILE>gstwebrtc-sender</FILE>
gst_webrtc_rtp_sender_new
gst_webrtc_rtp_sender_get_parameters
gst_webrtc_rtp_sender_set_parameters
gst_webrtc_rtp_sender_set_rtcp_transport
gst_webrtc_rtp_sender_set_transport
<SUBSECTION Standard>
GST_TYPE_WEBRTC_RTP_SENDER
gst_webrtc_rtp_sender_get_type
GstWebRTCRTPSender
GST_WEBRTC_RTP_SENDER
GST_IS_WEBRTC_RTP_SENDER
GstWebRTCRTPSenderClass
GST_WEBRTC_RTP_SENDER_CLASS
GST_WEBRTC_RTP_SENDER_GET_CLASS
GST_IS_WEBRTC_RTP_SENDER_CLASS
</SECTION>
<SECTION>
<FILE>gstwebrtc-sessiondescription</FILE>
GstWebRTCSessionDescription
gst_webrtc_session_description_new
gst_webrtc_session_description_copy
gst_webrtc_session_description_free
<SUBSECTION Standard>
gst_webrtc_session_description_get_type
GST_TYPE_WEBRTC_SESSION_DESCRIPTION
</SECTION>
<SECTION>
<FILE>gstwebrtc-transceiver</FILE>
<SUBSECTION Standard>
GST_TYPE_WEBRTC_RTP_TRANSCEIVER
gst_webrtc_rtp_transceiver_get_type
GstWebRTCRTPTransceiver
GST_WEBRTC_RTP_TRANSCEIVER
GST_IS_WEBRTC_RTP_TRANSCEIVER
GstWebRTCRTPTransceiverClass
GST_WEBRTC_RTP_TRANSCEIVER_CLASS
GST_WEBRTC_RTP_TRANSCEIVER_GET_CLASS
GST_IS_WEBRTC_RTP_TRANSCEIVER_CLASS
</SECTION>
......@@ -7,6 +7,7 @@
#include <gst/insertbin/gstinsertbin.h>
#include <gst/mpegts/mpegts.h>
#include <gst/player/player.h>
#include <gst/webrtc/webrtc.h>
gst_audio_aggregator_get_type
gst_audio_aggregator_pad_get_type
......@@ -49,3 +50,22 @@ gst_player_video_overlay_video_renderer_get_type
gst_player_video_renderer_get_type
gst_player_visualization_get_type
gst_webrtc_dtls_setup_get_type
gst_webrtc_dtls_transport_get_type
gst_webrtc_dtls_transport_state_get_type
gst_webrtc_ice_component_get_type
gst_webrtc_ice_connection_state_get_type
gst_webrtc_ice_gathering_state_get_type
gst_webrtc_ice_role_get_type
gst_webrtc_sdp_type_get_type
gst_webrtc_ice_transport_get_type
gst_webrtc_peer_connection_state_get_type
gst_webrtc_rtp_receiver_get_type
gst_webrtc_rtp_sender_get_type
gst_webrtc_session_description_get_type
gst_webrtc_signaling_state_get_type
gst_webrtc_rtp_transceiver_direction_get_type
gst_webrtc_rtp_transceiver_get_type
gst_webrtc_stats_type_get_type
......@@ -406,6 +406,12 @@ else
WEBRTCDSP_DIR=
endif
if USE_WEBRTC
WEBRTC_DIR=webrtc
else
WEBRTC_DIR=
endif
if USE_TTML
TTML_DIR=ttml
else
......@@ -482,7 +488,8 @@ SUBDIRS=\
$(DTLS_DIR) \
$(VULKAN_DIR) \
$(WEBRTCDSP_DIR) \
$(TTML_DIR)
$(TTML_DIR) \
$(WEBRTC_DIR)
DIST_SUBDIRS = \
assrender \
......@@ -551,6 +558,7 @@ DIST_SUBDIRS = \
dtls \
vulkan \
webrtcdsp \
ttml
ttml \
webrtc
include $(top_srcdir)/common/parallel-subdirs.mak
......@@ -65,6 +65,7 @@ subdir('voaacenc')
subdir('vulkan')
subdir('wayland')
subdir('webrtcdsp')
subdir('webrtc')
subdir('webp')
subdir('x265')
subdir('zbar')
plugin_LTLIBRARIES = libgstwebrtc.la
noinst_HEADERS = \
fwd.h \
gstwebrtcbin.h \
gstwebrtcice.h \
gstwebrtcstats.h \
icestream.h \
nicetransport.h \
transportstream.h \
transportsendbin.h \
transportreceivebin.h \
utils.h \
webrtcsdp.h \
webrtctransceiver.h
libgstwebrtc_la_SOURCES = \
gstwebrtc.c \
gstwebrtcbin.c \
gstwebrtcice.c \
gstwebrtcstats.c \
icestream.c \
nicetransport.c \
transportstream.c \
transportsendbin.c \
transportreceivebin.c \
utils.c \
webrtcsdp.c \
webrtctransceiver.c
libgstwebrtc_la_SOURCES += $(BUILT_SOURCES)
noinst_HEADERS += $(built_headers)
libgstwebrtc_la_CFLAGS = \
-I$(top_builddir)/gst-libs \
-I$(top_srcdir)/gst-libs \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
$(GST_SDP_CFLAGS) \
$(NICE_CFLAGS)
libgstwebrtc_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(GST_SDP_LIBS) \
$(NICE_LIBS) \
$(top_builddir)/gst-libs/gst/webrtc/libgstwebrtc-@GST_API_VERSION@.la
libgstwebrtc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstwebrtc_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
include $(top_srcdir)/common/gst-glib-gen.mak
/* GStreamer
* Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __WEBRTC_FWD_H__
#define __WEBRTC_FWD_H__
#include <gst/gst.h>
#include <gst/webrtc/webrtc.h>
G_BEGIN_DECLS
typedef struct _GstWebRTCBin GstWebRTCBin;
typedef struct _GstWebRTCBinClass GstWebRTCBinClass;
typedef struct _GstWebRTCBinPrivate GstWebRTCBinPrivate;
typedef struct _GstWebRTCICE GstWebRTCICE;
typedef struct _GstWebRTCICEClass GstWebRTCICEClass;
typedef struct _GstWebRTCICEPrivate GstWebRTCICEPrivate;
typedef struct _GstWebRTCICEStream GstWebRTCICEStream;
typedef struct _GstWebRTCICEStreamClass GstWebRTCICEStreamClass;
typedef struct _GstWebRTCICEStreamPrivate GstWebRTCICEStreamPrivate;
typedef struct _GstWebRTCNiceTransport GstWebRTCNiceTransport;
typedef struct _GstWebRTCNiceTransportClass GstWebRTCNiceTransportClass;
typedef struct _GstWebRTCNiceTransportPrivate GstWebRTCNiceTransportPrivate;
typedef struct _TransportStream TransportStream;
typedef struct _TransportStreamClass TransportStreamClass;
typedef struct _TransportSendBin TransportSendBin;
typedef struct _TransportSendBinClass TransportSendBinClass;
typedef struct _TransportReceiveBin TransportReceiveBin;
typedef struct _TransportReceiveBinClass TransportReceiveBinClass;
typedef struct _WebRTCTransceiver WebRTCTransceiver;
typedef struct _WebRTCTransceiverClass WebRTCTransceiverClass;
G_END_DECLS
#endif /* __WEBRTC_FWD_H__ */
/* GStreamer
* Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "gstwebrtcbin.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "webrtcbin", GST_RANK_PRIMARY,
GST_TYPE_WEBRTC_BIN))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
webrtc,
"WebRTC plugins",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
This source diff could not be displayed because it is too large. You can view the blob instead.
/* GStreamer
* Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_WEBRTC_BIN_H__
#define __GST_WEBRTC_BIN_H__
#include <gst/sdp/sdp.h>
#include "fwd.h"
#include "gstwebrtcice.h"
G_BEGIN_DECLS
#define GST_WEBRTC_BIN_ERROR gst_webrtc_bin_error_quark ()
GQuark gst_webrtc_bin_error_quark (void);
typedef enum
{
GST_WEBRTC_BIN_ERROR_FAILED,
GST_WEBRTC_BIN_ERROR_INVALID_SYNTAX,
GST_WEBRTC_BIN_ERROR_INVALID_MODIFICATION,
GST_WEBRTC_BIN_ERROR_INVALID_STATE,
GST_WEBRTC_BIN_ERROR_BAD_SDP,
GST_WEBRTC_BIN_ERROR_FINGERPRINT,
} GstWebRTCJSEPSDPError;
GType gst_webrtc_bin_pad_get_type(void);
#define GST_TYPE_WEBRTC_BIN_PAD (gst_webrtc_bin_pad_get_type())
#define GST_WEBRTC_BIN_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WEBRTC_BIN_PAD,GstWebRTCBinPad))
#define GST_IS_WEBRTC_BIN_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WEBRTC_BIN_PAD))
#define GST_WEBRTC_BIN_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_WEBRTC_BIN_PAD,GstWebRTCBinPadClass))
#define GST_IS_WEBRTC_BIN_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_WEBRTC_BIN_PAD))
#define GST_WEBRTC_BIN_PAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_WEBRTC_BIN_PAD,GstWebRTCBinPadClass))
typedef struct _GstWebRTCBinPad GstWebRTCBinPad;
typedef struct _GstWebRTCBinPadClass GstWebRTCBinPadClass;
struct _GstWebRTCBinPad
{
GstGhostPad parent;
guint mlineindex;
GstWebRTCRTPTransceiver *trans;
};
struct _GstWebRTCBinPadClass
{
GstGhostPadClass parent_class;
};
GType gst_webrtc_bin_get_type(void);
#define GST_TYPE_WEBRTC_BIN (gst_webrtc_bin_get_type())
#define GST_WEBRTC_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WEBRTC_BIN,GstWebRTCBin))
#define GST_IS_WEBRTC_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WEBRTC_BIN))
#define GST_WEBRTC_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_WEBRTC_BIN,GstWebRTCBinClass))
#define GST_IS_WEBRTC_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_WEBRTC_BIN))
#define GST_WEBRTC_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_WEBRTC_BIN,GstWebRTCBinClass))
struct _GstWebRTCBin
{
GstBin parent;
GstElement *rtpbin;
GstWebRTCSignalingState signaling_state;
GstWebRTCICEGatheringState ice_gathering_state;
GstWebRTCICEConnectionState ice_connection_state;
GstWebRTCPeerConnectionState peer_connection_state;
GstWebRTCSessionDescription *current_local_description;
GstWebRTCSessionDescription *pending_local_description;
GstWebRTCSessionDescription *current_remote_description;
GstWebRTCSessionDescription *pending_remote_description;
GstWebRTCBinPrivate *priv;
};
struct _GstWebRTCBinClass
{
GstBinClass parent_class;
};
struct _GstWebRTCBinPrivate
{
guint max_sink_pad_serial;
gboolean bundle;
GArray *transceivers;
GArray *session_mid_map;
GArray *transports;
GstWebRTCICE *ice;
GArray *ice_stream_map;
GArray *pending_ice_candidates;
/* peerconnection variables */
gboolean is_closed;
gboolean need_negotiation;
gpointer sctp_transport; /* FIXME */
/* peerconnection helper thread for promises */
GMainContext *main_context;
GMainLoop *loop;
GThread *thread;
GMutex pc_lock;
GCond pc_cond;
gboolean running;
gboolean async_pending;
GList *pending_pads;
/* count of the number of media streams we've offered for uniqueness */
/* FIXME: overflow? */
guint media_counter;
GstStructure *stats;
};
typedef void (*GstWebRTCBinFunc) (GstWebRTCBin * webrtc, gpointer data);
typedef struct
{
GstWebRTCBin *webrtc;
GstWebRTCBinFunc op;
gpointer data;
GDestroyNotify notify;
// GstPromise *promise; /* FIXME */
} GstWebRTCBinTask;
void gst_webrtc_bin_enqueue_task (GstWebRTCBin * pc,
GstWebRTCBinFunc func,
gpointer data,
GDestroyNotify notify);
G_END_DECLS
#endif /* __GST_WEBRTC_BIN_H__ */
This diff is collapsed.
/* GStreamer
* Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_WEBRTC_ICE_H__
#define __GST_WEBRTC_ICE_H__
#include <gst/gst.h>
#include <gst/sdp/sdp.h>
#include <gst/webrtc/webrtc.h>
#include "fwd.h"
G_BEGIN_DECLS
#define GST_WEBRTC_ICE_ERROR gst_webrtc_ice_error_quark ()
GQuark gst_webrtc_ice_error_quark (void);
GType gst_webrtc_ice_get_type(void);
#define GST_TYPE_WEBRTC_ICE (gst_webrtc_ice_get_type())
#define GST_WEBRTC_ICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WEBRTC_ICE,GstWebRTCICE))
#define GST_IS_WEBRTC_ICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WEBRTC_ICE))
#define GST_WEBRTC_ICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_WEBRTC_ICE,GstWebRTCICEClass))
#define GST_IS_WEBRTC_ICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_WEBRTC_ICE))
#define GST_WEBRTC_ICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_WEBRTC_ICE,GstWebRTCICEClass))
struct _GstWebRTCICE
{
GstObject parent;
GstWebRTCICEGatheringState ice_gathering_state;
GstWebRTCICEConnectionState ice_connection_state;
GstUri *stun_server;
GstUri *turn_server;
GstWebRTCICEPrivate *priv;
};
struct _GstWebRTCICEClass
{
GstObjectClass parent_class;
};
GstWebRTCICE * gst_webrtc_ice_new (void);
GstWebRTCICEStream * gst_webrtc_ice_add_stream (GstWebRTCICE * ice,
guint session_id);
GstWebRTCICETransport * gst_webrtc_ice_find_transport (GstWebRTCICE * ice,
GstWebRTCICEStream * stream,
GstWebRTCICEComponent component);
gboolean gst_webrtc_ice_gather_candidates (GstWebRTCICE * ice,
GstWebRTCICEStream * stream);
/* FIXME: GstStructure-ize the candidate */
void gst_webrtc_ice_add_candidate (GstWebRTCICE * ice,
GstWebRTCICEStream * stream,
const gchar * candidate);
gboolean gst_webrtc_ice_set_local_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream,
gchar * ufrag,
gchar * pwd);
gboolean gst_webrtc_ice_set_remote_credentials (GstWebRTCICE * ice,
GstWebRTCICEStream * stream,
gchar * ufrag,
gchar * pwd);
G_END_DECLS
#endif /* __GST_WEBRTC_ICE_H__ */
This diff is collapsed.
/* GStreamer
* Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_WEBRTC_STATS_H__
#define __GST_WEBRTC_STATS_H__
#include <gst/gst.h>
#include <gst/sdp/sdp.h>
#include <gst/webrtc/webrtc.h>
#include "fwd.h"
G_BEGIN_DECLS
G_GNUC_INTERNAL
void gst_webrtc_bin_update_stats (GstWebRTCBin * webrtc);
G_END_DECLS
#endif /* __GST_WEBRTC_STATS_H__ */
/* GStreamer
* Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "icestream.h"
#include "nicetransport.h"