test: gstreamer: Check availability of cameras before running
Move the logic for checking the availability of cameras from multi_stream_test to gstreamer test base class. Since single_stream_class always assumes that a camera is available on the system (which is not always the case for e.g. RPi in CI/CD environments) it makes sense to have the availability check in the base class. If no cameras are available, the behaviour should be to skip instead of a failure. We currently have 2 tests for gstreamer differing based on number of streams supported by the camera. Hence, the camera availability is checked in conjunction with the number of the streams required by the derived class. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
1b80d9e997
commit
5646849b59
3 changed files with 37 additions and 21 deletions
|
@ -29,7 +29,7 @@ class GstreamerMultiStreamTest : public GstreamerTest, public Test
|
|||
{
|
||||
public:
|
||||
GstreamerMultiStreamTest()
|
||||
: GstreamerTest()
|
||||
: GstreamerTest(2)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -39,24 +39,6 @@ protected:
|
|||
if (status_ != TestPass)
|
||||
return status_;
|
||||
|
||||
/* Check if platform supports multistream capture */
|
||||
libcamera::CameraManager cm;
|
||||
cm.start();
|
||||
bool cameraFound = false;
|
||||
for (auto &camera : cm.cameras()) {
|
||||
if (camera->streams().size() > 1) {
|
||||
cameraName_ = camera->id();
|
||||
cameraFound = true;
|
||||
cm.stop();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cameraFound) {
|
||||
cm.stop();
|
||||
return TestSkip;
|
||||
}
|
||||
|
||||
const gchar *streamDescription = "queue ! fakesink";
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue