libcamera: converter: Utilise shared MediaDevice pointers

With the upcoming addition of V4L2 requests support, the converters need
to keep a handle to the corresponding media device.

Prepare for that by changing the constructor parameter from a raw
pointer to a shared pointer.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
This commit is contained in:
Stefan Klug
2025-11-25 17:28:14 +01:00
parent 97227ebed3
commit 39c052c1e9
6 changed files with 14 additions and 12 deletions
+2 -2
View File
@@ -415,7 +415,7 @@ public:
V4L2VideoDevice *video(const MediaEntity *entity);
V4L2Subdevice *subdev(const MediaEntity *entity);
MediaDevice *converter() { return converter_.get(); }
std::shared_ptr<MediaDevice> converter() { return converter_; }
bool swIspEnabled() const { return swIspEnabled_; }
protected:
@@ -588,7 +588,7 @@ int SimpleCameraData::init()
int ret;
/* Open the converter, if any. */
MediaDevice *converter = pipe->converter();
std::shared_ptr<MediaDevice> converter = pipe->converter();
if (converter) {
converter_ = ConverterFactoryBase::create(converter);
if (!converter_) {