Age | Commit message (Collapse) | Author |
|
Add tests of the ControlList infrastructure and public API.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Provide an initial test coverage for the ControlInfo class.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Add initial basic testing for the new ControlValue class.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Test that the IPC supports sending data and file descriptors over the
IPC medium. To be able to execute the test two parts are needed, one
to drive the test and act as the libcamera (master) and a one to act as
the IPA (slave).
The master drives the testing posting requests to the slave to process
and sometimes respond to. A few different tests are performed.
- Master sends an array to the slave which responds with a reversed copy
of the array. The master verifies that a reversed array is returned.
- Master tries to send an empty message making sure that the send call
fails.
- Master sends a list of file descriptors and ask the slave to calculate
and respond with the sum of the size of the files. The master verifies
that the calculated size is correct.
- Master sends a pre-computed size and a list of file descriptors and
asks the slave to verify that the pre-computed size matches the sum of
the size of the file descriptors.
- Master sends two file descriptors and asks the slave to join the file
contents in a new file and respond with its file descriptor. The
master then verifies that the content of the returned file descriptor
matches the order of the original two files.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Timers should be automatically stopped and unregistered when deleted.
Add a test to verify this is the case.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
In preparation of creating a new V4L2Device base class, rename
V4L2Device to V4L2VideoDevice.
This is a project wide rename without any intended functional change.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Test that both discrete and range based stream format descriptions
result in good discrete frame sizes. The range based stream formats
needs to be fitted with a table of resolutions inside libcamera so if
that table is updated this test might need to be updated.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Replace all usage of FormatEnum with ImageFormats and completely
remove FormatEnum which is no longer needed.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Upstream commit 2978a505aaa981b2 ("media: vimc: stream: fix thread state
before sleep") changes the frame rate when capturing from the vimc raw
capture video nodes. The commit changes the frame rate from thousands of
frames per second to to roughly fifty.
The libcamera capture test was written with the assumption that vimc
would keep providing this fast frame rate and ran for a very short time
to decrease the overall run time of tests. This is no longer possible
and the test fails as it can't capture enough frames in its runtime,
increase the runtime to match the new vimc frame rate.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Three tests {capture,configuration_set,statemachine} override the
CameraTest::init() function, and call it as the first action.
However they were not checking the return value, and each of the tests
will segfault if the VIMC camera is not obtained.
Check the return value of the CameraTest base class initialisation and
return any errors to the test suite if initialisation fails.
R
const OptionValue &operator[](const T &opt) const;
void invalidate();
private:
friend class KeyValueParser;
friend class OptionsParser;
bool parseValue(const T &opt, const Option &option, const char *value);
std::map<T, OptionValue> values_;
bool valid_;
};
class KeyValueParser
{
public:
class Options : public OptionsBase<std::string>
{
};
KeyValueParser();
virtual ~KeyValueParser();
bool addOption(const char *name, OptionType type, const char *help,
OptionArgument argument = ArgumentNone);
virtual Options parse(const char *arguments);
private:
KeyValueParser(const KeyValueParser &) = delete;
KeyValueParser &operator=(const KeyValueParser &) = delete;
friend class OptionsParser;
unsigned int maxOptionLength() const;
void usage(int indent);
std::map<std::string, Option> optionsMap_;
};
class OptionsParser
{
public:
class Options : public OptionsBase<int>
{
};
OptionsParser();
~OptionsParser();
bool addOption(int opt, OptionType type, const char *help,
const char *name = nullptr,
OptionArgument argument = ArgumentNone,
const char *argumentName = nullptr, bool array = false,
int parent = 0);
bool addOption(int opt, KeyValueParser *parser, const char *help,
const char *name = nullptr, bool array = false,
int parent = 0);
Options parse(int argc, char *argv[]);
void usage();
private:
OptionsParser(const OptionsParser &) = delete;
OptionsParser &operator=(const OptionsParser &) = delete;
void usageOptions(const std::list<Option> &options, unsigned int indent);
std::tuple<OptionsParser::Options *, const Option *>
childOption(const Option *parent, Options *options);
bool parseValue(const Option &option, const char *arg, Options *options);
std::list<Option> options_;
std::map<unsigned int, Option *> optionsMap_;
};
class OptionValue
{
public:
enum ValueType {
ValueNone,
ValueInteger,
ValueString,
ValueKeyValue,
ValueArray,
};
OptionValue();
OptionValue(int value);
OptionValue(const char *value);
OptionValue(const std::string &value);
OptionValue(const KeyValueParser::Options &value);
void addValue(const OptionValue &value);
ValueType type() const { return type_; }
bool empty() const { return type_ == ValueType::ValueNone; }
operator int() const;
operator std::string() const;
int toInteger() const;
std::string toString() const;
const KeyValueParser::Options &toKeyValues() const;
const std::vector<OptionValue> &toArray() const;
const OptionsParser::Options &children() const;
private:
ValueType type_;
int integer_;
std::string string_;
KeyValueParser::Options keyValues_;
std::vector<OptionValue> array_;
OptionsParser::Options children_;
};
#endif /* __CAM_OPTIONS_H__ */
|