Initial release including wifi display based on gst-rtsp-server-1.4.1
[platform/upstream/gstreamer.git] / gst / rtsp-server / rtsp-token.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_TOKEN_H__
23 #define __GST_RTSP_TOKEN_H__
24
25 typedef struct _GstRTSPToken GstRTSPToken;
26
27 #include "rtsp-auth.h"
28
29 G_BEGIN_DECLS
30
31 GType gst_rtsp_token_get_type(void);
32
33 #define GST_TYPE_RTSP_TOKEN        (gst_rtsp_token_get_type())
34 #define GST_IS_RTSP_TOKEN(obj)     (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_RTSP_TOKEN))
35 #define GST_RTSP_TOKEN_CAST(obj)   ((GstRTSPToken*)(obj))
36 #define GST_RTSP_TOKEN(obj)        (GST_RTSP_TOKEN_CAST(obj))
37
38 /**
39  * GstRTSPToken:
40  *
41  * An opaque object used for checking authorisations.
42  * It is generated after successful authentication.
43  */
44 struct _GstRTSPToken {
45   GstMiniObject mini_object;
46 };
47
48 /* refcounting */
49 /**
50  * gst_rtsp_token_ref:
51  * @token: The token to refcount
52  *
53  * Increase the refcount of this token.
54  *
55  * Returns: (transfer full): @token (for convenience when doing assignments)
56  */
57 #ifdef _FOOL_GTK_DOC_
58 G_INLINE_FUNC GstRTSPToken * gst_rtsp_token_ref (GstRTSPToken * token);
59 #endif
60
61 static inline GstRTSPToken *
62 gst_rtsp_token_ref (GstRTSPToken * token)
63 {
64   return (GstRTSPToken *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (token));
65 }
66
67 /**
68  * gst_rtsp_token_unref:
69  * @token: (transfer full): the token to refcount
70  *
71  * Decrease the refcount of an token, freeing it if the refcount reaches 0.
72  */
73 #ifdef _FOOL_GTK_DOC_
74 G_INLINE_FUNC void gst_rtsp_token_unref (GstRTSPToken * token);
75 #endif
76
77 static inline void
78 gst_rtsp_token_unref (GstRTSPToken * token)
79 {
80   gst_mini_object_unref (GST_MINI_OBJECT_CAST (token));
81 }
82
83
84 GstRTSPToken *       gst_rtsp_token_new_empty          (void);
85 GstRTSPToken *       gst_rtsp_token_new                (const gchar * firstfield, ...);
86 GstRTSPToken *       gst_rtsp_token_new_valist         (const gchar * firstfield, va_list var_args);
87
88 const GstStructure * gst_rtsp_token_get_structure      (GstRTSPToken *token);
89 GstStructure *       gst_rtsp_token_writable_structure (GstRTSPToken *token);
90
91 const gchar *        gst_rtsp_token_get_string         (GstRTSPToken *token,
92                                                         const gchar *field);
93 gboolean             gst_rtsp_token_is_allowed         (GstRTSPToken *token,
94                                                         const gchar *field);
95 G_END_DECLS
96
97 #endif /* __GST_RTSP_TOKEN_H__ */