diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-05-20 19:42:51 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-05-20 19:43:18 +0300 |
commit | f322740ef9fd2839ce0e6a2248d48c618a5bf0cf (patch) | |
tree | 96f6f024972a62b07270c1c81518d9b8855bc6ee | |
parent | 9f05e6615417e4411540bf309c10223c71e61328 (diff) |
parse: Make gst_parse_context_copy() public for bindings
-rw-r--r-- | docs/gst/gstreamer-sections.txt | 1 | ||||
-rw-r--r-- | gst/gstparse.c | 48 | ||||
-rw-r--r-- | gst/gstparse.h | 3 | ||||
-rw-r--r-- | win32/common/libgstreamer.def | 1 |
4 files changed, 33 insertions, 20 deletions
diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 2efe9d216..190570b06 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -2247,6 +2247,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> diff --git a/gst/gstparse.c b/gst/gstparse.c index 4838d5c9a..f1f0c2267 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -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); @@ -114,6 +94,34 @@ gst_parse_context_new (void) } /** + * 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 * diff --git a/gst/gstparse.h b/gst/gstparse.h index 2d80f86d2..3b14da7e7 100644 --- a/gst/gstparse.h +++ b/gst/gstparse.h @@ -108,6 +108,9 @@ gchar ** gst_parse_context_get_missing_elements (GstParseContext * cont GST_EXPORT void gst_parse_context_free (GstParseContext * context); +GST_EXPORT +GstParseContext * gst_parse_context_copy (const GstParseContext * context); + /* parse functions */ diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 3fe1b4619..76d05a747 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -978,6 +978,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 |