In the original version, by setting different size between resolution
and bytesperline, vcam can simulate cropping function on the screen.
However there is three main drawbacks:
vcam crop left-top partition of the screen, which in most
cases users would expect for the middle region.
The origin implementation is lack of expansibility to offer user
to choose their region of interest.
vcam doesn't make good use of the var information in fb device.
By speculate how FFmpeg operate in fbdev_enc.c, I rewrite the
cropping mechanism by using fbdev information including x/yres,
x/yres_virtual, x/yoffset. Instead of copy all the information
sended from users, only select those we want to display to
copy_from_user.
Current version obtains the following improvement:
vcam is able to crop the middle region of the picture.
This version has the potential to offer user to choose their
region of interest, and will be my future work.
This version can finally pass all the v4l2-compliance when we allow
cropping and scaling together.
In the original version, by setting different size between resolution and bytesperline, vcam can simulate cropping function on the screen. However there is three main drawbacks:
var
information in fb device.By speculate how FFmpeg operate in
fbdev_enc.c
, I rewrite the cropping mechanism by using fbdev information includingx/yres
,x/yres_virtual
,x/yoffset
. Instead of copy all the information sended from users, only select those we want to display tocopy_from_user
.Current version obtains the following improvement:
cropping
andscaling
together.