Initial release including wifi display based on gst-rtsp-server-1.4.1
[platform/upstream/gstreamer.git] / gst / rtsp-server / rtsp-server-wfd.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 #ifndef __GST_RTSP_SERVER_WFD_H__
21 #define __GST_RTSP_SERVER_WFD_H__
22
23 #include <gst/gst.h>
24
25 G_BEGIN_DECLS
26
27 typedef struct _GstRTSPWFDServer GstRTSPWFDServer;
28 typedef struct _GstRTSPWFDServerClass GstRTSPWFDServerClass;
29 typedef struct _GstRTSPWFDServerPrivate GstRTSPWFDServerPrivate;
30
31 #include "rtsp-session-pool.h"
32 #include "rtsp-mount-points.h"
33 #include "rtsp-server.h"
34 #include "rtsp-client-wfd.h"
35 #include "rtsp-auth.h"
36
37 #define GST_TYPE_RTSP_WFD_SERVER              (gst_rtsp_wfd_server_get_type ())
38 #define GST_IS_RTSP_WFD_SERVER(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_WFD_SERVER))
39 #define GST_IS_RTSP_WFD_SERVER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_WFD_SERVER))
40 #define GST_RTSP_WFD_SERVER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_WFD_SERVER, GstRTSPWFDServerClass))
41 #define GST_RTSP_WFD_SERVER(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_WFD_SERVER, GstRTSPWFDServer))
42 #define GST_RTSP_WFD_SERVER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_WFD_SERVER, GstRTSPWFDServerClass))
43 #define GST_RTSP_WFD_SERVER_CAST(obj)         ((GstRTSPWFDServer*)(obj))
44 #define GST_RTSP_WFD_SERVER_CLASS_CAST(klass) ((GstRTSPWFDServerClass*)(klass))
45
46 /**
47  * GstRTSPWFDServer:
48  *
49  * This object listens on a port, creates and manages the clients connected to
50  * it.
51  */
52 struct _GstRTSPWFDServer {
53   GstRTSPServer parent;
54
55   /*< private >*/
56   GstRTSPWFDServerPrivate *priv;
57   gpointer _gst_reserved[GST_PADDING];
58 };
59
60 /**
61  * GstRTSPServerClass:
62  * @create_client: Create, configure a new GstRTSPClient
63  *          object that handles the new connection on @socket. The default
64  *          implementation will create a GstRTSPClient and will configure the
65  *          mount-points, auth, session-pool and thread-pool on the client.
66  * @client_connected: emited when a new client connected.
67  *
68  * The RTSP server class structure
69  */
70 struct _GstRTSPWFDServerClass {
71   GstRTSPServerClass  parent_class;
72
73   /*< private >*/
74   gpointer         _gst_reserved[GST_PADDING_LARGE];
75 };
76
77 GType                 gst_rtsp_wfd_server_get_type             (void);
78 GstRTSPWFDServer *    gst_rtsp_wfd_server_new                  (void);
79 GstRTSPResult         gst_rtsp_wfd_server_trigger_request      (GstRTSPServer *server, GstWFDTriggerType type);
80
81 GstRTSPResult gst_rtsp_wfd_server_set_supported_reso(GstRTSPWFDServer *server, guint64 supported_reso);
82
83 #if 0
84 void                  gst_rtsp_server_set_address          (GstRTSPServer *server, const gchar *address);
85 gchar *               gst_rtsp_server_get_address          (GstRTSPServer *server);
86
87 void                  gst_rtsp_server_set_service          (GstRTSPServer *server, const gchar *service);
88 gchar *               gst_rtsp_server_get_service          (GstRTSPServer *server);
89
90 void                  gst_rtsp_server_set_backlog          (GstRTSPServer *server, gint backlog);
91 gint                  gst_rtsp_server_get_backlog          (GstRTSPServer *server);
92
93 int                   gst_rtsp_server_get_bound_port       (GstRTSPServer *server);
94
95 void                  gst_rtsp_server_set_session_pool     (GstRTSPServer *server, GstRTSPSessionPool *pool);
96 GstRTSPSessionPool *  gst_rtsp_server_get_session_pool     (GstRTSPServer *server);
97
98 void                  gst_rtsp_server_set_mount_points     (GstRTSPServer *server, GstRTSPMountPoints *mounts);
99 GstRTSPMountPoints *  gst_rtsp_server_get_mount_points     (GstRTSPServer *server);
100
101 void                  gst_rtsp_server_set_auth             (GstRTSPServer *server, GstRTSPAuth *auth);
102 GstRTSPAuth *         gst_rtsp_server_get_auth             (GstRTSPServer *server);
103
104 void                  gst_rtsp_server_set_thread_pool      (GstRTSPServer *server, GstRTSPThreadPool *pool);
105 GstRTSPThreadPool *   gst_rtsp_server_get_thread_pool      (GstRTSPServer *server);
106
107 gboolean              gst_rtsp_server_transfer_connection  (GstRTSPServer * server, GSocket *socket,
108                                                             const gchar * ip, gint port,
109                                                             const gchar *initial_buffer);
110
111 gboolean              gst_rtsp_server_io_func              (GSocket *socket, GIOCondition condition,
112                                                             GstRTSPServer *server);
113
114 GSocket *             gst_rtsp_server_create_socket        (GstRTSPServer *server,
115                                                             GCancellable  *cancellable,
116                                                             GError **error);
117 GSource *             gst_rtsp_server_create_source        (GstRTSPServer *server,
118                                                             GCancellable * cancellable,
119                                                             GError **error);
120 guint                 gst_rtsp_server_attach               (GstRTSPServer *server,
121                                                             GMainContext *context);
122 /**
123  * GstRTSPServerClientFilterFunc:
124  * @server: a #GstRTSPServer object
125  * @client: a #GstRTSPClient in @server
126  * @user_data: user data that has been given to gst_rtsp_server_client_filter()
127  *
128  * This function will be called by the gst_rtsp_server_client_filter(). An
129  * implementation should return a value of #GstRTSPFilterResult.
130  *
131  * When this function returns #GST_RTSP_FILTER_REMOVE, @client will be removed
132  * from @server.
133  *
134  * A return value of #GST_RTSP_FILTER_KEEP will leave @client untouched in
135  * @server.
136  *
137  * A value of #GST_RTSP_FILTER_REF will add @client to the result #GList of
138  * gst_rtsp_server_client_filter().
139  *
140  * Returns: a #GstRTSPFilterResult.
141  */
142 typedef GstRTSPFilterResult (*GstRTSPServerClientFilterFunc)  (GstRTSPServer *server,
143                                                                GstRTSPClient *client,
144                                                                gpointer user_data);
145
146 GList *                gst_rtsp_server_client_filter    (GstRTSPServer *server,
147                                                          GstRTSPServerClientFilterFunc func,
148                                                          gpointer user_data);
149 #endif
150
151 G_END_DECLS
152
153 #endif /* __GST_RTSP_SERVER_WFD_H__ */