It also allows browser-based Flash apps to access the camera. This is tested using www/firefox35 and www/linux-f10-flashplugin10 together with www/nspluginwrapper.
The files below have been tested and work on 7.2, 8.0 and 9-current.
On 9-current, where versions of these have been committed, you only need to update linux_ioctl.c; the other files are unchanged from the committed versions. For an explanation of the changes between this version and the committed version, see Video Clipping below.
On 7.2 and 8.0, you will need to apply this diff:
In the directory /usr/src/sys/compat/linux:
| Filename | Size | Last Updated | |||
|---|---|---|---|---|---|
| • | linux_video.diff | 26449 | 2009/12/19 13:50:31 UTC |
On 8.0, you can just copy these four files if you prefer:
| Filename | Size | Last Updated | |||
|---|---|---|---|---|---|
| • | linux_ioctl.c | 77080 | 2009/12/19 13:50:31 UTC | ||
| • | linux_ioctl.h | 18851 | 2009/11/19 20:10:18 UTC | ||
| • | linux_videodev.h | 11843 | 2009/11/19 20:11:04 UTC | ||
| • | linux_videodev_compat.h | 1093 | 2009/12/02 19:44:48 UTC |
Video clipping allows the user to provide either a series of clip rectangles or a clip bitmap to the driver and have the driver mask the video according to the clipping specs provided.
Adding support for clipping to the FreeBSD Linux emulator is problematic because it seems that this feature is not supported by many drivers and therefore it is ignored by many applications. Unfortunately, when not using it, rather than passing in a null clipping list, some apps leave the clipping fields uninitialized, casuing random values to be passed in. In the case where the driver does not use the clipping info, this is not a problem (although it is bad form). But the Linux emulator does not know which drivers will use this and which won't, so the Linux emulator must try to handle this clip list, and deal gracefully with cases where the values seem to be uninitialized.
Video clipping info is passed in using the VIDIOCSWIN ioctl in two fields in the video_window structure: the integer clipcount and the pointer clips.
The emulator code currently handles the clip data as follows:
Feedback from folk familiar with the use of the clipping list is requested, regarding whether the above handling seems appropriate.
It should be noted that, at the time of developing this V4L emulator code, the pwc(4) V4L driver does not support clipping.