test-utils: add a create_and_monitor element function.

This commit is contained in:
Mathieu Duponchelle 2014-10-02 02:34:26 +02:00 committed by Mathieu Duponchelle
parent f001777cc6
commit d747e1cd05
2 changed files with 18 additions and 0 deletions

View file

@ -196,3 +196,20 @@ fake_demuxer_new (void)
{
return GST_ELEMENT (g_object_new (FAKE_DEMUXER_TYPE, NULL));
}
GstElement * create_and_monitor_element (const gchar *factoryname, const gchar *name,
GstValidateRunner *runner)
{
GstElement *element;
GstValidateMonitor *monitor;
element = gst_element_factory_make (factoryname, name);
if (runner) {
monitor =
gst_validate_monitor_factory_create (GST_OBJECT (element), runner, NULL);
gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (monitor));
fail_unless (GST_IS_VALIDATE_ELEMENT_MONITOR (monitor));
}
return element;
}

View file

@ -31,6 +31,7 @@ void check_destroyed (gpointer object_to_unref, gpointer first_object, ...) G_GN
GstValidateRunner * setup_runner (GstObject * object);
void clean_bus (GstElement *element);
GstValidatePadMonitor * get_pad_monitor (GstPad *pad);
GstElement * create_and_monitor_element (const gchar *factoryname, const gchar *name, GstValidateRunner *runner);
typedef struct {
GstElement parent;