2 * Copyright (C) 2010 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., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 #ifndef __GST_RTSP_AUTH_H__
23 #define __GST_RTSP_AUTH_H__
25 typedef struct _GstRTSPAuth GstRTSPAuth;
26 typedef struct _GstRTSPAuthClass GstRTSPAuthClass;
27 typedef struct _GstRTSPAuthPrivate GstRTSPAuthPrivate;
29 #include "rtsp-client.h"
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))
45 * The authentication structure.
50 GstRTSPAuthPrivate *priv;
53 struct _GstRTSPAuthClass {
54 GObjectClass parent_class;
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);
62 GType gst_rtsp_auth_get_type (void);
64 GstRTSPAuth * gst_rtsp_auth_new (void);
66 void gst_rtsp_auth_set_basic (GstRTSPAuth *auth, const gchar * basic);
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);
73 gchar * gst_rtsp_auth_make_basic (const gchar * user, const gchar * pass);
77 #endif /* __GST_RTSP_AUTH_H__ */