2 * Copyright (C) 2008 Wim Taymans <wim.taymans at gmail.com>
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.
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.
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.
21 #include <gst/rtsp/gstrtsprange.h>
22 #include <gst/rtsp/gstrtspurl.h>
24 #ifndef __GST_RTSP_STREAM_TRANSPORT_H__
25 #define __GST_RTSP_STREAM_TRANSPORT_H__
29 /* types for the media */
30 #define GST_TYPE_RTSP_STREAM_TRANSPORT (gst_rtsp_stream_transport_get_type ())
31 #define GST_IS_RTSP_STREAM_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_STREAM_TRANSPORT))
32 #define GST_IS_RTSP_STREAM_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_STREAM_TRANSPORT))
33 #define GST_RTSP_STREAM_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_STREAM_TRANSPORT, GstRTSPStreamTransportClass))
34 #define GST_RTSP_STREAM_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_STREAM_TRANSPORT, GstRTSPStreamTransport))
35 #define GST_RTSP_STREAM_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_STREAM_TRANSPORT, GstRTSPStreamTransportClass))
36 #define GST_RTSP_STREAM_TRANSPORT_CAST(obj) ((GstRTSPStreamTransport*)(obj))
37 #define GST_RTSP_STREAM_TRANSPORT_CLASS_CAST(klass) ((GstRTSPStreamTransportClass*)(klass))
39 typedef struct _GstRTSPStreamTransport GstRTSPStreamTransport;
40 typedef struct _GstRTSPStreamTransportClass GstRTSPStreamTransportClass;
42 #include "rtsp-stream.h"
43 #include "rtsp-address-pool.h"
45 typedef gboolean (*GstRTSPSendFunc) (GstBuffer *buffer, guint8 channel, gpointer user_data);
46 typedef void (*GstRTSPKeepAliveFunc) (gpointer user_data);
49 * GstRTSPStreamTransport:
50 * @parent: parent instance
51 * @stream: the GstRTSPStream we manage
52 * @send_rtp: callback for sending RTP messages
53 * @send_rtcp: callback for sending RTCP messages
54 * @user_data: user data passed in the callbacks
55 * @notify: free function for the user_data.
56 * @keep_alive: keep alive callback
57 * @ka_user_data: data passed to @keep_alive
58 * @ka_notify: called when @ka_user_data is freed
59 * @active: if we are actively sending
60 * @timeout: if we timed out
61 * @transport: a transport description
62 * @addr: an optional address
63 * @rtpsource: the receiver rtp source object
65 * A Transport description for stream @idx
67 struct _GstRTSPStreamTransport {
70 GstRTSPStream *stream;
72 GstRTSPSendFunc send_rtp;
73 GstRTSPSendFunc send_rtcp;
75 GDestroyNotify notify;
77 GstRTSPKeepAliveFunc keep_alive;
78 gpointer ka_user_data;
79 GDestroyNotify ka_notify;
83 GstRTSPTransport *transport;
88 struct _GstRTSPStreamTransportClass {
89 GObjectClass parent_class;
92 GType gst_rtsp_stream_transport_get_type (void);
94 GstRTSPStreamTransport * gst_rtsp_stream_transport_new (GstRTSPStream *stream,
95 GstRTSPTransport *tr);
97 void gst_rtsp_stream_transport_set_transport (GstRTSPStreamTransport *trans,
98 GstRTSPTransport * tr);
100 void gst_rtsp_stream_transport_set_callbacks (GstRTSPStreamTransport *trans,
101 GstRTSPSendFunc send_rtp,
102 GstRTSPSendFunc send_rtcp,
104 GDestroyNotify notify);
105 void gst_rtsp_stream_transport_set_keepalive (GstRTSPStreamTransport *trans,
106 GstRTSPKeepAliveFunc keep_alive,
108 GDestroyNotify notify);
110 gboolean gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport *trans,
112 gboolean gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport *trans,
115 void gst_rtsp_stream_transport_keep_alive (GstRTSPStreamTransport *trans);
119 #endif /* __GST_RTSP_STREAM_TRANSPORT_H__ */