aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/fbdev.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-24 02:54:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-24 03:07:04 +0200
commit686959e87e377c0494da636640e36779dd985c30 (patch)
tree8c4674c56f291638686e6bc3efafe0ef2b921327 /libavdevice/fbdev.c
parentffc6c8a4305d25db8a5af72389a2453b17f43646 (diff)
parentadbfc605f6bbe87b292c82cd1f5d4d974fa6b73c (diff)
downloadffmpeg-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/fbdev.c')
-rw-r--r--libavdevice/fbdev.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index d5ba561db8..a10d8c48c1 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -79,7 +79,7 @@ static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *var
typedef struct {
AVClass *class; ///< class for private options
int frame_size; ///< size in bytes of a grabbed frame
- AVRational fps; ///< framerate
+ AVRational framerate_q; ///< framerate
char *framerate; ///< framerate string set by a private option
int64_t time_frame; ///< time for the next frame to output (in 1/1000000 units)
@@ -102,14 +102,14 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
enum PixelFormat pix_fmt;
int ret, flags = O_RDONLY;
- ret = av_parse_video_rate(&fbdev->fps, fbdev->framerate);
+ ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate);
if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "Couldn't parse framerate.\n");
+ av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", fbdev->framerate);
return ret;
}
#if FF_API_FORMAT_PARAMETERS
if (ap->time_base.num)
- fbdev->fps = (AVRational){ap->time_base.den, ap->time_base.num};
+ fbdev->framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
#endif
if (!(st = av_new_stream(avctx, 0)))
@@ -168,15 +168,15 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
st->codec->width = fbdev->width;
st->codec->height = fbdev->heigth;
st->codec->pix_fmt = pix_fmt;
- st->codec->time_base = (AVRational){fbdev->fps.den, fbdev->fps.num};
+ st->codec->time_base = (AVRational){fbdev->framerate_q.den, fbdev->framerate_q.num};
st->codec->bit_rate =
- fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->fps) * 8;
+ fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->framerate_q) * 8;
av_log(avctx, AV_LOG_INFO,
"w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n",
fbdev->width, fbdev->heigth, fbdev->varinfo.bits_per_pixel,
av_pix_fmt_descriptors[pix_fmt].name,
- fbdev->fps.num, fbdev->fps.den,
+ fbdev->framerate_q.num, fbdev->framerate_q.den,
st->codec->bit_rate);
return 0;
@@ -204,7 +204,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
"time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
fbdev->time_frame, curtime, delay);
if (delay <= 0) {
- fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->fps);
+ fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->framerate_q);
break;
}
if (avctx->flags & AVFMT_FLAG_NONBLOCK)