diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h index 04187a2a9..afea46240 100644 --- a/include/libcamera/internal/converter.h +++ b/include/libcamera/internal/converter.h @@ -56,6 +56,7 @@ public: virtual int configure(const StreamConfiguration &inputCfg, const std::vector> &outputCfgs) = 0; + virtual bool isConfigured(const Stream *stream) const = 0; virtual int exportBuffers(const Stream *stream, unsigned int count, std::vector> *buffers) = 0; diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h index 402a80395..1ccbfc7c2 100644 --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h @@ -50,6 +50,7 @@ public: int configure(const StreamConfiguration &inputCfg, const std::vector> &outputCfg) override; + bool isConfigured(const Stream *stream) const override; int exportBuffers(const Stream *stream, unsigned int count, std::vector> *buffers) override; diff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp index 73c02fdcf..09ebf4f57 100644 --- a/src/libcamera/converter.cpp +++ b/src/libcamera/converter.cpp @@ -126,6 +126,13 @@ Converter::~Converter() * \return 0 on success or a negative error code otherwise */ +/** + * \fn Converter::isConfigured() + * \brief Check if a given stream is configured + * \param[in] stream The output stream + * \return True if the \a stream is configured or false otherwise + */ + /** * \fn Converter::exportBuffers() * \brief Export buffers from the converter device diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp index 342aa32da..83daca15b 100644 --- a/src/libcamera/converter/converter_v4l2_m2m.cpp +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp @@ -437,6 +437,14 @@ int V4L2M2MConverter::configure(const StreamConfiguration &inputCfg, return 0; } +/** + * \copydoc libcamera::Converter::isConfigured + */ +bool V4L2M2MConverter::isConfigured(const Stream *stream) const +{ + return streams_.find(stream) != streams_.end(); +} + /** * \copydoc libcamera::Converter::exportBuffers */