libcamera: v4l2_device: Identify multiplanar formats
Add functions to V4L2Capability to identify if a V4L2 device supports multiplanar V4L2 APIs. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
0052aaa40e
commit
987bd370b0
2 changed files with 25 additions and 4 deletions
|
@ -32,10 +32,25 @@ struct V4L2Capability final : v4l2_capability {
|
|||
? v4l2_capability::device_caps
|
||||
: v4l2_capability::capabilities;
|
||||
}
|
||||
|
||||
bool isCapture() const { return device_caps() & V4L2_CAP_VIDEO_CAPTURE; }
|
||||
bool isOutput() const { return device_caps() & V4L2_CAP_VIDEO_OUTPUT; }
|
||||
bool hasStreaming() const { return device_caps() & V4L2_CAP_STREAMING; }
|
||||
bool isMultiplanar() const
|
||||
{
|
||||
return device_caps() & (V4L2_CAP_VIDEO_CAPTURE_MPLANE |
|
||||
V4L2_CAP_VIDEO_OUTPUT_MPLANE);
|
||||
}
|
||||
bool isCapture() const
|
||||
{
|
||||
return device_caps() & (V4L2_CAP_VIDEO_CAPTURE |
|
||||
V4L2_CAP_VIDEO_CAPTURE_MPLANE);
|
||||
}
|
||||
bool isOutput() const
|
||||
{
|
||||
return device_caps() & (V4L2_CAP_VIDEO_OUTPUT |
|
||||
V4L2_CAP_VIDEO_OUTPUT_MPLANE);
|
||||
}
|
||||
bool hasStreaming() const
|
||||
{
|
||||
return device_caps() & V4L2_CAP_STREAMING;
|
||||
}
|
||||
};
|
||||
|
||||
class MediaEntity;
|
||||
|
|
|
@ -56,6 +56,12 @@ LOG_DEFINE_CATEGORY(V4L2)
|
|||
* driver capabilities otherwise
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn bool V4L2Capability::isMultiplanar()
|
||||
* \brief Identify if the device implement V4L2 multiplanar APIs
|
||||
* \return True if the device supports multiplanar APIs
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn bool V4L2Capability::isCapture()
|
||||
* \brief Identify if the device is capable of capturing video
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue