5 assert_feature_names (gchar * names, GType feature_type, gboolean spook)
7 GstPluginFeature *feature = NULL;
12 split = g_strsplit (names, ",", 0);
14 for (i = 0; split[i]; i++) {
15 feature = gst_registry_find_feature (gst_registry_get (),
16 split[i], feature_type);
18 g_assert_null (feature);
20 g_assert_nonnull (feature);
22 gst_object_unref (feature);
29 main (int argc, char *argv[])
33 gchar *elements, *typefinds, *deviceproviders, *dynamictypes;
34 gchar *spook_elements, *spook_typefinds, *spook_deviceproviders,
37 elements = typefinds = deviceproviders = dynamictypes = NULL;
38 spook_elements = spook_typefinds = spook_deviceproviders =
39 spook_dynamictypes = NULL;
41 GOptionEntry options[] = {
42 {"elements", 'e', 0, G_OPTION_ARG_STRING, &elements,
43 "Element(s) which should be available. Specify multiple ones using ',' as separator",
45 {"spook-elements", 'E', 0, G_OPTION_ARG_STRING, &spook_elements,
46 "Element(s) which should NOT be available. Specify multiple ones using ',' as separator",
48 {"typefinds", 't', 0, G_OPTION_ARG_STRING, &typefinds,
49 "Typefind(s) which should be available. Specify multiple ones using ',' as separator",
51 {"spook-typefinds", 'T', 0, G_OPTION_ARG_STRING, &spook_typefinds,
52 "Typefind(s) which should NOT be available. Specify multiple ones using ',' as separator",
54 {"deviceproviders", 'd', 0, G_OPTION_ARG_STRING, &deviceproviders,
55 "Deviceprovider(s) which should be available. Specify multiple ones using ',' as separator",
57 {"spook-deviceproviders", 'D', 0, G_OPTION_ARG_STRING,
58 &spook_deviceproviders,
59 "Deviceprovider(s) which should NOT be available. Specify multiple ones using ',' as separator",
61 {"dynamictypes", 'l', 0, G_OPTION_ARG_STRING, &dynamictypes,
62 "Dynamictype(s) which should be available. Specify multiple ones using ',' as separator",
64 {"spook-dynamictypes", 'L', 0, G_OPTION_ARG_STRING, &spook_dynamictypes,
65 "Dynamictype(s) which should NOT be available. Specify multiple ones using ',' as separator",
69 ctx = g_option_context_new ("elements ...");
70 g_option_context_add_main_entries (ctx, options, NULL);
71 g_option_context_add_group (ctx, gst_init_get_option_group ());
72 if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
73 g_print ("Error initializing: %s\n", GST_STR_NULL (err->message));
75 g_option_context_free (ctx);
78 g_option_context_free (ctx);
80 gst_init (&argc, &argv);
82 /* Test that elements are instanciable. */
83 assert_feature_names (elements, GST_TYPE_ELEMENT_FACTORY, FALSE);
84 /* Test that elements are NOT instanciable. */
85 assert_feature_names (spook_elements, GST_TYPE_ELEMENT_FACTORY, TRUE);
87 /* Test that typefinds are instanciable. */
88 assert_feature_names (typefinds, GST_TYPE_TYPE_FIND_FACTORY, FALSE);
89 /* Test that typefinds are NOT instanciable. */
90 assert_feature_names (spook_typefinds, GST_TYPE_TYPE_FIND_FACTORY, TRUE);
92 /* Test that device providers are instanciable. */
93 assert_feature_names (deviceproviders, GST_TYPE_DEVICE_PROVIDER_FACTORY,
95 /* Test that device providers are NOT instanciable. */
96 assert_feature_names (spook_deviceproviders, GST_TYPE_DEVICE_PROVIDER_FACTORY,
99 /* Test that dynamic types are instanciable. */
100 assert_feature_names (dynamictypes, GST_TYPE_DYNAMIC_TYPE_FACTORY, FALSE);
101 /* Test that dynamic types are NOT instanciable. */
102 assert_feature_names (spook_dynamictypes, GST_TYPE_DYNAMIC_TYPE_FACTORY,