libcamera: v4l2_device: Add enumeration of pixelformats and frame sizes

Add methods to enumerate pixelformats and frame sizes from a V4L2
device. The interface is similar to how V4L2Subdevice enumerates mbus
codes and frame sizes.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund
2019-06-19 11:54:30 +02:00
parent ce02ea29cd
commit 87e46f7f59
2 changed files with 119 additions and 0 deletions
+5
View File
@@ -16,6 +16,7 @@
#include <libcamera/geometry.h>
#include <libcamera/signal.h>
#include "formats.h"
#include "log.h"
namespace libcamera {
@@ -132,6 +133,7 @@ public:
int getFormat(V4L2DeviceFormat *format);
int setFormat(V4L2DeviceFormat *format);
ImageFormats formats();
int exportBuffers(BufferPool *pool);
int importBuffers(BufferPool *pool);
@@ -163,6 +165,9 @@ private:
int createPlane(Buffer *buffer, unsigned int plane,
unsigned int length);
std::vector<unsigned int> enumPixelformats();
std::vector<SizeRange> enumSizes(unsigned int pixelFormat);
Buffer *dequeueBuffer();
void bufferAvailable(EventNotifier *notifier);