Re: [GIT PULL] V4L2 file handles and event interface

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

 



> Mauro Carvalho Chehab wrote:
>>>>     Video device drivers should use the v4l2_fh pointer as their
>>>>     file->private_data.
>
> ...
>
>>> The struct v4l2_fh is meant to be a part of the driver's own file
>>> handle
>>> structure. It does not attempt to offer drivers anything directly but
>>> generic functionality that depends on file handle specific data such as
>>> V4L2 events. E.g.
>>>
>>> struct my_video_fh {
>>> 	blah;
>>> 	struct v4l2_fh fh;
>>> 	blah;
>>> };
>
> An additional comment about this:
>
> On your comment, you said that "Video device drivers should use the
> v4l2_fh
> pointer as their file->private_data.".
> This can be understood as:
> 	file->private_data = v4l2_fh;
>
> But a driver following your example, should do, instead:
> 	file->private_data = my_video_fh;

No, it should do:

        file->private_data = &my_video_fh.fh;

Then later you can use to_container to get back to my_video_fh.

But it is true that a short example might clarify things.

Regards,

       Hans

>
> Please, be sure that you document it clearly when you submit it again.
>
> --
>
> Cheers,
> Mauro
> --
> 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
>


-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

--
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

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux