995d753a3f51c81b3c727484c24c44791a2022b0
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / gst-libs / gst / rtsp / gstrtsptransport.h
1 /* GStreamer
2  * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.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  * Unless otherwise indicated, Source Code is licensed under MIT license.
21  * See further explanation attached in License Statement (distributed in the file
22  * LICENSE).
23  *
24  * Permission is hereby granted, free of charge, to any person obtaining a copy of
25  * this software and associated documentation files (the "Software"), to deal in
26  * the Software without restriction, including without limitation the rights to
27  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
28  * of the Software, and to permit persons to whom the Software is furnished to do
29  * so, subject to the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be included in all
32  * copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40  * SOFTWARE.
41  */
42
43 #ifndef __GST_RTSP_TRANSPORT_H__
44 #define __GST_RTSP_TRANSPORT_H__
45
46 #include <gst/rtsp/gstrtspdefs.h>
47
48 G_BEGIN_DECLS
49
50 /**
51  * GstRTSPTransMode:
52  * @GST_RTSP_TRANS_UNKNOWN: invalid tansport mode
53  * @GST_RTSP_TRANS_RTP: transfer RTP data
54  * @GST_RTSP_TRANS_RDT: transfer RDT (RealMedia) data
55  *
56  * The transfer mode to use.
57  */
58 typedef enum {
59   GST_RTSP_TRANS_UNKNOWN =  0,
60   GST_RTSP_TRANS_RTP     = (1 << 0),
61   GST_RTSP_TRANS_RDT     = (1 << 1)
62 } GstRTSPTransMode;
63
64 /**
65  * GstRTSPProfile:
66  * @GST_RTSP_PROFILE_UNKNOWN: invalid profile
67  * @GST_RTSP_PROFILE_AVP: the Audio/Visual profile
68  * @GST_RTSP_PROFILE_SAVP: the secure Audio/Visual profile
69  *
70  * The transfer profile to use.
71  */
72 typedef enum {
73   GST_RTSP_PROFILE_UNKNOWN =  0,
74   GST_RTSP_PROFILE_AVP     = (1 << 0),
75   GST_RTSP_PROFILE_SAVP    = (1 << 1)
76 } GstRTSPProfile;
77
78 /**
79  * GstRTSPLowerTrans:
80  * @GST_RTSP_LOWER_TRANS_UNKNOWN: invalid transport flag
81  * @GST_RTSP_LOWER_TRANS_UDP: stream data over UDP
82  * @GST_RTSP_LOWER_TRANS_UDP_MCAST: stream data over UDP multicast
83  * @GST_RTSP_LOWER_TRANS_TCP: stream data over TCP
84  * @GST_RTSP_LOWER_TRANS_HTTP: stream data tunneled over HTTP. Since: 0.10.23
85  *
86  * The different transport methods.
87  */
88 typedef enum {
89   GST_RTSP_LOWER_TRANS_UNKNOWN   = 0,
90   GST_RTSP_LOWER_TRANS_UDP       = (1 << 0),
91   GST_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1),
92   GST_RTSP_LOWER_TRANS_TCP       = (1 << 2),
93   GST_RTSP_LOWER_TRANS_HTTP      = (1 << 4)
94 } GstRTSPLowerTrans;
95
96 #define GST_TYPE_RTSP_LOWER_TRANS (gst_rtsp_lower_trans_get_type())
97 GType gst_rtsp_lower_trans_get_type (void);
98
99 typedef struct _GstRTSPRange GstRTSPRange;
100 typedef struct _GstRTSPTransport GstRTSPTransport;
101
102 /**
103  * GstRTSPRange:
104  * @min: minimum value of the range
105  * @max: maximum value of the range
106  *
107  * A type to specify a range.
108  */
109
110 struct _GstRTSPRange {
111   gint min;
112   gint max;
113 };
114
115 /**
116  * GstRTSPTransport:
117  * @trans: the transport mode
118  * @profile: the tansport profile
119  * @lower_transport: the lower transport
120  * @destination: the destination ip/hostname
121  * @source: the source ip/hostname
122  * @layers: the number of layers
123  * @mode_play: if play mode was selected
124  * @mode_record: if record mode was selected
125  * @append: is append mode was selected
126  * @interleaved: the interleave range
127  * @ttl: the time to live for multicast UDP
128  * @port: the port pair for multicast sessions
129  * @client_port: the client port pair for receiving data
130  * @server_port: the server port pair for receiving data
131  * @ssrc: the ssrc that the sender/receiver will use
132  *
133  * A structure holding the RTSP transport values.
134  */
135
136 struct _GstRTSPTransport {
137   GstRTSPTransMode  trans;
138   GstRTSPProfile    profile;
139   GstRTSPLowerTrans lower_transport;
140
141   gchar         *destination;
142   gchar         *source;
143   guint          layers;
144   gboolean       mode_play;
145   gboolean       mode_record;
146   gboolean       append;
147   GstRTSPRange   interleaved;
148
149   /* multicast specific */
150   guint  ttl;
151
152   /* UDP specific */
153   GstRTSPRange   port;
154   GstRTSPRange   client_port;
155   GstRTSPRange   server_port;
156   /* RTP specific */
157   guint          ssrc;
158
159 };
160
161 GstRTSPResult      gst_rtsp_transport_new          (GstRTSPTransport **transport);
162 GstRTSPResult      gst_rtsp_transport_init         (GstRTSPTransport *transport);
163
164 GstRTSPResult      gst_rtsp_transport_parse        (const gchar *str, GstRTSPTransport *transport);
165 gchar*             gst_rtsp_transport_as_text      (GstRTSPTransport *transport);
166
167 GstRTSPResult      gst_rtsp_transport_get_mime     (GstRTSPTransMode trans, const gchar **mime);
168 GstRTSPResult      gst_rtsp_transport_get_manager  (GstRTSPTransMode trans, const gchar **manager, guint option);
169
170 GstRTSPResult      gst_rtsp_transport_free         (GstRTSPTransport *transport);
171
172 G_END_DECLS
173
174 #endif /* __GST_RTSP_TRANSPORT_H__ */