pwc
[Top] [All Lists]

[pwc] pwc, v4l2, VIDIOC_DQBUF and mplayer

To:
Subject: [pwc] pwc, v4l2, VIDIOC_DQBUF and mplayer
From: Andrea <>
Date: Fri, 04 Jul 2008 23:17:07 +0100
Hi,

I have a Logitech QuickCam 4000 Pro USB and I am trying to use mplayer to play 
the video.
This is the command I use

mplayer -tv width=640:height=480:driver=v4l2 -fps 15 tv://

But when I quit mplayer hangs in the following line, while shutting down the 
video

         /* unqueue all remaining buffers */
         memset(&buf,0,sizeof(buf));
         buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
         buf.memory = V4L2_MEMORY_MMAP;
         while (!ioctl(priv->video_fd, VIDIOC_DQBUF, &buf));

Which is more or less at line 1111 of stream/tvi_v4l2.c.

The problem is that the ioctl call VIDIOC_DQBUF never returns.
Reading the doc for VIDIOC_DQBUF
http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec/r8849.htm

The function should stop if there is no block to unqueue, unless it has been 
opened with O_NONBLOCK.
mplayer DOES NOT use O_NONBLOCK, so the call is allowed to block.

The problems are 2

1) I've tried to open with O_NONBLOCK and the ioctl blocks anyway.
pwc-v4l.c at line 1120 does not check for O_NONBLOCK.
Is this a bug?

2) should mplayer handle the situation in a different way? is there a way to 
check if there are 
queued blocks?

Andrea

_______________________________________________
pwc mailing list

http://lists.saillard.org/mailman/listinfo/pwc

<Prev in Thread] Current Thread [Next in Thread>
  • [pwc] pwc, v4l2, VIDIOC_DQBUF and mplayer, Andrea <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU