2 * Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 * SECTION:gstwebrtc-sender
22 * @short_description: RTCRtpSender object
23 * @title: GstWebRTCRTPSender
24 * @see_also: #GstWebRTCRTPReceiver, #GstWebRTCRTPTransceiver
26 * <ulink url="https://www.w3.org/TR/webrtc/#rtcrtpsender-interface">https://www.w3.org/TR/webrtc/#rtcrtpsender-interface</ulink>
33 #include "rtpsender.h"
34 #include "rtptransceiver.h"
36 #define GST_CAT_DEFAULT gst_webrtc_rtp_sender_debug
37 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
39 #define gst_webrtc_rtp_sender_parent_class parent_class
40 G_DEFINE_TYPE_WITH_CODE (GstWebRTCRTPSender, gst_webrtc_rtp_sender,
41 GST_TYPE_OBJECT, GST_DEBUG_CATEGORY_INIT (gst_webrtc_rtp_sender_debug,
42 "webrtcsender", 0, "webrtcsender");
60 //static guint gst_webrtc_rtp_sender_signals[LAST_SIGNAL] = { 0 };
63 gst_webrtc_rtp_sender_set_transport (GstWebRTCRTPSender * sender,
64 GstWebRTCDTLSTransport * transport)
66 g_return_if_fail (GST_IS_WEBRTC_RTP_SENDER (sender));
67 g_return_if_fail (GST_IS_WEBRTC_DTLS_TRANSPORT (transport));
69 gst_object_replace ((GstObject **) & sender->transport,
70 GST_OBJECT (transport));
74 gst_webrtc_rtp_sender_set_rtcp_transport (GstWebRTCRTPSender * sender,
75 GstWebRTCDTLSTransport * transport)
77 g_return_if_fail (GST_IS_WEBRTC_RTP_SENDER (sender));
78 g_return_if_fail (GST_IS_WEBRTC_DTLS_TRANSPORT (transport));
80 gst_object_replace ((GstObject **) & sender->rtcp_transport,
81 GST_OBJECT (transport));
85 gst_webrtc_rtp_sender_set_property (GObject * object, guint prop_id,
86 const GValue * value, GParamSpec * pspec)
90 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
96 gst_webrtc_rtp_sender_get_property (GObject * object, guint prop_id,
97 GValue * value, GParamSpec * pspec)
101 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
107 gst_webrtc_rtp_sender_finalize (GObject * object)
109 GstWebRTCRTPSender *webrtc = GST_WEBRTC_RTP_SENDER (object);
111 if (webrtc->transport)
112 gst_object_unref (webrtc->transport);
113 webrtc->transport = NULL;
115 if (webrtc->rtcp_transport)
116 gst_object_unref (webrtc->rtcp_transport);
117 webrtc->rtcp_transport = NULL;
119 G_OBJECT_CLASS (parent_class)->finalize (object);
123 gst_webrtc_rtp_sender_class_init (GstWebRTCRTPSenderClass * klass)
125 GObjectClass *gobject_class = (GObjectClass *) klass;
127 gobject_class->get_property = gst_webrtc_rtp_sender_get_property;
128 gobject_class->set_property = gst_webrtc_rtp_sender_set_property;
129 gobject_class->finalize = gst_webrtc_rtp_sender_finalize;
133 gst_webrtc_rtp_sender_init (GstWebRTCRTPSender * webrtc)
138 gst_webrtc_rtp_sender_new (GArray * send_encodings /* FIXME */ )
140 return g_object_new (GST_TYPE_WEBRTC_RTP_SENDER, NULL);