/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2022, Tomi Valkeinen */ #pragma once #include #include #include using namespace libcamera; class PyCameraManager { public: PyCameraManager(); ~PyCameraManager(); pybind11::list cameras(); std::shared_ptr get(const std::string &name) { return cameraManager_->get(name); } static const std::string &version() { return CameraManager::version(); } int eventFd() const { return eventFd_; } std::vector getReadyRequests(); void handleRequestCompleted(Request *req); private: std::unique_ptr cameraManager_; int eventFd_ = -1; std::mutex completedRequestsMutex_; std::vector completedRequests_; void writeFd(); void readFd(); void pushRequest(Request *req); std::vector getCompletedRequests(); };