Age | Commit message (Collapse) | Author |
|
The PipelineHandlerFactory::create() function has no need to modify the
factory instance. Make it const, as well as the createInstance()
function.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The REGISTER_CAMERA_SENSOR_HELPER() macro defines a class type that
inherits from the CameraSensorHelperFactory class, and implements a
constructor and createInstance() function. Replace the code generation
through macro with the C++ equivalent, a class template, as done by the
Algorithm factory.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Avoid naked pointer with memory allocation by returning a unique_ptr
from CameraSensorHelperFactory::createInstance(), in order to increase
memory allocation safety.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The CameraSensorHelperFactory registerType() and createInstance()
functions are called by the CameraSensorHelperFactory class only. Make
them private.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The CameraSensorHelperFactory::createInstance() function has no need to
modify the factory instance. Make it const.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The CameraManager::get() function takes a string containing the ID of
the requested camera. This is correctly documented and implemented in
the .cpp file, but the header file names the parameter 'name' instead of
'id'. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
|
|
Tests are listed in meson.build using arrays that contain the test name
and source files at fixed positions. This isn't very readable, leading
to code using test[0], test[1] and test[2]. Replace the arrays with
dictionaries to improve readability.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
|
|
The 't' name is very short and not very explicit. Rename it to 'test'
instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
|
|
The IPAFrameContext documentation has a spurious Doxygen \struct
statement that is not needed, and uses a \struct instead of a \var in
another location. Fix both issues. This doesn't cause any change in the
generated documentation.
Note that the Doxygen output for IPAFrameContext is incorrect,
documentation is missing for all members. This is caused by using "."
instead of "::" in our documentation, which we currently do because the
correct syntax produces Doxygen warnings (and still incorrect output).
See https://github.com/doxygen/doxygen/issues/9343.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Commit 036d26d6677e ("test: threads: Test thread cleanup upon abnormal
termination") added calls to functions provided by the pthread library
in the threads test, but didn't add the corresponding dependency. This
caused a link breakage on some platforms:
/usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.4'
/usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Fix it by adding the missing dependency.
Fixes: 036d26d6677e ("test: threads: Test thread cleanup upon abnormal termination")
Reported-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Add BayerFormat conversions for formats::R12 (12-bit unpacked) format.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The "R" pixel formats (R8, R10, R10_CSI2P etc.) record the associated
colour space as being YUV rather than RAW, meaning that the code was
not detecting them as being raw formats.
In the case of Raspberry Pi, we deal only with raw formats, so the
revised test must work correctly for both these and the standard Bayer
formats.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Limit the minimum allowable exposure time to a single line in the IMX2
ret = serializer.serialize(infoMap, buffer);
if (ret < 0) {
cerr << "Failed to serialize ControlInfoMap" << endl;
return TestFail;
}
if (buffer.overflow()) {
cerr << "Overflow when serializing ControlInfoMap" << endl;
return TestFail;
}
/* Serialize the control list, this should now succeed. */
size = serializer.binarySize(list);
listData.resize(size);
buffer = ByteStreamBuffer(listData.data(), listData.size());
ret = serializer.serialize(list, buffer);
if (ret) {
cerr << "Failed to serialize ControlList" << endl;
return TestFail;
}
if (buffer.overflow()) {
cerr << "Overflow when serializing ControlList" << endl;
return TestFail;
}
/*
* Deserialize the control list, this should fail as the control
* info map hasn't been deserialized.
*/
buffer = ByteStreamBuffer(const_cast<const uint8_t *>(listData.data()),
listData.size());
ControlList newList = deserializer.deserialize<ControlList>(buffer);
if (!newList.empty()) {
cerr << "List deserialization without info map should have failed"
<< endl;
return TestFail;
}
if (buffer.overflow()) {
cerr << "Failed list deserialization modified the buffer"
<< endl;
return TestFail;
}
/* Deserialize the control info map and verify the contents. */
buffer = ByteStreamBuffer(const_cast<const uint8_t *>(infoData.data()),
infoData.size());
ControlInfoMap newInfoMap = deserializer.deserialize<ControlInfoMap>(buffer);
if (newInfoMap.empty()) {
cerr << "Failed to deserialize ControlInfoMap" << endl;
return TestFail;
}
if (buffer.overflow()) {
cerr << "Overflow when deserializing ControlInfoMap" << endl;
return TestFail;
}
if (!equals(infoMap, newInfoMap)) {
cerr << "Deserialized map doesn't match original" << endl;
return TestFail;
}
/* Make sure control limits looked up by id are not changed. */
const ControlInfo &newLimits = newInfoMap.at(&controls::Brightness);
const ControlInfo &initialLimits = infoMap.at(&controls::Brightness);
if (newLimits.min() != initialLimits.min() ||
newLimits.max() != initialLimits.max()) {
cerr << "The brightness control limits have changed" << endl;
return TestFail;
}
/* Deserialize the control list and verify the contents. */
buffer = ByteStreamBuffer(const_cast<const uint8_t *>(listData.data()),
listData.size());
newList = deserializer.deserialize<ControlList>(buffer);
if (newList.empty()) {
cerr << "Failed to deserialize ControlList" << endl;
return TestFail;
}
if (buffer.overflow()) {
cerr << "Overflow when deserializing ControlList" << endl;
return TestFail;
}
if (!equals(list, newList)) {
cerr << "Deserialized list doesn't match original" << endl;
return TestFail;
}
return TestPass;
}
};
TEST_REGISTER(ControlSerializationTest)
|