mirror of
https://github.com/mpv-player/mpv
synced 2024-12-15 03:15:52 +00:00
v4l2 check
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10594 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9be023633c
commit
7dadaf5e39
@ -404,6 +404,18 @@ static void init_v4l_audio(priv_t *priv)
|
||||
}
|
||||
}
|
||||
|
||||
struct v4l2_capability
|
||||
{
|
||||
__u8 driver[16]; /* i.e. "bttv" */
|
||||
__u8 card[32]; /* i.e. "Hauppauge WinTV" */
|
||||
__u8 bus_info[32]; /* "PCI:" + pci_dev->slot_name */
|
||||
__u32 version; /* should use KERNEL_VERSION() */
|
||||
__u32 capabilities; /* Device capabilities */
|
||||
__u32 reserved[4];
|
||||
};
|
||||
|
||||
#define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
|
||||
|
||||
static int init(priv_t *priv)
|
||||
{
|
||||
int i;
|
||||
@ -427,6 +439,16 @@ static int init(priv_t *priv)
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* check for v4l2 */
|
||||
if (ioctl(priv->video_fd, VIDIOC_QUERYCAP, &priv->capability) == 0) {
|
||||
mp_msg(MSGT_TV, MSGL_ERR, "=================================================================\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, " WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, " As the V4L1 compatibility layer is broken, this may not work.\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, " If you encounter any problems, use driver=v4l2 instead.\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, " Bugreports on driver=v4l with v4l2 drivers will be ignored.\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, "=================================================================\n");
|
||||
}
|
||||
|
||||
/* get capabilities (priv->capability is needed!) */
|
||||
if (ioctl(priv->video_fd, VIDIOCGCAP, &priv->capability) == -1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user