H.264/AVC profileLevelId - should be DOMString? #587

Closed
aboba opened this Issue Aug 31, 2016 · 5 comments

Projects

None yet

3 participants

@aboba
Contributor
aboba commented Aug 31, 2016

Currently, the H.264 profileLevelId is defined as unsigned long. This is inconvenient - developers can more easily manipulate it as a string.

@mjerris
mjerris commented Aug 31, 2016

Switching it to a string brings all kinds of additional issues with validating invalid data coming in. Either in long or string, it will still require a chart of valid values and what they mean, is it really inconvenient, seems the error that will be caused by people putting in strings that are kind of but not quite valid is much more inconvenient.

@aboba aboba added a commit that referenced this issue Aug 31, 2016
@aboba aboba H.264/AVC profileLevelId as DOMString
Fix for Issue #587
45facef
@aboba aboba added the PR exists label Aug 31, 2016
@aboba
Contributor
aboba commented Aug 31, 2016

Since the codec parameter dictionary is provided as a JSON blob, ORTC implementations already parse and validate the profileLevelId parameter represented as a string, and shim libraries such as adapter.js already handle profile-level-id that way, since profile-level-id is an SDP string in WebRTC 1.0. So in practice, existing ORTC implementations already treat profileLevelId as a DOMString.

@mjerris
mjerris commented Aug 31, 2016

If thats the case, can passing an invalid value throw an exception here so its very easy to catch the mistake?

@aboba
Contributor
aboba commented Sep 10, 2016

In send() or receiver() the promise will be rejected with InvalidParameters if invalid parameters are passed as an argument.

@robin-raymond
Contributor

Converted to a string since that's the way capability will be announced by the remote party as a string because of SDP. Otherwise adapters will have to know to specially convert this value to decimal. Resolved as a string.

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