-
Notifications
You must be signed in to change notification settings - Fork 70
Add support for a=imageattr (RFC 6236) #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- add export.parseImageattrParams()
lib/parser.js
Outdated
| list.push(params); | ||
| }); | ||
|
|
||
| return list; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the forEach in here should be a map so you don't have to think about the list temporary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| t.deepEqual(imageattr1RecvParams, [ | ||
| {'x': 1280, 'y': 720}, | ||
| {'x': 320, 'y': 180}, | ||
| ], 'video 1st imageattr recv params'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is nice
lib/grammar.js
Outdated
| //a=imageattr:* send [x=800,y=640] recv * | ||
| //a=imageattr:100 recv [x=320,y=240] | ||
| push: 'imageattrs', | ||
| reg: /^imageattr:(\d+|\*)(?:[\s\t]+send[\s\t]+(\*|\[\S+\](?:[\s\t]+\[\S+\])?)+)?(?:[\s\t]+recv[\s\t]+(\*|\[\S+\](?:[\s\t]+\[\S+\])?)+)?/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's one solid regex - i'd consider breaking this into multiple lines with comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A literal regular expression cannot be broken into multiple lines. The only workaround is using a RegExp object, but not sure if that would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, you'd have to use that instead of literal, but they are both regexes, it should work fine.
that said, it's not that bad, it just looks big at first sight due to all the repeated [\s\t] whitespace matchers. feel free to merge this now that you added the other changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too late, done 66eeb3c :)
|
nice addition, thanks a lot. left some suggestions, nothing super important though. |
| '(?:[\\s\\t]+send[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])?)+)?' + | ||
| //recv [x=330,y=250] | ||
| '(?:[\\s\\t]+recv[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])?)+)?' | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. thanks a lot.
imageattrsfora=imageattrlines (RFC 6236)export.parseImageattrParams()