aboutsummaryrefslogtreecommitdiffstats
path: root/utils
AgeCommit message (Collapse)AuthorFilesLines
2019-05-15cec-ctl: add --raw-msg optioncecHans Verkuil1-0/+4
This option sets the CEC_MSG_FL_RAW flag. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-05-09v4l2-compliance: if G_FMT returns 0, mark buftype as validHans Verkuil1-3/+5
Currently a buftype was only marked as valid in node->valid_buftypes if G_FMT returned 0 AND the validation of the returned v4l2_format was also successful. But this gave bad knock-on effects in later tests. So mark the buftype as valid if G_FMT returns 0, independent of the later tests. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-05-09qvidcap: toLatin1 -> toUtf8Hans Verkuil2-10/+10
Output UTF8 instead of Latin1 for better locale support. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-05-09qv4l2: Fix UTF8 error message stringsTasos Sahanidis1-4/+4
In locales such as el_GR.UTF-8, sterror() returns localised error messages, which get printed as question marks due to the conversion in QString::toLatin1(). Calling QString::toUtf8 instead, corrects this error. Signed-off-by: Tasos Sahanidis <tasos@tasossah.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-29v4l2-ctl: disable tracing in get_codec_type and do_setup_out_buffersHans Verkuil1-12/+16
Disable spurious tracing messages in the get_codec_type() and do_setup_out_buffers() functions. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-29v4l2-compliance: re-enable fail_on_test(!buf.qbuf(node)) testHans Verkuil1-3/+1
Commit 0efd87d40586 ("v4l2-compliance: fix and comment out qbuf test") commented out this qbuf test, but it can now be enabled again since the vb2 bug that caused the failure has now been fixed. The vb2 fix was commit 1f7f11e8ca15 ("videobuf2-v4l2.c: move up STATE_DEQUEUED check"). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-24cec-compliance: add colorsPhilipp Zabel3-7/+52
Use color codes to mark OK, warn, and FAIL messages with green, bold, and bright red accents, respectively. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-24cec-compliance: use warn() in warn_once()Philipp Zabel1-6/+1
Use the warn() macro in warn_once() instead of duplicating its contents. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-24v4l2-compliance: add colorsPhilipp Zabel3-6/+51
Use color codes to mark OK, warn, and FAIL messages with green, bold, and bright red accents, respectively. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-24v4l2-compliance: use warn() in warn_once()Philipp Zabel1-6/+1
Use the warn() macro in warn_once() instead of duplicating its contents. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-03keytable: improve description of ir-keytableSean Young2-6/+12
Signed-off-by: Sean Young <sean@mess.org>
2019-04-02v4l2-ctl: disable_trace disabled too muchHans Verkuil2-25/+45
When trying to stream twice from the same device the second attempt silently exits since REQBUFS returns EBUSY. The problem is that there is no feedback of the ioctl error to the user, and that is because the ioctl tracing is disabled before REQBUFS is called. Change the code to be a bit more refined w.r.t. what is traced and what isn't. Now a proper error code is shown. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-04-01v4l2-compliance: fix and comment out qbuf testHans Verkuil1-1/+3
The fail_on_test(qbuf()) check was missing a !. But if after this correctly-failing qbuf() the querybuf ioctl is called again, all the request information is dropped from the result. So comment this out while a investigation this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: 7ee189ecae01 ("v4l2-compliance: fix request API test")
2019-04-01keytable: no need to explain -s option separatelySean Young2-17/+12
Signed-off-by: Sean Young <sean@mess.org>
2019-03-31v4l2-ctl: fix debug printsDafna Hirschfeld1-2/+2
replace 'set_fwht_ext_ctrls' with 'set_fwht_ext_ctrl' in debug prints Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-31v4l2-ctl: declare hdr variable as constDafna Hirschfeld1-3/+3
declare the hdr param with 'const' in functions that use fwht header in order to set the fwht stateless params. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-30v4l2-ctl: suppress warning messages when decodingHans Verkuil1-3/+2
When reading from a compressed file the amount of data read can be less than the buffer size. Don't warn about that, it's perfectly normal. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-30v4l2-ctl: get fmt after source changeHans Verkuil1-2/+1
When a source change event arrives during decoding get the new format at that point instead of after restarting streaming. If there is another source change queued up, then when you call streamon for CAPTURE again it might send the new source change event and update the format for that one, so reading the format after streamon might give the wrong format. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-30v4l2-ctl: fix broken stateless decodingHans Verkuil1-5/+5
The last argument for do_handle_out was set to true instead of false, causing do_handle_out to think that the stateless decoder had stopped. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-compliance: fix request API testHans Verkuil1-3/+20
The vicodec driver's media controller supports requests, but the stateful en/decoder video nodes do not: improve the request API test to handle this somewhat uncommon case. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-compliance: add stateful encoder stream testingHans Verkuil2-16/+69
- Don't test the 'no poll' streaming case: it doesn't really work since there is no reliable 1-1 mapping of output and capture buffers. - Check the EOS event. - Test CMD_STOP. - Test V4L2_BUF_FLAG_LAST. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-compliance: check for EVENT_EOS for stateful encoderHans Verkuil1-0/+2
Stateful encoders require the presence of EVENT_EOS. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-compliance: check for the presence of MIN_BUFFERS_OUTPUTHans Verkuil1-0/+3
This control is required for stateful encoders. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-compliance: check presence of enum_framesizes for encHans Verkuil1-0/+2
Stateful encoders must support ENUM_FRAMESIZES. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-compliance: check if en/decoder commands are presentHans Verkuil1-2/+8
The stateful codecs require the encoder or decoder command ioctls. Check this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-compliance: fill first output bufferHans Verkuil1-0/+1
In setupMmap() the fill_output_buffer() function was never called for the first output buffer, so it was never filled with data when reading from a file. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-compliance: for m2m devices fix frame countingHans Verkuil1-0/+7
For m2m devices the pre-queued output buffers need to be taken into account when calculating the number of frames that have been streamed. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: use defines instead of -1 and -2Hans Verkuil1-32/+35
Several queueing related functions return -1 on error and -2 to indicate that the queue is stopped (i.e. no more buffers should be queued). Use defines for these two values to make the code more readable. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: fixes relating to frame counting and drainingHans Verkuil1-17/+27
do_handle_cap assumed that it could skip frame counting for m2m devices, but that's not true. It should count frames for stateful encoders and for the cap2out streaming use-case. So make this an argument to do_handle_cap instead. Also fix various issues with detecting when the output side of an m2m device is stopped (e.g. because --stream-count buffers have been queued up). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: ignore empty and error frames w.r.t. --stream-countHans Verkuil1-1/+7
Empty frames and error frames should not decrement the counter set by --stream-count. Only count valid non-empty frames. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: reset internal counters after a source changeHans Verkuil1-0/+6
If a source change events arrives, then streaming stops, all buffers are reallocated and streaming restarts, but then various internal counters have to be reset since streaming starts with a clean slate. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: bytesused was reported as 0 when logging the bufferHans Verkuil1-2/+3
In do_handle_out() when the buffer information was logged the bytesused value was always 0. Move the code the clears this field to *after* the logging function so the actual values are logged. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: add missing cleanup to stateless_m2m()Hans Verkuil1-0/+9
stateless_m2m() didn't free allocated resources. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: Add implementation for the stateless fwht decoder.Dafna Hirschfeld1-8/+210
Add code to support the stateless decoder and the function 'stateless_m2m' that implements it. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: use g_timestamp_ns instead of get_ns_timestamp]
2019-03-29v4l2-ctl: Add functions and variables to support fwht stateless decoderDafna Hirschfeld1-0/+132
Add the variable 'last_fwht_bf_ts' and the array 'fwht_reqs' to allow the fwht stateless decoder to maintain the requests. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: dropped get_ns_timestamp]
2019-03-29cv4l-helpers.h: add g_timestamp_ns()Hans Verkuil1-0/+1
Add helper to return a v4l2_buffer timestamp as nanoseconds. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: fix compiler warningHans Verkuil1-1/+2
v4l2-ctl-streaming.cpp: In function ‘__u32 read_u32(FILE*)’: v4l2-ctl-streaming.cpp:434:7: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(&v, 1, sizeof(v), f); ^ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-29v4l2-ctl: print an error for invalid pixelformatsHans Verkuil4-24/+99
If the given pixelformat was invalid, then it was silently replaced by the driver with a default format. Give an error instead and bail out. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29v4l2-ctl: support -BE handling for list framesize/ivalsHans Verkuil1-4/+17
With the G/S/TRY_FMT ioctls the -BE suffix to a fourcc was handled correctly, but this was not supported for the ENUM_FRAMESIZES and the ENUM_FRAMEINTERVALS ioctls. Support it there as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-29Revert "cec-compliance: suppress some warnings for vivid"Hans Verkuil3-9/+2
Instead of changing the adapter test itself (and thus hiding the very real vivid bug), we drop the -A option in test-media instead. This reverts commit 336df387b517572f06d37bbc79a9337804291530.
2019-03-29cec-compliance: suppress some warnings for vividHans Verkuil3-2/+9
The vivid's CEC emulation isn't perfect (it doesn't handle Arbitration Lost situations properly). So disable some warnings when the vivid emulation is detected. This should be reverted once vivid is eventually fixed. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-28v4l2-ctl: fix multiplanar handlingHans Verkuil1-5/+5
Fixes commit 8e695c1d3403 ("v4l2-ctl-streaming.cpp: use cv4l-helpers.h") which used g_bytesused() and g_data_offset() instead of explicitly specifying the plane index as argument. So it would only take bytesused and data_offset from the first plane. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Benoit Parrot <bparrot@ti.com>
2019-03-27v4l2-compliance: fix broken MEDIA_LNK_FL_IMMUTABLE testHans Verkuil1-1/+1
If the link is dynamic, then it is a failure if MEDIA_LNK_FL_IMMUTABLE is set (the two are mutually exclusive). But the test was the wrong way around. Fix this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Tomasz Figa <tfiga@chromium.org>
2019-03-26v4l2-compliance: fix error code checkHans Verkuil1-1/+1
The previous commit accidentally broke one error code check where EINVAL was changed to EBADR when it shouldn't. Revert that part of the commit. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-26v4l2-compliance: test for EBADR instead of EACCESHans Verkuil1-3/+5
If requests are used when they shouldn't, or not used when they should, then EBADR (Invalid request descriptor) is now returned instead of EACCES. Update the compliance tests accordingly. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-25v4l-utils: sync with latest media masterHans Verkuil7-346/+236
Synchronize with the latest headers from the media master tree. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-24Update my e-mail on all placesMauro Carvalho Chehab16-16/+16
My e-mail has changed over the years. Due to that, people still send me bug reports to e-mails I don't use anymore for upstream stuff, or even send e-mails to addresses that doesn't exist anymore. So, let's put an order at the house, using just the canonical e-mail mchehab@kernel.org, as this e-mail should always point to my current e-mail preference. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-22v4l2-ctl: fix small do_handle_cap bugHans Verkuil1-2/+2
do_handle_cap() returns -2 if EPIPE what returned, and it should also return -2 when stream_count reaches 0 since -2 indicates end-of-stream. But when capturing the error code was only checks for -1 instead of < 0. Fix this as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-22v4l2-ctl: improve stream-count handling for m2mHans Verkuil1-43/+91
When streaming for m2m devices the stream-count should be exact and work even for e.g. --stream-count=1. This means that when filling in the initial output buffers, no more than stream_count buffers should be filled, even for count values less than the number of allocated buffers. This also means that STOP should be issued right after filling in the buffers if stream_count has already reached 0. This patch also is more precise when > or < is printed and when the buffer contents (--verbose) is shown. '<' is shown after a capture buffer is dequeued. '>' is shown after an output buffer is queued. The buffer contents is always shown after a buffer is dequeued. For capture or output devices the stream count refers to the number of dequeued buffers, and the number of queued buffers is more than that (number of allocated buffers + stream_count). For m2m devices the stream_count refers to the number of queued output buffers. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2019-03-21keytable: remove misleading --device argumentSean Young2-52/+26
Running 'ir-keytable --device /dev/input/event24 -p rc5' does not work since ir-keytable cannot find an rc device via the input device name. Simply remove this options from ir-keytable since it is not useful and is only misleading. Signed-off-by: Sean Young <sean@mess.org>

Privacy Policy