rtc-io / rtc-sdp

SDP parsing, filtering, munging, etc
Apache License 2.0
9 stars 3 forks source link

Add prefer codecs SDP munger + tests and example #3

Closed nathanoehlman closed 8 years ago

nathanoehlman commented 8 years ago

Adds the prefer-codecs filter function to allow for the easy specification of codec preferences.

It will identify which of the specified preferred codecs are supported by each media line (either due to a definition in an a=rtpmap line, or as a result of being a builtin IANA specified type), and for those supported types, will add them as the preferred options in the media line.

It will then add the remaining codecs that were not specified in the codec preferences in the same order they were originally specified in the media line to the end of the set of codecs.

DamonOehlman commented 8 years ago

Nice one @nathanoehlman - nice to see the sdpfilter function getting some use, and in a nicely reusable way too :)

DamonOehlman commented 8 years ago

One thought though is it worth grouping the filters in a separate filters directory?

This way usage would look something like:

const quickconnect = require('rtc-quickconnect');
const preferCodecs = require('rtc-quickconnect/filters/prefer-codecs');

That way you can start to add more filters without cluttering up the root directory. Up to you though :)

magestican commented 8 years ago

One thought though is it worth grouping the filters in a separate filters directory?

This way usage would look something like:

const quickconnect = require('rtc-quickconnect'); const preferCodecs = require('rtc-quickconnect/filters/prefer-codecs'); That way you can start to add more filters without cluttering up the root directory. Up to you though :)

@DamonOehlman this looks nice but its not dynamic at least not in our solution since we browserify quickconnect and publish the bundle for our apps, i think the current implementation is good

silviapfeiffer commented 8 years ago

Nice! WFM!

nathanoehlman commented 8 years ago

@DamonOehlman I was thinking about organising the filters a bit more, although I think I might just leave it as is for the moment given there's only two for the moment. I figure if I add another one, then that'll be a good indication that it's time to organise ;)