W3C home > Mailing lists > Public > public-media-capture@w3.org > April 2014

Some code: Constraint transformations

From: Harald Alvestrand <harald@alvestrand.no>
Date: Mon, 28 Apr 2014 13:00:55 +0200
Message-ID: <535E34E7.6000306@alvestrand.no>
To: "public-media-capture@w3.org" <public-media-capture@w3.org>
My instincts told me it was possible to mechanically transform the newly 
proposed Constraints format into the previous version of Constraints 
format without changing semantics.

But instincts don't prove much. Code does.

So here's some code:

https://github.com/alvestrand/webrtc/tree/constraint-transforms

It seems to do reasonable things on all the 3 examples in the current 
(old-style) constraints spec. And I only found one interesting corner case.

Note: The transform is NOT round-tripping; ToApril(ToJan(constraints)) 
won't give you back the same thing as you put in.

Comments, bugs and feature requests welcome! (no promises....)

         Harald
Received on Monday, 28 April 2014 11:01:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:26 UTC