@@ -33,6 +33,27 @@ Results::Result testRequestBalance(std::shared_ptr<Camera> camera,
std::to_string(startCycles) + " start cycles" };
}
+Results::Result testMultipleConfigures(std::shared_ptr<Camera> camera,
+ StreamRole role, unsigned int numRequests)
+{
+ const std::vector<StreamRole> roles = { Raw, StillCapture, VideoRecording, Viewfinder };
+ Results::Result ret;
+
+ SimpleCaptureBalanced capture(camera);
+
+ for (auto r: roles) {
+ ret = capture.configure(r);
+ if (ret.first == Results::Fail)
+ return ret;
+ }
+
+ ret = capture.configure(role);
+ if (ret.first != Results::Pass)
+ return ret;
+
+ return capture.capture(numRequests);
+}
+
Results::Result testRequestUnbalance(std::shared_ptr<Camera> camera,
StreamRole role, unsigned int numRequests)
{
@@ -55,7 +76,7 @@ Results testSingleStream(std::shared_ptr<Camera> camera)
};
static const std::vector<unsigned int> numRequests = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };
- Results results(numRequests.size() * roles.size() * 3);
+ Results results(numRequests.size() * roles.size() * 3 + roles.size());
for (const auto &role : roles) {
std::cout << "= Test role " << role.first << std::endl;
@@ -91,6 +112,16 @@ Results testSingleStream(std::shared_ptr<Camera> camera)
std::cout << "* Test unbalanced stop" << std::endl;
for (unsigned int num : numRequests)
results.add(testRequestUnbalance(camera, role.second, num));
+
+ /*
+ * Test multiple configure()
+ *
+ * Makes sure that the camera supports being configured multiple
+ * times, with only the last one taking effect, before starting
+ * to capture.
+ */
+ std::cout << "* Test multiple configure()" << std::endl;
+ results.add(testMultipleConfigures(camera, role.second, numRequests.back()));
}
return results;