All of lore.kernel.org
 help / color / mirror / Atom feed
From: "audetto@tiscali.it" <audetto@tiscali.it>
To: video4linux-list@redhat.com
Subject: An issue with: pwc, v4l2, VIDIOC_DQBUF and mplayer
Date: Sat, 5 Jul 2008 00:37:35 +0200 (CEST)	[thread overview]
Message-ID: <16342448.1215211055980.JavaMail.root@ps11> (raw)

Sorry if the message arrives twice, but when sending from gmail I 
always get
"Message has a suspicious header"
=====================================================

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



_________________________________________________________________
Tiscali Family: Adsl e Telefono senza limiti e senza scatto alla risposta. PER TE CON LO SCONTO DEL 25% FINO AL 2010. In più il software parental control Magic Desktop Basic è GRATIS! Attiva entro il 10/07/08. http://abbonati.tiscali.it/promo/tuttoincluso/ 


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

                 reply	other threads:[~2008-07-04 22:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16342448.1215211055980.JavaMail.root@ps11 \
    --to=audetto@tiscali.it \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.