/* GStreamer
* Copyright (C) 2013 Collabora Ltd.
* Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * Copyright (C) 2013 Sebastian Dröge <slomo@circular-chaos.org>
*
* gstcontext.h: Header for GstContext subsystem
*
#ifndef __GST_CONTEXT_H__
#define __GST_CONTEXT_H__
+#include <glib.h>
+
G_BEGIN_DECLS
typedef struct _GstContext GstContext;
#include <gst/gstminiobject.h>
#include <gst/gststructure.h>
-#define GST_TYPE_CONTEXT (gst_context_get_type())
+GST_API GType _gst_context_type;
+
+#define GST_TYPE_CONTEXT (_gst_context_type)
#define GST_IS_CONTEXT(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_CONTEXT))
#define GST_CONTEXT_CAST(obj) ((GstContext*)(obj))
#define GST_CONTEXT(obj) (GST_CONTEXT_CAST(obj))
+GST_API
GType gst_context_get_type (void);
*
* Returns: @context (for convenience when doing assignments)
*/
-#ifdef _FOOL_GTK_DOC_
-G_INLINE_FUNC GstContext * gst_context_ref (GstContext * context);
-#endif
-
static inline GstContext *
gst_context_ref (GstContext * context)
{
* Convenience macro to decrease the reference count of the context, possibly
* freeing it.
*/
-#ifdef _FOOL_GTK_DOC_
-G_INLINE_FUNC void gst_context_unref (GstContext * context);
-#endif
-
static inline void
gst_context_unref (GstContext * context)
{
*
* MT safe
*/
-#ifdef _FOOL_GTK_DOC_
-G_INLINE_FUNC GstContext * gst_context_copy (const GstContext * context);
-#endif
-
static inline GstContext *
gst_context_copy (const GstContext * context)
{
* in some cases), and the reference counts are updated appropriately (the old
* context is unreffed, the new one is reffed).
*
- * Either @new_context or the #GstContext pointed to by @old_context may be NULL.
+ * Either @new_context or the #GstContext pointed to by @old_context may be %NULL.
*
- * Returns: TRUE if @new_context was different from @old_context
+ * Returns: %TRUE if @new_context was different from @old_context
*/
-#ifdef _FOOL_GTK_DOC_
-G_INLINE_FUNC gboolean gst_context_replace (GstContext **old_context, GstContext *new_context);
-#endif
-
static inline gboolean
gst_context_replace (GstContext **old_context, GstContext *new_context)
{
return gst_mini_object_replace ((GstMiniObject **) old_context, (GstMiniObject *) new_context);
}
-GstContext * gst_context_new (void) G_GNUC_MALLOC;
+GST_API
+GstContext * gst_context_new (const gchar * context_type,
+ gboolean persistent) G_GNUC_MALLOC;
+GST_API
+const gchar * gst_context_get_context_type (const GstContext * context);
+
+GST_API
+gboolean gst_context_has_context_type (const GstContext * context, const gchar * context_type);
+
+GST_API
+const GstStructure * gst_context_get_structure (const GstContext * context);
-const GstStructure *
- gst_context_get_structure (GstContext *context);
+GST_API
+GstStructure * gst_context_writable_structure (GstContext * context);
+
+GST_API
+gboolean gst_context_is_persistent (const GstContext * context);
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstContext, gst_context_unref)
+#endif
G_END_DECLS