test: gstreamer: Use env instead of registry edit
Instead of editing the registry, use gst_env variable provided by the plugin and already used as part of the devenv shell. This reduces the complexity of the C++ test code. Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
ebc396fc7a
commit
484c86ac65
2 changed files with 1 additions and 18 deletions
|
@ -51,23 +51,6 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Remove the system libcamera plugin, if any, and add the plugin from
|
|
||||||
* the build directory.
|
|
||||||
*/
|
|
||||||
GstRegistry *registry = gst_registry_get();
|
|
||||||
g_autoptr(GstPlugin) plugin = gst_registry_lookup(registry, "libgstlibcamera.so");
|
|
||||||
if (plugin)
|
|
||||||
gst_registry_remove_plugin(registry, plugin);
|
|
||||||
|
|
||||||
std::string path = libcamera::utils::libcameraBuildPath() + "src/gstreamer";
|
|
||||||
if (!gst_registry_scan_path(registry, path.c_str())) {
|
|
||||||
g_printerr("Failed to add plugin to registry\n");
|
|
||||||
|
|
||||||
status_ = TestFail;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Atleast one camera should be available with numStreams streams,
|
* Atleast one camera should be available with numStreams streams,
|
||||||
* otherwise skip the test entirely.
|
* otherwise skip the test entirely.
|
||||||
|
|
|
@ -17,5 +17,5 @@ foreach test : gstreamer_tests
|
||||||
link_with : test_libraries,
|
link_with : test_libraries,
|
||||||
include_directories : test_includes_internal)
|
include_directories : test_includes_internal)
|
||||||
|
|
||||||
test(test['name'], exe, suite : 'gstreamer', is_parallel : false)
|
test(test['name'], exe, suite : 'gstreamer', is_parallel : false, env : gst_env)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue