• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* RTP Retransmission receiver element for GStreamer
2  *
3  * gstrtprtxreceive.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_RECEIVE_H__
25 #define __GST_RTP_RTX_RECEIVE_H__
26 
27 #include <gst/gst.h>
28 #include <gst/rtp/gstrtpbuffer.h>
29 
30 G_BEGIN_DECLS
31 typedef struct _GstRtpRtxReceive GstRtpRtxReceive;
32 typedef struct _GstRtpRtxReceiveClass GstRtpRtxReceiveClass;
33 
34 #define GST_TYPE_RTP_RTX_RECEIVE (gst_rtp_rtx_receive_get_type())
35 #define GST_RTP_RTX_RECEIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_RTX_RECEIVE, GstRtpRtxReceive))
36 #define GST_RTP_RTX_RECEIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_RTX_RECEIVE, GstRtpRtxReceiveClass))
37 #define GST_RTP_RTX_RECEIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_RTX_RECEIVE, GstRtpRtxReceiveClass))
38 #define GST_IS_RTP_RTX_RECEIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_RTX_RECEIVE))
39 #define GST_IS_RTP_RTX_RECEIVE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_RTX_RECEIVE))
40 #define GST_RTP_RTX_RECEIVE_CAST(obj) ((GstRtpRtxReceive *)(obj))
41 
42 struct _GstRtpRtxReceive
43 {
44   GstElement element;
45 
46   /* pad */
47   GstPad *sinkpad;
48   GstPad *srcpad;
49 
50   /* retrieve associated master stream from rtx stream
51    * it also works to retrieve rtx stream from master stream
52    * as we make sure all ssrc are unique */
53   GHashTable *ssrc2_ssrc1_map;
54 
55   /* contains seqnum of request packets of whom their ssrc have
56    * not been associated to a rtx stream yet */
57   GHashTable *seqnum_ssrc1_map;
58 
59   /* rtx pt (uint) -> origin pt (uint) */
60   GHashTable *rtx_pt_map;
61   /* origin pt (string) -> rtx pt (uint) */
62   GstStructure *rtx_pt_map_structure;
63 
64   /* statistics */
65   guint num_rtx_requests;
66   guint num_rtx_packets;
67   guint num_rtx_assoc_packets;
68 
69   GstClockTime last_time;
70 };
71 
72 struct _GstRtpRtxReceiveClass
73 {
74   GstElementClass parent_class;
75 };
76 
77 
78 GType gst_rtp_rtx_receive_get_type (void);
79 
80 GST_ELEMENT_REGISTER_DECLARE (rtprtxreceive);
81 
82 G_END_DECLS
83 #endif /* __GST_RTP_RTX_RECEIVE_H__ */
84