summaryrefslogtreecommitdiff
path: root/libavdevice/v4l2.c
Commit message (Collapse)AuthorAge
* v4l2: make possible to disable libv4l2 at runtime.Clément Bœsch2013-05-22
| | | | | | 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-20
| | | | This will be shared with the output device.
* Merge commit 'a5f8873620ce502d37d0cc3ef93ada2ea8fb8de7'Michael Niedermayer2013-05-04
|\ | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a5f8873620ce502d37d0cc3ef93ada2ea8fb8de7': silly typo fixes Conflicts: doc/protocols.texi libavcodec/aacpsy.c libavformat/utils.c tools/patcheck Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * silly typo fixesDiego Biurrun2013-05-03
| |
* | lavd/v4l2: fully init an ioctl argument.Nicolas George2013-04-01
| | | | | | | | Silence a valgrind warning about uninitialized memory.
* | lavd/v4l2: fix printing of list_formats tableGiorgio Vazzana2013-03-28
| | | | | | | | | | | | In particular we needed a '\n' at the end of the line when the format is emulated. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: replace ioctl() with v4l2_ioctl()Giorgio Vazzana2013-03-28
| | | | | | | | | | | | | | This is consistent with the rest of the file and makes listing of emulated formats possible when ffmpeg is compiled with libv4l2. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: honor previously selected input channelGiorgio Vazzana2013-03-23
| | | | | | | | | | | | | | An input channel could have been previously set with another application, like v4l2-ctl, so if no input channel is specified use the previosly selected one. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: silence libv4l2 loggingGiorgio Vazzana2013-03-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: fix bug in init_convert_timestamp()Giorgio Vazzana2013-03-12
| | | | | | | | | | | | The current code returned a period=0, resulting in identical pts for all frames after time-filtering. This is because AV_TIME_BASE_Q={1, AV_TIME_BASE} and not {AV_TIME_BASE, 1}. With this patch the correct period in microseconds is computed.
* | avformat/avdevice: add missing time.h includesMichael Niedermayer2013-03-12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: simplify codeGiorgio Vazzana2013-03-09
| | | | | | | | | | | | | | struct buff_data contains a pointer to struct video_data, so passing the file descriptor again is redundant. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: correctly handle error conditions in mmap_read_frame()Giorgio Vazzana2013-03-09
| | | | | | | | | | | | | | | | | | In particular: 1) save errno before it (possibly) gets overwritten by other calls 2) do not forget to enqueue the buffer again in case of error Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '1afddbe59e96af75f1c07605afc95615569f388f'Michael Niedermayer2013-03-08
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1afddbe59e96af75f1c07605afc95615569f388f': avpacket: use AVBuffer to allow refcounting the packets. Conflicts: libavcodec/avpacket.c libavcodec/utils.c libavdevice/v4l2.c libavformat/avidec.c libavformat/flacdec.c libavformat/id3v2.c libavformat/matroskaenc.c libavformat/mux.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avpacket: use AVBuffer to allow refcounting the packets.Anton Khirnov2013-03-08
| | | | | | | | | | | | This will allow us to avoid copying the packets in many cases. This breaks ABI.
* | v4l2: fix regression that caused ffmpeg to occasionally get stuckMichael Niedermayer2013-03-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavd/v4l2: copy frames into normally allocated packets whenever there is ↵Giorgio Vazzana2013-03-02
| | | | | | | | | | | | | | | | | | | | | | just one buffer left available This will avoid the possibility that we dequeue more buffers than we have obtained from the v4l2 driver. Fixes ticket #1570 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | v4l2: try to fix build on BSDMichael Niedermayer2013-02-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Add yvu410 as a supported v4l2 input format.Carl Eugen Hoyos2013-02-17
| |
* | Add gray16 as a supported v4l2 input format.Carl Eugen Hoyos2013-02-17
| |
* | lavd/v4l2: fix error logic when enumerating standardsStefano Sabatini2013-02-10
| | | | | | | | | | | | | | Set ret to 0 before enumerating standards in v4l2_set_parameters(), avoid use of uninitialized variable. Regression introduced in 60950adc18fe145a235211e75da68ab07123fcaa.
* | lavd/v4l2: implement consistent error handlingStefano Sabatini2013-02-10
| | | | | | | | | | In particular, avoid use of non-thread-safe strerror(), and store errno before calling av_log().
* | lavd/v4l2: read the correct time per frame from devices that support a standardGiorgio Vazzana2013-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally speaking, there are two types of v4l2 devices [1]: 1) devices that support a standard, like PAL or NTFS (tv cards, for example). For this class of devices the framerate is fixed by the standard (for example PAL uses 25 fps) and the v4l2 driver cannot usually negotiate a different framerate (unless it can skip frames on the driver side, to save I/O bandwidth). 2) devices for which the notion of standard does not make sense (webcams, for example). For these devices it is usually possibile to request a desidered framerate. In either case, the desidered frame rate can be requested when the VIDIOC_G_PARM ioctl returns the V4L2_CAP_TIMEPERFRAME flag in the capability field. Currently the code does not check for V4L2_CAP_TIMEPERFRAME and supports only the second category of devices, returning a time per frame of 0/0 for devices in the first group that do not permit to negotiate the framerate. This patch adds support to read the correct framerate in all cases. [1] http://linuxtv.org/downloads/v4l-dvb-apis/standard.html Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
* | lavd/v4l2: add list_standards optionGiorgio Vazzana2013-01-31
| | | | | | | | | | | | | | Since the user is expected to choose the standard by name (with -standard option), add the possibility to list all the supported standards. Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
* | lavd/v4l2: use avcodec_find_decoder in list_formatsStephan Hilb2013-01-28
| | | | | | | | | | | | | | | | Because libavdevice/v4l2 is a demuxer, it makes sense to look for decoders instead of encoders when listing the formats supported by the device. Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
* | lavd/v4l2: select input immediately after opening the deviceGiorgio Vazzana2013-01-27
| | | | | | | | | | | | | | | | | | | | | | | | After opening the device, the first thing we should do is selecting the input. This is because the image formats (VIDIOC_ENUM_FMT ioctl) and the standards (VIDIOC_ENUMSTD ioctl) supported may depend on the selected input ([1] and [2]). [1] http://linuxtv.org/downloads/v4l-dvb-apis/vidioc-enum-fmt.html [2] http://linuxtv.org/downloads/v4l-dvb-apis/vidioc-enumstd.html Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
* | lavd/v4l2: sanitize logic of device_try_init(), so that it properly signal ↵Stefano Sabatini2013-01-27
| | | | | | | | | | | | | | | | | | errors Make device_try_init() return an error value, and allow to properly report errors which are not due to a wrong pixel/codec configuration. In particular, report intelligible feedback in case of busy device.
* | lavd/v4l2: init return value.Nicolas George2013-01-16
| | | | | | | | Fix a warning and random failures.
* | lavd/v4l2: update broken link to v4l2 video capture exampleStephan Hilb2013-01-16
| | | | | | | | Reviewed-by: Stefano Sabatini
* | lavd/v4l2: improve debug messageStephan Hilb2013-01-16
| | | | | | | | Reviewed-by: Stefano Sabatini
* | lavd/v4l2: apply grammar/consistency fixes to options help fieldsStefano Sabatini2013-01-15
| |
* | lavd/v4l2: return meaningful error code from device_init()Stefano Sabatini2013-01-15
| | | | | | | | In particular, propagate errno value in case of device init failure.
* | lavd/v4l2: fix misc messagesStefano Sabatini2013-01-15
| |
* | lavd/v4l2: extend error/debug feedback in case of invalid codec/pix_fmtStefano Sabatini2013-01-15
| |
* | Merge commit '90cfc084e3e6d37ab88fc96a95f0401d8e8b4cd1'Michael Niedermayer2013-01-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '90cfc084e3e6d37ab88fc96a95f0401d8e8b4cd1': avpacket: free side data in av_free_packet(). v4l2: do not assert on a value received from outside of Libav v4l2: set the average framerate instead of codec timebase. Conflicts: libavcodec/avpacket.c libavdevice/v4l2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * v4l2: do not assert on a value received from outside of LibavAnton Khirnov2013-01-13
| |
| * v4l2: set the average framerate instead of codec timebase.Anton Khirnov2013-01-13
| | | | | | | | Codec timebase is supposed to be set by decoders only.
* | Merge commit '246da0b13551b1f80f067e4f258e5bd691f5ab33'Michael Niedermayer2013-01-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '246da0b13551b1f80f067e4f258e5bd691f5ab33': v4l2: avoid pointless indirection. vdpau: Add VC-1 decoding via hwaccel infrastructure vdpau: Add H.264 decoding via hwaccel infrastructure Conflicts: configure libavcodec/Makefile libavcodec/version.h libavdevice/v4l2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * v4l2: avoid pointless indirection.Anton Khirnov2013-01-13
| | | | | | | | | | v4l2_read_header() does no cleanup, so it can return directly, without any need for goto.
* | Support H264 over video4linux2.Carl Eugen Hoyos2012-12-21
| | | | | | | | Tested-by: Val Malykh
* | Merge commit '716d413c13981da15323c7a3821860536eefdbbb'Michael Niedermayer2012-10-08
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '716d413c13981da15323c7a3821860536eefdbbb': Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat Conflicts: doc/examples/muxing.c ffmpeg.h ffmpeg_filter.c ffmpeg_opt.c ffplay.c ffprobe.c libavcodec/8bps.c libavcodec/aasc.c libavcodec/aura.c libavcodec/avcodec.h libavcodec/avs.c libavcodec/bfi.c libavcodec/bmp.c libavcodec/bmpenc.c libavcodec/c93.c libavcodec/cscd.c libavcodec/cyuv.c libavcodec/dpx.c libavcodec/dpxenc.c libavcodec/eatgv.c libavcodec/escape124.c libavcodec/ffv1.c libavcodec/flashsv.c libavcodec/fraps.c libavcodec/h264.c libavcodec/huffyuv.c libavcodec/iff.c libavcodec/imgconvert.c libavcodec/indeo3.c libavcodec/kmvc.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libx264.c libavcodec/ljpegenc.c libavcodec/mjpegdec.c libavcodec/mjpegenc.c libavcodec/motionpixels.c libavcodec/mpeg12.c libavcodec/mpeg12enc.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo_enc.c libavcodec/pamenc.c libavcodec/pcxenc.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/pnm.c libavcodec/pnmdec.c libavcodec/pnmenc.c libavcodec/ptx.c libavcodec/qdrw.c libavcodec/qpeg.c libavcodec/qtrleenc.c libavcodec/raw.c libavcodec/rawdec.c libavcodec/rl2.c libavcodec/sgidec.c libavcodec/sgienc.c libavcodec/snowdec.c libavcodec/snowenc.c libavcodec/sunrast.c libavcodec/targa.c libavcodec/targaenc.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/tmv.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/vb.c libavcodec/vp3.c libavcodec/wnv1.c libavcodec/xl.c libavcodec/xwddec.c libavcodec/xwdenc.c libavcodec/yop.c libavdevice/v4l2.c libavdevice/x11grab.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/buffersrc.c libavfilter/drawutils.c libavfilter/formats.c libavfilter/src_movie.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_format.c libavfilter/vf_hflip.c libavfilter/vf_lut.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_yadif.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/movenc.c libavformat/mxf.h libavformat/utils.c libavformat/yuv4mpeg.c libavutil/imgutils.c libavutil/pixdesc.c libswscale/input.c libswscale/output.c libswscale/swscale_internal.h libswscale/swscale_unscaled.c libswscale/utils.c libswscale/x86/swscale_template.c libswscale/x86/yuv2rgb.c libswscale/x86/yuv2rgb_template.c libswscale/yuv2rgb.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormatAnton Khirnov2012-10-08
| |
* | Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9'Michael Niedermayer2012-09-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9': avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member Conflicts: libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libx264.c libavcodec/mpeg12enc.c libavcodec/options_table.h libavcodec/snowenc.c libavcodec/tiffenc.c libavdevice/v4l2.c libavdevice/x11grab.c libavfilter/af_amix.c libavfilter/af_asyncts.c libavfilter/af_join.c libavfilter/buffersrc.c libavfilter/src_movie.c libavfilter/vf_delogo.c libavfilter/vf_drawtext.c libavformat/http.c libavformat/img2dec.c libavformat/img2enc.c libavformat/movenc.c libavformat/mpegenc.c libavformat/mpegtsenc.c libavformat/options_table.h libavformat/segment.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union memberMartin Storsjö2012-09-04
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '124134e42455763b28cc346fed1d07017a76e84e'Michael Niedermayer2012-09-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '124134e42455763b28cc346fed1d07017a76e84e': avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member Conflicts: libavcodec/aacenc.c libavcodec/libopenjpegenc.c libavcodec/options_table.h libavdevice/bktr.c libavdevice/v4l2.c libavdevice/x11grab.c libavfilter/af_amix.c libavfilter/vf_drawtext.c libavformat/movenc.c libavformat/options_table.h libavutil/opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union memberMartin Storsjö2012-09-04
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | v4l2: fix compile on systems that lack V4L2_PIX_FMT_CPIA1Michael Niedermayer2012-08-31
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Add CPiA video decoderStephan Hilb2012-08-31
| | | | | | | | | | | | | | | | | | The cpia video decoder is intended to be used with the v4l2 demuxer. There are some small changes to the v4l2 demuxer to support the variable frame length of the format. Fixes ticket #1537 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-07
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
| |