Commit Graph

80 Commits

Author SHA1 Message Date
Luca Barbato cd2bbad303 v4l2: set the proper codec_tag
Unbreak direct streamcopy.
2012-01-04 13:10:20 +01:00
Luca Barbato eb89b4fc09 v4l2: refactor device_open
Check capabilities directly in the function, further simplify the code.
2012-01-04 13:10:20 +01:00
Luca Barbato 246007d370 v4l2: simplify away io_method
Only mmap is supported.
2012-01-04 13:10:20 +01:00
Luca Barbato a896d7f45a v4l2: cosmetics 2012-01-04 13:10:20 +01:00
Luca Barbato 21aa6ae4fb v4l2: uniform and format options 2012-01-04 13:10:20 +01:00
Luca Barbato af7123b2ad v4l2: do not force interlaced mode
Video4linux2 supports both interlaced and non-interlaced mode, do not
ask for interlaced if not necessary.
2012-01-04 13:10:20 +01:00
Janne Grunau 1adba23cec v4l2: remove unneded linux specific asm/types.h include 2011-12-27 16:07:58 +01:00
Anton Khirnov c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Reimar Döffinger bb3244dee2 Replace all usage of strcasecmp/strncasecmp
All current usages of it are incompatible with localization.
For example strcasecmp("i", "I") != 0 is possible, but would
break many of the places where it is used.

Instead use our own implementations that always treat the data
as ASCII.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:52:57 +02:00
Anton Khirnov 3b3bbdd3e6 lavf,lavd: replace av_new_stream->avformat_new_stream part I.
Trivial replacements with sed are done in this commit:
sed 's/av_new_stream(\([^)]*\), 0)/avformat_new_stream(\1, NULL)/'
2011-10-19 17:02:11 +02:00
Anton Khirnov 145f741e11 AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* 2011-10-12 16:51:16 +02:00
Diego Biurrun 30b4ee7901 Use explicit struct initializers for AVOutputFormat/AVInputFormat declarations. 2011-09-24 12:11:17 +02:00
Anton Khirnov c14fe6bc99 lavf,lavd: remove all usage of AVFormatParameters from demuxers.
AVFormatParameters are converted into corresponding private options in
av_open_input_file/stream() compat wrappers, so accessing them from
demuxers is redundant.
2011-08-15 19:59:48 +02:00
Stefano Sabatini 41b68dce4d lavdev: improve feedback in case of invalid frame rate/size
Show the invalid string in the error message.

While at it also prefer "Could not" over "Couldn't", plain forms are
preferred over contractions (simplify readability, especially for non
English-savvy people).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-23 08:49:49 +02:00
Stefano Sabatini e60068baeb v4l2: prefer "framerate_q" over "fps" in v4l2_set_parameters()
The variable is used for containing the parsed value of framerate,
using a lexically consistent name eases readability/understanding.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-23 08:49:49 +02:00
Luca Barbato 2c6fb9f032 v4l2: do not force NTSC as standard
Setting a standard is meaningful only for analog capture devices.
2011-06-05 14:20:56 -05:00
Anton Khirnov 367732832f lavf,lavc: free avoptions in a generic way.
It's simpler and less error-prone.

Fixes some memleaks along the way.
2011-06-05 15:01:36 +02:00
Anton Khirnov a3b15e411d fbdev,v4l2: remove some forgotten uses of AVFormatParameters.time_base. 2011-06-04 19:48:08 +02:00
Anton Khirnov fefa67d536 v4l2: remove one forgotten use of AVFormatParameters.pix_fmt. 2011-06-02 21:52:15 +02:00
Anton Khirnov c21324eeb6 v4l2: add a framerate private option. 2011-06-02 21:52:15 +02:00
Anton Khirnov 7a70e01b26 v4l2: don't leak video standard string on error. 2011-05-29 15:10:35 +02:00
Anton Khirnov d576bbf3eb v4l2: add a pixel_format private option. 2011-05-27 23:33:51 +02:00
Anton Khirnov 8fe7b6443f v4l2: add video_size private option. 2011-05-27 06:52:51 +02:00
Anton Khirnov 82b5aa0add v4l2: factorize returning error codes.
This will be useful in the following commit.
2011-05-27 06:52:51 +02:00
Anton Khirnov d20576d01b lavf: deprecate AVFormatParameters.channel. 2011-05-25 15:55:47 +02:00
Anton Khirnov 3d2a418605 v4l2: reindent. 2011-05-25 15:55:47 +02:00
Anton Khirnov a02fd06ab7 v4l2: add a private option for channel. 2011-05-25 15:55:47 +02:00
Anton Khirnov fc68a8f703 lavf: deprecate AVFormatParameters.standard. 2011-05-25 15:55:47 +02:00
Anton Khirnov b3da269211 v4l2: add a private option for video standard. 2011-05-25 15:55:46 +02:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Reinhard Tartler 737eb5976f Merge libavcore into libavutil
It is pretty hopeless that other considerable projects will adopt
libavutil alone in other projects. Projects that need small footprint
are better off with more specialized libraries such as gnulib or rather
just copy the necessary parts that they need. With this in mind, nobody
is helped by having libavutil and libavcore split. In order to ease
maintenance inside and around FFmpeg and to reduce confusion where to
put common code, avcore's functionality is merged (back) to avutil.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-02-15 16:18:21 +01:00
Diego Elio Pettenò c6610a216e Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.
2011-01-26 22:10:09 +00:00
Stefano Sabatini 5d3d238f82 Factorize common code in v4l2_set_parameters().
Originally committed as revision 26225 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-05 14:15:13 +00:00
Stefano Sabatini 8621a37d9f In video4linux2, in the case the timebase value in ap is 0/0, read the
timebase value already set in the driver, and set it back in the codec
stream, rather than leaving the invalid value of 0/0.

In particular, fix ffmpeg grabbing timestamps when the timebase value
is not set through the CLI.

Originally committed as revision 26224 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-05 14:15:11 +00:00
Stefano Sabatini bd7d9e45a4 In the video4linux2 output device, log an error description in case of
ioctl failure in mmap_release_buffer().

Originally committed as revision 26214 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-04 18:18:01 +00:00
José Miguel Gonçalves 70f77361d8 Allow to set the frame rate in v4l2 devices
Patch by José Miguel Gonçalves (jose DOT goncalves AT inov DOT pt)

Originally committed as revision 25159 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-23 09:16:05 +00:00
Stefano Sabatini 0105889358 Cosmetics: simplify layout of fmt_conversion_table, make it shorter
and more readable.

Originally committed as revision 25108 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-12 19:44:45 +00:00
Stefano Sabatini 680861ca73 Cosmetics: apply minor style fixes.
Originally committed as revision 25106 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-11 16:44:10 +00:00
Stefano Sabatini e16f217ceb Use new imgutils.h API names, fix deprecation warnings.
Originally committed as revision 25058 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-07 19:15:29 +00:00
Pete Eberlein b4f81b7429 Add a mapping for the V4L2_PIX_FMT_NV12 format to PIX_FMT_NV12 for
video4linux2 devices. This is used by Sensoray Model 2253 cards.
Patch by Pete Eberlein (pete AT sensoray DOT com)

Originally committed as revision 24759 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-11 07:34:33 +00:00
Stefano Sabatini 6ce9b4310c Remove use of the deprecated function avcodec_check_dimensions(), use
av_check_image_size() instead.

Originally committed as revision 24711 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-06 09:37:04 +00:00
Stefano Sabatini 50f852186f Make device_open() store the VIDIOC_QUERYCAP ioctl errno, and in case
of failure return the stored value rather than the current errno,
which may be overwritten by a following call to close().

Originally committed as revision 23001 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-05-01 08:24:24 +00:00
Luca Abeni b01dba14f3 Check the return value of device_try_init() immediately after calling such a
function. Avoids the following warning:
libavdevice/v4l2.c: In function ‘v4l2_read_header’:
libavdevice/v4l2.c:586: warning: ‘codec_id’ may be used uninitialized in this function

Originally committed as revision 22986 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-28 08:02:52 +00:00
Stefano Sabatini 6e25b78001 Fix weird brace placement.
Originally committed as revision 22982 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-27 22:45:27 +00:00
Luca Abeni 1ace15f58c Reduce the verbosity of the v4l2 input device
Originally committed as revision 22980 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-27 21:33:56 +00:00
Luca Abeni 4f54d924bc Simplify some output messages in the v4l2 input device
Originally committed as revision 22979 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-27 21:32:11 +00:00
Stefano Sabatini 932d775fa2 Implement v4l2 input size autodetection in v4l2_read_header().
Move check on frame size after the device is opened and after
device_try_init() is attempted. If the provided size value is 0x0,
perform a VIDIOC_G_FMT ioctl() on the device, which sets size to the
current settings.

Originally committed as revision 22971 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-26 22:07:15 +00:00
Stefano Sabatini c57a8fefd9 Return meaningful error codes, rather than always -1.
Originally committed as revision 22966 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-26 19:40:15 +00:00
Stefano Sabatini 18225025ff Remove unnecessary width and height variables from v4l2_read_header().
Originally committed as revision 22963 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-25 18:47:40 +00:00
Stefano Sabatini 72415b2adb Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-30 23:30:55 +00:00