client: add support for setting the server.
[platform/upstream/gstreamer.git] / gst / rtsp-server / rtsp-client.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., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #include <gst/gst.h>
21 #include <gst/rtsp/gstrtspconnection.h>
22
23 #ifndef __GST_RTSP_CLIENT_H__
24 #define __GST_RTSP_CLIENT_H__
25
26 G_BEGIN_DECLS
27
28 typedef struct _GstRTSPClient GstRTSPClient;
29 typedef struct _GstRTSPClientClass GstRTSPClientClass;
30
31 #include "rtsp-server.h"
32 #include "rtsp-media.h"
33 #include "rtsp-media-mapping.h"
34 #include "rtsp-session-pool.h"
35 #include "rtsp-auth.h"
36
37 #define GST_TYPE_RTSP_CLIENT              (gst_rtsp_client_get_type ())
38 #define GST_IS_RTSP_CLIENT(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_CLIENT))
39 #define GST_IS_RTSP_CLIENT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_CLIENT))
40 #define GST_RTSP_CLIENT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_CLIENT, GstRTSPClientClass))
41 #define GST_RTSP_CLIENT(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_CLIENT, GstRTSPClient))
42 #define GST_RTSP_CLIENT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_CLIENT, GstRTSPClientClass))
43 #define GST_RTSP_CLIENT_CAST(obj)         ((GstRTSPClient*)(obj))
44 #define GST_RTSP_CLIENT_CLASS_CAST(klass) ((GstRTSPClientClass*)(klass))
45
46
47 /**
48  * GstRTSPClient:
49  *
50  * @connection: the connection object handling the client request.
51  * @watch: watch for the connection
52  * @watchid: id of the watch
53  * @ip: ip address used by the client to connect to us
54  * @session_pool: handle to the session pool used by the client.
55  * @media_mapping: handle to the media mapping used by the client.
56  * @uri: cached uri
57  * @media: cached media
58  * @streams: a list of streams using @connection.
59  * @sessions: a list of sessions managed by @connection.
60  *
61  * The client structure.
62  */
63 struct _GstRTSPClient {
64   GObject       parent;
65
66   GstRTSPConnection *connection;
67   GstRTSPWatch      *watch;
68   guint              watchid;
69   gchar             *server_ip;
70   gboolean           is_ipv6;
71
72   GstRTSPServer        *server;
73   GstRTSPSessionPool   *session_pool;
74   GstRTSPMediaMapping  *media_mapping;
75   GstRTSPAuth          *auth;
76
77   GstRTSPUrl     *uri;
78   GstRTSPMedia   *media;
79
80   GList *streams;
81   GList *sessions;
82 };
83
84 struct _GstRTSPClientClass {
85   GObjectClass  parent_class;
86 };
87
88 GType                 gst_rtsp_client_get_type          (void);
89
90 GstRTSPClient *       gst_rtsp_client_new               (void);
91
92 void                  gst_rtsp_client_set_server        (GstRTSPClient * client, GstRTSPServer * server);
93 GstRTSPServer *       gst_rtsp_client_get_server        (GstRTSPClient * client);
94
95 void                  gst_rtsp_client_set_session_pool  (GstRTSPClient *client,
96                                                          GstRTSPSessionPool *pool);
97 GstRTSPSessionPool *  gst_rtsp_client_get_session_pool  (GstRTSPClient *client);
98
99 void                  gst_rtsp_client_set_media_mapping (GstRTSPClient *client,
100                                                          GstRTSPMediaMapping *mapping);
101 GstRTSPMediaMapping * gst_rtsp_client_get_media_mapping (GstRTSPClient *client);
102
103 void                  gst_rtsp_client_set_auth          (GstRTSPClient *client, GstRTSPAuth *auth);
104 GstRTSPAuth *         gst_rtsp_client_get_auth          (GstRTSPClient *client);
105
106
107 gboolean              gst_rtsp_client_accept            (GstRTSPClient *client,
108                                                          GIOChannel *channel);
109
110 G_END_DECLS
111
112 #endif /* __GST_RTSP_CLIENT_H__ */