Skip to content

Commit

Permalink
MT#60476 Add rtcp-db (all type) attributes via generics
Browse files Browse the repository at this point in the history
Add rtcp-fb attributes applied to all payload types
via generic attributes instead of using the chopper.

This will be required when switching to the sdp create
approach.

No functional change. Tests containing `*` payload type
had to be fixed accordingly, because of the appeared
offset in the list of attributes.

Change-Id: I9fc1d2faf578a3c533cd85e5e52afd4af2062149
  • Loading branch information
zenichev committed Sep 29, 2024
1 parent a6719e9 commit 6760760
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
10 changes: 6 additions & 4 deletions daemon/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ const str rtpe_instance_id = STR_CONST(__id_buf);
/**
* Declarations for inner functions/helpers.
*/
static struct sdp_attr *sdp_attr_dup(const struct sdp_attribute *c);
static void attr_free(struct sdp_attribute *p);
static void attr_insert(struct sdp_attributes *attrs, struct sdp_attribute *attr);
INLINE void chopper_append_c(struct sdp_chopper *c, const char *s);
Expand Down Expand Up @@ -1519,8 +1520,11 @@ static int __rtp_payload_types(struct stream_params *sp, struct sdp_media *media
q = attr_list_get_by_id(&media->attributes, ATTR_RTCP_FB);
for (__auto_type ql = q ? q->head : NULL; ql; ql = ql->next) {
attr = ql->data;
if (attr->rtcp_fb.payload_type == -1)
continue;
/* rtcp-fb attributes applied on all payload types, must be added via generic attributes */
if (attr->rtcp_fb.payload_type == -1) {
struct sdp_attr *ac = sdp_attr_dup(attr);
t_queue_push_tail(&sp->generic_attributes, ac);
}
GQueue *rq = g_hash_table_lookup_queue_new(ht_rtcp_fb, GINT_TO_POINTER(attr->rtcp_fb.payload_type), NULL);
g_queue_push_tail(rq, &attr->rtcp_fb.value);
}
Expand Down Expand Up @@ -2576,8 +2580,6 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media *
goto strip;
break;
case ATTR_RTCP_FB:
if (attr->rtcp_fb.payload_type == -1)
break; // leave this one alone
if (media->codecs.codec_prefs.length > 0)
goto strip;
break;
Expand Down
18 changes: 9 additions & 9 deletions t/auto-daemon-tests.pl
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,6 @@ sub stun_succ {
m=video PORT RTP/AVP 99 97 126 123
b=TIAS:5952000
a=label:11
a=rtcp-fb:* ccm pan
a=rtcp-fb:* nack pli
a=rtcp-fb:* ccm fir
a=rtcp-fb:* ccm tmmbr
a=mid:2
a=rtpmap:99 H265/90000
a=fmtp:99 level-id=90;max-lsr=125337600;max-lps=2088960;max-tr=22;max-tc=20;max-fps=6000;x-cisco-hevc=529
Expand All @@ -191,6 +187,10 @@ sub stun_succ {
a=fmtp:126 profile-level-id=428016;packetization-mode=1;max-mbps=490000;max-fs=8160;max-cpb=200;max-dpb=16320;max-br=5000;max-smbps=490000;max-fps=6000
a=rtpmap:123 X-ULPFECUC/90000
a=fmtp:123 multi_ssrc=1;feedback=0;max_esel=1450;m=8;max_n=42;FEC_ORDER=FEC_SRTP;non_seq=1
a=rtcp-fb:* ccm pan
a=rtcp-fb:* nack pli
a=rtcp-fb:* ccm fir
a=rtcp-fb:* ccm tmmbr
a=answer:full
a=extmap:4 http://protocols.cisco.com/timestamp#100us
a=cisco-mari-psre:97 ltrf=3
Expand Down Expand Up @@ -24714,9 +24714,9 @@ sub stun_succ {
t=0 0
m=audio PORT RTP/AVP 0
c=IN IP4 203.0.113.1
a=rtcp-fb:* foobar
a=rtpmap:0 PCMU/8000
a=rtcp-fb:0 blah
a=rtcp-fb:* foobar
a=sendrecv
a=rtcp:PORT
SDP
Expand Down Expand Up @@ -24764,8 +24764,8 @@ sub stun_succ {
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVPF 0
a=rtcp-fb:* foobar
a=rtpmap:0 PCMU/8000
a=rtcp-fb:* foobar
a=sendrecv
a=rtcp:PORT
SDP
Expand Down Expand Up @@ -24867,8 +24867,8 @@ sub stun_succ {
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVPF 0
a=rtcp-fb:* foobar
a=rtpmap:0 PCMU/8000
a=rtcp-fb:* foobar
a=sendrecv
a=rtcp:PORT
SDP
Expand Down Expand Up @@ -24899,8 +24899,8 @@ sub stun_succ {
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVP 0
a=rtcp-fb:* foobar
a=rtpmap:0 PCMU/8000
a=rtcp-fb:* foobar
a=sendrecv
a=rtcp:PORT
SDP
Expand All @@ -24920,8 +24920,8 @@ sub stun_succ {
c=IN IP4 203.0.113.1
t=0 0
m=audio PORT RTP/AVPF 0
a=rtcp-fb:* foobar
a=rtpmap:0 PCMU/8000
a=rtcp-fb:* foobar
a=sendrecv
a=rtcp:PORT
SDP
Expand Down

0 comments on commit 6760760

Please sign in to comment.