parse: Fix transfer annotations for parse_launch functions.
authorJan Schmidt <thaytan@noraisin.net>
Sat, 12 Oct 2013 05:16:09 +0000 (16:16 +1100)
committerSebastian Dröge <slomo@circular-chaos.org>
Sun, 13 Oct 2013 19:54:19 +0000 (21:54 +0200)
gst_parse_launchv, gst_parse_launchv_full and gst_parse_launch_full
all return floating refs, the same as gst_parse_launch, which just
calls gst_parse_launch_full internally anyway.

Add a unit test assertion to check it's true.

Spotted by nemequ on IRC.

gst/gstparse.c
tests/check/pipelines/parse-launch.c

index faac9e9279ad1f30c4bf4e9381d00159db8e749c..a23cafa5eb6a2d62e10343b43e78d8c7bebf69fa 100644 (file)
@@ -207,7 +207,7 @@ _gst_parse_escape (const gchar * str)
  * @error will contain an error message if an erroneuos pipeline is specified.
  * An error does not mean that the pipeline could not be constructed.
  *
- * Returns: (transfer full): a new element on success and %NULL on failure.
+ * Returns: (transfer floating): a new element on success and %NULL on failure.
  */
 GstElement *
 gst_parse_launchv (const gchar ** argv, GError ** error)
@@ -227,7 +227,7 @@ gst_parse_launchv (const gchar ** argv, GError ** error)
  * @error will contain an error message if an erroneous pipeline is specified.
  * An error does not mean that the pipeline could not be constructed.
  *
- * Returns: (transfer full): a new element on success; on failure, either %NULL
+ * Returns: (transfer floating): a new element on success; on failure, either %NULL
  *   or a partially-constructed bin or element will be returned and @error will
  *   be set (unless you passed #GST_PARSE_FLAG_FATAL_ERRORS in @flags, then
  *   %NULL will always be returned on failure)
@@ -304,7 +304,7 @@ gst_parse_launch (const gchar * pipeline_description, GError ** error)
  * the @error is set. In this case there was a recoverable parsing error and you
  * can try to play the pipeline.
  *
- * Returns: (transfer full): a new element on success, %NULL on failure. If
+ * Returns: (transfer floating): a new element on success, %NULL on failure. If
  *    more than one toplevel element is specified by the @pipeline_description,
  *    all elements are put into a #GstPipeline, which then is returned.
  */
index e23a045c10f3271ca6543bcb969ec05365e54f9a..8db1d6b5058954a86d570a1c6113db0073479857 100644 (file)
@@ -48,6 +48,8 @@ setup_pipeline (const gchar * pipe_descr)
     g_error_free (error);
   }
   fail_unless (pipeline != NULL, "Failed to create pipeline %s", pipe_descr);
+  /* Newly returned object should be floating reffed */
+  fail_unless (g_object_is_floating (pipeline));
   return pipeline;
 }