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 * <ulink url="https://www.w3.org/TR/webrtc/#rtcrtpreceiver-interface">https://www.w3.org/TR/webrtc/#rtcrtpreceiver-interface</ulink>
33 #include "rtpreceiver.h"
35 #define GST_CAT_DEFAULT gst_webrtc_rtp_receiver_debug
36 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
38 #define gst_webrtc_rtp_receiver_parent_class parent_class
39 G_DEFINE_TYPE_WITH_CODE (GstWebRTCRTPReceiver, gst_webrtc_rtp_receiver,
40 GST_TYPE_OBJECT, GST_DEBUG_CATEGORY_INIT (gst_webrtc_rtp_receiver_debug,
41 "webrtcreceiver", 0, "webrtcreceiver"););
54 //static guint gst_webrtc_rtp_receiver_signals[LAST_SIGNAL] = { 0 };
57 gst_webrtc_rtp_receiver_set_transport (GstWebRTCRTPReceiver * receiver,
58 GstWebRTCDTLSTransport * transport)
60 g_return_if_fail (GST_IS_WEBRTC_RTP_RECEIVER (receiver));
61 g_return_if_fail (GST_IS_WEBRTC_DTLS_TRANSPORT (transport));
63 gst_object_replace ((GstObject **) & receiver->transport,
64 GST_OBJECT (transport));
68 gst_webrtc_rtp_receiver_set_rtcp_transport (GstWebRTCRTPReceiver * receiver,
69 GstWebRTCDTLSTransport * transport)
71 g_return_if_fail (GST_IS_WEBRTC_RTP_RECEIVER (receiver));
72 g_return_if_fail (GST_IS_WEBRTC_DTLS_TRANSPORT (transport));
74 gst_object_replace ((GstObject **) & receiver->rtcp_transport,
75 GST_OBJECT (transport));
79 gst_webrtc_rtp_receiver_set_property (GObject * object, guint prop_id,
80 const GValue * value, GParamSpec * pspec)
84 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
90 gst_webrtc_rtp_receiver_get_property (GObject * object, guint prop_id,
91 GValue * value, GParamSpec * pspec)
95 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
101 gst_webrtc_rtp_receiver_finalize (GObject * object)
103 GstWebRTCRTPReceiver *webrtc = GST_WEBRTC_RTP_RECEIVER (object);
105 if (webrtc->transport)
106 gst_object_unref (webrtc->transport);
107 webrtc->transport = NULL;
109 if (webrtc->rtcp_transport)
110 gst_object_unref (webrtc->rtcp_transport);
111 webrtc->rtcp_transport = NULL;
113 G_OBJECT_CLASS (parent_class)->finalize (object);
117 gst_webrtc_rtp_receiver_class_init (GstWebRTCRTPReceiverClass * klass)
119 GObjectClass *gobject_class = (GObjectClass *) klass;
121 gobject_class->get_property = gst_webrtc_rtp_receiver_get_property;
122 gobject_class->set_property = gst_webrtc_rtp_receiver_set_property;
123 gobject_class->finalize = gst_webrtc_rtp_receiver_finalize;
127 gst_webrtc_rtp_receiver_init (GstWebRTCRTPReceiver * webrtc)
131 GstWebRTCRTPReceiver *
132 gst_webrtc_rtp_receiver_new (void)
134 return g_object_new (GST_TYPE_WEBRTC_RTP_RECEIVER, NULL);