Implement the camera configuration thru out the library, tests, cam and qcam tools. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
47 lines
929 B
C++
47 lines
929 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2019, Google Inc.
|
|
*
|
|
* libcamera Camera API tests
|
|
*/
|
|
|
|
#include <iostream>
|
|
|
|
#include "camera_test.h"
|
|
|
|
using namespace std;
|
|
|
|
namespace {
|
|
|
|
class ConfigurationDefault : public CameraTest
|
|
{
|
|
protected:
|
|
int run()
|
|
{
|
|
CameraConfiguration conf;
|
|
|
|
/* Test asking for configuration for a video stream. */
|
|
conf = camera_->streamConfiguration({ Stream::VideoRecording() });
|
|
if (!conf.isValid()) {
|
|
cout << "Default configuration invalid" << endl;
|
|
return TestFail;
|
|
}
|
|
|
|
/*
|
|
* Test that asking for configuration for an empty array of
|
|
* stream usages returns an empty list of configurations.
|
|
*/
|
|
conf = camera_->streamConfiguration({});
|
|
if (conf.isValid()) {
|
|
cout << "Failed to retrieve configuration for empty usage list"
|
|
<< endl;
|
|
return TestFail;
|
|
}
|
|
|
|
return TestPass;
|
|
}
|
|
};
|
|
|
|
} /* namespace */
|
|
|
|
TEST_REGISTER(ConfigurationDefault);
|