Re: V4l Api: video_register() fails.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



>>        camera->v4l.priv = (void*)camera;

> I don't think you're supposed to use the priv field here. Using fops
> should give you a 'struct file *file' on open(), use file->private_data
> for these purposes. On open(), just search the global array of
> registered devices for which device was being opened. That way, you
> don't need to use the priv field.

I usually need the struct video_device 'priv' field to obtain the main 
structure using the new v4l1 interface (video_devdata() in particular). On 
open , for example:

int open(struct file* filp, ..., ....)
{
	...
	struct my_device* camera = 
	                               (struct my_device*)video_devdata(filp)->priv;
	...
}

I think it is more clear this way...

Luca Risolia






[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux