webrtc: Fix documentaton moving symbols in the right pages
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / gst-libs / gst / webrtc / rtpreceiver.c
1 /* GStreamer
2  * Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 /**
21  * SECTION:gstwebrtc-receiver
22  * @short_description: RTCRtpReceiver object
23  * @title: GstWebRTCRTPReceiver
24  * @see_also: #GstWebRTCRTPSender, #GstWebRTCRTPTransceiver
25  * @symbols:
26  * - GstWebRTCRTPReceiver
27  *
28  * <https://www.w3.org/TR/webrtc/#rtcrtpreceiver-interface>
29  */
30
31 #ifdef HAVE_CONFIG_H
32 # include "config.h"
33 #endif
34
35 #include "rtpreceiver.h"
36 #include "webrtc-priv.h"
37
38 #define GST_CAT_DEFAULT gst_webrtc_rtp_receiver_debug
39 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
40
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"););
45
46 enum
47 {
48   SIGNAL_0,
49   LAST_SIGNAL,
50 };
51
52 enum
53 {
54   PROP_0,
55   PROP_TRANSPORT,
56 };
57
58 //static guint gst_webrtc_rtp_receiver_signals[LAST_SIGNAL] = { 0 };
59
60 static void
61 gst_webrtc_rtp_receiver_set_property (GObject * object, guint prop_id,
62     const GValue * value, GParamSpec * pspec)
63 {
64   switch (prop_id) {
65     default:
66       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
67       break;
68   }
69 }
70
71 static void
72 gst_webrtc_rtp_receiver_get_property (GObject * object, guint prop_id,
73     GValue * value, GParamSpec * pspec)
74 {
75   GstWebRTCRTPReceiver *receiver = GST_WEBRTC_RTP_RECEIVER (object);
76   switch (prop_id) {
77     case PROP_TRANSPORT:
78       GST_OBJECT_LOCK (receiver);
79       g_value_set_object (value, receiver->transport);
80       GST_OBJECT_UNLOCK (receiver);
81       break;
82     default:
83       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
84       break;
85   }
86 }
87
88 static void
89 gst_webrtc_rtp_receiver_finalize (GObject * object)
90 {
91   GstWebRTCRTPReceiver *webrtc = GST_WEBRTC_RTP_RECEIVER (object);
92
93   if (webrtc->transport)
94     gst_object_unref (webrtc->transport);
95   webrtc->transport = NULL;
96
97   G_OBJECT_CLASS (parent_class)->finalize (object);
98 }
99
100 static void
101 gst_webrtc_rtp_receiver_class_init (GstWebRTCRTPReceiverClass * klass)
102 {
103   GObjectClass *gobject_class = (GObjectClass *) klass;
104
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;
108
109   /**
110    * GstWebRTCRTPReceiver:transport:
111    *
112    * The DTLS transport for this receiver
113    *
114    * Since: 1.20
115    */
116   g_object_class_install_property (gobject_class,
117       PROP_TRANSPORT,
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));
122 }
123
124 static void
125 gst_webrtc_rtp_receiver_init (GstWebRTCRTPReceiver * webrtc)
126 {
127 }
128
129 GstWebRTCRTPReceiver *
130 gst_webrtc_rtp_receiver_new (void)
131 {
132   return g_object_new (GST_TYPE_WEBRTC_RTP_RECEIVER, NULL);
133 }