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;
30 GType gst_rtsp_permissions_get_type (void);
32 #define GST_TYPE_RTSP_PERMISSIONS (gst_rtsp_permissions_get_type ())
33 #define GST_IS_RTSP_PERMISSIONS(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_RTSP_PERMISSIONS))
34 #define GST_RTSP_PERMISSIONS_CAST(obj) ((GstRTSPPermissions*)(obj))
35 #define GST_RTSP_PERMISSIONS(obj) (GST_RTSP_PERMISSIONS_CAST(obj))
40 * The opaque permissions structure. It is used to define the permissions
41 * of objects in different roles.
43 struct _GstRTSPPermissions {
44 GstMiniObject mini_object;
49 * gst_rtsp_permissions_ref:
50 * @permissions: The permissions to refcount
52 * Increase the refcount of this permissions.
54 * Returns: (transfer full): @permissions (for convenience when doing assignments)
56 static inline GstRTSPPermissions *
57 gst_rtsp_permissions_ref (GstRTSPPermissions * permissions)
59 return (GstRTSPPermissions *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (permissions));
63 * gst_rtsp_permissions_unref:
64 * @permissions: (transfer full): the permissions to refcount
66 * Decrease the refcount of an permissions, freeing it if the refcount reaches 0.
69 gst_rtsp_permissions_unref (GstRTSPPermissions * permissions)
71 gst_mini_object_unref (GST_MINI_OBJECT_CAST (permissions));
76 GstRTSPPermissions * gst_rtsp_permissions_new (void);
79 void gst_rtsp_permissions_add_role (GstRTSPPermissions *permissions,
81 const gchar *fieldname, ...);
84 void gst_rtsp_permissions_add_role_valist (GstRTSPPermissions *permissions,
86 const gchar *fieldname,
90 void gst_rtsp_permissions_remove_role (GstRTSPPermissions *permissions,
94 const GstStructure * gst_rtsp_permissions_get_role (GstRTSPPermissions *permissions,
98 gboolean gst_rtsp_permissions_is_allowed (GstRTSPPermissions *permissions,
99 const gchar *role, const gchar *permission);
101 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
102 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTSPPermissions, gst_rtsp_permissions_unref)
107 #endif /* __GST_RTSP_PERMISSIONS_H__ */