GST_END_TEST;
-/* is there an easier way to compare two structures / tagslists? */
-static gboolean
-taglists_are_equal (const GstTagList * list_1, const GstTagList * list_2)
-{
- GstCaps *c_list_1 = gst_caps_new_empty ();
- GstCaps *c_list_2 = gst_caps_new_empty ();
- gboolean ret;
-
- gst_caps_append_structure (c_list_1,
- gst_structure_copy ((GstStructure *) list_1));
- gst_caps_append_structure (c_list_2,
- gst_structure_copy ((GstStructure *) list_2));
-
- ret = gst_caps_is_equal (c_list_2, c_list_1);
-
- gst_caps_unref (c_list_1);
- gst_caps_unref (c_list_2);
-
- return ret;
-}
-
GST_START_TEST (test_vorbis_tags)
{
GstTagList *list;
vendor_id = NULL;
GST_LOG ("new_list = %" GST_PTR_FORMAT, new_list);
- fail_unless (taglists_are_equal (list, new_list));
+ fail_unless (gst_tag_list_is_equal (list, new_list));
buf2 = gst_tag_list_to_vorbiscomment_buffer (new_list,
(const guint8 *) "\003vorbis", 7, "libgstunittest");
vendor_id = NULL;
GST_LOG ("even_newer_list = %" GST_PTR_FORMAT, even_newer_list);
- fail_unless (taglists_are_equal (new_list, even_newer_list));
+ fail_unless (gst_tag_list_is_equal (new_list, even_newer_list));
gst_tag_list_free (new_list);
gst_tag_list_free (even_newer_list);
fail_unless (vendor != NULL);
fail_unless_equals_string (vendor, "foo");
fail_unless (list != NULL);
- fail_unless (gst_structure_n_fields ((GstStructure *) list) == 0);
+ fail_unless (gst_tag_list_n_tags (list) == 0);
g_free (vendor);
gst_tag_list_free (list);
/* now again without vendor */
list = gst_tag_list_from_vorbiscomment_buffer (buf, NULL, 0, NULL);
fail_unless (list != NULL);
- fail_unless (gst_structure_n_fields ((GstStructure *) list) == 0);
+ fail_unless (gst_tag_list_n_tags (list) == 0);
gst_tag_list_free (list);
gst_buffer_unref (buf);
fail_unless (vendor != NULL);
fail_unless_equals_string (vendor, "foo");
fail_unless (list != NULL);
- fail_unless (gst_structure_n_fields ((GstStructure *) list) == 1);
+ fail_unless (gst_tag_list_n_tags (list) == 1);
ASSERT_TAG_LIST_HAS_STRING (list, GST_TAG_ARTIST, "foo bar");
g_free (vendor);
gst_tag_list_free (list);
list = gst_tag_list_from_vorbiscomment_buffer (buf,
(guint8 *) "\003vorbis", 7, NULL);
fail_unless (list != NULL);
- fail_unless (gst_structure_n_fields ((GstStructure *) list) == 1);
+ fail_unless (gst_tag_list_n_tags (list) == 1);
ASSERT_TAG_LIST_HAS_STRING (list, GST_TAG_ARTIST, "foo bar");
gst_tag_list_free (list);
if (test_data[i].result_size >= 0) {
fail_unless (list != NULL);
- result_size = gst_structure_n_fields ((GstStructure *) list);
+ result_size = gst_tag_list_n_tags (list);
fail_unless (result_size == test_data[i].result_size);
/* check the taglist content */
for (i = 0; i < app->n_video; i++) {
g_signal_emit_by_name (app->pipeline, "get-video-tags", i, &tags);
if (tags) {
- str = gst_structure_to_string ((GstStructure *) tags);
+ str = gst_tag_list_to_string (tags);
g_print ("video %d: %s\n", i, str);
g_free (str);
}
for (i = 0; i < app->n_audio; i++) {
g_signal_emit_by_name (app->pipeline, "get-audio-tags", i, &tags);
if (tags) {
- str = gst_structure_to_string ((GstStructure *) tags);
+ str = gst_tag_list_to_string (tags);
g_print ("audio %d: %s\n", i, str);
g_free (str);
}
if (tags) {
const GValue *value;
- str = gst_structure_to_string ((GstStructure *) tags);
+ str = gst_tag_list_to_string (tags);
g_print ("text %d: %s\n", i, str);
g_free (str);
for (i = 0; i < n_video; i++) {
g_signal_emit_by_name (pipeline, "get-video-tags", i, &tags);
if (tags) {
- str = gst_structure_to_string ((GstStructure *) tags);
+ str = gst_tag_list_to_string (tags);
g_print ("video %d: %s\n", i, str);
g_free (str);
}
for (i = 0; i < n_audio; i++) {
g_signal_emit_by_name (pipeline, "get-audio-tags", i, &tags);
if (tags) {
- str = gst_structure_to_string ((GstStructure *) tags);
+ str = gst_tag_list_to_string (tags);
g_print ("audio %d: %s\n", i, str);
g_free (str);
}
if (tags) {
const GValue *value;
- str = gst_structure_to_string ((GstStructure *) tags);
+ str = gst_tag_list_to_string (tags);
g_print ("text %d: %s\n", i, str);
g_free (str);