mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
tests: add test for videorate caps renegotiation after a framerate has been calculated and added to caps
The original 0/1 framerate must still be allowed to be configured on the upstream side of videorate, otherwise future caps renegotiation is going to fail. https://bugzilla.gnome.org/show_bug.cgi?id=750032
This commit is contained in:
parent
c84f911cee
commit
a998d380bd
1 changed files with 26 additions and 0 deletions
|
@ -1137,6 +1137,31 @@ GST_START_TEST (test_fixed_framerate)
|
|||
|
||||
GST_END_TEST;
|
||||
|
||||
GST_START_TEST (test_variable_framerate_renegotiation)
|
||||
{
|
||||
GstElement *videorate;
|
||||
GstCaps *caps;
|
||||
GstCaps *allowed;
|
||||
|
||||
videorate = setup_videorate_full (&srctemplate, &sinktemplate);
|
||||
ASSERT_SET_STATE (videorate, GST_STATE_PLAYING, GST_STATE_CHANGE_SUCCESS);
|
||||
caps = gst_caps_from_string ("video/x-raw,framerate=0/1");
|
||||
gst_check_setup_events (mysrcpad, videorate, caps, GST_FORMAT_TIME);
|
||||
videorate_send_buffers (videorate, "video/x-raw,framerate=0/1",
|
||||
"video/x-raw,framerate=25/1");
|
||||
|
||||
/* framerate=0/1 must still be allowed to be configured on
|
||||
* the upstream side of videorate */
|
||||
allowed = gst_pad_get_allowed_caps (mysrcpad);
|
||||
fail_unless (gst_caps_is_subset (caps, allowed) == TRUE);
|
||||
|
||||
gst_caps_unref (allowed);
|
||||
gst_caps_unref (caps);
|
||||
cleanup_videorate (videorate);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
|
||||
static Suite *
|
||||
videorate_suite (void)
|
||||
|
@ -1157,6 +1182,7 @@ videorate_suite (void)
|
|||
tcase_add_loop_test (tc_chain, test_caps_negotiation,
|
||||
0, G_N_ELEMENTS (caps_negotiation_tests));
|
||||
tcase_add_test (tc_chain, test_fixed_framerate);
|
||||
tcase_add_test (tc_chain, test_variable_framerate_renegotiation);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue