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 33 typedef struct _GstRtpRtxSend GstRtpRtxSend; 34 typedef struct _GstRtpRtxSendClass GstRtpRtxSendClass; 35 36 #define GST_TYPE_RTP_RTX_SEND (gst_rtp_rtx_send_get_type()) 37 #define GST_RTP_RTX_SEND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_RTX_SEND, GstRtpRtxSend)) 38 #define GST_RTP_RTX_SEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_RTX_SEND, GstRtpRtxSendClass)) 39 #define GST_RTP_RTX_SEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_RTX_SEND, GstRtpRtxSendClass)) 40 #define GST_IS_RTP_RTX_SEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_RTX_SEND)) 41 #define GST_IS_RTP_RTX_SEND_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_RTX_SEND)) 42 #define GST_RTP_RTX_SEND_CAST(obj) ((GstRtpRtxSend *)(obj)) 43 44 struct _GstRtpRtxSend 45 { 46 GstElement element; 47 48 /* pad */ 49 GstPad *sinkpad; 50 GstPad *srcpad; 51 52 /* rtp packets that will be pushed out */ 53 GstDataQueue *queue; 54 55 /* ssrc -> SSRCRtxData */ 56 GHashTable *ssrc_data; 57 /* rtx ssrc -> master ssrc */ 58 GHashTable *rtx_ssrcs; 59 60 /* master ssrc -> rtx ssrc (property) */ 61 GstStructure *external_ssrc_map; 62 63 /* orig pt (uint) -> rtx pt (uint) */ 64 GHashTable *rtx_pt_map; 65 /* orig pt (string) -> rtx pt (uint) */ 66 GstStructure *rtx_pt_map_structure; 67 68 /* orig pt (uint) -> clock rate (uint) */ 69 GHashTable *clock_rate_map; 70 /* orig pt (string) -> clock rate (uint) */ 71 GstStructure *clock_rate_map_structure; 72 73 /* buffering control properties */ 74 guint max_size_time; 75 guint max_size_packets; 76 77 /* statistics */ 78 guint num_rtx_requests; 79 guint num_rtx_packets; 80 }; 81 82 struct _GstRtpRtxSendClass 83 { 84 GstElementClass parent_class; 85 }; 86 87 GType gst_rtp_rtx_send_get_type (void); 88 89 GST_ELEMENT_REGISTER_DECLARE (rtprtxsend); 90 91 G_END_DECLS 92 #endif /* __GST_RTP_RTX_SEND_H__ */ 93