Hello Hans, On 09/26/2011 04:25 PM, Hans Verkuil wrote: > On Wednesday, September 14, 2011 16:30:47 Sylwester Nawrocki wrote: >> On 09/14/2011 09:10 AM, Scott Jiang wrote: >>>>> +static int bcap_qbuf(struct file *file, void *priv, >>>>> + struct v4l2_buffer *buf) >>>>> +{ >>>>> + struct bcap_device *bcap_dev = video_drvdata(file); >>>>> + struct v4l2_fh *fh = file->private_data; >>>>> + struct bcap_fh *bcap_fh = container_of(fh, struct bcap_fh, fh); >>>>> + >>>>> + if (!bcap_fh->io_allowed) >>>>> + return -EACCES; >>>> >>>> I suppose -EBUSY would be more appropriate here. >>>> >>> no, io_allowed is to control which file instance has the right to do I/O. >> >> Looks like you are doing here what the v4l2 priority mechanism is meant for. >> Have you considered the access priority (VIDIOC_G_PRIORITY/VIDIOC_S_PRIORITY >> and friends)? Does it have any shortcomings? > > Sylwester, the priority handling doesn't take care of this particular case. > > When it comes to streaming you need to administrate which filehandle started > the streaming and block any other filehandle from interfering with that. > > This check should really be done in vb2. True, I've noticed QBUF/DQBUF are not touched by the priority handling. Perhaps I didn't follow the discussions in this topic carefully enough. Then we seem to have another feature request for vb2. -- Thanks, Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html