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:
@@ -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_) {
|
||||
|
||||
Reference in New Issue
Block a user