parse: Fix transfer annotations for parse_launch functions.

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.
This commit is contained in:
Jan Schmidt 2013-10-12 16:16:09 +11:00 committed by Sebastian Dröge
parent 2bcafd4d56
commit 1a148ecb16
2 changed files with 5 additions and 3 deletions

View file

@ -207,7 +207,7 @@ _gst_parse_escape (const gchar * str)
* @error will contain an error message if an erroneuos pipeline is specified. * @error will contain an error message if an erroneuos pipeline is specified.
* An error does not mean that the pipeline could not be constructed. * 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 * GstElement *
gst_parse_launchv (const gchar ** argv, GError ** error) 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. * @error will contain an error message if an erroneous pipeline is specified.
* An error does not mean that the pipeline could not be constructed. * 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 * 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 * be set (unless you passed #GST_PARSE_FLAG_FATAL_ERRORS in @flags, then
* %NULL will always be returned on failure) * %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 * the @error is set. In this case there was a recoverable parsing error and you
* can try to play the pipeline. * 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, * more than one toplevel element is specified by the @pipeline_description,
* all elements are put into a #GstPipeline, which then is returned. * all elements are put into a #GstPipeline, which then is returned.
*/ */

View file

@ -48,6 +48,8 @@ setup_pipeline (const gchar * pipe_descr)
g_error_free (error); g_error_free (error);
} }
fail_unless (pipeline != NULL, "Failed to create pipeline %s", pipe_descr); 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; return pipeline;
} }