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-receiver
22 * @short_description: RTCRtpReceiver object
23 * @title: GstWebRTCRTPReceiver
24 * @see_also: #GstWebRTCRTPSender, #GstWebRTCRTPTransceiver
26 * - GstWebRTCRTPReceiver
28 * <https://www.w3.org/TR/webrtc/#rtcrtpreceiver-interface>
35 #include "rtpreceiver.h"
36 #include "webrtc-priv.h"
38 #define GST_CAT_DEFAULT gst_webrtc_rtp_receiver_debug
39 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
41 #define gst_webrtc_rtp_receiver_parent_class parent_class
42 G_DEFINE_TYPE_WITH_CODE (GstWebRTCRTPReceiver, gst_webrtc_rtp_receiver,
43 GST_TYPE_OBJECT, GST_DEBUG_CATEGORY_INIT (gst_webrtc_rtp_receiver_debug,
44 "webrtcreceiver", 0, "webrtcreceiver"););
58 //static guint gst_webrtc_rtp_receiver_signals[LAST_SIGNAL] = { 0 };
61 gst_webrtc_rtp_receiver_set_property (GObject * object, guint prop_id,
62 const GValue * value, GParamSpec * pspec)
66 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
72 gst_webrtc_rtp_receiver_get_property (GObject * object, guint prop_id,
73 GValue * value, GParamSpec * pspec)
75 GstWebRTCRTPReceiver *receiver = GST_WEBRTC_RTP_RECEIVER (object);
78 GST_OBJECT_LOCK (receiver);
79 g_value_set_object (value, receiver->transport);
80 GST_OBJECT_UNLOCK (receiver);
83 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
89 gst_webrtc_rtp_receiver_finalize (GObject * object)
91 GstWebRTCRTPReceiver *webrtc = GST_WEBRTC_RTP_RECEIVER (object);
93 if (webrtc->transport)
94 gst_object_unref (webrtc->transport);
95 webrtc->transport = NULL;
97 G_OBJECT_CLASS (parent_class)->finalize (object);
101 gst_webrtc_rtp_receiver_class_init (GstWebRTCRTPReceiverClass * klass)
103 GObjectClass *gobject_class = (GObjectClass *) klass;
105 gobject_class->get_property = gst_webrtc_rtp_receiver_get_property;
106 gobject_class->set_property = gst_webrtc_rtp_receiver_set_property;
107 gobject_class->finalize = gst_webrtc_rtp_receiver_finalize;
110 * GstWebRTCRTPReceiver:transport:
112 * The DTLS transport for this receiver
116 g_object_class_install_property (gobject_class,
118 g_param_spec_object ("transport", "Transport",
119 "The DTLS transport for this receiver",
120 GST_TYPE_WEBRTC_DTLS_TRANSPORT,
121 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
125 gst_webrtc_rtp_receiver_init (GstWebRTCRTPReceiver * webrtc)
129 GstWebRTCRTPReceiver *
130 gst_webrtc_rtp_receiver_new (void)
132 return g_object_new (GST_TYPE_WEBRTC_RTP_RECEIVER, NULL);