diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2024-10-01 02:09:06 +0900 |
---|---|---|
committer | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2024-10-02 08:00:40 +0200 |
commit | 18f72aa4e662b831fc2137b3affddd247f0b878e (patch) | |
tree | e878344629f516d4ee11941361946924ec5b6699 /include | |
parent | 3088e14e814eb3bb25103de8f5402ef6b0211689 (diff) |
pipeline: Add support for dumping capture script and metadata
Add support for dumping capture scripts and metadata. The capture
scripts can then be fed into the cam application and a capture can thus
be "replayed". Metadata can also be dumped.
Camera configuration is also dumped to the capture script. The cam
application currently does not support loading configuration from the
capture script, but support for that will be added in a subsequent
patch.
These can be enabled by a new environment variable.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/internal/camera.h | 3 | ||||
-rw-r--r-- | include/libcamera/internal/pipeline_handler.h | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h index 0add0428..a42f03d4 100644 --- a/include/libcamera/internal/camera.h +++ b/include/libcamera/internal/camera.h @@ -19,6 +19,8 @@ namespace libcamera { +enum class Orientation; + class CameraControlValidator; class PipelineHandler; class Stream; @@ -65,6 +67,7 @@ private: std::string id_; std::set<Stream *> streams_; std::set<const Stream *> activeStreams_; + Orientation orientation_; bool disconnected_; std::atomic<State> state_; diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index 0d380803..fb391418 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -9,6 +9,7 @@ #include <memory> #include <queue> +#include <set> #include <string> #include <sys/types.h> #include <vector> @@ -20,6 +21,8 @@ namespace libcamera { +enum class Orientation; + class Camera; class CameraConfiguration; class CameraManager; @@ -68,6 +71,9 @@ public: CameraManager *cameraManager() const { return manager_; } + void dumpConfiguration(const std::set<const Stream *> &streams, + const Orientation &orientation); + protected: void registerCamera(std::shared_ptr<Camera> camera); void hotplugMediaDevice(MediaDevice *media); @@ -81,6 +87,11 @@ protected: CameraManager *manager_; private: + enum DumpMode { + Controls, + Metadata, + }; + void unlockMediaDevices(); void mediaDeviceDisconnected(MediaDevice *media); @@ -89,6 +100,8 @@ private: void doQueueRequest(Request *request); void doQueueRequests(); + void dumpRequest(Request *request, DumpMode mode); + std::vector<std::shared_ptr<MediaDevice>> mediaDevices_; std::vector<std::weak_ptr<Camera>> cameras_; @@ -97,6 +110,9 @@ private: const char *name_; unsigned int useCount_; + std::ostream *dumpCaptureScript_; + std::ostream *dumpMetadata_; + friend class PipelineHandlerFactoryBase; }; |