nativeState proposal

Martin Thomson has pointed out that there are cases where the native property values of a device may differ from the values the user agent may present to the application.  To address this, I propose a fairly small change to the spec.  This change brings together two long-standing and differing views on how devices are related to sources and sources to tracks.

The terminology may of course need to change somewhat once the Constrainable interface changes are applied to the specification.

-- dan

---------------------------------------------------------------------------------------------------

In Section 3, under "State (Source State)", add the following:

"As represented in this specification, a source is the realization of a device as presented by the User Agent. Thus, it is possible that the actual settings of the device may differ from those presented by the User Agent.  As an example, there are some operating systems and native device APIs that will treat a camera with a single native capture resolution as if it can produce any resolution less than that value, downsampling as necessary. Even though the camera technically has only one specific width and one specific height it can support, it is likely that the User Agent will represent this camera as a source with a range of supported widths and heights. To enable the application to determine when this has occurred, tracks provide both a states() method (which always returns a setting that satisfies the constraints applied to the track) and a nativeStates() method (which always returns, to the best of the User Agent's determination, the actual setting of the native device).  Note that both state and nativeState are snapshots and can change without application involvement.  In particular, changes in the nativeState could cause changes in the state that would result in the latter values being outside of the constraints and thus causing overconstrained events for all affected tracks."



In section 4.3.3, add a new method
 MediaSourceStates nativeStates ()

whose description is

Returns an object containing all the state variables associated with the allowed constraints.  Unlike the return value from the states() method, this return object a) MUST reflect, to the best of the User Agent's ability, the actual native settings of the source device, b) MAY have values that do not match the current composite set of constraints applied by all tracks associated with this source, only to the extent necessary to reflect the native settings of the source device, and c) MUST be the same for all tracks associated with this same source.



In section 4.3.3, change the description of the states() method to read

Returns an object containing all the state variables associated with the allowed constraints.  The values in the return object MUST lie within the currently satisfied set of constraints applied by this track.

Received on Friday, 25 October 2013 00:14:58 UTC