rtp: Update codes based on 1.18.4
[platform/upstream/gst-plugins-good.git] / gst / rtp / gstrtp.c
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
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 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include <gst/tag/tag.h>
25
26 #include "gstrtputils.h"
27
28 #include "gstrtpac3depay.h"
29 #include "gstrtpac3pay.h"
30 #include "gstrtpbvdepay.h"
31 #include "gstrtpbvpay.h"
32 #include "gstrtpceltdepay.h"
33 #include "gstrtpceltpay.h"
34 #include "gstrtpdvdepay.h"
35 #include "gstrtpdvpay.h"
36 #include "gstrtpgstdepay.h"
37 #include "gstrtpgstpay.h"
38 #include "gstrtpilbcdepay.h"
39 #include "gstrtpilbcpay.h"
40 #include "gstrtppcmupay.h"
41 #include "gstrtppcmapay.h"
42 #include "gstrtppcmadepay.h"
43 #include "gstrtppcmudepay.h"
44 #include "gstrtpg722depay.h"
45 #include "gstrtpg722pay.h"
46 #include "gstrtpg723depay.h"
47 #include "gstrtpg723pay.h"
48 #include "gstrtpg726depay.h"
49 #include "gstrtpg726pay.h"
50 #include "gstrtpg729depay.h"
51 #include "gstrtpg729pay.h"
52 #include "gstrtpgsmpay.h"
53 #include "gstrtpgsmdepay.h"
54 #include "gstrtpamrpay.h"
55 #include "gstrtpamrdepay.h"
56 #include "gstrtpmpapay.h"
57 #include "gstrtpmpadepay.h"
58 #include "gstrtpmparobustdepay.h"
59 #include "gstrtpmpvdepay.h"
60 #include "gstrtpmpvpay.h"
61 #include "gstrtpopusdepay.h"
62 #include "gstrtpopuspay.h"
63 #include "gstrtph261pay.h"
64 #include "gstrtph261depay.h"
65 #include "gstrtph263pdepay.h"
66 #include "gstrtph263ppay.h"
67 #include "gstrtph263depay.h"
68 #include "gstrtph263pay.h"
69 #include "gstrtph264depay.h"
70 #include "gstrtph264pay.h"
71 #include "gstrtph265depay.h"
72 #include "gstrtph265pay.h"
73 #include "gstrtpj2kdepay.h"
74 #include "gstrtpj2kpay.h"
75 #include "gstrtpjpegdepay.h"
76 #include "gstrtpjpegpay.h"
77 #include "gstrtpklvdepay.h"
78 #include "gstrtpklvpay.h"
79 #include "gstrtpL8depay.h"
80 #include "gstrtpL8pay.h"
81 #include "gstrtpL16depay.h"
82 #include "gstrtpL16pay.h"
83 #include "gstrtpL24depay.h"
84 #include "gstrtpL24pay.h"
85 #include "gstasteriskh263.h"
86 #include "gstrtpmp1sdepay.h"
87 #include "gstrtpmp2tdepay.h"
88 #include "gstrtpmp2tpay.h"
89 #include "gstrtpmp4vdepay.h"
90 #include "gstrtpmp4vpay.h"
91 #include "gstrtpmp4adepay.h"
92 #include "gstrtpmp4apay.h"
93 #include "gstrtpmp4gdepay.h"
94 #include "gstrtpmp4gpay.h"
95 #include "gstrtpqcelpdepay.h"
96 #include "gstrtpqdmdepay.h"
97 #include "gstrtpsbcdepay.h"
98 #include "gstrtpsbcpay.h"
99 #include "gstrtpsirenpay.h"
100 #include "gstrtpsirendepay.h"
101 #include "gstrtpspeexpay.h"
102 #include "gstrtpspeexdepay.h"
103 #include "gstrtpsv3vdepay.h"
104 #include "gstrtptheoradepay.h"
105 #include "gstrtptheorapay.h"
106 #include "gstrtpvorbisdepay.h"
107 #include "gstrtpvorbispay.h"
108 #include "gstrtpvp8depay.h"
109 #include "gstrtpvp8pay.h"
110 #include "gstrtpvp9depay.h"
111 #include "gstrtpvp9pay.h"
112 #include "gstrtpvrawdepay.h"
113 #include "gstrtpvrawpay.h"
114 #include "gstrtpstreampay.h"
115 #include "gstrtpstreamdepay.h"
116 #include "gstrtpredenc.h"
117 #include "gstrtpreddec.h"
118 #include "gstrtpulpfecdec.h"
119 #include "gstrtpulpfecenc.h"
120 #include "gstrtpstorage.h"
121
122 static gboolean
123 plugin_init (GstPlugin * plugin)
124 {
125   gst_tag_image_type_get_type ();
126
127   rtp_quark_meta_tag_video =
128       g_quark_from_static_string (GST_META_TAG_VIDEO_STR);
129   rtp_quark_meta_tag_audio =
130       g_quark_from_static_string (GST_META_TAG_AUDIO_STR);
131
132   if (!gst_rtp_ac3_depay_plugin_init (plugin))
133     return FALSE;
134
135   if (!gst_rtp_ac3_pay_plugin_init (plugin))
136     return FALSE;
137
138   if (!gst_rtp_bv_depay_plugin_init (plugin))
139     return FALSE;
140
141   if (!gst_rtp_bv_pay_plugin_init (plugin))
142     return FALSE;
143
144   if (!gst_rtp_celt_depay_plugin_init (plugin))
145     return FALSE;
146
147   if (!gst_rtp_celt_pay_plugin_init (plugin))
148     return FALSE;
149
150   if (!gst_rtp_dv_depay_plugin_init (plugin))
151     return FALSE;
152
153   if (!gst_rtp_dv_pay_plugin_init (plugin))
154     return FALSE;
155
156   if (!gst_rtp_gst_depay_plugin_init (plugin))
157     return FALSE;
158
159   if (!gst_rtp_gst_pay_plugin_init (plugin))
160     return FALSE;
161
162   if (!gst_rtp_ilbc_pay_plugin_init (plugin))
163     return FALSE;
164
165   if (!gst_rtp_ilbc_depay_plugin_init (plugin))
166     return FALSE;
167
168   if (!gst_rtp_g722_depay_plugin_init (plugin))
169     return FALSE;
170
171   if (!gst_rtp_g722_pay_plugin_init (plugin))
172     return FALSE;
173
174   if (!gst_rtp_g723_depay_plugin_init (plugin))
175     return FALSE;
176
177   if (!gst_rtp_g723_pay_plugin_init (plugin))
178     return FALSE;
179
180   if (!gst_rtp_g726_depay_plugin_init (plugin))
181     return FALSE;
182
183   if (!gst_rtp_g726_pay_plugin_init (plugin))
184     return FALSE;
185
186   if (!gst_rtp_g729_depay_plugin_init (plugin))
187     return FALSE;
188
189   if (!gst_rtp_g729_pay_plugin_init (plugin))
190     return FALSE;
191
192   if (!gst_rtp_gsm_depay_plugin_init (plugin))
193     return FALSE;
194
195   if (!gst_rtp_gsm_pay_plugin_init (plugin))
196     return FALSE;
197
198   if (!gst_rtp_amr_depay_plugin_init (plugin))
199     return FALSE;
200
201   if (!gst_rtp_amr_pay_plugin_init (plugin))
202     return FALSE;
203
204   if (!gst_rtp_pcma_depay_plugin_init (plugin))
205     return FALSE;
206
207   if (!gst_rtp_pcmu_depay_plugin_init (plugin))
208     return FALSE;
209
210   if (!gst_rtp_pcmu_pay_plugin_init (plugin))
211     return FALSE;
212
213   if (!gst_rtp_pcma_pay_plugin_init (plugin))
214     return FALSE;
215
216   if (!gst_rtp_mpa_depay_plugin_init (plugin))
217     return FALSE;
218
219   if (!gst_rtp_mpa_pay_plugin_init (plugin))
220     return FALSE;
221
222   if (!gst_rtp_mpa_robust_depay_plugin_init (plugin))
223     return FALSE;
224
225   if (!gst_rtp_mpv_depay_plugin_init (plugin))
226     return FALSE;
227
228   if (!gst_rtp_mpv_pay_plugin_init (plugin))
229     return FALSE;
230
231   if (!gst_rtp_opus_depay_plugin_init (plugin))
232     return FALSE;
233
234   if (!gst_rtp_opus_pay_plugin_init (plugin))
235     return FALSE;
236
237   if (!gst_rtp_h261_pay_plugin_init (plugin))
238     return FALSE;
239
240   if (!gst_rtp_h261_depay_plugin_init (plugin))
241     return FALSE;
242
243   if (!gst_rtp_h263p_pay_plugin_init (plugin))
244     return FALSE;
245
246   if (!gst_rtp_h263p_depay_plugin_init (plugin))
247     return FALSE;
248
249   if (!gst_rtp_h263_depay_plugin_init (plugin))
250     return FALSE;
251
252   if (!gst_rtp_h263_pay_plugin_init (plugin))
253     return FALSE;
254
255   if (!gst_rtp_h264_depay_plugin_init (plugin))
256     return FALSE;
257
258   if (!gst_rtp_h264_pay_plugin_init (plugin))
259     return FALSE;
260
261   if (!gst_rtp_h265_depay_plugin_init (plugin))
262     return FALSE;
263
264   if (!gst_rtp_h265_pay_plugin_init (plugin))
265     return FALSE;
266
267   if (!gst_rtp_j2k_depay_plugin_init (plugin))
268     return FALSE;
269
270   if (!gst_rtp_j2k_pay_plugin_init (plugin))
271     return FALSE;
272
273   if (!gst_rtp_jpeg_depay_plugin_init (plugin))
274     return FALSE;
275
276   if (!gst_rtp_jpeg_pay_plugin_init (plugin))
277     return FALSE;
278
279   if (!gst_rtp_klv_depay_plugin_init (plugin))
280     return FALSE;
281
282   if (!gst_rtp_klv_pay_plugin_init (plugin))
283     return FALSE;
284
285   if (!gst_rtp_L8_pay_plugin_init (plugin))
286     return FALSE;
287
288   if (!gst_rtp_L8_depay_plugin_init (plugin))
289     return FALSE;
290
291   if (!gst_rtp_L16_pay_plugin_init (plugin))
292     return FALSE;
293
294   if (!gst_rtp_L16_depay_plugin_init (plugin))
295     return FALSE;
296
297   if (!gst_rtp_L24_pay_plugin_init (plugin))
298     return FALSE;
299
300   if (!gst_rtp_L24_depay_plugin_init (plugin))
301     return FALSE;
302
303   if (!gst_asteriskh263_plugin_init (plugin))
304     return FALSE;
305
306   if (!gst_rtp_mp1s_depay_plugin_init (plugin))
307     return FALSE;
308
309   if (!gst_rtp_mp2t_depay_plugin_init (plugin))
310     return FALSE;
311
312   if (!gst_rtp_mp2t_pay_plugin_init (plugin))
313     return FALSE;
314
315   if (!gst_rtp_mp4v_pay_plugin_init (plugin))
316     return FALSE;
317
318   if (!gst_rtp_mp4v_depay_plugin_init (plugin))
319     return FALSE;
320
321   if (!gst_rtp_mp4a_pay_plugin_init (plugin))
322     return FALSE;
323
324   if (!gst_rtp_mp4a_depay_plugin_init (plugin))
325     return FALSE;
326
327   if (!gst_rtp_mp4g_depay_plugin_init (plugin))
328     return FALSE;
329
330   if (!gst_rtp_mp4g_pay_plugin_init (plugin))
331     return FALSE;
332
333   if (!gst_rtp_qcelp_depay_plugin_init (plugin))
334     return FALSE;
335
336   if (!gst_rtp_qdm2_depay_plugin_init (plugin))
337     return FALSE;
338
339   if (!gst_rtp_sbc_depay_plugin_init (plugin))
340     return FALSE;
341
342   if (!gst_rtp_sbc_pay_plugin_init (plugin))
343     return FALSE;
344
345   if (!gst_rtp_siren_pay_plugin_init (plugin))
346     return FALSE;
347
348   if (!gst_rtp_siren_depay_plugin_init (plugin))
349     return FALSE;
350
351   if (!gst_rtp_speex_pay_plugin_init (plugin))
352     return FALSE;
353
354   if (!gst_rtp_speex_depay_plugin_init (plugin))
355     return FALSE;
356
357   if (!gst_rtp_sv3v_depay_plugin_init (plugin))
358     return FALSE;
359
360   if (!gst_rtp_theora_depay_plugin_init (plugin))
361     return FALSE;
362
363   if (!gst_rtp_theora_pay_plugin_init (plugin))
364     return FALSE;
365
366   if (!gst_rtp_vorbis_depay_plugin_init (plugin))
367     return FALSE;
368
369   if (!gst_rtp_vorbis_pay_plugin_init (plugin))
370     return FALSE;
371
372   if (!gst_rtp_vp8_depay_plugin_init (plugin))
373     return FALSE;
374
375   if (!gst_rtp_vp8_pay_plugin_init (plugin))
376     return FALSE;
377
378   if (!gst_rtp_vp9_depay_plugin_init (plugin))
379     return FALSE;
380
381   if (!gst_rtp_vp9_pay_plugin_init (plugin))
382     return FALSE;
383
384   if (!gst_rtp_vraw_depay_plugin_init (plugin))
385     return FALSE;
386
387   if (!gst_rtp_vraw_pay_plugin_init (plugin))
388     return FALSE;
389
390   if (!gst_rtp_stream_pay_plugin_init (plugin))
391     return FALSE;
392
393   if (!gst_rtp_stream_depay_plugin_init (plugin))
394     return FALSE;
395
396   if (!gst_element_register (plugin, "rtpredenc", GST_RANK_NONE,
397           GST_TYPE_RTP_RED_ENC))
398     return FALSE;
399
400   if (!gst_element_register (plugin, "rtpreddec", GST_RANK_NONE,
401           GST_TYPE_RTP_RED_DEC))
402     return FALSE;
403
404   if (!gst_element_register (plugin, "rtpulpfecdec", GST_RANK_NONE,
405           GST_TYPE_RTP_ULPFEC_DEC))
406     return FALSE;
407
408   if (!gst_element_register (plugin, "rtpulpfecenc", GST_RANK_NONE,
409           GST_TYPE_RTP_ULPFEC_ENC))
410     return FALSE;
411
412   if (!gst_element_register (plugin, "rtpstorage", GST_RANK_NONE,
413           GST_TYPE_RTP_STORAGE))
414     return FALSE;
415
416   return TRUE;
417 }
418
419 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
420     GST_VERSION_MINOR,
421     rtp,
422     "Real-time protocol plugins",
423     plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);