libcamera: v4l2_subdevice: Replace ImageFormats with a map

Replace the V4L2Subdevice usage of the ImageFormats class with a
std::map and the utils::map_keys() helper.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Niklas Söderlund
2020-07-23 16:31:41 +02:00
parent d9295552b1
commit dcda73ec14
5 changed files with 29 additions and 22 deletions
+2 -4
View File
@@ -16,13 +16,11 @@
#include "libcamera/internal/formats.h"
#include "libcamera/internal/log.h"
#include "libcamera/internal/v4l2_subdevice.h"
namespace libcamera {
class MediaEntity;
class V4L2Subdevice;
struct V4L2SubdeviceFormat;
struct CameraSensorInfo {
std::string model;
@@ -75,7 +73,7 @@ private:
std::string model_;
ImageFormats formats_;
V4L2Subdevice::Formats formats_;
Size resolution_;
std::vector<unsigned int> mbusCodes_;
std::vector<Size> sizes_;
+3 -1
View File
@@ -32,6 +32,8 @@ struct V4L2SubdeviceFormat {
class V4L2Subdevice : public V4L2Device
{
public:
using Formats = std::map<unsigned int, std::vector<SizeRange>>;
enum Whence {
ActiveFormat,
TryFormat,
@@ -51,7 +53,7 @@ public:
int setSelection(unsigned int pad, unsigned int target,
Rectangle *rect);
ImageFormats formats(unsigned int pad);
Formats formats(unsigned int pad);
int getFormat(unsigned int pad, V4L2SubdeviceFormat *format,
Whence whence = ActiveFormat);