GNOME Bugzilla – Bug 107296
[PATCH] v4l doesn't close device on failure and fails to quickly
Last modified: 2004-12-22 21:47:04 UTC
When v4lelement changes state from NULL to READY and it fails the video device is kept open. Also when setting an audio options fails, NULL to READY is declared as a failure. Unfortunely the pwc driver says it has a audio device, but returns a failure on all audio options one tries to set. Because of this the v4l plugin doesn't work at all with a philips webcam. The patch fixes the first issue and works around the second
Created attachment 14699 [details] [review] patch for gstv4lelement
I don't like that audio part - why does the webcam driver say it has an audio device at all if it doesn't? That sounds like a driver bug. It's better to not set the audio properties at all... making gstv4lelement->mute a gint8 and setting it to default -1 is a good way of doing this. How about that?
Created attachment 14709 [details] [review] something like this
> why does the webcam driver say it has >an audio device at all if it doesn't? That sounds like a driver bug. I already e-mailed the author about that. The webcam has a mic, but it is not accessible through the v4l api. According to him the flag is informational only and in the future it will be possible to ask to which audio device it is coupled.. Your patch works fine and is indeed a better solution to the problem
(patch applied to CVS/HEAD, please reopen if something's still wrong). -edit- concerning the driver, the driver author is wrong (imho). In v4l2, these flags are partly informational (there's an additional syscall for per-input audio information). In v4l1, the flag informs applications that the driver can do sound. In both cases, if the v4l api is not used for sound, it shouldn't say it has sound. v4l will never include information about which device does sound, since that's outside the scope of v4l (and system-specific). Informational doesn't mean "show me how cool my cam is", it means "give information to the application what features the cam provides over this API".
I agree with you on the driver part, but i don't feel like argueing with it's author ;)