Some code: Constraint transformations

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