parse: Fix transfer annotations for parse_launch functions.
authorJan Schmidt <thaytan@noraisin.net>
Sat, 12 Oct 2013 05:16:09 +0000 (16:16 +1100)
committerJan Schmidt <thaytan@noraisin.net>
Sat, 12 Oct 2013 05:20:50 +0000 (16:20 +1100)
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 faac9e9..a23cafa 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 e23a045..8db1d6b 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;
 }