Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pan and Tilt Constraints #177

Closed
dsanders11 opened this issue May 16, 2017 · 7 comments
Closed

Pan and Tilt Constraints #177

dsanders11 opened this issue May 16, 2017 · 7 comments

Comments

@dsanders11
Copy link
Contributor

What are the feelings on adding a pan constraint and a tilt constraint?

Both settings are part of the UVC spec. They're supported on Windows (getRange_Pan and getRange_Tilt) and via V4L2 on Linux (V4L2_CID_PAN_ABSOLUTE and V4L2_CID_TILT_ABSOLUTE).

They do not, however, appear to be supported on Android via either API (android.hardware.camera or android.hardware.camera2). Most built-in cameras on Android devices likely don't support them anyway, from my experience.

Logitech webcams support pan and tilt and it would be a great resource to have in the spec for fully controlling these types of cameras.

@dsanders11
Copy link
Contributor Author

@YellowDoge, thoughts? I do see in this commit you mentioned "Avoid reset PAN/TILT controls due to Image Capture API not giving access
to them (yet)" so it sounds like you're in favor of adding the controls to the spec.

Anything learned there with V4L2 that makes the implementation seem too tricky to tackle at the moment?

@yell0wd0g
Copy link
Member

Yeah, there's a private webcam extension (code), essentially a JS-surfaced IDL directly touching the filesystem /dev/videoX to manipulate zoom, pan and tilt for certain cameras (more code). The issue that prompted that commit was to avoid resetting those controls because the clients of this extension API relied on the V4L2 API persisting the configuration values.

@dsanders11
Copy link
Contributor Author

Would that pose a large problem for adding pan and tilt constraints, or does it seem possible to work around?

@yell0wd0g
Copy link
Member

yell0wd0g commented May 24, 2017

I think the private api should not prevent consensus and addition to the spec of this new capabilities/constraints, but from the point of view of the implementation, we should have a way to allow those users an easy migration and right now they rely on the UVC camera to store the last configured state (except across reboots). Such path could be provided via a method to return constraints to their default values; a discussion did not really clarify to me if applyConstraints() (with an empty dictionary) would clear all constraints (which would cover my needs), or do nothing at all :-)

@jan-ivar, wdyt?

@jan-ivar
Copy link
Member

Yes applyConstraints({}) removes all your constraints, leaving the device "unconstrained" if you are the only user. Other tabs may be accessing the same device, but barring that edge-case, the API should¹ play well with outside controls (which could even be a web api in a different tab).

As to "default values", constraints is a device settings API. Device setting defaults may vary from browser to browser, device to device, or even the situation, so never rely on them. If you care about a setting, constrain it.

1. In theory. The browser is the ultimate owner of the device. How well it plays with others depends.

@dsanders11
Copy link
Contributor Author

@YellowDoge, @jan-ivar, unless any reasons not to, I'll go ahead and make a PR adding pan and tilt to the spec, after the focus distance PR is finished (still waiting on IPR stuff).

@yell0wd0g
Copy link
Member

Ofc, please go ahead, we'll debate over the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants