client: send out teardown signal before tearing down
[platform/upstream/gstreamer.git] / gst / rtsp-server / rtsp-auth.h
1 /* GStreamer
2  * Copyright (C) 2010 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
22 #ifndef __GST_RTSP_AUTH_H__
23 #define __GST_RTSP_AUTH_H__
24
25 typedef struct _GstRTSPAuth GstRTSPAuth;
26 typedef struct _GstRTSPAuthClass GstRTSPAuthClass;
27 typedef struct _GstRTSPAuthPrivate GstRTSPAuthPrivate;
28
29 #include "rtsp-client.h"
30
31 G_BEGIN_DECLS
32
33 #define GST_TYPE_RTSP_AUTH              (gst_rtsp_auth_get_type ())
34 #define GST_IS_RTSP_AUTH(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_AUTH))
35 #define GST_IS_RTSP_AUTH_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_AUTH))
36 #define GST_RTSP_AUTH_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_AUTH, GstRTSPAuthClass))
37 #define GST_RTSP_AUTH(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_AUTH, GstRTSPAuth))
38 #define GST_RTSP_AUTH_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_AUTH, GstRTSPAuthClass))
39 #define GST_RTSP_AUTH_CAST(obj)         ((GstRTSPAuth*)(obj))
40 #define GST_RTSP_AUTH_CLASS_CAST(klass) ((GstRTSPAuthClass*)(klass))
41
42 /**
43  * GstRTSPAuth:
44  *
45  * The authentication structure.
46  */
47 struct _GstRTSPAuth {
48   GObject       parent;
49
50   GstRTSPAuthPrivate *priv;
51 };
52
53 struct _GstRTSPAuthClass {
54   GObjectClass  parent_class;
55
56   gboolean (*setup_auth)   (GstRTSPAuth *auth, GstRTSPClient * client,
57                             GQuark hint, GstRTSPClientState *state);
58   gboolean (*check_method) (GstRTSPAuth *auth, GstRTSPClient * client,
59                             GQuark hint, GstRTSPClientState *state);
60 };
61
62 GType               gst_rtsp_auth_get_type          (void);
63
64 GstRTSPAuth *       gst_rtsp_auth_new               (void);
65
66 void                gst_rtsp_auth_set_basic         (GstRTSPAuth *auth, const gchar * basic);
67
68 gboolean            gst_rtsp_auth_setup_auth        (GstRTSPAuth *auth, GstRTSPClient * client,
69                                                      GQuark hint, GstRTSPClientState *state);
70 gboolean            gst_rtsp_auth_check             (GstRTSPAuth *auth, GstRTSPClient * client,
71                                                      GQuark hint, GstRTSPClientState *state);
72 /* helpers */
73 gchar *             gst_rtsp_auth_make_basic        (const gchar * user, const gchar * pass);
74
75 G_END_DECLS
76
77 #endif /* __GST_RTSP_AUTH_H__ */