check: drop caps argument from gst_check_setup_{src,sink}_pad

Calling set_caps at that point is not useful in 0.10 (FIXME comment!), and in
0.11 it is totally pointless: the caps event doesn't stick to a flushing pad.
This commit is contained in:
René Stadler 2011-11-24 21:36:12 +01:00
parent e9ac94cffb
commit f6e992cb06
10 changed files with 18 additions and 36 deletions

View file

@ -197,19 +197,10 @@ gst_check_teardown_element (GstElement * element)
gst_object_unref (element); gst_object_unref (element);
} }
/* FIXME: set_caps isn't that useful
*/
GstPad * GstPad *
gst_check_setup_src_pad (GstElement * element, gst_check_setup_src_pad (GstElement * element, GstStaticPadTemplate * tmpl)
GstStaticPadTemplate * tmpl, GstCaps * caps)
{ {
GstPad *srcpad; return gst_check_setup_src_pad_by_name (element, tmpl, "sink");
srcpad = gst_check_setup_src_pad_by_name (element, tmpl, "sink");
if (caps)
fail_unless (gst_pad_push_event (srcpad, gst_event_new_caps (caps)),
"could not set caps on pad");
return srcpad;
} }
GstPad * GstPad *
@ -277,19 +268,10 @@ gst_check_teardown_src_pad (GstElement * element)
gst_check_teardown_pad_by_name (element, "sink"); gst_check_teardown_pad_by_name (element, "sink");
} }
/* FIXME: set_caps isn't that useful; might want to check if fixed,
* then use set_use_fixed or somesuch */
GstPad * GstPad *
gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * tmpl, gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * tmpl)
GstCaps * caps)
{ {
GstPad *sinkpad; return gst_check_setup_sink_pad_by_name (element, tmpl, "src");
sinkpad = gst_check_setup_sink_pad_by_name (element, tmpl, "src");
if (caps)
fail_unless (gst_pad_send_event (sinkpad, gst_event_new_caps (caps)),
"Could not set pad caps");
return sinkpad;
} }
GstPad * GstPad *

View file

@ -72,7 +72,7 @@ void gst_check_message_error (GstMessage * message, GstMessageType type,
GstElement *gst_check_setup_element (const gchar * factory); GstElement *gst_check_setup_element (const gchar * factory);
void gst_check_teardown_element (GstElement * element); void gst_check_teardown_element (GstElement * element);
GstPad *gst_check_setup_src_pad (GstElement * element, GstPad *gst_check_setup_src_pad (GstElement * element,
GstStaticPadTemplate * tmpl, GstCaps * caps); GstStaticPadTemplate * tmpl);
GstPad * gst_check_setup_src_pad_by_name (GstElement * element, GstPad * gst_check_setup_src_pad_by_name (GstElement * element,
GstStaticPadTemplate * tmpl, const gchar *name); GstStaticPadTemplate * tmpl, const gchar *name);
GstPad * gst_check_setup_sink_pad_by_name (GstElement * element, GstPad * gst_check_setup_sink_pad_by_name (GstElement * element,
@ -87,7 +87,7 @@ void gst_check_element_push_buffer_list (const gchar * element_name,
void gst_check_element_push_buffer (const gchar * element_name, void gst_check_element_push_buffer (const gchar * element_name,
GstBuffer * buffer_in, GstBuffer * buffer_out); GstBuffer * buffer_in, GstBuffer * buffer_out);
GstPad *gst_check_setup_sink_pad (GstElement * element, GstPad *gst_check_setup_sink_pad (GstElement * element,
GstStaticPadTemplate * tmpl, GstCaps * caps); GstStaticPadTemplate * tmpl);
void gst_check_teardown_sink_pad (GstElement * element); void gst_check_teardown_sink_pad (GstElement * element);
void gst_check_abi_list (GstCheckABIStruct list[], gboolean have_abi_sizes); void gst_check_abi_list (GstCheckABIStruct list[], gboolean have_abi_sizes);
gint gst_check_run_suite (Suite * suite, const gchar * name, gint gst_check_run_suite (Suite * suite, const gchar * name,

View file

@ -50,7 +50,7 @@ GST_START_TEST (test_unfixed_downstream_caps)
gst_bin_add_many (GST_BIN (pipe), src, filter, NULL); gst_bin_add_many (GST_BIN (pipe), src, filter, NULL);
fail_unless (gst_element_link (src, filter)); fail_unless (gst_element_link (src, filter));
mysinkpad = gst_check_setup_sink_pad (filter, &sinktemplate, NULL); mysinkpad = gst_check_setup_sink_pad (filter, &sinktemplate);
gst_pad_set_active (mysinkpad, TRUE); gst_pad_set_active (mysinkpad, TRUE);
fail_unless_equals_int (gst_element_set_state (pipe, GST_STATE_PLAYING), fail_unless_equals_int (gst_element_set_state (pipe, GST_STATE_PLAYING),

View file

@ -53,7 +53,7 @@ setup_fakesrc (void)
GST_DEBUG ("setup_fakesrc"); GST_DEBUG ("setup_fakesrc");
fakesrc = gst_check_setup_element ("fakesrc"); fakesrc = gst_check_setup_element ("fakesrc");
mysinkpad = gst_check_setup_sink_pad (fakesrc, &sinktemplate, NULL); mysinkpad = gst_check_setup_sink_pad (fakesrc, &sinktemplate);
gst_pad_set_event_function (mysinkpad, event_func); gst_pad_set_event_function (mysinkpad, event_func);
gst_pad_set_active (mysinkpad, TRUE); gst_pad_set_active (mysinkpad, TRUE);
have_eos = FALSE; have_eos = FALSE;

View file

@ -56,7 +56,7 @@ setup_fdsrc (void)
GST_DEBUG ("setup_fdsrc"); GST_DEBUG ("setup_fdsrc");
fdsrc = gst_check_setup_element ("fdsrc"); fdsrc = gst_check_setup_element ("fdsrc");
mysinkpad = gst_check_setup_sink_pad (fdsrc, &sinktemplate, NULL); mysinkpad = gst_check_setup_sink_pad (fdsrc, &sinktemplate);
gst_pad_set_event_function (mysinkpad, event_func); gst_pad_set_event_function (mysinkpad, event_func);
gst_pad_set_active (mysinkpad, TRUE); gst_pad_set_active (mysinkpad, TRUE);
return fdsrc; return fdsrc;

View file

@ -48,7 +48,7 @@ setup_filesink (void)
GST_DEBUG ("setup_filesink"); GST_DEBUG ("setup_filesink");
filesink = gst_check_setup_element ("filesink"); filesink = gst_check_setup_element ("filesink");
mysrcpad = gst_check_setup_src_pad (filesink, &srctemplate, NULL); mysrcpad = gst_check_setup_src_pad (filesink, &srctemplate);
gst_pad_set_active (mysrcpad, TRUE); gst_pad_set_active (mysrcpad, TRUE);
return filesink; return filesink;
} }

View file

@ -73,7 +73,7 @@ setup_filesrc (void)
GST_DEBUG ("setup_filesrc"); GST_DEBUG ("setup_filesrc");
filesrc = gst_check_setup_element ("filesrc"); filesrc = gst_check_setup_element ("filesrc");
mysinkpad = gst_check_setup_sink_pad (filesrc, &sinktemplate, NULL); mysinkpad = gst_check_setup_sink_pad (filesrc, &sinktemplate);
gst_pad_set_event_function (mysinkpad, event_func); gst_pad_set_event_function (mysinkpad, event_func);
gst_pad_set_active (mysinkpad, TRUE); gst_pad_set_active (mysinkpad, TRUE);

View file

@ -62,8 +62,8 @@ setup_identity (void)
GST_DEBUG ("setup_identity"); GST_DEBUG ("setup_identity");
identity = gst_check_setup_element ("identity"); identity = gst_check_setup_element ("identity");
mysrcpad = gst_check_setup_src_pad (identity, &srctemplate, NULL); mysrcpad = gst_check_setup_src_pad (identity, &srctemplate);
mysinkpad = gst_check_setup_sink_pad (identity, &sinktemplate, NULL); mysinkpad = gst_check_setup_sink_pad (identity, &sinktemplate);
gst_pad_set_event_function (mysinkpad, event_func); gst_pad_set_event_function (mysinkpad, event_func);
gst_pad_set_active (mysrcpad, TRUE); gst_pad_set_active (mysrcpad, TRUE);
gst_pad_set_active (mysinkpad, TRUE); gst_pad_set_active (mysinkpad, TRUE);

View file

@ -97,7 +97,7 @@ setup (void)
queue = gst_check_setup_element ("queue"); queue = gst_check_setup_element ("queue");
g_signal_connect (queue, "underrun", G_CALLBACK (queue_underrun), NULL); g_signal_connect (queue, "underrun", G_CALLBACK (queue_underrun), NULL);
mysrcpad = gst_check_setup_src_pad (queue, &srctemplate, NULL); mysrcpad = gst_check_setup_src_pad (queue, &srctemplate);
gst_pad_set_active (mysrcpad, TRUE); gst_pad_set_active (mysrcpad, TRUE);
mysinkpad = NULL; mysinkpad = NULL;
@ -167,7 +167,7 @@ GST_START_TEST (test_non_leaky_underrun)
{ {
g_signal_connect (queue, "overrun", G_CALLBACK (queue_overrun), NULL); g_signal_connect (queue, "overrun", G_CALLBACK (queue_overrun), NULL);
g_object_set (G_OBJECT (queue), "max-size-buffers", 2, NULL); g_object_set (G_OBJECT (queue), "max-size-buffers", 2, NULL);
mysinkpad = gst_check_setup_sink_pad (queue, &sinktemplate, NULL); mysinkpad = gst_check_setup_sink_pad (queue, &sinktemplate);
gst_pad_set_active (mysinkpad, TRUE); gst_pad_set_active (mysinkpad, TRUE);
GST_DEBUG ("starting"); GST_DEBUG ("starting");

View file

@ -241,7 +241,7 @@ run_output_selector_buffer_count (gint num_output_pads,
gint i = 0; gint i = 0;
GList *output_pads = NULL, *input_pads = NULL; GList *output_pads = NULL, *input_pads = NULL;
GstElement *sel = gst_check_setup_element ("output-selector"); GstElement *sel = gst_check_setup_element ("output-selector");
GstPad *input_pad = gst_check_setup_src_pad (sel, &srctemplate, NULL); GstPad *input_pad = gst_check_setup_src_pad (sel, &srctemplate);
input_pads = g_list_append (input_pads, input_pad); input_pads = g_list_append (input_pads, input_pad);
gst_pad_set_active (input_pad, TRUE); gst_pad_set_active (input_pad, TRUE);
@ -308,7 +308,7 @@ run_input_selector_buffer_count (gint num_input_pads,
gint i = 0, probe_id = 0; gint i = 0, probe_id = 0;
GList *input_pads = NULL, *output_pads = NULL; GList *input_pads = NULL, *output_pads = NULL;
GstElement *sel = gst_check_setup_element ("input-selector"); GstElement *sel = gst_check_setup_element ("input-selector");
GstPad *output_pad = gst_check_setup_sink_pad (sel, &sinktemplate, NULL); GstPad *output_pad = gst_check_setup_sink_pad (sel, &sinktemplate);
output_pads = g_list_append (output_pads, output_pad); output_pads = g_list_append (output_pads, output_pad);
gst_pad_set_active (output_pad, TRUE); gst_pad_set_active (output_pad, TRUE);
@ -434,7 +434,7 @@ static void
setup_output_selector (void) setup_output_selector (void)
{ {
sel = gst_check_setup_element ("output-selector"); sel = gst_check_setup_element ("output-selector");
input_pad = gst_check_setup_src_pad (sel, &srctemplate, NULL); input_pad = gst_check_setup_src_pad (sel, &srctemplate);
gst_pad_set_active (input_pad, TRUE); gst_pad_set_active (input_pad, TRUE);
output_pads = g_list_append (output_pads, setup_output_pad (sel, output_pads = g_list_append (output_pads, setup_output_pad (sel,