diff options
author | Jan Schmidt <thaytan@noraisin.net> | 2013-10-12 16:16:09 +1100 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2013-10-12 16:20:50 +1100 |
commit | 75b7387f8bb04b52eff356e8fa79cc22e34d09f4 (patch) | |
tree | 8c70120bc89869bf7ea8c2d67f4b51840052880c | |
parent | 94a3394edffb0e27a44464625b07bebf28991b4b (diff) |
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.
-rw-r--r-- | gst/gstparse.c | 6 | ||||
-rw-r--r-- | tests/check/pipelines/parse-launch.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/gst/gstparse.c b/gst/gstparse.c index faac9e927..a23cafa5e 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -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. */ diff --git a/tests/check/pipelines/parse-launch.c b/tests/check/pipelines/parse-launch.c index e23a045c1..8db1d6b50 100644 --- a/tests/check/pipelines/parse-launch.c +++ b/tests/check/pipelines/parse-launch.c @@ -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; } |