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;
41 typedef struct _GstRTSPStreamTransportPrivate GstRTSPStreamTransportPrivate;
43 #include "rtsp-stream.h"
47 * @buffer: a #GstBuffer
49 * @user_data: user data
51 * Function registered with gst_rtsp_stream_transport_set_callbacks() and
52 * called when @buffer must be sent on @channel.
54 * Returns: %TRUE on success
56 typedef gboolean (*GstRTSPSendFunc) (GstBuffer *buffer, guint8 channel, gpointer user_data);
58 * GstRTSPKeepAliveFunc:
59 * @user_data: user data
61 * Function registered with gst_rtsp_stream_transport_set_keepalive() and called
62 * when the stream is active.
64 typedef void (*GstRTSPKeepAliveFunc) (gpointer user_data);
67 * GstRTSPStreamTransport:
68 * @parent: parent instance
70 * A Transport description for a stream
72 struct _GstRTSPStreamTransport {
76 GstRTSPStreamTransportPrivate *priv;
77 gpointer _gst_reserved[GST_PADDING];
80 struct _GstRTSPStreamTransportClass {
81 GObjectClass parent_class;
84 gpointer _gst_reserved[GST_PADDING];
87 GType gst_rtsp_stream_transport_get_type (void);
89 GstRTSPStreamTransport * gst_rtsp_stream_transport_new (GstRTSPStream *stream,
90 GstRTSPTransport *tr);
92 GstRTSPStream * gst_rtsp_stream_transport_get_stream (GstRTSPStreamTransport *trans);
94 void gst_rtsp_stream_transport_set_transport (GstRTSPStreamTransport *trans,
95 GstRTSPTransport * tr);
96 const GstRTSPTransport * gst_rtsp_stream_transport_get_transport (GstRTSPStreamTransport *trans);
98 void gst_rtsp_stream_transport_set_url (GstRTSPStreamTransport *trans,
99 const GstRTSPUrl * url);
100 const GstRTSPUrl * gst_rtsp_stream_transport_get_url (GstRTSPStreamTransport *trans);
103 gchar * gst_rtsp_stream_transport_get_rtpinfo (GstRTSPStreamTransport *trans);
105 void gst_rtsp_stream_transport_set_callbacks (GstRTSPStreamTransport *trans,
106 GstRTSPSendFunc send_rtp,
107 GstRTSPSendFunc send_rtcp,
109 GDestroyNotify notify);
110 void gst_rtsp_stream_transport_set_keepalive (GstRTSPStreamTransport *trans,
111 GstRTSPKeepAliveFunc keep_alive,
113 GDestroyNotify notify);
114 void gst_rtsp_stream_transport_keep_alive (GstRTSPStreamTransport *trans);
116 gboolean gst_rtsp_stream_transport_set_active (GstRTSPStreamTransport *trans,
119 void gst_rtsp_stream_transport_set_timed_out (GstRTSPStreamTransport *trans,
121 gboolean gst_rtsp_stream_transport_is_timed_out (GstRTSPStreamTransport *trans);
125 gboolean gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport *trans,
127 gboolean gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport *trans,
132 #endif /* __GST_RTSP_STREAM_TRANSPORT_H__ */