aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | lavd/v4l2: Use AVSTREAM_PARSE_FULL_ONCE when reading a h264 stream.Carl Eugen Hoyos2015-08-041-1/+1
| | | | | | | | | | Reported, debugged and tested by trac user noah. Fixes ticket #4644.
* | Merge commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370'Michael Niedermayer2015-07-211-0/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370': Deprecate avctx.coded_frame Conflicts: ffmpeg.c libavcodec/a64multienc.c libavcodec/asvenc.c libavcodec/cljrenc.c libavcodec/dpxenc.c libavcodec/gif.c libavcodec/mpegvideo_enc.c libavcodec/nvenc.c libavcodec/proresenc_kostya.c libavcodec/pthread_frame.c libavcodec/rawenc.c libavcodec/sunrastenc.c libavcodec/tiffenc.c libavcodec/version.h libavcodec/xbmenc.c libavcodec/xwdenc.c libavdevice/v4l2.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * Deprecate avctx.coded_frameVittorio Giovara2015-07-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rationale is that coded_frame was only used to communicate key_frame, pict_type and quality to the caller, as well as a few other random fields, in a non predictable, let alone consistent way. There was agreement that there was no use case for coded_frame, as it is a full-sized AVFrame container used for just 2-3 int-sized properties, which shouldn't even belong into the AVCodecContext in the first place. The appropriate AVPacket flag can be used instead of key_frame, while quality is exported with the new AVPacketSideData quality factor. There is no replacement for the other fields as they were unreliable, mishandled or just not used at all. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * v4l2: Add support for h264Luca Barbato2015-03-021-1/+6
| |
* | avdevice/v4l2: Fix vertical alignment in list_formats() outputMichael Niedermayer2015-05-161-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avdevice/v4l2: Try to fix build on netbsd/openbsdMichael Niedermayer2015-05-091-1/+4
| | | | | | | | | | Found-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: produce a 0 byte packet when a dequeued buffer is flagged with ↵Giorgio Vazzana2015-05-081-15/+22
| | | | | | | | | | | | | | | | V4L2_BUF_FLAG_ERROR Fixes ticket #4030. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: fix typoGiorgio Vazzana2015-05-081-1/+1
| | | | | | | | | | | | This was introduced in cde6e328de214ffe8387641cdc1e433a2c2150f3 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: print buffer flags in case of errorGiorgio Vazzana2015-04-241-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | fix spelling errorsAndreas Cadhalpun2015-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | opttimizations -> optimizations grabing -> grabbing many resource -> many resources isnt -> isn't silcense -> silence Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '619d5e7db88941cadb8136f805564e885c6c6434'Michael Niedermayer2015-03-021-3/+3
|\| | | | | | | | | | | | | | | | | | | * commit '619d5e7db88941cadb8136f805564e885c6c6434': v4l2: Use the codec descriptor facility Conflicts: libavdevice/v4l2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * v4l2: Use the codec descriptor facilityLuca Barbato2015-03-021-2/+2
| | | | | | | | | | The encoder or decoder might be disabled but the format would be supported for at least remuxing.
| * v4l2: Unify one instance of reading/storing errnoMartin Storsjö2014-11-111-3/+3
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavd/v4l2: implement list device callbackLukasz Marek2015-01-111-0/+77
| | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | avdevice/v4l2: use av_freep() to avoid leaving stale pointers in memoryMichael Niedermayer2014-12-121-3/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '09f25533a564eab743f258d168697a11122914c4'Michael Niedermayer2014-11-101-10/+11
|\| | | | | | | | | | | | | | | | | | | | | * commit '09f25533a564eab743f258d168697a11122914c4': v4l2: Preserve errno values Conflicts: libavdevice/v4l2.c See: 60950adc18fe145a235211e75da68ab07123fcaa Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * v4l2: Preserve errno valuesLuca Barbato2014-11-091-16/+23
| | | | | | | | av_log usually resets it.
* | Merge commit 'a1a259881fa7b23e2ffc0c2a43d4923fe42d0478'Michael Niedermayer2014-11-101-4/+8
|\| | | | | | | | | | | | | | | | | | | | | * commit 'a1a259881fa7b23e2ffc0c2a43d4923fe42d0478': v4l2: Use av_strerror Conflicts: libavdevice/v4l2.c See: 60950adc18fe145a235211e75da68ab07123fcaa Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * v4l2: Use av_strerrorTristan Matthews2014-11-091-15/+34
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Revert "v4l2: setting device parameters early"Michael Niedermayer2014-11-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b1ad9312331759679a9c956233716a67ae681d89. Fixes Ticket #3517 Conflicts: libavdevice/v4l2.c Requested-by: Giorgio Vazzana <mywing81@gmail.com> Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: use pixel format variable names consistentlyGiorgio Vazzana2014-11-061-10/+11
| | | | | | | | | | | | | | | | | | We now use 'pixelformat' for V4L2_PIX_FMT_* (as they do in v4l2 documentation) and 'pix_fmt' for AVPixelFormat. No functional change in the code. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: don't use avpriv_ prefix for internal functionsJames Almer2014-10-291-10/+10
| | | | | | | | | | | | | | | | | | | | No need to keep the old symbols around until a major bump since lavd functions with the avpriv_ prefix were never exposed. Signed-off-by: James Almer <jamrial@gmail.com> Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Use v4l2 input format automatically if filename starts with "/dev/video"Andrey Utkin2014-10-291-0/+8
| | | | | | | | Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
* | lavd/v4l2: introduce enqueue_buffer()Giorgio Vazzana2014-09-061-18/+21
| | | | | | | | | | | | | | | | Additionally, make sure a buffer gets enqueued again (even in error paths) after it has been succesfully dequeued. Tested-by: Dmitry Volyntsev <xeioexception@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: simplify list_formats()Giorgio Vazzana2014-09-051-3/+3
| | | | | | | | | | | | We can avoid passing file descriptor fd explicitely. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: simplify list_framesizes()Giorgio Vazzana2014-09-051-3/+3
| | | | | | | | | | | | We can avoid passing file descriptor fd explicitely. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: remove unneeded variable in device_init()Giorgio Vazzana2014-09-051-3/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: simplify first_field()Giorgio Vazzana2014-09-051-7/+5
| | | | | | | | | | | | | | There is no need to pass fd as a second parameter. Additionally remove unneeded curly braces. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: Replace s1 with ctx for consistency.Giorgio Vazzana2014-09-051-57/+57
| | | | | | | | | | | | No functional change in the code. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavdevice/v4l2: fix descriptors leak on error pathsDmitry Volyntsev2014-09-041-17/+20
| | | | | | | | | | | | | | Signed-off-by: Dmitry Volytnsev <xeioexception@gmail.com> Reviewed-by: Benoit Fouet <benoit.fouet@free.fr> Reviewed-by: Giorgio Vazzana <mywing81@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avdevice/v4l2: try to fix build for openbsdMichael Niedermayer2014-08-181-1/+5
| | | | | | | | | | Found-by: carl Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: do not fail when VIDIOC_ENUMSTD returns ENODATAAndre Wolokita2014-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of September 14 2012, v4l_enumstd() will return ENODATA when a device's std field is set to 0. That is, the device does not have a standard format. In order to properly handle this case, v4l2_set_parameters should catch the ENODATA code and break instead of failing. Below is the v4l2-core commit describing this change. >>commit a5338190efc7cfa8c99a6856342a77d21c9a05cf >>Author: Hans Verkuil <hans.verkuil@cisco.com> >>Date: Fri Sep 14 06:45:43 2012 -0300 >> >> [media] v4l2-core: tvnorms may be 0 for a given input, handle that case >> >> Currently the core code looks at tvnorms to see whether ENUMSTD >> or G_PARM should be enabled. This is not a good check for drivers >> that support the STD API on one input and the DV Timings API on another. >> In that case tvnorms may be 0. >> Instead check whether s_std is present (for ENUMSTD) or whether g_std or >> current_norm is present for g_parm. >> Also, in the enumstd core function return ENODATA if tvnorms is 0, >> because in that case the current input does not support the STD API >> and ENUMSTD should return ENODATA for that. >> >> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> >> Reviewed-by: Sakari Ailus <sakari.ailus@iki.fi> >> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-151-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-151-3/+3
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * libavdevice: use avpriv_open()Rémi Denis-Courmont2013-08-071-1/+1
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avdevice/v4l2: Use av_malloc_array()Michael Niedermayer2014-05-221-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd: Use av_gettime_relative()Olivier Langlois2014-05-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever av_gettime() is used to measure relative period of time, av_gettime_relative() is prefered as it guarantee monotonic time on supported platforms. Since v4l2 is compiled only on Linux where av_gettime_relative() is monotonic, a small wrapper function av_gettime_monotonic() is used (should be inlined the compiler) to put emphasis on that fact. Signed-off-by: Olivier Langlois <olivier@trillion01.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix convertion typosMichael Niedermayer2014-04-291-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd: add categories to device implementationsLukasz Marek2014-03-031-0/+1
| | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* | avdevice/v4l2: only use average frame rate if setMichael Niedermayer2014-02-021-13/+16
| | | | | | | | | | | | It might be unset on some platforms with some drivers and some input Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avdevice/v4l2: only use frame period from v4l2 if validMichael Niedermayer2014-02-021-3/+6
| | | | | | | | | | | | | | There is evidence that some drivers do not set a valid value See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718805 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | v4l2: setting device parameters earlyFederico Simoncelli2014-01-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Setting the v4l2 device parameters may influence video properties such as width, height and pixel format. This patch moves v4l2_set_parameters to be executed before fetching the video properties, avoiding errors such as (pal vs ntsc): The v4l2 frame is 829440 bytes, but 691200 bytes are expected Signed-off-by: Federico Simoncelli <fsimonce@redhat.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | timefilter: Handle memory allocation failureDerek Buitenhuis2013-10-271-0/+2
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | lavd/v4l2: do not fail when VIDIOC_ENUMSTD returns EINVAL without a valid matchmrlika2013-09-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With some (buggy) drivers, the VIDIOC_G_STD ioctl returns a std_id that cannot be matched with any of the enumerated v4l2_standard structures (for example std_id = 0 or std_id = 0xffffff). Do not fail when we reach the end of the enumeration without a valid match. Fixes ticket #2370 Note: This commit message has been modified by Giorgio Vazzana, the original commit message was: "Fixed regression for mandatory VIDIOC_ENUMSTD support by v4l2" Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: Improve debug messageGiorgio Vazzana2013-09-081-5/+5
| | | | | | | | | | | | | | In particular, print the standard supported by the selected input. Additionally, use PRIx64 everywhere when printing standards. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Read h264 headers from v4l2 to allow stream-copying.Carl Eugen Hoyos2013-09-011-0/+3
| | | | | | | | | | Fixes ticket #2882. Analyzed and tested by William C Bonner.
* | Merge commit '7950e519bb094897f957b9a9531cc60ba46cbc91'Michael Niedermayer2013-08-031-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7950e519bb094897f957b9a9531cc60ba46cbc91': Disable deprecation warnings for cases where a replacement is available Conflicts: libavcodec/avpacket.c libavcodec/pthread.c libavcodec/utils.c libavdevice/v4l2.c libavfilter/avfiltergraph.c libavfilter/buffersrc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Disable deprecation warnings for cases where a replacement is availableDiego Biurrun2013-08-021-0/+3
| |
* | v4l2: make possible to disable libv4l2 at runtime.Clément Bœsch2013-05-221-12/+46
| | | | | | | | | | | | Also disable it by default since it looks currently buggy. The usefulness of such library is mostly limited to backward compatibility with very old devices.
* | lavd/v4l2: move pixel format conversion code to a separate place.Clément Bœsch2013-05-201-119/+11
| | | | | | | | This will be shared with the output device.