Trying to set auto_exposure on this camera to 0 (which according to the driver should be acceptable, see min=0) results in an error, since no menu item with index 0 is defined. Calling decrease() would fail for the same reason: there is no menu item with index 2.
One possible solution would be to not rely on the minimum and maximum values announced by the driver when dealing with menu controls, but rather determine the lowest/highest index of all items that are defined for that menu control; similar for increasing/decreasing the control.
But.. what about other control types, such as string or boolean? While a boolean may be considered having a minimum of 0 (False) and a maximum of 1 (True), and trying to increase/decrease it may be ignored, how would that apply to a string? It appears now that introducing these helpers in https://github.com/otaku42/v4l2py/commit/c352385f343edd2fc7625d0aadf4e4b1ccb35dc9 as currently implemented was not well thought, since they each make sense only for certain control types, but not for others. Hmm.
Trying to set
auto_exposure
on this camera to 0 (which according to the driver should be acceptable, seemin=0
) results in an error, since no menu item with index 0 is defined. Callingdecrease()
would fail for the same reason: there is no menu item with index 2.One possible solution would be to not rely on the minimum and maximum values announced by the driver when dealing with menu controls, but rather determine the lowest/highest index of all items that are defined for that menu control; similar for increasing/decreasing the control.
But.. what about other control types, such as
string
orboolean
? While aboolean
may be considered having a minimum of 0 (False) and a maximum of 1 (True), and trying to increase/decrease it may be ignored, how would that apply to astring
? It appears now that introducing these helpers in https://github.com/otaku42/v4l2py/commit/c352385f343edd2fc7625d0aadf4e4b1ccb35dc9 as currently implemented was not well thought, since they each make sense only for certain control types, but not for others. Hmm.