2013-07-05 18:34:40 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2010 Wim Taymans <wim.taymans at gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
#ifndef __GST_RTSP_TOKEN_H__
|
|
|
|
#define __GST_RTSP_TOKEN_H__
|
|
|
|
|
|
|
|
typedef struct _GstRTSPToken GstRTSPToken;
|
|
|
|
|
|
|
|
#include "rtsp-auth.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2013-07-05 18:34:40 +00:00
|
|
|
GType gst_rtsp_token_get_type(void);
|
|
|
|
|
|
|
|
#define GST_TYPE_RTSP_TOKEN (gst_rtsp_token_get_type())
|
|
|
|
#define GST_IS_RTSP_TOKEN(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_RTSP_TOKEN))
|
|
|
|
#define GST_RTSP_TOKEN_CAST(obj) ((GstRTSPToken*)(obj))
|
|
|
|
#define GST_RTSP_TOKEN(obj) (GST_RTSP_TOKEN_CAST(obj))
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstRTSPToken:
|
|
|
|
*
|
|
|
|
* An opaque object used for checking authorisations.
|
2013-12-12 00:36:07 +00:00
|
|
|
* It is generated after successful authentication.
|
2013-07-05 18:34:40 +00:00
|
|
|
*/
|
|
|
|
struct _GstRTSPToken {
|
|
|
|
GstMiniObject mini_object;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* refcounting */
|
|
|
|
/**
|
|
|
|
* gst_rtsp_token_ref:
|
|
|
|
* @token: The token to refcount
|
|
|
|
*
|
|
|
|
* Increase the refcount of this token.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): @token (for convenience when doing assignments)
|
|
|
|
*/
|
|
|
|
static inline GstRTSPToken *
|
|
|
|
gst_rtsp_token_ref (GstRTSPToken * token)
|
|
|
|
{
|
|
|
|
return (GstRTSPToken *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (token));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_rtsp_token_unref:
|
|
|
|
* @token: (transfer full): the token to refcount
|
|
|
|
*
|
|
|
|
* Decrease the refcount of an token, freeing it if the refcount reaches 0.
|
|
|
|
*/
|
|
|
|
static inline void
|
|
|
|
gst_rtsp_token_unref (GstRTSPToken * token)
|
|
|
|
{
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (token));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2013-07-12 14:36:05 +00:00
|
|
|
GstRTSPToken * gst_rtsp_token_new_empty (void);
|
2017-05-18 09:35:18 +00:00
|
|
|
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2013-07-12 14:36:05 +00:00
|
|
|
GstRTSPToken * gst_rtsp_token_new (const gchar * firstfield, ...);
|
2017-05-18 09:35:18 +00:00
|
|
|
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2013-07-12 14:36:05 +00:00
|
|
|
GstRTSPToken * gst_rtsp_token_new_valist (const gchar * firstfield, va_list var_args);
|
2013-07-05 18:34:40 +00:00
|
|
|
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2013-07-05 18:34:40 +00:00
|
|
|
const GstStructure * gst_rtsp_token_get_structure (GstRTSPToken *token);
|
2017-05-18 09:35:18 +00:00
|
|
|
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2013-07-05 18:34:40 +00:00
|
|
|
GstStructure * gst_rtsp_token_writable_structure (GstRTSPToken *token);
|
|
|
|
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2018-01-18 11:07:45 +00:00
|
|
|
void gst_rtsp_token_set_string (GstRTSPToken * token,
|
|
|
|
const gchar * field,
|
|
|
|
const gchar * string_value);
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2013-07-05 18:34:40 +00:00
|
|
|
const gchar * gst_rtsp_token_get_string (GstRTSPToken *token,
|
|
|
|
const gchar *field);
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2018-01-18 11:07:45 +00:00
|
|
|
void gst_rtsp_token_set_bool (GstRTSPToken * token,
|
|
|
|
const gchar * field,
|
|
|
|
gboolean bool_value);
|
2018-03-13 13:30:41 +00:00
|
|
|
GST_RTSP_SERVER_API
|
2013-07-12 15:06:37 +00:00
|
|
|
gboolean gst_rtsp_token_is_allowed (GstRTSPToken *token,
|
|
|
|
const gchar *field);
|
2018-01-18 11:07:45 +00:00
|
|
|
|
2015-11-10 19:17:18 +00:00
|
|
|
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstRTSPToken, gst_rtsp_token_unref)
|
|
|
|
#endif
|
|
|
|
|
2013-07-05 18:34:40 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GST_RTSP_TOKEN_H__ */
|