summaryrefslogtreecommitdiff
path: root/yavta.c
AgeCommit message (Collapse)Author
2024-09-14yavta: Format type errors for non x86 archesHEADmasterRicardo Ribalda
mipsel64el, ppc64el, ia64, ppc64, sparc64 and x32 have different lengths for long long ints, which result in some compilation errors. Lets add some castings and inttypes macros to help the compiler deal with this. We have to use the castings, because kernel types (__u64 et al) does not seem to be compatible with inttypes macros. Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-03-24Add YUVA32 and YUVX32 4:4:4 packed pixel formats supportLaurent Pinchart
The YUVA32 and YUVX32 formats are permutations of other YUV 4:4:4 packed pixel formats. Support them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28Return an error status when capture failsLaurent Pinchart
The video_do_capture() function overrides the error code when a failure occurs. This prevents returning an error status to the calling process. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-07Add support for 32-bit packed YUV 4:4:4 pixel formatsLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-02-25yavta: Add support for YUV32 pixel formatJacopo Mondi
Add YUV32 to the list of supported pixel formats. YUV32 represents the packed YUV format version with 4:4:4 subsampling with 8-bits per component plus an additional alpha channel component in the 8 MSB of the 32-bits word. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-05-22yavta: Fix usage documentation for --field optionNiklas Söderlund
The --field option takes an argument selecting the field order. Update the usage text to reflect this. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-05yavta: Add 16-bit Bayer formatsLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-22Remove unnecessary semicolonsLaurent Pinchart
The semicolons after the empty for loop statements are not needed. Remove them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Fix control array parsingLaurent Pinchart
Commit 4480b561404f ("Implement compound control set support") didn't properly parse control array values. Fix it. Fixes: 4480b561404f ("Implement compound control set support") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Print numerical control type for unsupported typesLaurent Pinchart
Help diagnosing problems by reporting the type of unsupported control types instead of just printing "unsupported". Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Fix emulation of old API for string controlsLaurent Pinchart
For kernel versions that didn't define the V4L2_CTRL_FLAG_HAS_PAYLOAD flag, commits 2f146567186f ("Implement compound control get support") and 4480b561404f ("Implement compound control set support") broke string control support. Fix this by emulating the V4L2_CTRL_FLAG_HAS_PAYLOAD and compound control API for the older API. Fixes: 2f146567186f ("Implement compound control get support") Fixes: 4480b561404f ("Implement compound control set support") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Add optional frame count argument to pause parameterLaurent Pinchart
When a number of frames is specified, yavta will pause waiting for a key press or a SIGUSR1 signal after the number of frames before continuing. It will also create a file on disk named ".yavta.wait.<pid>" (where <pid> is the process ID) in the local directory when pausing, and remove it after resuming. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Remove unneeded conditional compilation for old V4L2 API versionsLaurent Pinchart
As we include a copy of the V4L2 kernel headers, there's no need for conditional compilation to support old versions of the API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Support setting control from values stored in a fileLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Add support to reset device controlsKieran Bingham
Provide a new option '--reset-controls' which will enumerate the available controls on a device or sub-device, and re-initialise them to defaults. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Implement compound control set supportLaurent Pinchart
Only arrays of integer types are supported. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Implement compound control get supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20Implement VIDIOC_QUERY_EXT_CTRL supportLaurent Pinchart
Use the new extended control query ioctl when available with an automatic fall back to VIDIOC_QUERYCTRL. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-20yavta: Refactor video_list_controls()Laurent Pinchart
Separate iteration over controls from printing, in order to reuse the iteration to implement control reset. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-17Zero dev in main()Sakari Ailus
This is necessary since video_open() may not be always called soon. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-01-08Add meta-data output supportRajmohan Mani
The V4L2_BUF_TYPE_META_OUTPUT mirrors the V4L2_BUF_TYPE_META_CAPTURE with the exception that it is an OUTPUT type. The use case for this is to pass buffers to the device that are not image data but metadata. The formats, just as the metadata capture formats, are typically device specific and highly structured. Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-11-18Add support for IPU3 raw 10-bit Bayer packed formatsJacopo Mondi
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-08-24Add meta-data capture supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-10-24Add YVU 3-planar formats supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-10-24Add HSV24 and HSV32 formats supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-18Fix handling of last buffers before end of captureLaurent Pinchart
yavta is supposed not to requeue the last buffers before end of capture (unless requested to do so with the --requeue-last option). However, the logic is wrong, and only one of the last buffers is not requeued. Fix it by skipping all of the last buffers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-16Add YUV422M and YUV444M supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-05-13Print driver name when querying capabilitiesLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-12-14Return proper error code if STREAMON failsTuukka Toivonen
Return the error code if video_enable() and VIDIOC_STREAMON fails. Signed-off-by: Tuukka Toivonen <tuukka.toivonen@intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-12-12Print the number of frames and bytes captured when the interval is nullLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-10-16List supported formats with -f helpSakari Ailus
Passing format "help" to the -f option will list the supported formats and exit. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2015-05-05Zero the planes array before queuing buffersLaurent Pinchart
V4L2 requires reserved fields to be zeroed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-03-20yavta: Fix printing of device capabilitiesLaurent Pinchart
Commit d029d1d5bba831b9 ("Separate querying capabilities and determining buffer queue type") broke capabilities printing. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2015-02-26Prints bytes used for all planesLaurent Pinchart
When using the multiplanar API the v4l2_buffer bytesused field is documented as ignored, and the planes array should be used instead. Compute the total number of bytes used to be printed during capture based on the planes array when using the multiplanar API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-01-07Fix data offset config option parsingSakari Ailus
The option itself was considered correctly, but a small but crucial break statement was missing. --data-offset option does not take an argument either. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-01-07Rename buffer prefix as data prefixSakari Ailus
Data prefix is a much better name for this (think of data_offset, for instance). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-01-02yavta: Add support for 10-bit packed raw bayer formatsSakari Ailus
Add support for these pixel formats: V4L2_PIX_FMT_SBGGR10P V4L2_PIX_FMT_SGBRG10P V4L2_PIX_FMT_SGRBG10P V4L2_PIX_FMT_SRGGB10P Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-12-15yavta: Implement data_offset support for multi plane buffersSakari Ailus
Support data_offset for multi plane buffers. Also add an option to write the data in the buffer before data offset (--buffer-prefix). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-12-15yavta: Set plane size for mplane buffers in qbufSakari Ailus
The plane size was left zero for mplane buffers when queueing a buffer. Fix this. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> [For consistency set buf.length for USERPTR buffers only] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-10-26yavta: Add --queue-late option for delay queueing buffers over streaming startSakari Ailus
Queue buffers to the device after VIDIOC_STREAMON, not before. This does not affect queueing behaviour otherwise. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-10-01Add support for premultiplied formatsLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-10-01Add --buffer-size argumentLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-10-01Add support for missing RGB formatsLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-06-25Add support for printing string controlsLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-05-24Add log status supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-05-24Add support for interlaced formatsLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2014-04-16Set timestamp for output buffers if the timestamp type is copySakari Ailus
Copy timestamp type will mean the timestamp is be copied from the source to the destination buffer on mem-to-mem devices. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
2014-04-16Support copy timestampsSakari Ailus
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
2014-04-16Shorten dequeued buffer info printSakari Ailus
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
2014-04-16Print timestamp type and source for dequeued buffersSakari Ailus
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>