mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-02 09:51:11 +00:00
tests: make tests compile
This commit is contained in:
parent
f9d64ff495
commit
bc3c7aa05e
5 changed files with 26 additions and 20 deletions
|
@ -62,8 +62,8 @@ setup_amrnbenc (void)
|
||||||
GST_DEBUG ("setup_amrnbenc");
|
GST_DEBUG ("setup_amrnbenc");
|
||||||
|
|
||||||
amrnbenc = gst_check_setup_element ("amrnbenc");
|
amrnbenc = gst_check_setup_element ("amrnbenc");
|
||||||
srcpad = gst_check_setup_src_pad (amrnbenc, &srctemplate, NULL);
|
srcpad = gst_check_setup_src_pad (amrnbenc, &srctemplate);
|
||||||
sinkpad = gst_check_setup_sink_pad (amrnbenc, &sinktemplate, NULL);
|
sinkpad = gst_check_setup_sink_pad (amrnbenc, &sinktemplate);
|
||||||
gst_pad_set_active (srcpad, TRUE);
|
gst_pad_set_active (srcpad, TRUE);
|
||||||
gst_pad_set_active (sinkpad, TRUE);
|
gst_pad_set_active (sinkpad, TRUE);
|
||||||
|
|
||||||
|
|
|
@ -1345,8 +1345,8 @@ setup_mpeg2dec ()
|
||||||
|
|
||||||
GST_DEBUG ("setup_mpeg2dec");
|
GST_DEBUG ("setup_mpeg2dec");
|
||||||
mpeg2dec = gst_check_setup_element ("mpeg2dec");
|
mpeg2dec = gst_check_setup_element ("mpeg2dec");
|
||||||
mysrcpad = gst_check_setup_src_pad (mpeg2dec, &srctemplate, NULL);
|
mysrcpad = gst_check_setup_src_pad (mpeg2dec, &srctemplate);
|
||||||
mysinkpad = gst_check_setup_sink_pad (mpeg2dec, &sinktemplate, NULL);
|
mysinkpad = gst_check_setup_sink_pad (mpeg2dec, &sinktemplate);
|
||||||
gst_pad_set_active (mysrcpad, TRUE);
|
gst_pad_set_active (mysrcpad, TRUE);
|
||||||
gst_pad_set_active (mysinkpad, TRUE);
|
gst_pad_set_active (mysinkpad, TRUE);
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,8 @@ setup_x264enc (void)
|
||||||
|
|
||||||
GST_DEBUG ("setup_x264enc");
|
GST_DEBUG ("setup_x264enc");
|
||||||
x264enc = gst_check_setup_element ("x264enc");
|
x264enc = gst_check_setup_element ("x264enc");
|
||||||
mysrcpad = gst_check_setup_src_pad (x264enc, &srctemplate, NULL);
|
mysrcpad = gst_check_setup_src_pad (x264enc, &srctemplate);
|
||||||
mysinkpad = gst_check_setup_sink_pad (x264enc, &sinktemplate, NULL);
|
mysinkpad = gst_check_setup_sink_pad (x264enc, &sinktemplate);
|
||||||
gst_pad_set_active (mysrcpad, TRUE);
|
gst_pad_set_active (mysrcpad, TRUE);
|
||||||
gst_pad_set_active (mysinkpad, TRUE);
|
gst_pad_set_active (mysinkpad, TRUE);
|
||||||
|
|
||||||
|
@ -231,6 +231,7 @@ GST_END_TEST;
|
||||||
|
|
||||||
GstCaps *pad_caps;
|
GstCaps *pad_caps;
|
||||||
|
|
||||||
|
#if 0
|
||||||
GstCaps *
|
GstCaps *
|
||||||
getcaps_test (GstPad * pad, GstCaps * filter)
|
getcaps_test (GstPad * pad, GstCaps * filter)
|
||||||
{
|
{
|
||||||
|
@ -239,6 +240,7 @@ getcaps_test (GstPad * pad, GstCaps * filter)
|
||||||
else
|
else
|
||||||
return gst_caps_intersect (pad_caps, filter);
|
return gst_caps_intersect (pad_caps, filter);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
GST_START_TEST (test_profile_in_caps)
|
GST_START_TEST (test_profile_in_caps)
|
||||||
{
|
{
|
||||||
|
@ -251,7 +253,9 @@ GST_START_TEST (test_profile_in_caps)
|
||||||
pad_caps = gst_caps_from_string (MPEG_CAPS_STRING);
|
pad_caps = gst_caps_from_string (MPEG_CAPS_STRING);
|
||||||
|
|
||||||
x264enc = setup_x264enc ();
|
x264enc = setup_x264enc ();
|
||||||
gst_pad_set_getcaps_function (mysinkpad, getcaps_test);
|
gst_pad_set_caps (mysinkpad, pad_caps);
|
||||||
|
gst_pad_use_fixed_caps (mysinkpad);
|
||||||
|
|
||||||
srcpad = gst_element_get_static_pad (x264enc, "src");
|
srcpad = gst_element_get_static_pad (x264enc, "src");
|
||||||
sinkpad = gst_element_get_static_pad (x264enc, "sink");
|
sinkpad = gst_element_get_static_pad (x264enc, "sink");
|
||||||
fail_unless (gst_element_set_state (x264enc,
|
fail_unless (gst_element_set_state (x264enc,
|
||||||
|
|
|
@ -89,9 +89,8 @@ GST_START_TEST (test_xing_remux)
|
||||||
"could not set to playing");
|
"could not set to playing");
|
||||||
|
|
||||||
inbuffer = gst_buffer_new_and_alloc (sizeof (test_xing));
|
inbuffer = gst_buffer_new_and_alloc (sizeof (test_xing));
|
||||||
memcpy (GST_BUFFER_DATA (inbuffer), test_xing, sizeof (test_xing));
|
gst_buffer_fill (inbuffer, 0, test_xing, sizeof (test_xing));
|
||||||
|
|
||||||
gst_buffer_set_caps (inbuffer, GST_PAD_CAPS (mysrcpad));
|
|
||||||
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
||||||
|
|
||||||
/* pushing gives away my reference ... */
|
/* pushing gives away my reference ... */
|
||||||
|
@ -103,27 +102,30 @@ GST_START_TEST (test_xing_remux)
|
||||||
verify_data = test_xing;
|
verify_data = test_xing;
|
||||||
for (it = buffers; it != NULL; it = it->next) {
|
for (it = buffers; it != NULL; it = it->next) {
|
||||||
GstBuffer *outbuffer = (GstBuffer *) it->data;
|
GstBuffer *outbuffer = (GstBuffer *) it->data;
|
||||||
|
gsize size;
|
||||||
|
guint8 *data;
|
||||||
|
|
||||||
|
data = gst_buffer_map (outbuffer, &size, NULL, GST_MAP_READ);
|
||||||
|
|
||||||
if (it == buffers) {
|
if (it == buffers) {
|
||||||
gint j;
|
gint j;
|
||||||
|
|
||||||
/* Empty Xing header, should be the same as input data until the "Xing" marker
|
/* Empty Xing header, should be the same as input data until the "Xing" marker
|
||||||
* and zeroes afterwards. */
|
* and zeroes afterwards. */
|
||||||
fail_unless (memcmp (test_xing, GST_BUFFER_DATA (outbuffer), 25) == 0);
|
fail_unless (memcmp (data, test_xing, 25) == 0);
|
||||||
for (j = 26; j < GST_BUFFER_SIZE (outbuffer); j++)
|
for (j = 26; j < size; j++)
|
||||||
fail_unless (GST_BUFFER_DATA (outbuffer)[j] == 0);
|
fail_unless (data[j] == 0);
|
||||||
verify_data += GST_BUFFER_SIZE (outbuffer);
|
verify_data += size;
|
||||||
} else if (it->next != NULL) {
|
} else if (it->next != NULL) {
|
||||||
/* Should contain the raw MP3 data without changes */
|
/* Should contain the raw MP3 data without changes */
|
||||||
fail_unless (memcmp (verify_data, GST_BUFFER_DATA (outbuffer),
|
fail_unless (memcmp (data, verify_data, size) == 0);
|
||||||
GST_BUFFER_SIZE (outbuffer)) == 0);
|
verify_data += size;
|
||||||
verify_data += GST_BUFFER_SIZE (outbuffer);
|
|
||||||
} else {
|
} else {
|
||||||
/* Last buffer is the rewrite of the first buffer and should be exactly the same
|
/* Last buffer is the rewrite of the first buffer and should be exactly the same
|
||||||
* as the old Xing header we had */
|
* as the old Xing header we had */
|
||||||
fail_unless (memcmp (test_xing, GST_BUFFER_DATA (outbuffer),
|
fail_unless (memcmp (test_xing, data, size) == 0);
|
||||||
GST_BUFFER_SIZE (outbuffer)) == 0);
|
|
||||||
}
|
}
|
||||||
|
gst_buffer_unmap (outbuffer, data, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
|
|
|
@ -45,7 +45,7 @@ setup ()
|
||||||
ignorelist = g_strsplit (STATE_IGNORE_ELEMENTS, " ", 0);
|
ignorelist = g_strsplit (STATE_IGNORE_ELEMENTS, " ", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins = gst_registry_get_plugin_list (gst_registry_get_default ());
|
plugins = gst_registry_get_plugin_list (gst_registry_get ());
|
||||||
|
|
||||||
for (p = plugins; p; p = p->next) {
|
for (p = plugins; p; p = p->next) {
|
||||||
GstPlugin *plugin = p->data;
|
GstPlugin *plugin = p->data;
|
||||||
|
@ -54,7 +54,7 @@ setup ()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
features =
|
features =
|
||||||
gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
|
gst_registry_get_feature_list_by_plugin (gst_registry_get (),
|
||||||
gst_plugin_get_name (plugin));
|
gst_plugin_get_name (plugin));
|
||||||
|
|
||||||
for (f = features; f; f = f->next) {
|
for (f = features; f; f = f->next) {
|
||||||
|
|
Loading…
Reference in a new issue