rtpmanager: Update codes based on 1.18.4
[platform/upstream/gst-plugins-good.git] / gst / rtpmanager / gstrtprtxsend.h
1 /* RTP Retransmission sender element for GStreamer
2  *
3  * gstrtprtxsend.h:
4  *
5  * Copyright (C) 2013 Collabora Ltd.
6  *   @author Julien Isorce <julien.isorce@collabora.co.uk>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23
24 #ifndef __GST_RTP_RTX_SEND_H__
25 #define __GST_RTP_RTX_SEND_H__
26
27 #include <gst/gst.h>
28 #include <gst/rtp/gstrtpbuffer.h>
29 #include <gst/base/gstdataqueue.h>
30
31 G_BEGIN_DECLS
32 #define GST_TYPE_RTP_RTX_SEND (gst_rtp_rtx_send_get_type())
33 #define GST_RTP_RTX_SEND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_RTX_SEND, GstRtpRtxSend))
34 #define GST_RTP_RTX_SEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_RTX_SEND, GstRtpRtxSendClass))
35 #define GST_RTP_RTX_SEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_RTX_SEND, GstRtpRtxSendClass))
36 #define GST_IS_RTP_RTX_SEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_RTX_SEND))
37 #define GST_IS_RTP_RTX_SEND_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_RTX_SEND))
38 typedef struct _GstRtpRtxSend GstRtpRtxSend;
39 typedef struct _GstRtpRtxSendClass GstRtpRtxSendClass;
40
41 struct _GstRtpRtxSend
42 {
43   GstElement element;
44
45   /* pad */
46   GstPad *sinkpad;
47   GstPad *srcpad;
48
49   /* rtp packets that will be pushed out */
50   GstDataQueue *queue;
51
52   /* ssrc -> SSRCRtxData */
53   GHashTable *ssrc_data;
54   /* rtx ssrc -> master ssrc */
55   GHashTable *rtx_ssrcs;
56
57   /* master ssrc -> rtx ssrc (property) */
58   GstStructure *external_ssrc_map;
59
60   /* orig pt (uint) -> rtx pt (uint) */
61   GHashTable *rtx_pt_map;
62   /* orig pt (string) -> rtx pt (uint) */
63   GstStructure *rtx_pt_map_structure;
64
65   /* orig pt (uint) -> clock rate (uint) */
66   GHashTable *clock_rate_map;
67   /* orig pt (string) -> clock rate (uint) */
68   GstStructure *clock_rate_map_structure;
69
70   /* buffering control properties */
71   guint max_size_time;
72   guint max_size_packets;
73
74   /* statistics */
75   guint num_rtx_requests;
76   guint num_rtx_packets;
77 };
78
79 struct _GstRtpRtxSendClass
80 {
81   GstElementClass parent_class;
82 };
83
84
85 GType gst_rtp_rtx_send_get_type (void);
86 gboolean gst_rtp_rtx_send_plugin_init (GstPlugin * plugin);
87
88 G_END_DECLS
89 #endif /* __GST_RTP_RTX_SEND_H__ */