2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 * <2006> Wim Taymans <wim@fluendo.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 * Unless otherwise indicated, Source Code is licensed under MIT license.
22 * See further explanation attached in License Statement (distributed in the file
25 * Permission is hereby granted, free of charge, to any person obtaining a copy of
26 * this software and associated documentation files (the "Software"), to deal in
27 * the Software without restriction, including without limitation the rights to
28 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
29 * of the Software, and to permit persons to whom the Software is furnished to do
30 * so, subject to the following conditions:
32 * The above copyright notice and this permission notice shall be included in all
33 * copies or substantial portions of the Software.
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
44 #ifndef __GST_RTSPSRC_H__
45 #define __GST_RTSPSRC_H__
51 #include <gst/rtsp/rtsp.h>
54 #include "gstrtspext.h"
56 #define GST_TYPE_RTSPSRC \
57 (gst_rtspsrc_get_type())
58 #define GST_RTSPSRC(obj) \
59 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RTSPSRC,GstRTSPSrc))
60 #define GST_RTSPSRC_CLASS(klass) \
61 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_RTSPSRC,GstRTSPSrcClass))
62 #define GST_IS_RTSPSRC(obj) \
63 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_RTSPSRC))
64 #define GST_IS_RTSPSRC_CLASS(klass) \
65 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RTSPSRC))
66 #define GST_RTSPSRC_CAST(obj) \
69 typedef struct _GstRTSPSrc GstRTSPSrc;
70 typedef struct _GstRTSPSrcClass GstRTSPSrcClass;
72 #define GST_RTSP_STATE_GET_LOCK(rtsp) (&GST_RTSPSRC_CAST(rtsp)->state_rec_lock)
73 #define GST_RTSP_STATE_LOCK(rtsp) (g_rec_mutex_lock (GST_RTSP_STATE_GET_LOCK(rtsp)))
74 #define GST_RTSP_STATE_UNLOCK(rtsp) (g_rec_mutex_unlock (GST_RTSP_STATE_GET_LOCK(rtsp)))
76 #define GST_RTSP_STREAM_GET_LOCK(rtsp) (&GST_RTSPSRC_CAST(rtsp)->stream_rec_lock)
77 #define GST_RTSP_STREAM_LOCK(rtsp) (g_rec_mutex_lock (GST_RTSP_STREAM_GET_LOCK(rtsp)))
78 #define GST_RTSP_STREAM_UNLOCK(rtsp) (g_rec_mutex_unlock (GST_RTSP_STREAM_GET_LOCK(rtsp)))
80 typedef struct _GstRTSPConnInfo GstRTSPConnInfo;
82 struct _GstRTSPConnInfo {
86 GstRTSPConnection *connection;
91 typedef struct _GstRTSPStream GstRTSPStream;
93 struct _GstRTSPStream {
96 GstRTSPSrc *parent; /* parent, no extra ref to parent is taken */
98 /* pad we expose or NULL when it does not have an actual pad */
100 GstFlowReturn last_ret;
107 /* for interleaved mode */
109 GstPad *channelpad[2];
111 /* our udp sources */
112 GstElement *udpsrc[2];
117 /* our udp sinks back to the server */
118 GstElement *udpsink[2];
121 /* fakesrc for sending dummy data */
129 GstRTSPProfile profile;
131 /* original control url */
137 GstCaps *srtcpparams;
141 /* per stream connection */
142 GstRTSPConnInfo conninfo;
154 gboolean is_multicast;
157 GstStructure *rtx_pt_map;
162 * @GST_RTSP_NAT_NONE: none
163 * @GST_RTSP_NAT_DUMMY: send dummy packets
165 * Different methods for trying to traverse firewalls.
176 /* task and mutex for interleaved mode */
177 gboolean interleaved;
179 GRecMutex stream_rec_lock;
185 gboolean need_segment;
186 GstClockTime base_time;
191 gboolean ignore_timeout;
194 /* mutex for protecting state changes */
195 GRecMutex state_rec_lock;
201 gboolean need_activate;
204 GstRTSPLowerTrans protocols;
208 GTimeVal tcp_timeout;
209 GTimeVal *ptcp_timeout;
211 gboolean drop_on_latency;
212 guint64 connection_speed;
213 GstRTSPNatMethod nat_method;
215 gboolean do_rtsp_keep_alive;
218 gchar *proxy_user; /* from url or property */
219 gchar *proxy_passwd; /* from url or property */
220 gchar *prop_proxy_id; /* set via property */
221 gchar *prop_proxy_pw; /* set via property */
226 GstRTSPRange client_port_range;
227 gint udp_buffer_size;
228 gboolean short_header;
230 gboolean udp_reconnect;
233 gboolean use_pipeline_clock;
235 GTlsCertificateFlags tls_validation_flags;
236 GTlsDatabase *tls_database;
237 GTlsInteraction *tls_interaction;
238 gboolean do_retransmission;
239 gint ntp_time_source;
241 GstClockTime max_rtcp_rtp_time_diff;
246 GstRTSPLowerTrans cur_protocols;
247 gboolean tried_url_auth;
249 gboolean need_redirect;
250 GstRTSPTimeRange *range;
253 GstClock *provided_clock;
255 /* supported methods */
259 GstClockTime last_pos;
261 /* session management */
263 gulong manager_sig_id;
264 gulong manager_ptmap_id;
265 gboolean use_buffering;
267 GstRTSPConnInfo conninfo;
269 /* a list of RTSP extensions as GstElement */
270 GstRTSPExtensionList *extensions;
273 struct _GstRTSPSrcClass {
274 GstBinClass parent_class;
277 GType gst_rtspsrc_get_type(void);
281 #endif /* __GST_RTSPSRC_H__ */