mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
token: add method to check boolean permission
This commit is contained in:
parent
b8c5aa3a6b
commit
c4db302559
2 changed files with 23 additions and 0 deletions
|
@ -205,3 +205,24 @@ gst_rtsp_token_get_string (GstRTSPToken * token, const gchar * field)
|
||||||
{
|
{
|
||||||
return gst_structure_get_string (GST_RTSP_TOKEN_STRUCTURE (token), field);
|
return gst_structure_get_string (GST_RTSP_TOKEN_STRUCTURE (token), field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_token_is_allowed:
|
||||||
|
* @token: a #GstRTSPToken
|
||||||
|
* @field: a field name
|
||||||
|
*
|
||||||
|
* Check if @token has a boolean @field and if it is set to %TRUE.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if @token has a boolean field named @field set to %TRUE.
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_rtsp_token_is_allowed (GstRTSPToken * token, const gchar * field)
|
||||||
|
{
|
||||||
|
gboolean result;
|
||||||
|
|
||||||
|
if (!gst_structure_get_boolean (GST_RTSP_TOKEN_STRUCTURE (token), field,
|
||||||
|
&result))
|
||||||
|
result = FALSE;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
|
@ -90,6 +90,8 @@ GstStructure * gst_rtsp_token_writable_structure (GstRTSPToken *token);
|
||||||
|
|
||||||
const gchar * gst_rtsp_token_get_string (GstRTSPToken *token,
|
const gchar * gst_rtsp_token_get_string (GstRTSPToken *token,
|
||||||
const gchar *field);
|
const gchar *field);
|
||||||
|
gboolean gst_rtsp_token_is_allowed (GstRTSPToken *token,
|
||||||
|
const gchar *field);
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_RTSP_TOKEN_H__ */
|
#endif /* __GST_RTSP_TOKEN_H__ */
|
||||||
|
|
Loading…
Reference in a new issue