client: Check client provided addresses against the address pool
[platform/upstream/gstreamer.git] / gst / rtsp-server / rtsp-stream.h
1 /* GStreamer
2  * Copyright (C) 2008 Wim Taymans <wim.taymans at 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., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #include <gst/gst.h>
21 #include <gst/rtsp/gstrtsprange.h>
22 #include <gst/rtsp/gstrtspurl.h>
23
24 #ifndef __GST_RTSP_STREAM_H__
25 #define __GST_RTSP_STREAM_H__
26
27 G_BEGIN_DECLS
28
29 /* types for the media stream */
30 #define GST_TYPE_RTSP_STREAM              (gst_rtsp_stream_get_type ())
31 #define GST_IS_RTSP_STREAM(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_STREAM))
32 #define GST_IS_RTSP_STREAM_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_STREAM))
33 #define GST_RTSP_STREAM_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStreamClass))
34 #define GST_RTSP_STREAM(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStream))
35 #define GST_RTSP_STREAM_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_STREAM, GstRTSPStreamClass))
36 #define GST_RTSP_STREAM_CAST(obj)         ((GstRTSPStream*)(obj))
37 #define GST_RTSP_STREAM_CLASS_CAST(klass) ((GstRTSPStreamClass*)(klass))
38
39 typedef struct _GstRTSPStream GstRTSPStream;
40 typedef struct _GstRTSPStreamClass GstRTSPStreamClass;
41 typedef struct _GstRTSPStreamPrivate GstRTSPStreamPrivate;
42
43 #include "rtsp-stream-transport.h"
44 #include "rtsp-address-pool.h"
45
46 /**
47  * GstRTSPStream:
48  * @parent: the parent instance
49  *
50  * The definition of a media stream.
51  */
52 struct _GstRTSPStream {
53   GObject       parent;
54
55   GstRTSPStreamPrivate *priv;
56 };
57
58 struct _GstRTSPStreamClass {
59   GObjectClass parent_class;
60 };
61
62 GType             gst_rtsp_stream_get_type         (void);
63
64 GstRTSPStream *   gst_rtsp_stream_new              (guint idx, GstElement *payloader,
65                                                     GstPad *srcpad);
66 guint             gst_rtsp_stream_get_index        (GstRTSPStream *stream);
67
68 void              gst_rtsp_stream_set_mtu          (GstRTSPStream *stream, guint mtu);
69 guint             gst_rtsp_stream_get_mtu          (GstRTSPStream *stream);
70
71 void              gst_rtsp_stream_set_address_pool (GstRTSPStream *stream, GstRTSPAddressPool *pool);
72 GstRTSPAddressPool *
73                   gst_rtsp_stream_get_address_pool (GstRTSPStream *stream);
74
75 GstRTSPAddress *  gst_rtsp_stream_get_address      (GstRTSPStream *stream);
76
77 GstRTSPAddress *  gst_rtsp_stream_reserve_address  (GstRTSPStream *stream,
78                                                     const gchar * address,
79                                                     guint port,
80                                                     guint n_ports,
81                                                     guint ttl);
82
83 gboolean          gst_rtsp_stream_join_bin         (GstRTSPStream *stream,
84                                                     GstBin *bin, GstElement *rtpbin,
85                                                     GstState state);
86 gboolean          gst_rtsp_stream_leave_bin        (GstRTSPStream *stream,
87                                                     GstBin *bin, GstElement *rtpbin);
88
89 void              gst_rtsp_stream_get_server_port  (GstRTSPStream *stream,
90                                                     GstRTSPRange *server_port);
91 void              gst_rtsp_stream_get_ssrc         (GstRTSPStream *stream,
92                                                     guint *ssrc);
93
94 gboolean          gst_rtsp_stream_get_rtpinfo      (GstRTSPStream *stream,
95                                                     guint *rtptime, guint *seq);
96 GstCaps *         gst_rtsp_stream_get_caps         (GstRTSPStream *stream);
97
98 GstFlowReturn     gst_rtsp_stream_recv_rtp         (GstRTSPStream *stream,
99                                                     GstBuffer *buffer);
100 GstFlowReturn     gst_rtsp_stream_recv_rtcp        (GstRTSPStream *stream,
101                                                     GstBuffer *buffer);
102
103 gboolean          gst_rtsp_stream_add_transport    (GstRTSPStream *stream,
104                                                     GstRTSPStreamTransport *trans);
105 gboolean          gst_rtsp_stream_remove_transport (GstRTSPStream *stream,
106                                                     GstRTSPStreamTransport *trans);
107
108 G_END_DECLS
109
110 #endif /* __GST_RTSP_STREAM_H__ */