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_PERMISSIONS_H__
23 #define __GST_RTSP_PERMISSIONS_H__
25 typedef struct _GstRTSPPermissions GstRTSPPermissions;
29 GType gst_rtsp_permissions_get_type (void);
31 #define GST_TYPE_RTSP_PERMISSIONS (gst_rtsp_permissions_get_type ())
32 #define GST_IS_RTSP_PERMISSIONS(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_RTSP_PERMISSIONS))
33 #define GST_RTSP_PERMISSIONS_CAST(obj) ((GstRTSPPermissions*)(obj))
34 #define GST_RTSP_PERMISSIONS(obj) (GST_RTSP_PERMISSIONS_CAST(obj))
39 * The opaque permissions structure. It is used to define the permissions
40 * of objects in different roles.
42 struct _GstRTSPPermissions {
43 GstMiniObject mini_object;
48 * gst_rtsp_permissions_ref:
49 * @permissions: The permissions to refcount
51 * Increase the refcount of this permissions.
53 * Returns: (transfer full): @permissions (for convenience when doing assignments)
56 G_INLINE_FUNC GstRTSPPermissions * gst_rtsp_permissions_ref (GstRTSPPermissions * permissions);
59 static inline GstRTSPPermissions *
60 gst_rtsp_permissions_ref (GstRTSPPermissions * permissions)
62 return (GstRTSPPermissions *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (permissions));
66 * gst_rtsp_permissions_unref:
67 * @permissions: (transfer full): the permissions to refcount
69 * Decrease the refcount of an permissions, freeing it if the refcount reaches 0.
72 G_INLINE_FUNC void gst_rtsp_permissions_unref (GstRTSPPermissions * permissions);
76 gst_rtsp_permissions_unref (GstRTSPPermissions * permissions)
78 gst_mini_object_unref (GST_MINI_OBJECT_CAST (permissions));
82 GstRTSPPermissions * gst_rtsp_permissions_new (void);
84 void gst_rtsp_permissions_add_role (GstRTSPPermissions *permissions,
86 const gchar *fieldname, ...);
87 void gst_rtsp_permissions_add_role_valist (GstRTSPPermissions *permissions,
89 const gchar *fieldname,
91 void gst_rtsp_permissions_remove_role (GstRTSPPermissions *permissions,
93 const GstStructure * gst_rtsp_permissions_get_role (GstRTSPPermissions *permissions,
96 gboolean gst_rtsp_permissions_is_allowed (GstRTSPPermissions *permissions,
97 const gchar *role, const gchar *permission);
101 #endif /* __GST_RTSP_PERMISSIONS_H__ */