libcamera: V4L2Control: remove V4L2Control classes

V4L2ControlId and V4L2ControlInfo are just convenience classes to
create ControlId and ControlInfo from v4l2_query_ext_control.
Therefore, there is no need of being a class. It is used only
from V4L2Device. This removes the classes and put the equivalent
functions of creating ControlId and ControlInfo in
v4l2_device.cpp.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Hirokazu Honda
2021-05-10 14:42:42 +09:00
committed by Laurent Pinchart
parent afb503fa34
commit a5f8ab82df
6 changed files with 72 additions and 190 deletions
-1
View File
@@ -43,7 +43,6 @@ libcamera_internal_headers = files([
'thread.h',
'timer.h',
'utils.h',
'v4l2_controls.h',
'v4l2_device.h',
'v4l2_pixelformat.h',
'v4l2_subdevice.h',
@@ -1,31 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* v4l2_controls.h - V4L2 Controls Support
*/
#ifndef __LIBCAMERA_INTERNAL_V4L2_CONTROLS_H__
#define __LIBCAMERA_INTERNAL_V4L2_CONTROLS_H__
#include <linux/videodev2.h>
#include <libcamera/controls.h>
namespace libcamera {
class V4L2ControlId : public ControlId
{
public:
V4L2ControlId(const struct v4l2_query_ext_ctrl &ctrl);
};
class V4L2ControlInfo : public ControlInfo
{
public:
V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl);
};
} /* namespace libcamera */
#endif /* __LIBCAMERA_INTERNAL_V4L2_CONTROLS_H__ */
+2 -2
View File
@@ -13,11 +13,11 @@
#include <linux/videodev2.h>
#include <libcamera/controls.h>
#include <libcamera/signal.h>
#include <libcamera/span.h>
#include "libcamera/internal/log.h"
#include "libcamera/internal/v4l2_controls.h"
namespace libcamera {
@@ -63,7 +63,7 @@ private:
void eventAvailable(EventNotifier *notifier);
std::map<unsigned int, struct v4l2_query_ext_ctrl> controlInfo_;
std::vector<std::unique_ptr<V4L2ControlId>> controlIds_;
std::vector<std::unique_ptr<ControlId>> controlIds_;
ControlInfoMap controls_;
std::string deviceNode_;
int fd_;