Initial release including wifi display based on gst-rtsp-server-1.4.1
[platform/upstream/gstreamer.git] / gst / rtsp-server / rtsp-stream-transport.h
1 /* GStreamer
2  * Copyright (C) 2008 Wim Taymans <wim.taymans at gmail.com>
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 #include <gst/gst.h>
21 #include <gst/rtsp/gstrtsprange.h>
22 #include <gst/rtsp/gstrtspurl.h>
23
24 #ifndef __GST_RTSP_STREAM_TRANSPORT_H__
25 #define __GST_RTSP_STREAM_TRANSPORT_H__
26
27 G_BEGIN_DECLS
28
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))
38
39 typedef struct _GstRTSPStreamTransport GstRTSPStreamTransport;
40 typedef struct _GstRTSPStreamTransportClass GstRTSPStreamTransportClass;
41 typedef struct _GstRTSPStreamTransportPrivate GstRTSPStreamTransportPrivate;
42
43 #include "rtsp-stream.h"
44
45 /**
46  * GstRTSPSendFunc:
47  * @buffer: a #GstBuffer
48  * @channel: a channel
49  * @user_data: user data
50  *
51  * Function registered with gst_rtsp_stream_transport_set_callbacks() and
52  * called when @buffer must be sent on @channel.
53  *
54  * Returns: %TRUE on success
55  */
56 typedef gboolean (*GstRTSPSendFunc)      (GstBuffer *buffer, guint8 channel, gpointer user_data);
57 /**
58  * GstRTSPKeepAliveFunc:
59  * @user_data: user data
60  *
61  * Function registered with gst_rtsp_stream_transport_set_keepalive() and called
62  * when the stream is active.
63  */
64 typedef void     (*GstRTSPKeepAliveFunc) (gpointer user_data);
65
66 /**
67  * GstRTSPStreamTransport:
68  * @parent: parent instance
69  *
70  * A Transport description for a stream
71  */
72 struct _GstRTSPStreamTransport {
73   GObject              parent;
74
75   /*< private >*/
76   GstRTSPStreamTransportPrivate *priv;
77   gpointer _gst_reserved[GST_PADDING];
78 };
79
80 struct _GstRTSPStreamTransportClass {
81   GObjectClass parent_class;
82
83   /*< private >*/
84   gpointer _gst_reserved[GST_PADDING];
85 };
86
87 GType                    gst_rtsp_stream_transport_get_type (void);
88
89 GstRTSPStreamTransport * gst_rtsp_stream_transport_new           (GstRTSPStream *stream,
90                                                                   GstRTSPTransport *tr);
91
92 GstRTSPStream *          gst_rtsp_stream_transport_get_stream    (GstRTSPStreamTransport *trans);
93
94 void                     gst_rtsp_stream_transport_set_transport (GstRTSPStreamTransport *trans,
95                                                                   GstRTSPTransport * tr);
96 const GstRTSPTransport * gst_rtsp_stream_transport_get_transport (GstRTSPStreamTransport *trans);
97
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);
101
102
103 gchar *                  gst_rtsp_stream_transport_get_rtpinfo   (GstRTSPStreamTransport *trans,
104                                                                   GstClockTime start_time);
105
106 void                     gst_rtsp_stream_transport_set_callbacks (GstRTSPStreamTransport *trans,
107                                                                   GstRTSPSendFunc send_rtp,
108                                                                   GstRTSPSendFunc send_rtcp,
109                                                                   gpointer user_data,
110                                                                   GDestroyNotify  notify);
111 void                     gst_rtsp_stream_transport_set_keepalive (GstRTSPStreamTransport *trans,
112                                                                   GstRTSPKeepAliveFunc keep_alive,
113                                                                   gpointer user_data,
114                                                                   GDestroyNotify  notify);
115 void                     gst_rtsp_stream_transport_keep_alive    (GstRTSPStreamTransport *trans);
116
117 gboolean                 gst_rtsp_stream_transport_set_active    (GstRTSPStreamTransport *trans,
118                                                                   gboolean active);
119
120 void                     gst_rtsp_stream_transport_set_timed_out (GstRTSPStreamTransport *trans,
121                                                                   gboolean timedout);
122 gboolean                 gst_rtsp_stream_transport_is_timed_out  (GstRTSPStreamTransport *trans);
123
124
125
126 gboolean                 gst_rtsp_stream_transport_send_rtp      (GstRTSPStreamTransport *trans,
127                                                                   GstBuffer *buffer);
128 gboolean                 gst_rtsp_stream_transport_send_rtcp     (GstRTSPStreamTransport *trans,
129                                                                   GstBuffer *buffer);
130
131 G_END_DECLS
132
133 #endif /* __GST_RTSP_STREAM_TRANSPORT_H__ */