This commit focus on the problem according to issue#23. There are three
main changes:
Modify TRY_FMT to only negotiate and fill in information to user,
while S_FMT responsible for switching device format.
Initialize the expected format in create_vcam_device rather than
accomplish it in S_FMT, and open S_FMT scaling option for user to
switch from three kinds of resolution defined in vcam_sizes[]
Extract negotiate_resolution and set_crop_resolution function for
reuse in TRY_FMT, S_FMT, create_vcam_device.
The version can pass compliance test from scaling mode and cropping mode.
However the current version could not pass scaling+cropping mode in
TRY_FMT and S_FMT, which I think in current implementation is not able
to pass it. Because G_FMT return crop resolution, and in TRY_FMT will
negotiate with crop resolution which will return a new resolution type.
The test will fail when "TRY_FMT(G_FMT) != G_FMT".
The reason why we can use it normally on vlc player is that vlc will S_FMT
base on input_format but not the format return by G_FMT. I don't know
the detail how vlc player work, but it is the behavior I found.
This commit focus on the problem according to issue#23. There are three main changes:
TRY_FMT
to only negotiate and fill in information to user, whileS_FMT
responsible for switching device format.create_vcam_device
rather than accomplish it inS_FMT
, and openS_FMT
scaling option for user to switch from three kinds of resolution defined invcam_sizes[]
negotiate_resolution
andset_crop_resolution
function for reuse inTRY_FMT
,S_FMT
,create_vcam_device
.The version can pass compliance test from scaling mode and cropping mode. However the current version could not pass scaling+cropping mode in
TRY_FMT
andS_FMT
, which I think in current implementation is not able to pass it. BecauseG_FMT
return crop resolution, and inTRY_FMT
will negotiate with crop resolution which will return a new resolution type. The test will fail when "TRY_FMT(G_FMT) != G_FMT".The reason why we can use it normally on vlc player is that vlc will
S_FMT
base on input_format but not the format return byG_FMT
. I don't know the detail how vlc player work, but it is the behavior I found.