libcamera: pipeline: Utilise shared MediaDevice pointers
Adapt the PipelineHandler::acquireMediaDevice() support function to return a shared pointer instead of the underlying raw pointer. Propagate this update to all pipeline handlers that use the MediaDevice and store a std::shared_ptr<MediaDevice> accordingly. This is required to support media devices that are potentially shared among multiple pipeline handlers, like a dewarper implemented as v4l2 m2m device. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
This commit is contained in:
committed by
Stefan Klug
parent
4e720d5bae
commit
97227ebed3
@@ -52,7 +52,8 @@ int BufferSource::allocate(const StreamConfiguration &config)
|
||||
return TestSkip;
|
||||
}
|
||||
|
||||
std::unique_ptr<V4L2VideoDevice> video = V4L2VideoDevice::fromEntityName(media_.get(), videoDeviceName);
|
||||
std::unique_ptr<V4L2VideoDevice> video = V4L2VideoDevice::fromEntityName(media_.get(),
|
||||
videoDeviceName);
|
||||
if (!video) {
|
||||
std::cout << "Failed to get video device from entity "
|
||||
<< videoDeviceName << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user