summaryrefslogtreecommitdiff
path: root/src/cam
AgeCommit message (Expand)Author
2019-05-23libcamera: Refactor the camera configuration storage and APILaurent Pinchart
2019-05-23libcamera: Use stream roles directly instead of StreamUsageLaurent Pinchart
2019-05-23libcamera: camera: Rename configureStreams() and streamConfiguration()Laurent Pinchart
2019-04-30libcamera: Use the Size class through libcameraLaurent Pinchart
2019-04-26cam: options: Fix string concatenationLaurent Pinchart
2019-04-26cam: options: Don't initialise variable-length arraysLaurent Pinchart
2019-04-18Install the cam and qcam utilitiesLaurent Pinchart
2019-04-09cam: Allow cameras with more than one streamNiklas Söderlund
2019-04-09cam: Extend request completion handler to deal with multiple streamsNiklas Söderlund
2019-04-09cam: Add support to specify multiple stream configurations with rolesNiklas Söderlund
2019-04-09cam: Extend BufferWriter to include a stream name in file pathNiklas Söderlund
2019-04-09cam: Rename --format to --streamNiklas Söderlund
2019-04-09libcamera: Switch to CameraConfigurationNiklas Söderlund
2019-04-05libcamera: camera: Add support for stream usagesNiklas Söderlund
2019-04-04cam: Rework how streams configuration is preparedNiklas Söderlund
2019-03-27cam: Separate options valid() and empty()Laurent Pinchart
2019-03-27cam: options: Add support for repeatable optionsNiklas Söderlund
2019-03-27cam: options: Add an array data type to OptionValueNiklas Söderlund
2019-03-25cam: options: Create separate enum for OptionValue typesNiklas Söderlund
2019-03-01cam: Don't requeue requests when stopping streamLaurent Pinchart
2019-02-28libcamera: store stream pointers in sets instead of a vectorsNiklas Söderlund
2019-02-28cam: fix order camera is operated onNiklas Söderlund
2019-02-25cam: Improve when usage information is printedNiklas Söderlund
2019-02-25cam: fix printing of camera nameNiklas Söderlund
2019-02-25cam: improve error checking when capturingNiklas Söderlund
2019-02-25cam: free allocated buffers when done capturingNiklas Söderlund
2019-02-25cam: fix return type of configureStreams()Niklas Söderlund
2019-02-13cam: options: Fix coding style issue related to templatesLaurent Pinchart
2019-02-06cam: Add option to write raw frames to diskNiklas Söderlund
2019-02-06cam: Add BufferWriter helperNiklas Söderlund
2019-02-06cam: Add capture operationNiklas Söderlund
2019-02-01cam: options: Add explicit conversion methods to OptionValueLaurent Pinchart
2019-02-01cam: Add --format option to configure a streamNiklas Söderlund
2019-02-01cam: options: Add a key=value parserNiklas Söderlund
2019-02-01cam: options: Add option type handling to options parserLaurent Pinchart
2019-02-01cam: options: Store options in a list instead of a vectorLaurent Pinchart
2019-02-01cam: options: Return whether addOption() succeeds or notNiklas Söderlund
2019-02-01cam: options: Create a template class for optionsNiklas Söderlund
2019-02-01cam: options: Move struct OptionLaurent Pinchart
2019-02-01cam: options: Move enum OptionArgumentNiklas Söderlund
2019-01-27cam: options: Indent multi-line help message correctlyLaurent Pinchart
2019-01-25cam: options: optional arguments needs to be specified as --foo=barNiklas Söderlund
2019-01-25cam: Add event loopLaurent Pinchart
2019-01-22cam: options: Don't implement move semantics for OptionsParser::OptionsLaurent Pinchart
2019-01-22cam: Extract option parser to separate fileLaurent Pinchart
2019-01-22cam: add utility to control camerasNiklas Söderlund
is should fail as the control * info map hasn't been serialized. */ size = serializer.binarySize(list); listData.resize(size); ByteStreamBuffer buffer(listData.data(), listData.size()); ret = serializer.serialize(list, buffer); if (!ret) { cerr << "List serialization without info map should have failed" << endl; return TestFail; } if (buffer.overflow() || buffer.offset()) { cerr << "Failed list serialization modified the buffer" << endl; return TestFail; } /* Serialize the control info map. */ size = serializer.binarySize(infoMap); infoData.resize(size); buffer = ByteStreamBuffer(infoData.data(), infoData.size()); 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)