1 /* RTP muxer element for GStreamer 2 * 3 * gstrtpmux.h: 4 * 5 * Copyright (C) <2007> Nokia Corporation. 6 * Contact: Zeeshan Ali <zeeshan.ali@nokia.com> 7 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> 8 * 2000,2005 Wim Taymans <wim@fluendo.com> 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Library General Public 12 * License as published by the Free Software Foundation; either 13 * version 2 of the License, or (at your option) any later version. 14 * 15 * This library is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 * Library General Public License for more details. 19 * 20 * You should have received a copy of the GNU Library General Public 21 * License along with this library; if not, write to the 22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 23 * Boston, MA 02110-1301, USA. 24 */ 25 26 #ifndef __GST_RTP_MUX_H__ 27 #define __GST_RTP_MUX_H__ 28 29 #include <gst/gst.h> 30 #include <gst/rtp/gstrtpbuffer.h> 31 32 G_BEGIN_DECLS 33 #define GST_TYPE_RTP_MUX (gst_rtp_mux_get_type()) 34 #define GST_RTP_MUX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTP_MUX, GstRTPMux)) 35 #define GST_RTP_MUX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTP_MUX, GstRTPMuxClass)) 36 #define GST_RTP_MUX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTP_MUX, GstRTPMuxClass)) 37 #define GST_IS_RTP_MUX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTP_MUX)) 38 #define GST_IS_RTP_MUX_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTP_MUX)) 39 typedef struct _GstRTPMux GstRTPMux; 40 typedef struct _GstRTPMuxClass GstRTPMuxClass; 41 42 43 typedef struct 44 { 45 gboolean have_timestamp_offset; 46 guint timestamp_offset; 47 48 GstSegment segment; 49 50 gboolean priority; 51 } GstRTPMuxPadPrivate; 52 53 54 /* GstRTPMux: 55 * 56 * The opaque #GstRTPMux structure. 57 */ 58 struct _GstRTPMux 59 { 60 GstElement element; 61 62 /* pad */ 63 GstPad *srcpad; 64 65 guint32 ts_base; 66 guint16 seqnum_base; 67 68 gint32 ts_offset; 69 gint16 seqnum_offset; 70 guint16 seqnum; /* protected by object lock */ 71 guint ssrc; 72 guint current_ssrc; 73 gboolean have_ssrc; 74 75 GstPad *last_pad; /* protected by object lock */ 76 77 GstClockTime last_stop; 78 gboolean send_stream_start; 79 }; 80 81 struct _GstRTPMuxClass 82 { 83 GstElementClass parent_class; 84 85 gboolean (*accept_buffer_locked) (GstRTPMux *rtp_mux, 86 GstRTPMuxPadPrivate * padpriv, GstRTPBuffer * buffer); 87 88 gboolean (*src_event) (GstRTPMux *rtp_mux, GstEvent *event); 89 }; 90 91 GType gst_rtp_mux_get_type (void); 92 93 GST_ELEMENT_REGISTER_DECLARE (rtpmux); 94 95 G_END_DECLS 96 #endif /* __GST_RTP_MUX_H__ */ 97