diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-10-07 22:39:19 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-10-13 20:37:44 +0300 |
commit | 764ff6fdf3145868d8b6f91c6a93072d7b86ecaf (patch) | |
tree | 0d2c7d31043ce62ef3569eb813dcec459160d22a /test/message.cpp | |
parent | abe2c1b55c788873ee1a24dc207cad82f931a48e (diff) |
libcamera: v4l2_device: Avoid copy of V4L2ControlInfo
The V4L2Device::listControls() method creates an instance of
V4L2ControlInfo and then inserts it in the device's list of controls.
The insertion uses std::map::emplace(), but passes the V4L2ControlInfo,
resulting in a copy being performed (using the copy constructor of
V4L2ControlInfo).
Optimise this by really constructing the V4L2ControlInfo in-place. The
use of std::piecewise_construct is required for gcc-5 that seems to have
trouble with std::map::emplace() on non-copyable values in this case.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'test/message.cpp')
0 files changed, 0 insertions, 0 deletions