mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
libcamera: v4l2_device: Construct from MediaEntity*
The V4L2Device constructor wants a "const MediaEntity &", while entities are usually retrieved by pointer before being used to construct a V4L2Device. Change the constructor argument to "const MediaEntity *". Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
dd45866ea4
commit
f7e75d9e70
5 changed files with 6 additions and 6 deletions
|
@ -72,7 +72,7 @@ class V4L2Device
|
|||
{
|
||||
public:
|
||||
explicit V4L2Device(const std::string &deviceNode);
|
||||
explicit V4L2Device(const MediaEntity &entity);
|
||||
explicit V4L2Device(const MediaEntity *entity);
|
||||
V4L2Device(const V4L2Device &) = delete;
|
||||
~V4L2Device();
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ V4L2Device *PipelineHandlerIPU3::createVideoDevice(unsigned int id)
|
|||
if (!cio2)
|
||||
return nullptr;
|
||||
|
||||
V4L2Device *dev = new V4L2Device(*cio2);
|
||||
V4L2Device *dev = new V4L2Device(cio2);
|
||||
if (dev->open()) {
|
||||
delete dev;
|
||||
return nullptr;
|
||||
|
|
|
@ -95,7 +95,7 @@ bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)
|
|||
|
||||
for (MediaEntity *entity : media_->entities()) {
|
||||
if (entity->flags() & MEDIA_ENT_FL_DEFAULT) {
|
||||
video_ = new V4L2Device(*entity);
|
||||
video_ = new V4L2Device(entity);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)
|
|||
|
||||
media_->acquire();
|
||||
|
||||
video_ = new V4L2Device(*media_->getEntityByName("Raw Capture 1"));
|
||||
video_ = new V4L2Device(media_->getEntityByName("Raw Capture 1"));
|
||||
|
||||
if (video_->open()) {
|
||||
media_->release();
|
||||
|
|
|
@ -169,8 +169,8 @@ V4L2Device::V4L2Device(const std::string &deviceNode)
|
|||
*
|
||||
* Construct a V4L2Device from a MediaEntity's device node path.
|
||||
*/
|
||||
V4L2Device::V4L2Device(const MediaEntity &entity)
|
||||
: V4L2Device(entity.deviceNode())
|
||||
V4L2Device::V4L2Device(const MediaEntity *entity)
|
||||
: V4L2Device(entity->deviceNode())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue