diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-03-06 23:34:56 +0200 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-03-06 23:38:45 +0200 |
commit | 772f8f6a8a9febe581159f8d811a2aaace2fa096 (patch) | |
tree | 1e4e759c5a0653517eea67515835405583f94c74 /tests/check | |
parent | 152830945646ca4230c60c92ce250d1a64c4f9d7 (diff) | |
download | gst-plugins-bad-772f8f6a8a9febe581159f8d811a2aaace2fa096.tar.gz gst-plugins-bad-772f8f6a8a9febe581159f8d811a2aaace2fa096.tar.bz2 gst-plugins-bad-772f8f6a8a9febe581159f8d811a2aaace2fa096.zip |
metadata: cleanup, fix the test, add comments
First do not build the plugin, if we have none of the backend, as it won't work
then. Fix the miniobject_unref error in the test. Sprinkle a first handful of
debug logs into the element code.
Diffstat (limited to 'tests/check')
-rw-r--r-- | tests/check/pipelines/metadata.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/check/pipelines/metadata.c b/tests/check/pipelines/metadata.c index 9f5034e3..ef1bdbc5 100644 --- a/tests/check/pipelines/metadata.c +++ b/tests/check/pipelines/metadata.c @@ -38,7 +38,6 @@ bus_handler (GstBus * bus, GstMessage * message, gpointer data) gst_message_parse_error (message, &gerror, &debug); gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug); - gst_message_unref (message); g_error_free (gerror); g_free (debug); g_main_loop_quit (loop); @@ -81,12 +80,18 @@ test_tags (const gchar * tag_str) gint i, j, n_recv, n_sent; const gchar *name_sent, *name_recv; const GValue *value_sent, *value_recv; - gboolean found; + gboolean found, ok; gint comparison; - GstElement *videotestsrc, *jpegenc, *metadatamux, *metadatademux, *fakesink; GstTagSetter *setter; + GST_DEBUG ("testing tags : %s", tag_str); + + if (received_tags) { + gst_tag_list_free (received_tags); + received_tags = NULL; + } + pipeline = gst_pipeline_new ("pipeline"); fail_unless (pipeline != NULL); @@ -94,7 +99,7 @@ test_tags (const gchar * tag_str) fail_unless (videotestsrc != NULL); g_object_set (G_OBJECT (videotestsrc), "num-buffers", 1, NULL); - jpegenc = gst_element_factory_make ("jpegenc", "enc"); + jpegenc = gst_element_factory_make ("q", "enc"); if (jpegenc == NULL) { g_print ("Cannot test - jpegenc not available\n"); return; @@ -113,8 +118,9 @@ test_tags (const gchar * tag_str) gst_bin_add_many (GST_BIN (pipeline), videotestsrc, jpegenc, metadatamux, metadatademux, fakesink, NULL); - fail_unless (gst_element_link_many (videotestsrc, jpegenc, metadatamux, - metadatademux, fakesink, NULL)); + ok = gst_element_link_many (videotestsrc, jpegenc, metadatamux, metadatademux, + fakesink, NULL); + fail_unless (ok == TRUE); loop = g_main_loop_new (NULL, TRUE); fail_unless (loop != NULL); @@ -129,11 +135,14 @@ test_tags (const gchar * tag_str) setter = GST_TAG_SETTER (metadatamux); fail_unless (setter != NULL); sent_tags = gst_structure_from_string (tag_str, NULL); + fail_unless (sent_tags != NULL); gst_tag_setter_merge_tags (setter, sent_tags, GST_TAG_MERGE_REPLACE); gst_element_set_state (pipeline, GST_STATE_PLAYING); g_main_loop_run (loop); + GST_DEBUG ("mainloop done : %p", received_tags); + /* verify tags */ fail_unless (received_tags != NULL); n_recv = gst_structure_n_fields (received_tags); |