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_TOKEN_H__
23 #define __GST_RTSP_TOKEN_H__
25 typedef struct _GstRTSPToken GstRTSPToken;
27 #include "rtsp-auth.h"
32 GType gst_rtsp_token_get_type(void);
34 #define GST_TYPE_RTSP_TOKEN (gst_rtsp_token_get_type())
35 #define GST_IS_RTSP_TOKEN(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_RTSP_TOKEN))
36 #define GST_RTSP_TOKEN_CAST(obj) ((GstRTSPToken*)(obj))
37 #define GST_RTSP_TOKEN(obj) (GST_RTSP_TOKEN_CAST(obj))
42 * An opaque object used for checking authorisations.
43 * It is generated after successful authentication.
45 struct _GstRTSPToken {
46 GstMiniObject mini_object;
52 * @token: The token to refcount
54 * Increase the refcount of this token.
56 * Returns: (transfer full): @token (for convenience when doing assignments)
58 static inline GstRTSPToken *
59 gst_rtsp_token_ref (GstRTSPToken * token)
61 return (GstRTSPToken *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (token));
65 * gst_rtsp_token_unref:
66 * @token: (transfer full): the token to refcount
68 * Decrease the refcount of an token, freeing it if the refcount reaches 0.
71 gst_rtsp_token_unref (GstRTSPToken * token)
73 gst_mini_object_unref (GST_MINI_OBJECT_CAST (token));
78 GstRTSPToken * gst_rtsp_token_new_empty (void);
81 GstRTSPToken * gst_rtsp_token_new (const gchar * firstfield, ...);
84 GstRTSPToken * gst_rtsp_token_new_valist (const gchar * firstfield, va_list var_args);
87 const GstStructure * gst_rtsp_token_get_structure (GstRTSPToken *token);
90 GstStructure * gst_rtsp_token_writable_structure (GstRTSPToken *token);
93 const gchar * gst_rtsp_token_get_string (GstRTSPToken *token,
97 gboolean gst_rtsp_token_is_allowed (GstRTSPToken *token,
99 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
100 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTSPToken, gst_rtsp_token_unref)
105 #endif /* __GST_RTSP_TOKEN_H__ */