/* 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
*
GstMiniObject mini_object;
GstStructure *structure;
+ gboolean persistent;
};
#define GST_CONTEXT_STRUCTURE(c) (((GstContext *)(c))->structure)
gst_structure_set_parent_refcount (GST_CONTEXT_STRUCTURE (copy),
©->mini_object.refcount);
+ copy->persistent = context->persistent;
+
return GST_CONTEXT_CAST (copy);
}
/**
* gst_context_new:
+ * @persistent: Persistent context
*
* Create a new context.
*
* Since: 1.2
*/
GstContext *
-gst_context_new (void)
+gst_context_new (gboolean persistent)
{
GstContext *context;
GstStructure *structure;
gst_context_init (context);
GST_CONTEXT_STRUCTURE (context) = structure;
+ context->persistent = persistent;
return context;
}
* Since: 1.2
*/
const GstStructure *
-gst_context_get_structure (GstContext * context)
+gst_context_get_structure (const GstContext * context)
{
g_return_val_if_fail (GST_IS_CONTEXT (context), NULL);
return GST_CONTEXT_STRUCTURE (context);
}
+
+/**
+ * gst_context_is_persistent:
+ * @context: The #GstContext.
+ *
+ * Check if @context is persistent.
+ *
+ * Returns: %TRUE if the context is persistent.
+ *
+ * Since: 1.2
+ */
+gboolean
+gst_context_is_persistent (const GstContext * context)
+{
+ g_return_val_if_fail (GST_IS_CONTEXT (context), NULL);
+
+ return context->persistent;
+}
/* 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
*
return gst_mini_object_replace ((GstMiniObject **) old_context, (GstMiniObject *) new_context);
}
-GstContext * gst_context_new (void) G_GNUC_MALLOC;
+GstContext * gst_context_new (gboolean persistent) G_GNUC_MALLOC;
-const GstStructure * gst_context_get_structure (GstContext *context);
+const GstStructure * gst_context_get_structure (const GstContext *context);
GstStructure * gst_context_writable_structure (GstContext *context);
+gboolean gst_context_is_persistent (const GstContext * context);
+
G_END_DECLS
#endif /* __GST_CONTEXT_H__ */