[Nice] New SDP parsing API
youness.alaoui at collabora.co.uk
Tue Feb 5 11:03:01 PST 2013
On 02/05/2013 03:55 AM, Olivier Crête wrote:
> Good work!
> On Mon, 2013-02-04 at 23:39 -0500, Youness Alaoui wrote:
>> To summarize the new API, you can now call :
>> sdp_string = nice_agent_generate_local_sdp(agent);
>> which will generate a single string containing a listing of all your streams,
>> components, their credentials and candidates. You can then send that string as
>> is to a remote user, which would call :
> This should be available at least be per-media, ideally even
> per-candidate (to support trickling). Having it per-media without the m=
> line means that one can just put the blob from libnice inside you SDP
> without having to mangle it. Possibly also add some API to get the
> recommended default candidate (ie, the lowest priority).
Humm... That's a good point. So how would you suggest it? An API like this :
with parse_remote_sdp_stream/parse_remote_sdp_candidate ?
That would work.
For the default, I'm not sure, it's easy enough to find the lowest priority
candidate... although it gets confusing when you need to find the equivalent
default candidate for other components (which must have the same foundation as
the default for the first component).
If I add it, I'm thinking of :
NiceCandidate *nice_agent_get_default_candidate(agent, stream, component);
>> The SDP can also be used in a SIP call, but of course, you'd need to add your
>> codec list to it and parse it to change the 'm' line to add the payload types to
>> it. Other than that, it's a valid SDP according to the ICE RFC.
> Also, not everyone uses the RTP/AVP profile, for example WebRTC mandates
> RTP/AVPF, I would just not provide an m= line at all.
I could put something else there as placeholder like "ICE/SDP". I used "RTP/AVP"
because that's what they had in the example on the ICE RFC. and either way,
whoever uses that will have to replace the m= line anyways, so it didn't matter
what was in there, as long as it had the stream name.
I can't remove the m= line though because if you want a single SDP for the whole
agent, then you need to differentiate between the streams, and it also has the
name of the stream so I can select it. Without that generate/parse single
string, then the sdp-example would be a lot more complicated to handle.
> Also, please check https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-02
> as I believe this will become major user (it's the candidate API for
Oh that's interesting! I'll have a look thanks!
Thanks a lot for your comments! I thought you were on vacation though :p
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 263 bytes
Desc: OpenPGP digital signature
More information about the nice