+
+/**
+ * gst_parse_context_new:
+ *
+ * Allocates a parse context for use with gst_parse_launch_full() or
+ * gst_parse_launchv_full().
+ *
+ * Free-function: gst_parse_context_free
+ *
+ * Returns: (transfer full) (nullable): a newly-allocated parse context. Free
+ * with gst_parse_context_free() when no longer needed.
+ */
+GstParseContext *
+gst_parse_context_new (void)
+{
+#ifndef GST_DISABLE_PARSE
+ GstParseContext *ctx;
+
+ ctx = g_slice_new (GstParseContext);
+ ctx->missing_elements = NULL;
+
+ return ctx;
+#else
+ return NULL;
+#endif
+}
+
+/**
+ * gst_parse_context_copy:
+ * @context: a #GstParseContext
+ *
+ * Copies the @context.
+ *
+ * Returns: (transfer full) (nullable): A copied #GstParseContext
+ */
+GstParseContext *
+gst_parse_context_copy (const GstParseContext * context)
+{
+ GstParseContext *ret = NULL;
+#ifndef GST_DISABLE_PARSE
+
+ ret = gst_parse_context_new ();
+ if (context) {
+ GQueue missing_copy = G_QUEUE_INIT;
+ GList *l;
+
+ for (l = context->missing_elements; l != NULL; l = l->next)
+ g_queue_push_tail (&missing_copy, g_strdup ((const gchar *) l->data));
+
+ ret->missing_elements = missing_copy.head;
+ }
+#endif
+ return ret;
+}
+
+/**
+ * gst_parse_context_free:
+ * @context: (transfer full): a #GstParseContext
+ *
+ * Frees a parse context previously allocated with gst_parse_context_new().
+ */
+void
+gst_parse_context_free (GstParseContext * context)
+{
+#ifndef GST_DISABLE_PARSE
+ if (context) {
+ g_list_foreach (context->missing_elements, (GFunc) g_free, NULL);
+ g_list_free (context->missing_elements);
+ g_slice_free (GstParseContext, context);
+ }
+#endif
+}
+
+/**
+ * gst_parse_context_get_missing_elements:
+ * @context: a #GstParseContext
+ *
+ * Retrieve missing elements from a previous run of gst_parse_launch_full()
+ * or gst_parse_launchv_full(). Will only return results if an error code
+ * of %GST_PARSE_ERROR_NO_SUCH_ELEMENT was returned.
+ *
+ * Returns: (transfer full) (array zero-terminated=1) (element-type gchar*) (nullable): a
+ * %NULL-terminated array of element factory name strings of missing
+ * elements. Free with g_strfreev() when no longer needed.
+ */
+gchar **
+gst_parse_context_get_missing_elements (GstParseContext * context)
+{
+#ifndef GST_DISABLE_PARSE
+ gchar **arr;
+ GList *l;
+ guint len, i;
+
+ g_return_val_if_fail (context != NULL, NULL);
+
+ len = g_list_length (context->missing_elements);
+
+ if (G_UNLIKELY (len == 0))
+ return NULL;
+
+ arr = g_new (gchar *, len + 1);
+
+ for (i = 0, l = context->missing_elements; l != NULL; l = l->next, ++i)
+ arr[i] = g_strdup (l->data);
+
+ arr[i] = NULL;
+
+ return arr;
+#else
+ return NULL;
+#endif
+}
+
+#ifndef GST_DISABLE_PARSE