diff options
author | Umang Jain <umang.jain@ideasonboard.com> | 2024-09-26 15:06:20 +0530 |
---|---|---|
committer | Umang Jain <umang.jain@ideasonboard.com> | 2024-10-24 14:04:31 +0530 |
commit | 7fad22efae4e89374d1767642cdd0bb4d683df1f (patch) | |
tree | ddb51ae296679d2e6175abb81ea96242705944d6 /src | |
parent | 994588fb75838b46d5eb74b916d66f0b9fc49421 (diff) |
libcamera: converter: Add interface for feature flags
This patch intends to extend the converter interface to have feature
flags, which enables each converter to expose the set of features
it supports.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/converter.cpp | 27 | ||||
-rw-r--r-- | src/libcamera/converter/converter_v4l2_m2m.cpp | 4 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp index 8237998f..d7bb7273 100644 --- a/src/libcamera/converter.cpp +++ b/src/libcamera/converter.cpp @@ -35,13 +35,26 @@ LOG_DEFINE_CATEGORY(Converter) */ /** + * \enum Converter::Feature + * \brief Specify the features supported by the converter + * \var Converter::Feature::None + * \brief No extra features supported by the converter + */ + +/** + * \typedef Converter::Features + * \brief A bitwise combination of features supported by the converter + */ + +/** * \brief Construct a Converter instance * \param[in] media The media device implementing the converter + * \param[in] features Features flags representing supported features * * This searches for the entity implementing the data streaming function in the * media graph entities and use its device node as the converter device node. */ -Converter::Converter(MediaDevice *media) +Converter::Converter(MediaDevice *media, Features features) { const std::vector<MediaEntity *> &entities = media->entities(); auto it = std::find_if(entities.begin(), entities.end(), @@ -56,6 +69,7 @@ Converter::Converter(MediaDevice *media) } deviceNode_ = (*it)->deviceNode(); + features_ = features; } Converter::~Converter() @@ -158,12 +172,23 @@ Converter::~Converter() */ /** + * \var Converter::features_ + * \brief Stores the features supported by the converter + */ + +/** * \fn Converter::deviceNode() * \brief The converter device node attribute accessor * \return The converter device node string */ /** + * \fn Converter::features() + * \brief Retrieve the features supported by the converter + * \return The converter Features flags + */ + +/** * \class ConverterFactoryBase * \brief Base class for converter factories * diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp index e4f656da..4f3e8ce4 100644 --- a/src/libcamera/converter/converter_v4l2_m2m.cpp +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp @@ -446,6 +446,10 @@ int V4L2M2MConverter::queueBuffers(FrameBuffer *input, return 0; } +/* + * \todo: This should be extended to include Feature::Flag to denote + * what each converter supports feature-wise. + */ static std::initializer_list<std::string> compatibles = { "mtk-mdp", "pxp", |