Browse Source

MT#56465 sdp_parse: add support of `b=AS:`

As the standard assumes, that the bandwidth
can be also controlled per media, it makes
sense to support it, so introduce `b=AS:` attr
parsing.

Change-Id: Id4b344c10bbd45b1f3ba14a882d58072a4e43c68
pull/1838/head
Donat Zenichev 1 year ago
parent
commit
fee6c2b5d1
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      daemon/sdp.c

+ 6
- 3
daemon/sdp.c View File

@ -124,7 +124,7 @@ struct sdp_media {
struct sdp_connection connection; struct sdp_connection connection;
const char *c_line_pos; const char *c_line_pos;
int rr, rs;
int as, rr, rs;
struct sdp_attributes attributes; struct sdp_attributes attributes;
GQueue format_list; /* list of slice-alloc'd str objects */ GQueue format_list; /* list of slice-alloc'd str objects */
enum media_type media_type_id; enum media_type media_type_id;
@ -1325,7 +1325,7 @@ new_session:
goto error; goto error;
t_queue_push_tail(&session->media_streams, media); t_queue_push_tail(&session->media_streams, media);
media->s.s = b; media->s.s = b;
media->rr = media->rs = -1;
media->rr = media->rs = media->as = -1;
media->media_sdp_id = media_sdp_id++; media->media_sdp_id = media_sdp_id++;
break; break;
@ -1366,7 +1366,10 @@ new_session:
/* RR:0 */ /* RR:0 */
if (line_end - value < 4) if (line_end - value < 4)
break; break;
if (!memcmp(value, "RR:", 3))
/* AS only supported per media */
if (media && !memcmp(value, "AS:", 3))
*(&media->as) = (line_end - value == 4 && value[3] == '0') ? 0 : 1;
else if (!memcmp(value, "RR:", 3))
*(media ? &media->rr : &session->rr) = *(media ? &media->rr : &session->rr) =
(line_end - value == 4 && value[3] == '0') ? 0 : 1; (line_end - value == 4 && value[3] == '0') ? 0 : 1;
else if (!memcmp(value, "RS:", 3)) else if (!memcmp(value, "RS:", 3))


Loading…
Cancel
Save