Mercurial > mplayer.hg
comparison stream/tvi_v4l2.c @ 27139:0917bf2bed6c
Try to get frame rate information through VIDIOC_G_PARM if
capture device driver (such as uvcvideo USB video driver) does
not provide VIDIOC_G_STD ioctl.
author | voroshil |
---|---|
date | Mon, 30 Jun 2008 17:46:27 +0000 |
parents | 62916b06a055 |
children | 14c5017f40d2 |
comparison
equal
deleted
inserted
replaced
27138:62916b06a055 | 27139:0917bf2bed6c |
---|---|
446 { | 446 { |
447 v4l2_std_id id; | 447 v4l2_std_id id; |
448 int i=0; | 448 int i=0; |
449 | 449 |
450 if (ioctl(priv->video_fd, VIDIOC_G_STD, &id) < 0) { | 450 if (ioctl(priv->video_fd, VIDIOC_G_STD, &id) < 0) { |
451 struct v4l2_streamparm parm; | |
452 | |
453 parm.type=V4L2_BUF_TYPE_VIDEO_CAPTURE; | |
454 if(ioctl(priv->video_fd, VIDIOC_G_PARM, &parm) >= 0) { | |
455 mp_msg(MSGT_TV, MSGL_WARN, "%s: your device driver does not support VIDIOC_G_STD ioctl," | |
456 " VIDIOC_G_PARM was used instead.\n", info.short_name); | |
457 priv->standard.index=0; | |
458 priv->standard.id=0; | |
459 priv->standard.frameperiod=parm.parm.capture.timeperframe; | |
460 return 0; | |
461 } | |
462 | |
451 mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl get standard failed: %s\n", | 463 mp_msg(MSGT_TV, MSGL_ERR, "%s: ioctl get standard failed: %s\n", |
452 info.short_name, strerror(errno)); | 464 info.short_name, strerror(errno)); |
453 return -1; | 465 return -1; |
454 } | 466 } |
455 do { | 467 do { |