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"
44 typedef gboolean (*GstRTSPSendFunc) (GstBuffer *buffer, guint8 channel, gpointer user_data);
45 typedef void (*GstRTSPKeepAliveFunc) (gpointer user_data);
48 * GstRTSPStreamTransport:
49 * @parent: parent instance
50 * @stream: the GstRTSPStream we manage
51 * @send_rtp: callback for sending RTP messages
52 * @send_rtcp: callback for sending RTCP messages
53 * @user_data: user data passed in the callbacks
54 * @notify: free function for the user_data.
55 * @keep_alive: keep alive callback
56 * @ka_user_data: data passed to @keep_alive
57 * @ka_notify: called when @ka_user_data is freed
58 * @active: if we are actively sending
59 * @timeout: if we timed out
60 * @transport: a transport description
61 * @rtpsource: the receiver rtp source object
63 * A Transport description for stream @idx
65 struct _GstRTSPStreamTransport {
68 GstRTSPStream *stream;
70 GstRTSPSendFunc send_rtp;
71 GstRTSPSendFunc send_rtcp;
73 GDestroyNotify notify;
75 GstRTSPKeepAliveFunc keep_alive;
76 gpointer ka_user_data;
77 GDestroyNotify ka_notify;
81 GstRTSPTransport *transport;
86 struct _GstRTSPStreamTransportClass {
87 GObjectClass parent_class;
90 GType gst_rtsp_stream_transport_get_type (void);
92 GstRTSPStreamTransport * gst_rtsp_stream_transport_new (GstRTSPStream *stream,
93 GstRTSPTransport *tr);
95 void gst_rtsp_stream_transport_set_transport (GstRTSPStreamTransport *trans,
96 GstRTSPTransport * tr);
98 void gst_rtsp_stream_transport_set_callbacks (GstRTSPStreamTransport *trans,
99 GstRTSPSendFunc send_rtp,
100 GstRTSPSendFunc send_rtcp,
102 GDestroyNotify notify);
103 void gst_rtsp_stream_transport_set_keepalive (GstRTSPStreamTransport *trans,
104 GstRTSPKeepAliveFunc keep_alive,
106 GDestroyNotify notify);
108 gboolean gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport *trans,
110 gboolean gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport *trans,
113 void gst_rtsp_stream_transport_keep_alive (GstRTSPStreamTransport *trans);
117 #endif /* __GST_RTSP_STREAM_TRANSPORT_H__ */