gstbuffer: fix GstParentBufferMeta GType name

The alias define GST_TYPE_PARENT_BUFFER_META_API_TYPE is wrong and
breaks the usage of gst_buffer_get_parent_buffer_meta().

This patch fixes the GType alias and make another alias to keep the API
compatibility guarded by GST_DISABLE_DEPRECATED.

Also added a unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=763112
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-03-04 18:23:18 +01:00
parent c904e00661
commit c1f2775dcb
2 changed files with 25 additions and 1 deletions

View file

@ -597,7 +597,10 @@ struct _GstParentBufferMeta
};
GType gst_parent_buffer_meta_api_get_type (void);
#define GST_TYPE_PARENT_BUFFER_META_API_TYPE (gst_parent_buffer_meta_api_get_type())
#ifndef GST_DISABLE_DEPRECATED
#define GST_TYPE_PARENT_BUFFER_META_API_TYPE GST_PARENT_BUFFER_META_API_TYPE
#endif
#define GST_PARENT_BUFFER_META_API_TYPE (gst_parent_buffer_meta_api_get_type())
/**
* gst_buffer_get_parent_buffer_meta:

View file

@ -890,6 +890,26 @@ GST_START_TEST (test_fill)
GST_END_TEST;
GST_START_TEST (test_parent_buffer_meta)
{
GstBuffer *buf, *parent;
GstParentBufferMeta *meta;
buf = gst_buffer_new ();
parent = gst_buffer_new ();
gst_buffer_add_parent_buffer_meta (buf, parent);
meta = gst_buffer_get_parent_buffer_meta (buf);
fail_unless (meta);
fail_unless (parent == meta->buffer);
gst_buffer_unref (buf);
gst_buffer_unref (parent);
}
GST_END_TEST;
static Suite *
gst_buffer_suite (void)
{
@ -912,6 +932,7 @@ gst_buffer_suite (void)
tcase_add_test (tc_chain, test_map_range);
tcase_add_test (tc_chain, test_find);
tcase_add_test (tc_chain, test_fill);
tcase_add_test (tc_chain, test_parent_buffer_meta);
return s;
}