codecparser: mpeg4 type error
[profile/ivi/gst-plugins-bad.git] / gst / sdp / gstsdpdemux.h
1 /* GStreamer
2  * Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
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., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GST_SDP_DEMUX_H__
21 #define __GST_SDP_DEMUX_H__
22
23 #include <gst/gst.h>
24 #include <gst/base/gstadapter.h>
25
26 G_BEGIN_DECLS
27
28 #define GST_TYPE_SDP_DEMUX \
29   (gst_sdp_demux_get_type())
30 #define GST_SDP_DEMUX(obj) \
31   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SDP_DEMUX,GstSDPDemux))
32 #define GST_SDP_DEMUX_CLASS(klass) \
33   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SDP_DEMUX,GstSDPDemuxClass))
34 #define GST_IS_SDP_DEMUX(obj) \
35   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SDP_DEMUX))
36 #define GST_IS_SDP_DEMUX_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SDP_DEMUX))
38 #define GST_SDP_DEMUX_CAST(obj) \
39   ((GstSDPDemux *)(obj))
40
41 typedef struct _GstSDPDemux GstSDPDemux;
42 typedef struct _GstSDPDemuxClass GstSDPDemuxClass;
43
44 #define GST_SDP_STREAM_GET_LOCK(sdp)   (GST_SDP_DEMUX_CAST(sdp)->stream_rec_lock)
45 #define GST_SDP_STREAM_LOCK(sdp)       (g_static_rec_mutex_lock (GST_SDP_STREAM_GET_LOCK(sdp)))
46 #define GST_SDP_STREAM_UNLOCK(sdp)     (g_static_rec_mutex_unlock (GST_SDP_STREAM_GET_LOCK(sdp)))
47
48 typedef struct _GstSDPStream GstSDPStream;
49
50 struct _GstSDPStream {
51   gint          id;
52
53   GstSDPDemux    *parent; /* parent, no extra ref to parent is taken */
54
55   /* pad we expose or NULL when it does not have an actual pad */
56   GstPad       *srcpad;
57   GstFlowReturn last_ret;
58   gboolean      added;
59   gboolean      disabled;
60   GstCaps      *caps;
61   gboolean      eos;
62
63   /* our udp sources */
64   GstElement   *udpsrc[2];
65   GstPad       *channelpad[2];
66   guint         rtp_port;
67   guint         rtcp_port;
68
69   gchar        *destination;
70   guint         ttl;
71   gboolean      multicast;
72
73   /* our udp sink back to the server */
74   GstElement   *udpsink;
75   GstPad       *rtcppad;
76
77   /* state */
78   gint          pt;
79   gboolean      container;
80 };
81
82 struct _GstSDPDemux {
83   GstBin           parent;
84
85   GstPad          *sinkpad;
86   GstAdapter      *adapter;
87   GstState         target;
88
89   /* task for UDP loop */
90   gboolean         ignore_timeout;
91
92   gint             numstreams;
93   GStaticRecMutex *stream_rec_lock;
94   GList           *streams;
95
96   /* properties */
97   gboolean          debug;
98   guint64           udp_timeout;
99   guint             latency;
100   gboolean          redirect;
101
102   /* session management */
103   GstElement      *session;
104   gulong           session_sig_id;
105   gulong           session_ptmap_id;
106   gulong           session_nmp_id;
107 };
108
109 struct _GstSDPDemuxClass {
110   GstBinClass parent_class;
111 };
112
113 GType gst_sdp_demux_get_type(void);
114
115 G_END_DECLS
116
117 #endif /* __GST_SDP_DEMUX_H__ */