Commit e99368a0 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

parse: Make gst_parse_context_copy() public for bindings

parent f9e6e424
......@@ -2242,6 +2242,7 @@ gst_parse_bin_from_description
gst_parse_bin_from_description_full
<SUBSECTION>
gst_parse_context_new
gst_parse_context_copy
gst_parse_context_free
gst_parse_context_get_missing_elements
<SUBSECTION Standard>
......
......@@ -45,26 +45,6 @@
#include "parse/types.h"
#endif
static 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;
}
G_DEFINE_BOXED_TYPE (GstParseContext, gst_parse_context,
(GBoxedCopyFunc) gst_parse_context_copy,
(GBoxedFreeFunc) gst_parse_context_free);
......@@ -113,6 +93,34 @@ gst_parse_context_new (void)
#endif
}
/**
* gst_parse_context_copy:
* @context: a #GstParseContext
*
* Copies the @context.
*
* Returns: (transfer full): 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
......
......@@ -102,6 +102,9 @@ gchar ** gst_parse_context_get_missing_elements (GstParseContext * cont
void gst_parse_context_free (GstParseContext * context);
GST_EXPORT
GstParseContext * gst_parse_context_copy (const GstParseContext * context);
/* parse functions */
......
......@@ -975,6 +975,7 @@ EXPORTS
gst_parent_buffer_meta_get_info
gst_parse_bin_from_description
gst_parse_bin_from_description_full
gst_parse_context_copy
gst_parse_context_free
gst_parse_context_get_missing_elements
gst_parse_context_get_type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment