summaryrefslogtreecommitdiff
path: root/test/media_device/media_device_test.cpp
diff options
context:
space:
mode:
authorAnle Pan <anle.pan@nxp.com>2024-04-04 12:18:14 +0200
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-04-20 01:37:25 +0100
commitfb74bb7df66b96dbe28702155cddfc96a1b30f78 (patch)
treef4e3110919955797d0dc0a99b31d384e839f6128 /test/media_device/media_device_test.cpp
parent503c3a838ae5fa7fda755f80694b444019f8ac13 (diff)
android: camera_device: Always clear descriptors_ in stop()
When flush() is called and then a new stream configuration is set, the descriptors_ queue might have a chance to be not cleared in stop(), as the Camera is already in Stopped state. This will prevent further requests from being completed in sendCaptureResults() as the descriptors_ queue is not empty. To fix the issue, clear the descriptors_ even if the Camera State is Stopped. As a drawback the libcamera::Camera::stop() function might be called twice, but this is allowed by the Camera state machine, and the second call is guaranteed to be a nop. Signed-off-by: Anle Pan <anle.pan@nxp.com> Signed-off-by: Fang Hui <hui.fang@nxp.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/media_device/media_device_test.cpp')
0 files changed, 0 insertions, 0 deletions
using namespace std; using namespace libcamera; bool SerializationTest::equals(const ControlInfoMap &lhs, const ControlInfoMap &rhs) { std::map<unsigned int, ControlInfo> rlhs; std::transform(lhs.begin(), lhs.end(), std::inserter(rlhs, rlhs.end()), [](const ControlInfoMap::value_type &v) -> decltype(rlhs)::value_type { return { v.first->id(), v.second }; }); std::map<unsigned int, ControlInfo> rrhs; std::transform(rhs.begin(), rhs.end(), std::inserter(rrhs, rrhs.end()), [](const ControlInfoMap::value_type &v) -> decltype(rrhs)::value_type { return { v.first->id(), v.second }; }); if (rlhs == rrhs) return true; cerr << "lhs:" << endl; for (const auto &value : rlhs) cerr << "- " << value.first << ": " << value.second.toString() << endl; cerr << "rhs:" << endl; for (const auto &value : rrhs) cerr << "- " << value.first << ": " << value.second.toString() << endl; return false; } bool SerializationTest::equals(const ControlList &lhs, const ControlList &rhs) { std::map<unsigned int, ControlValue> rlhs;