1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
|
/* GStreamer
* Copyright (C) 2008 Wim Taymans <wim.taymans at gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <gst/gst.h>
#include <gst/rtsp/rtsp.h>
#include <gio/gio.h>
#ifndef __GST_RTSP_STREAM_H__
#define __GST_RTSP_STREAM_H__
#include "rtsp-server-prelude.h"
G_BEGIN_DECLS
/* types for the media stream */
#define GST_TYPE_RTSP_STREAM (gst_rtsp_stream_get_type ())
#define GST_IS_RTSP_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_STREAM))
#define GST_IS_RTSP_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_STREAM))
#define GST_RTSP_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStreamClass))
#define GST_RTSP_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_STREAM, GstRTSPStream))
#define GST_RTSP_STREAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_STREAM, GstRTSPStreamClass))
#define GST_RTSP_STREAM_CAST(obj) ((GstRTSPStream*)(obj))
#define GST_RTSP_STREAM_CLASS_CAST(klass) ((GstRTSPStreamClass*)(klass))
typedef struct _GstRTSPStream GstRTSPStream;
typedef struct _GstRTSPStreamClass GstRTSPStreamClass;
typedef struct _GstRTSPStreamPrivate GstRTSPStreamPrivate;
#include "rtsp-stream-transport.h"
#include "rtsp-address-pool.h"
#include "rtsp-session.h"
#include "rtsp-media.h"
/**
* GstRTSPStream:
*
* The definition of a media stream.
*/
struct _GstRTSPStream {
GObject parent;
/*< private >*/
GstRTSPStreamPrivate *priv;
gpointer _gst_reserved[GST_PADDING];
};
struct _GstRTSPStreamClass {
GObjectClass parent_class;
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
GST_RTSP_SERVER_API
GType gst_rtsp_stream_get_type (void);
GST_RTSP_SERVER_API
GstRTSPStream * gst_rtsp_stream_new (guint idx, GstElement *payloader,
GstPad *pad);
GST_RTSP_SERVER_API
guint gst_rtsp_stream_get_index (GstRTSPStream *stream);
GST_RTSP_SERVER_API
guint gst_rtsp_stream_get_pt (GstRTSPStream *stream);
GST_RTSP_SERVER_API
GstPad * gst_rtsp_stream_get_srcpad (GstRTSPStream *stream);
GST_RTSP_SERVER_API
GstPad * gst_rtsp_stream_get_sinkpad (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_control (GstRTSPStream *stream, const gchar *control);
GST_RTSP_SERVER_API
gchar * gst_rtsp_stream_get_control (GstRTSPStream *stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_has_control (GstRTSPStream *stream, const gchar *control);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_mtu (GstRTSPStream *stream, guint mtu);
GST_RTSP_SERVER_API
guint gst_rtsp_stream_get_mtu (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_dscp_qos (GstRTSPStream *stream, gint dscp_qos);
GST_RTSP_SERVER_API
gint gst_rtsp_stream_get_dscp_qos (GstRTSPStream *stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_is_transport_supported (GstRTSPStream *stream,
GstRTSPTransport *transport);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_profiles (GstRTSPStream *stream, GstRTSPProfile profiles);
GST_RTSP_SERVER_API
GstRTSPProfile gst_rtsp_stream_get_profiles (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_protocols (GstRTSPStream *stream, GstRTSPLowerTrans protocols);
GST_RTSP_SERVER_API
GstRTSPLowerTrans gst_rtsp_stream_get_protocols (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_address_pool (GstRTSPStream *stream, GstRTSPAddressPool *pool);
GST_RTSP_SERVER_API
GstRTSPAddressPool *
gst_rtsp_stream_get_address_pool (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_multicast_iface (GstRTSPStream *stream, const gchar * multicast_iface);
GST_RTSP_SERVER_API
gchar * gst_rtsp_stream_get_multicast_iface (GstRTSPStream *stream);
GST_RTSP_SERVER_API
GstRTSPAddress * gst_rtsp_stream_reserve_address (GstRTSPStream *stream,
const gchar * address,
guint port,
guint n_ports,
guint ttl);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_join_bin (GstRTSPStream *stream,
GstBin *bin, GstElement *rtpbin,
GstState state);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_leave_bin (GstRTSPStream *stream,
GstBin *bin, GstElement *rtpbin);
GST_RTSP_SERVER_API
GstBin * gst_rtsp_stream_get_joined_bin (GstRTSPStream *stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_set_blocked (GstRTSPStream * stream,
gboolean blocked);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_is_blocking (GstRTSPStream * stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_unblock_linked (GstRTSPStream * stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_client_side (GstRTSPStream *stream, gboolean client_side);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_is_client_side (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_get_server_port (GstRTSPStream *stream,
GstRTSPRange *server_port,
GSocketFamily family);
GST_RTSP_SERVER_API
GstRTSPAddress * gst_rtsp_stream_get_multicast_address (GstRTSPStream *stream,
GSocketFamily family);
GST_RTSP_SERVER_API
GObject * gst_rtsp_stream_get_rtpsession (GstRTSPStream *stream);
GST_RTSP_SERVER_API
GstElement * gst_rtsp_stream_get_srtp_encoder (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_get_ssrc (GstRTSPStream *stream,
guint *ssrc);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_get_rtpinfo (GstRTSPStream *stream,
guint *rtptime, guint *seq,
guint *clock_rate,
GstClockTime *running_time);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_get_rates (GstRTSPStream * stream,
gdouble * rate,
gdouble * applied_rate);
GST_RTSP_SERVER_API
GstCaps * gst_rtsp_stream_get_caps (GstRTSPStream *stream);
GST_RTSP_SERVER_API
GstFlowReturn gst_rtsp_stream_recv_rtp (GstRTSPStream *stream,
GstBuffer *buffer);
GST_RTSP_SERVER_API
GstFlowReturn gst_rtsp_stream_recv_rtcp (GstRTSPStream *stream,
GstBuffer *buffer);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_add_transport (GstRTSPStream *stream,
GstRTSPStreamTransport *trans);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_remove_transport (GstRTSPStream *stream,
GstRTSPStreamTransport *trans);
GST_RTSP_SERVER_API
GSocket * gst_rtsp_stream_get_rtp_socket (GstRTSPStream *stream,
GSocketFamily family);
GST_RTSP_SERVER_API
GSocket * gst_rtsp_stream_get_rtcp_socket (GstRTSPStream *stream,
GSocketFamily family);
GST_RTSP_SERVER_API
GSocket * gst_rtsp_stream_get_rtp_multicast_socket (GstRTSPStream *stream,
GSocketFamily family);
GST_RTSP_SERVER_API
GSocket * gst_rtsp_stream_get_rtcp_multicast_socket (GstRTSPStream *stream,
GSocketFamily family);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_add_multicast_client_address (GstRTSPStream * stream,
const gchar * destination,
guint rtp_port,
guint rtcp_port,
GSocketFamily family);
GST_RTSP_SERVER_API
gchar * gst_rtsp_stream_get_multicast_client_addresses (GstRTSPStream * stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_update_crypto (GstRTSPStream * stream,
guint ssrc, GstCaps * crypto);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_query_position (GstRTSPStream * stream,
gint64 * position);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_query_stop (GstRTSPStream * stream,
gint64 * stop);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_seekable (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_seqnum_offset (GstRTSPStream *stream, guint16 seqnum);
GST_RTSP_SERVER_API
guint16 gst_rtsp_stream_get_current_seqnum (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_retransmission_time (GstRTSPStream *stream, GstClockTime time);
GST_RTSP_SERVER_API
GstClockTime gst_rtsp_stream_get_retransmission_time (GstRTSPStream *stream);
GST_RTSP_SERVER_API
guint gst_rtsp_stream_get_retransmission_pt (GstRTSPStream * stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_retransmission_pt (GstRTSPStream * stream,
guint rtx_pt);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_buffer_size (GstRTSPStream *stream, guint size);
GST_RTSP_SERVER_API
guint gst_rtsp_stream_get_buffer_size (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_pt_map (GstRTSPStream * stream, guint pt, GstCaps * caps);
GST_RTSP_SERVER_API
GstElement * gst_rtsp_stream_request_aux_sender (GstRTSPStream * stream, guint sessid);
GST_RTSP_SERVER_API
GstElement * gst_rtsp_stream_request_aux_receiver (GstRTSPStream * stream, guint sessid);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_allocate_udp_sockets (GstRTSPStream * stream, GSocketFamily family,
GstRTSPTransport *transport, gboolean use_client_settings);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_publish_clock_mode (GstRTSPStream * stream, GstRTSPPublishClockMode mode);
GST_RTSP_SERVER_API
GstRTSPPublishClockMode gst_rtsp_stream_get_publish_clock_mode (GstRTSPStream * stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_set_max_mcast_ttl (GstRTSPStream *stream, guint ttl);
GST_RTSP_SERVER_API
guint gst_rtsp_stream_get_max_mcast_ttl (GstRTSPStream *stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_verify_mcast_ttl (GstRTSPStream *stream, guint ttl);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_bind_mcast_address (GstRTSPStream * stream, gboolean bind_mcast_addr);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_is_bind_mcast_address (GstRTSPStream * stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_complete_stream (GstRTSPStream * stream, const GstRTSPTransport * transport);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_is_complete (GstRTSPStream * stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_is_sender (GstRTSPStream * stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_is_receiver (GstRTSPStream * stream);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_handle_keymgmt (GstRTSPStream *stream, const gchar *keymgmt);
/* ULP Forward Error Correction (RFC 5109) */
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_get_ulpfec_enabled (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_ulpfec_pt (GstRTSPStream *stream, guint pt);
GST_RTSP_SERVER_API
guint gst_rtsp_stream_get_ulpfec_pt (GstRTSPStream *stream);
GST_RTSP_SERVER_API
GstElement * gst_rtsp_stream_request_ulpfec_decoder (GstRTSPStream *stream, GstElement *rtpbin, guint sessid);
GST_RTSP_SERVER_API
GstElement * gst_rtsp_stream_request_ulpfec_encoder (GstRTSPStream *stream, guint sessid);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_ulpfec_percentage (GstRTSPStream *stream, guint percentage);
GST_RTSP_SERVER_API
guint gst_rtsp_stream_get_ulpfec_percentage (GstRTSPStream *stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_set_rate_control (GstRTSPStream * stream, gboolean enabled);
GST_RTSP_SERVER_API
gboolean gst_rtsp_stream_get_rate_control (GstRTSPStream * stream);
GST_RTSP_SERVER_API
void gst_rtsp_stream_unblock_rtcp (GstRTSPStream * stream);
/**
* GstRTSPStreamTransportFilterFunc:
* @stream: a #GstRTSPStream object
* @trans: a #GstRTSPStreamTransport in @stream
* @user_data: user data that has been given to gst_rtsp_stream_transport_filter()
*
* This function will be called by the gst_rtsp_stream_transport_filter(). An
* implementation should return a value of #GstRTSPFilterResult.
*
* When this function returns #GST_RTSP_FILTER_REMOVE, @trans will be removed
* from @stream.
*
* A return value of #GST_RTSP_FILTER_KEEP will leave @trans untouched in
* @stream.
*
* A value of #GST_RTSP_FILTER_REF will add @trans to the result #GList of
* gst_rtsp_stream_transport_filter().
*
* Returns: a #GstRTSPFilterResult.
*/
typedef GstRTSPFilterResult (*GstRTSPStreamTransportFilterFunc) (GstRTSPStream *stream,
GstRTSPStreamTransport *trans,
gpointer user_data);
GST_RTSP_SERVER_API
GList * gst_rtsp_stream_transport_filter (GstRTSPStream *stream,
GstRTSPStreamTransportFilterFunc func,
gpointer user_data);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTSPStream, gst_object_unref)
#endif
G_END_DECLS
#endif /* __GST_RTSP_STREAM_H__ */
|