diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-06-24 02:54:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-06-24 03:07:04 +0200 |
commit | 686959e87e377c0494da636640e36779dd985c30 (patch) | |
tree | 8c4674c56f291638686e6bc3efafe0ef2b921327 /libavdevice/v4l2.c | |
parent | ffc6c8a4305d25db8a5af72389a2453b17f43646 (diff) | |
parent | adbfc605f6bbe87b292c82cd1f5d4d974fa6b73c (diff) | |
download | ffmpeg-686959e87e377c0494da636640e36779dd985c30.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
doxygen: Consistently use '@' instead of '\' for Doxygen markup.
Use av_printf_format to check the usage of printf style functions
Add av_printf_format, for marking printf style format strings and their parameters
ARM: enable thumb for Cortex-M* CPUs
nsvdec: Propagate error values instead of returning 0 in nsv_read_header().
build: remove SRC_PATH_BARE variable
build: move basic rules and variables to main Makefile
build: move special targets to end of main Makefile
lavdev: improve feedback in case of invalid frame rate/size
vfwcap: prefer "framerate_q" over "fps" in vfw_read_header()
v4l2: prefer "framerate_q" over "fps" in v4l2_set_parameters()
fbdev: prefer "framerate_q" over "fps" in device context
bktr: prefer "framerate" over "fps" for grab_read_header()
ALSA: implement channel layout for playback.
alsa: support unsigned variants of already supported signed formats.
alsa: add support for more formats.
ARM: allow building in Thumb2 mode
Conflicts:
common.mak
doc/APIchanges
libavcodec/vdpau.h
libavdevice/alsa-audio-common.c
libavdevice/fbdev.c
libavdevice/libdc1394.c
libavutil/avutil.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r-- | libavdevice/v4l2.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 7223654891..468c133f60 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -439,19 +439,19 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) struct v4l2_streamparm streamparm = {0}; struct v4l2_fract *tpf = &streamparm.parm.capture.timeperframe; int i, ret; - AVRational fps; + AVRational framerate_q; streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (s->framerate && (ret = av_parse_video_rate(&fps, s->framerate)) < 0) { - av_log(s1, AV_LOG_ERROR, "Couldn't parse framerate.\n"); + if (s->framerate && (ret = av_parse_video_rate(&framerate_q, s->framerate)) < 0) { + av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate); return ret; } #if FF_API_FORMAT_PARAMETERS if (ap->channel > 0) s->channel = ap->channel; if (ap->time_base.num) - fps = (AVRational){ap->time_base.den, ap->time_base.num}; + framerate_q = (AVRational){ap->time_base.den, ap->time_base.num}; #endif /* set tv video input */ @@ -500,23 +500,23 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) } } - if (fps.num && fps.den) { + if (framerate_q.num && framerate_q.den) { av_log(s1, AV_LOG_DEBUG, "Setting time per frame to %d/%d\n", - fps.den, fps.num); - tpf->numerator = fps.den; - tpf->denominator = fps.num; + framerate_q.den, framerate_q.num); + tpf->numerator = framerate_q.den; + tpf->denominator = framerate_q.num; if (ioctl(s->fd, VIDIOC_S_PARM, &streamparm) != 0) { av_log(s1, AV_LOG_ERROR, "ioctl set time per frame(%d/%d) failed\n", - fps.den, fps.num); + framerate_q.den, framerate_q.num); return AVERROR(EIO); } - if (fps.num != tpf->denominator || - fps.den != tpf->numerator) { + if (framerate_q.num != tpf->denominator || + framerate_q.den != tpf->numerator) { av_log(s1, AV_LOG_INFO, "The driver changed the time per frame from %d/%d to %d/%d\n", - fps.den, fps.num, + framerate_q.den, framerate_q.num, tpf->numerator, tpf->denominator); } } else { @@ -581,7 +581,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */ if (s->video_size && (res = av_parse_video_size(&s->width, &s->height, s->video_size)) < 0) { - av_log(s1, AV_LOG_ERROR, "Couldn't parse video size.\n"); + av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n", s->video_size); goto out; } if (s->pixel_format && (pix_fmt = av_get_pix_fmt(s->pixel_format)) == PIX_FMT_NONE) { |