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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
26 #include <sys/types.h>
27 #include <netinet/in.h>
29 #include <sys/socket.h>
32 #include <arpa/inet.h>
36 #include "rtsp-session-pool.h"
37 #include "rtsp-media-mapping.h"
38 #include "rtsp-media-factory-uri.h"
39 #include "rtsp-client.h"
40 #include "rtsp-auth.h"
42 #ifndef __GST_RTSP_SERVER_H__
43 #define __GST_RTSP_SERVER_H__
47 #define GST_TYPE_RTSP_SERVER (gst_rtsp_server_get_type ())
48 #define GST_IS_RTSP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_SERVER))
49 #define GST_IS_RTSP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_SERVER))
50 #define GST_RTSP_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_SERVER, GstRTSPServerClass))
51 #define GST_RTSP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_SERVER, GstRTSPServer))
52 #define GST_RTSP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_SERVER, GstRTSPServerClass))
53 #define GST_RTSP_SERVER_CAST(obj) ((GstRTSPServer*)(obj))
54 #define GST_RTSP_SERVER_CLASS_CAST(klass) ((GstRTSPServerClass*)(klass))
56 typedef struct _GstRTSPServer GstRTSPServer;
57 typedef struct _GstRTSPServerClass GstRTSPServerClass;
59 struct _GstRTSPServer {
62 /* server information */
67 struct sockaddr_in server_sin;
69 /* socket and channels */
70 GstPollFD server_sock;
71 GIOChannel *io_channel;
74 /* sessions on this server */
75 GstRTSPSessionPool *session_pool;
77 /* media mapper for this server */
78 GstRTSPMediaMapping *media_mapping;
80 /* authentication manager */
87 * @accept_client: Create, configure, accept and return a new GstRTSPClient
88 * object that handles the new connection on @channel.
90 * The RTSP server class structure
92 struct _GstRTSPServerClass {
93 GObjectClass parent_class;
95 GstRTSPClient * (*accept_client) (GstRTSPServer *server, GIOChannel *channel);
98 GType gst_rtsp_server_get_type (void);
100 GstRTSPServer * gst_rtsp_server_new (void);
102 void gst_rtsp_server_set_address (GstRTSPServer *server, const gchar *address);
103 gchar * gst_rtsp_server_get_address (GstRTSPServer *server);
105 void gst_rtsp_server_set_service (GstRTSPServer *server, const gchar *service);
106 gchar * gst_rtsp_server_get_service (GstRTSPServer *server);
108 void gst_rtsp_server_set_backlog (GstRTSPServer *server, gint backlog);
109 gint gst_rtsp_server_get_backlog (GstRTSPServer *server);
111 void gst_rtsp_server_set_session_pool (GstRTSPServer *server, GstRTSPSessionPool *pool);
112 GstRTSPSessionPool * gst_rtsp_server_get_session_pool (GstRTSPServer *server);
114 void gst_rtsp_server_set_media_mapping (GstRTSPServer *server, GstRTSPMediaMapping *mapping);
115 GstRTSPMediaMapping * gst_rtsp_server_get_media_mapping (GstRTSPServer *server);
117 void gst_rtsp_server_set_auth (GstRTSPServer *server, GstRTSPAuth *auth);
118 GstRTSPAuth * gst_rtsp_server_get_auth (GstRTSPServer *server);
120 gboolean gst_rtsp_server_io_func (GIOChannel *channel, GIOCondition condition,
121 GstRTSPServer *server);
123 GIOChannel * gst_rtsp_server_get_io_channel (GstRTSPServer *server);
124 GSource * gst_rtsp_server_create_watch (GstRTSPServer *server);
125 guint gst_rtsp_server_attach (GstRTSPServer *server,
126 GMainContext *context);
130 #endif /* __GST_RTSP_SERVER_H__ */