W3C home > Mailing lists > Public > public-webrtc@w3.org > November 2013

RE: constraints vs attributes

From: Jim Barnett <Jim.Barnett@genesyslab.com>
Date: Wed, 13 Nov 2013 23:35:42 +0000
To: Jan-Ivar Bruaroey <jib@mozilla.com>, "public-webrtc@w3.org" <public-webrtc@w3.org>
Message-ID: <57A15FAF9E58F841B2B1651FFE16D2811ECC52@GENSJZMBX03.msg.int.genesyslab.com>
I agree that there are a legitimate questions about when to use Constraints vs dictionaries or other simpler structures.  We'll have to go through them  case by case.


-          Jim

From: Jan-Ivar Bruaroey [mailto:jib@mozilla.com]
Sent: Wednesday, November 13, 2013 5:48 PM
To: Jim Barnett; public-webrtc@w3.org
Subject: Re: constraints vs attributes

On 11/13/13 4:00 PM, Jim Barnett wrote:
Jan-Ivar,
For my edification, can you explain how the use of a dictionary lets you do the following:

1.       Ask the device what range of framerates it supports?

2.       Request that the device set a framerate between n and m frames per second

3.       Request the above, but allow the UA the choice of choosing another framerate if it can't set it to something between n and m.

I'm not challenging the use of constraints with devices. I happen to think that's their ideal use.

I was challenging the use of constraints in other areas like PeerConnection and MediaTrackTransmissionController.

What I meant was a lot of the organizational benefits of constraints come from them being built on dictionaries, which are quite useful on their own as well, in new API cases where constraints may be overkill. For example, someone wanting a property to have a min/max range, could trivially define this in a webidl dictionary, without requiring a constrainable interface for that reason alone.


 Jim

P.S.  Perhaps there's some terminological confusion here.  The question asked was when to define something as a property inside the Constrainable interface as opposed to an attribute.  The Constraint structure is only one part of that interface.

It is quite possible we have some confusion. I though this was from the MediaTrackTransmissionController conversation, where I interpreted the need to be that we want to access a relatively simple set settings.

.: Jan-Ivar :.
Received on Wednesday, 13 November 2013 23:36:07 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:36 UTC