Commit 483bdcf8 authored by Olivier Crête's avatar Olivier Crête
Browse files

agent: Warn on invalid media types for SDP

Only 6 strings are valid.

https://bugs.freedesktop.org/show_bug.cgi?id=90019
parent 52534c43
...@@ -5314,6 +5314,18 @@ nice_agent_set_stream_name (NiceAgent *agent, guint stream_id, ...@@ -5314,6 +5314,18 @@ nice_agent_set_stream_name (NiceAgent *agent, guint stream_id,
g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE); g_return_val_if_fail (NICE_IS_AGENT (agent), FALSE);
g_return_val_if_fail (stream_id >= 1, FALSE); g_return_val_if_fail (stream_id >= 1, FALSE);
g_return_val_if_fail (name, FALSE);
if (strcmp (name, "audio") &&
strcmp (name, "video") &&
strcmp (name, "text") &&
strcmp (name, "application") &&
strcmp (name, "message") &&
strcmp (name, "image")) {
g_critical ("Stream name %s will produce invalid SDP, only \"audio\","
" \"video\", \"text\", \"application\", \"image\" and \"message\""
" are valid", name);
}
agent_lock(); agent_lock();
......
...@@ -1253,8 +1253,12 @@ void nice_agent_set_software ( ...@@ -1253,8 +1253,12 @@ void nice_agent_set_software (
* @stream_id: The ID of the stream to change * @stream_id: The ID of the stream to change
* @name: The new name of the stream or %NULL * @name: The new name of the stream or %NULL
* *
* This function will assign a unique name to a stream. * This function will assign a media type to a stream. The only values
* This is only useful when parsing and generating an SDP of the candidates. * that can be used to produce a valid SDP are: "audio", "video",
* "text", "application", "image" and "message".
*
* This is only useful when parsing and generating an SDP of the
* candidates.
* *
* <para>See also: nice_agent_generate_local_sdp()</para> * <para>See also: nice_agent_generate_local_sdp()</para>
* <para>See also: nice_agent_parse_remote_sdp()</para> * <para>See also: nice_agent_parse_remote_sdp()</para>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment