tee: Check for the removed pad flag also in the slow pushing path
[platform/upstream/gstreamer.git] / gst / gstcontext.c
index 1cc3f3f..c1bbe0a 100644 (file)
@@ -23,6 +23,7 @@
 
 /**
  * SECTION:gstcontext
+ * @title: GstContext
  * @short_description: Lightweight objects to represent element contexts
  * @see_also: #GstMiniObject, #GstElement
  *
  * known context on the element that asks for it if possible. Otherwise the
  * application should provide one if it can.
  *
+ * #GstContext<!-- -->s can be persistent.
+ * A persistent #GstContext is kept in elements when they reach
+ * %GST_STATE_NULL, non-persistent ones will be removed.
+ * Also, a non-persistent context won't override a previous persistent
+ * context set to an element.
+ *
  * Since: 1.2
  */
 
@@ -68,7 +75,7 @@ struct _GstContext
 
 #define GST_CONTEXT_STRUCTURE(c)  (((GstContext *)(c))->structure)
 
-static GType _gst_context_type = 0;
+GType _gst_context_type = 0;
 GST_DEFINE_MINI_OBJECT_TYPE (GstContext, gst_context);
 
 void
@@ -101,6 +108,10 @@ _gst_context_free (GstContext * context)
   }
   g_free (context->context_type);
 
+#ifdef USE_POISONING
+  memset (context, 0xff, sizeof (GstContext));
+#endif
+
   g_slice_free1 (sizeof (GstContext), context);
 }
 
@@ -239,8 +250,8 @@ gst_context_get_structure (const GstContext * context)
  * Get a writable version of the structure.
  *
  * Returns: The structure of the context. The structure is still
- * owned by the event, which means that you should not free it and
- * that the pointer becomes invalid when you free the event.
+ * owned by the context, which means that you should not free it and
+ * that the pointer becomes invalid when you free the context.
  * This function checks if @context is writable.
  *
  * Since: 1.2