diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-09 01:22:08 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-04-15 01:07:31 +0300 |
commit | 639cc1ad7acfdb86c892ccf3227a09e018ca545a (patch) | |
tree | d995b56d0ab76b388647cee70496d388aed66e74 /src/libcamera/include/v4l2_subdevice.h | |
parent | 79ce121b6bd33cc90e0a6645ef7391291792986f (diff) |
libcamera: v4l2_subdevice: Extend [gs]etFormat() to specify format type
The V4L2 subdevice API exposes ACTIVE and TRY formats, but the
V4L2Subdevice getFormat() and setFormat() operations only apply on
ACTIVE formats. Extend them to support TRY formats as well.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/include/v4l2_subdevice.h')
-rw-r--r-- | src/libcamera/include/v4l2_subdevice.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h index 9c077674..4a04eadf 100644 --- a/src/libcamera/include/v4l2_subdevice.h +++ b/src/libcamera/include/v4l2_subdevice.h @@ -32,6 +32,11 @@ struct V4L2SubdeviceFormat { class V4L2Subdevice : public V4L2Device { public: + enum Whence { + ActiveFormat, + TryFormat, + }; + explicit V4L2Subdevice(const MediaEntity *entity); V4L2Subdevice(const V4L2Subdevice &) = delete; V4L2Subdevice &operator=(const V4L2Subdevice &) = delete; @@ -46,8 +51,10 @@ public: ImageFormats formats(unsigned int pad); - int getFormat(unsigned int pad, V4L2SubdeviceFormat *format); - int setFormat(unsigned int pad, V4L2SubdeviceFormat *format); + int getFormat(unsigned int pad, V4L2SubdeviceFormat *format, + Whence whence = ActiveFormat); + int setFormat(unsigned int pad, V4L2SubdeviceFormat *format, + Whence whence = ActiveFormat); static V4L2Subdevice *fromEntityName(const MediaDevice *media, const std::string &entity); |