From 5f767b08a0d2e6911f456ed5576a0024622edbb5 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Thu, 22 Aug 2013 15:01:03 -0400 Subject: [PATCH] Backed out changesets 3adaeac9d567 and ee85a2f2ecb1 (bug 880067) for Windows bustage on a CLOSED TREE. --- .../signaling/src/sipcc/core/gsm/gsm_sdp.c | 227 ++-------------- .../webrtc/signaling/src/sipcc/core/sdp/sdp.h | 7 +- .../signaling/src/sipcc/core/sdp/sdp_attr.c | 4 +- .../webrtc/signaling/src/sipcc/include/vcm.h | 1 - media/webrtc/signaling/test/sdp_unittests.cpp | 243 +----------------- .../signaling/test/signaling_unittests.cpp | 2 - 6 files changed, 41 insertions(+), 443 deletions(-) diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c index 9dbc369488b..ff857d84b7f 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c @@ -1,6 +1,4 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public +/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -4403,189 +4401,6 @@ fsmdef_media_t* gsmsdp_find_media_by_media_type(fsmdef_dcb_t *dcb_p, sdp_media_e return (NULL); } -/* - * gsmsdp_add_rtcp_fb - * - * Description: - * Adds a=rtcp-fb attributes to local SDP for supported video codecs - * - * Parameters: - * level - SDP media level (between 1 and the # of m-lines) - * sdp_p - pointer to local SDP - * codec - the codec type that the attributes should be added for - * types - a bitmask of rtcp-fb types to add, taken from - * sdp_rtcp_fb_bitmask_e - * - * returns - * CC_CAUSE_OK - success - * any other code - failure - */ -cc_causes_t -gsmsdp_add_rtcp_fb (int level, sdp_t *sdp_p, - rtp_ptype codec, unsigned int types) -{ - int num_pts; - int pt_codec; - sdp_payload_ind_e indicator; - - int pt_index; - unsigned int j; - num_pts = sdp_get_media_num_payload_types(sdp_p, level); - for (pt_index = 1; pt_index <= num_pts; pt_index++) { - pt_codec = sdp_get_media_payload_type (sdp_p, level, pt_index, - &indicator); - if ((pt_codec & 0xFF) == codec) { - int pt = GET_DYN_PAYLOAD_TYPE_VALUE(pt_codec); - - /* Add requested a=rtcp-fb:nack attributes */ - for (j = 0; j < SDP_MAX_RTCP_FB_NACK; j++) { - if (types & SDP_RTCP_FB_NACK_TO_BITMAP(j)) { - gsmsdp_set_rtcp_fb_nack_attribute(level, sdp_p, pt, j); - } - } - - /* Add requested a=rtcp-fb:ack attributes */ - for (j = 0; j < SDP_MAX_RTCP_FB_ACK; j++) { - if (types & SDP_RTCP_FB_ACK_TO_BITMAP(j)) { - gsmsdp_set_rtcp_fb_nack_attribute(level, sdp_p, pt, j); - } - } - - /* Add requested a=rtcp-fb:ccm attributes */ - for (j = 0; j < SDP_MAX_RTCP_FB_CCM; j++) { - if (types & SDP_RTCP_FB_CCM_TO_BITMAP(j)) { - gsmsdp_set_rtcp_fb_ccm_attribute(level, sdp_p, pt, j); - } - } - - } - } - return CC_CAUSE_OK; -} - - -/* - * gsmsdp_negotiate_rtcp_fb - * - * Description: - * Negotiates a=rtcp-fb attributes to local SDP for supported video codecs - * - * Parameters: - * cc_sdp_p - local and remote SDP - * media - The media structure for the current level to be negotiated - * offer - True if the remote SDP is an offer - * - * returns - * CC_CAUSE_OK - success - * any other code - failure - */ -cc_causes_t -gsmsdp_negotiate_rtcp_fb (cc_sdp_t *cc_sdp_p, - fsmdef_media_t *media, - boolean offer) -{ - int level = media->level; - int pt_codec; - int remote_pt; - sdp_payload_ind_e indicator; - int pt_index, i; - sdp_rtcp_fb_nack_type_e nack_type; - sdp_rtcp_fb_ack_type_e ack_type; - sdp_rtcp_fb_ccm_type_e ccm_type; - uint32_t fb_types = 0; - - int num_pts = sdp_get_media_num_payload_types(cc_sdp_p->dest_sdp, level); - - /* - * Remove any previously negotiated rtcp-fb attributes from the - * local SDP - */ - sdp_result_e result = SDP_SUCCESS; - while (result == SDP_SUCCESS) { - result = sdp_delete_attr (cc_sdp_p->src_sdp, level, 0, - SDP_ATTR_RTCP_FB, 1); - } - - /* - * For each remote payload type, determine what feedback types are - * requested. - */ - for (pt_index = 1; pt_index <= num_pts; pt_index++) { - int pt_codec = sdp_get_media_payload_type (cc_sdp_p->dest_sdp, - level, pt_index, &indicator); - remote_pt = GET_DYN_PAYLOAD_TYPE_VALUE(pt_codec); - int codec = pt_codec & 0xFF; - fb_types = 0; - - /* a=rtcp-fb:nack */ - i = 1; - do { - nack_type = sdp_attr_get_rtcp_fb_nack(cc_sdp_p->dest_sdp, - level, remote_pt, i); - if (nack_type >= 0 && nack_type < SDP_MAX_RTCP_FB_NACK) { - fb_types |= SDP_RTCP_FB_NACK_TO_BITMAP(nack_type); - } - i++; - } while (nack_type != SDP_RTCP_FB_NACK_NOT_FOUND); - - /* a=rtcp-fb:ack */ - i = 1; - do { - ack_type = sdp_attr_get_rtcp_fb_ack(cc_sdp_p->dest_sdp, - level, remote_pt, i); - if (ack_type >= 0 && ack_type < SDP_MAX_RTCP_FB_ACK) { - fb_types |= SDP_RTCP_FB_ACK_TO_BITMAP(ack_type); - } - i++; - } while (ack_type != SDP_RTCP_FB_CCM_NOT_FOUND); - - /* a=rtcp-fb:ccm */ - i = 1; - do { - ccm_type = sdp_attr_get_rtcp_fb_ccm(cc_sdp_p->dest_sdp, - level, remote_pt, i); - if (ccm_type >= 0 && ccm_type < SDP_MAX_RTCP_FB_CCM) { - fb_types |= SDP_RTCP_FB_CCM_TO_BITMAP(ccm_type); - } - i++; - } while (ccm_type != SDP_RTCP_FB_CCM_NOT_FOUND); - - /* - * Mask out the types that we do not support - */ - switch (codec) { - case RTP_VP8: - fb_types &= - SDP_RTCP_FB_NACK_TO_BITMAP(SDP_RTCP_FB_NACK_BASIC) | - SDP_RTCP_FB_NACK_TO_BITMAP(SDP_RTCP_FB_NACK_PLI) | - SDP_RTCP_FB_CCM_TO_BITMAP(SDP_RTCP_FB_CCM_FIR); - break; - default: - fb_types = 0; - } - - /* - * Now, in our local SDP, set rtcp-fb types that both we and the - * remote party support - */ - if (fb_types) { - gsmsdp_add_rtcp_fb (level, cc_sdp_p->src_sdp, codec, fb_types); - } - - /* - * Finally, update the media record for this payload type to - * reflect the expected feedback types - */ - for (i = 0; i < media->num_payloads; i++) { - if (media->payloads[i].remote_rtp_pt == remote_pt) { - media->payloads[i].video.rtcp_fb_types = fb_types; - } - } - } - - return CC_CAUSE_OK; -} - /* * gsmsdp_negotiate_media_lines * @@ -4916,11 +4731,6 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, boolean initial update_local_ret_value = TRUE; } - /* Negotiate rtcp feedback mechanisms */ - if (media && media_type == SDP_MEDIA_VIDEO) { - gsmsdp_negotiate_rtcp_fb (dcb_p->sdp, media, offer); - } - /* * Negotiate rtcp-mux */ @@ -5005,6 +4815,19 @@ gsmsdp_negotiate_media_lines (fsm_fcb_t *fcb_p, cc_sdp_t *sdp_p, boolean initial break; } + /* TODO (abr) -- temporarily hardcode rtcb-fb attributes to match our + actual behavior. This really needs to be a negotiation, with the + results of the negotiation propagating into the codec configuration. + See Bug 880067. */ + if (media && media_type == SDP_MEDIA_VIDEO) { + gsmsdp_set_rtcp_fb_nack_attribute(media->level, sdp_p->src_sdp, + SDP_ALL_PAYLOADS, + SDP_RTCP_FB_NACK_UNSPECIFIED); + gsmsdp_set_rtcp_fb_ccm_attribute(media->level, sdp_p->src_sdp, + SDP_ALL_PAYLOADS, + SDP_RTCP_FB_CCM_FIR); + } + if (unsupported_line) { /* add this line to unsupported line */ gsmsdp_add_unsupported_stream_to_local_sdp(sdp_p, i); @@ -5448,14 +5271,6 @@ gsmsdp_add_media_line (fsmdef_dcb_t *dcb_p, const cc_media_cap_t *media_cap, gsmsdp_set_local_sdp_direction(dcb_p, media, media->direction); - /* Add supported rtcp-fb types */ - if (media_cap->type == SDP_MEDIA_VIDEO) { - gsmsdp_add_rtcp_fb (level, dcb_p->sdp->src_sdp, RTP_VP8, - SDP_RTCP_FB_NACK_TO_BITMAP(SDP_RTCP_FB_NACK_BASIC) | - SDP_RTCP_FB_NACK_TO_BITMAP(SDP_RTCP_FB_NACK_PLI) | - SDP_RTCP_FB_CCM_TO_BITMAP(SDP_RTCP_FB_CCM_FIR)); - } - /* * wait until here to set ICE candidates as SDP is now initialized */ @@ -5582,6 +5397,20 @@ gsmsdp_create_local_sdp (fsmdef_dcb_t *dcb_p, boolean force_streams_enabled, level = level - 1; } } + + /* TODO (abr) -- temporarily hardcode rtcb-fb attributes to match + our actual behavior. This really needs to be a negotiation, with + the results of the negotiation propagating into the codec + configuration. See Bug 880067. */ + if (media_cap->type == SDP_MEDIA_VIDEO) { + gsmsdp_set_rtcp_fb_nack_attribute(level, dcb_p->sdp->src_sdp, + SDP_ALL_PAYLOADS, + SDP_RTCP_FB_NACK_UNSPECIFIED); + gsmsdp_set_rtcp_fb_ccm_attribute(level, dcb_p->sdp->src_sdp, + SDP_ALL_PAYLOADS, + SDP_RTCP_FB_CCM_FIR); + } + } /* next capability */ media_cap++; diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h b/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h index cda4b552625..f6afb1af459 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp.h @@ -488,7 +488,7 @@ typedef enum { typedef enum { SDP_RTCP_FB_NACK_NOT_FOUND = -1, - SDP_RTCP_FB_NACK_BASIC = 0, + SDP_RTCP_FB_NACK_UNSPECIFIED = 0, SDP_RTCP_FB_NACK_SLI, SDP_RTCP_FB_NACK_PLI, SDP_RTCP_FB_NACK_RPSI, @@ -519,11 +519,6 @@ typedef enum { SDP_RTCP_FB_CCM_UNKNOWN } sdp_rtcp_fb_ccm_type_e; -#define SDP_RTCP_FB_NACK_TO_BITMAP(type) (1 << (type)) -#define SDP_RTCP_FB_ACK_TO_BITMAP(type) (1 << (SDP_MAX_RTCP_FB_NACK + (type))) -#define SDP_RTCP_FB_CCM_TO_BITMAP(type) (1 << (SDP_MAX_RTCP_FB_NACK + \ - SDP_MAX_RTCP_FB_ACK + (type))) - /* * sdp_srtp_fec_order_t * This type defines the order in which to perform FEC diff --git a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c index 808b162648c..2992038c144 100644 --- a/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c +++ b/media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c @@ -4784,7 +4784,7 @@ sdp_result_e sdp_build_attr_rtcp_fb(sdp_t *sdp_p, } break; case SDP_RTCP_FB_NACK: - if (attr_p->attr.rtcp_fb.param.nack > SDP_RTCP_FB_NACK_BASIC + if (attr_p->attr.rtcp_fb.param.nack > SDP_RTCP_FB_NACK_UNSPECIFIED && attr_p->attr.rtcp_fb.param.nack < SDP_MAX_RTCP_FB_NACK) { flex_string_sprintf(fs, " %s", sdp_rtcp_fb_nack_type_val[attr_p->attr.rtcp_fb.param.nack] @@ -4935,7 +4935,7 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, } /* Check for empty string */ if (*ptr == '\r') { - rtcp_fb_p->param.nack = SDP_RTCP_FB_NACK_BASIC; + rtcp_fb_p->param.nack = SDP_RTCP_FB_NACK_UNSPECIFIED; break; } i = find_token_enum("rtcp-fb nack type", sdp_p, &ptr, diff --git a/media/webrtc/signaling/src/sipcc/include/vcm.h b/media/webrtc/signaling/src/sipcc/include/vcm.h index 71688e81641..13b5bd2d5d1 100755 --- a/media/webrtc/signaling/src/sipcc/include/vcm.h +++ b/media/webrtc/signaling/src/sipcc/include/vcm.h @@ -185,7 +185,6 @@ typedef struct { int width; int height; - uint32_t rtcp_fb_types; } video; }; diff --git a/media/webrtc/signaling/test/sdp_unittests.cpp b/media/webrtc/signaling/test/sdp_unittests.cpp index 80b79fdc7e5..042f86ec799 100644 --- a/media/webrtc/signaling/test/sdp_unittests.cpp +++ b/media/webrtc/signaling/test/sdp_unittests.cpp @@ -167,7 +167,7 @@ class SdpTest : public ::testing::Test { return inst_num; } - u16 AddNewRtcpFbTrrInt(int level, u32 interval, + u16 AddNewRtcpTrrInt(int level, u32 interval, u16 payload = SDP_ALL_PAYLOADS) { u16 inst_num = 0; EXPECT_EQ(sdp_add_new_attr(sdp_ptr_, level, 0, SDP_ATTR_RTCP_FB, @@ -233,7 +233,7 @@ TEST_F(SdpTest, parseRtcpFbAckFooBarBaz) { TEST_F(SdpTest, parseRtcpFbNack) { ParseSdp(kVideoSdp + "a=rtcp-fb:120 nack\r\n"); ASSERT_EQ(sdp_attr_get_rtcp_fb_nack(sdp_ptr_, 1, 120, 1), - SDP_RTCP_FB_NACK_BASIC); + SDP_RTCP_FB_NACK_UNSPECIFIED); } TEST_F(SdpTest, parseRtcpFbNackPli) { @@ -381,7 +381,7 @@ TEST_F(SdpTest, parseRtcpFbKitchenSink) { SDP_RTCP_FB_ACK_NOT_FOUND); ASSERT_EQ(sdp_attr_get_rtcp_fb_nack(sdp_ptr_, 1, 120, 1), - SDP_RTCP_FB_NACK_BASIC); + SDP_RTCP_FB_NACK_UNSPECIFIED); ASSERT_EQ(sdp_attr_get_rtcp_fb_nack(sdp_ptr_, 1, 120, 2), SDP_RTCP_FB_NACK_PLI); ASSERT_EQ(sdp_attr_get_rtcp_fb_nack(sdp_ptr_, 1, 120, 3), @@ -422,42 +422,16 @@ TEST_F(SdpTest, parseRtcpFbKitchenSink) { SDP_RTCP_FB_CCM_NOT_FOUND); } -TEST_F(SdpTest, addRtcpFbAckRpsi) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbAck(level, SDP_RTCP_FB_ACK_RPSI, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 ack rpsi\r\n"), std::string::npos); -} -TEST_F(SdpTest, addRtcpFbAckRpsiAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbAck(level, SDP_RTCP_FB_ACK_RPSI); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* ack rpsi\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbAckApp) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbAck(level, SDP_RTCP_FB_ACK_APP, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 ack app\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbAckAppAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbAck(level, SDP_RTCP_FB_ACK_APP); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* ack app\r\n"), std::string::npos); -} +/* TODO (abr@mozilla.com) These attribute adding test cases definitely need + beefing up; for now, I'm testing the two use cases that we know + we need right now. An exhaustive check of the various permutations + will look similar to the parsing tests, above */ TEST_F(SdpTest, addRtcpFbNack) { InitLocalSdp(); int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_BASIC, 120); + AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_UNSPECIFIED, 120); std::string body = SerializeSdp(); ASSERT_NE(body.find("a=rtcp-fb:120 nack\r\n"), std::string::npos); } @@ -465,154 +439,11 @@ TEST_F(SdpTest, addRtcpFbNack) { TEST_F(SdpTest, addRtcpFbNackAllPt) { InitLocalSdp(); int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_BASIC); + AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_UNSPECIFIED); std::string body = SerializeSdp(); ASSERT_NE(body.find("a=rtcp-fb:* nack\r\n"), std::string::npos); } -TEST_F(SdpTest, addRtcpFbNackSli) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_SLI, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 nack sli\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackSliAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_SLI); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* nack sli\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackPli) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_PLI, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 nack pli\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackPliAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_PLI); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* nack pli\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackRpsi) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_RPSI, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 nack rpsi\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackRpsiAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_RPSI); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* nack rpsi\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackApp) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_APP, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 nack app\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackAppAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_APP); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* nack app\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackRai) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_RAI, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 nack rai\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackRaiAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_RAI); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* nack rai\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackTllei) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_TLLEI, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 nack tllei\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackTlleiAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_TLLEI); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* nack tllei\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackPslei) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_PSLEI, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 nack pslei\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackPsleiAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_PSLEI); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* nack pslei\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackEcn) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_ECN, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 nack ecn\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackEcnAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbNack(level, SDP_RTCP_FB_NACK_ECN); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* nack ecn\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbTrrInt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbTrrInt(level, 12345, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 trr-int 12345\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbNackTrrIntAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbTrrInt(level, 0); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* trr-int 0\r\n"), std::string::npos); -} TEST_F(SdpTest, addRtcpFbCcmFir) { InitLocalSdp(); @@ -630,61 +461,7 @@ TEST_F(SdpTest, addRtcpFbCcmFirAllPt) { ASSERT_NE(body.find("a=rtcp-fb:* ccm fir\r\n"), std::string::npos); } -TEST_F(SdpTest, addRtcpFbCcmTmmbr) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbCcm(level, SDP_RTCP_FB_CCM_TMMBR, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 ccm tmmbr\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbCcmTmmbrAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbCcm(level, SDP_RTCP_FB_CCM_TMMBR); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* ccm tmmbr\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbCcmTstr) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbCcm(level, SDP_RTCP_FB_CCM_TSTR, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 ccm tstr\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbCcmTstrAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbCcm(level, SDP_RTCP_FB_CCM_TSTR); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* ccm tstr\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbCcmVbcm) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbCcm(level, SDP_RTCP_FB_CCM_VBCM, 120); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:120 ccm vbcm\r\n"), std::string::npos); -} - -TEST_F(SdpTest, addRtcpFbCcmVbcmAllPt) { - InitLocalSdp(); - int level = AddNewMedia(SDP_MEDIA_VIDEO); - AddNewRtcpFbCcm(level, SDP_RTCP_FB_CCM_VBCM); - std::string body = SerializeSdp(); - ASSERT_NE(body.find("a=rtcp-fb:* ccm vbcm\r\n"), std::string::npos); -} - -TEST_F(SdpTest, parseRtcpFbAllPayloads) { - ParseSdp(kVideoSdp + "a=rtcp-fb:* ack rpsi\r\n"); - for (int i = 0; i < 128; i++) { - ASSERT_EQ(sdp_attr_get_rtcp_fb_ack(sdp_ptr_, 1, i, 1), - SDP_RTCP_FB_ACK_RPSI); - } -} +/* TODO We need to test the pt=* use cases. */ } // End namespace test. diff --git a/media/webrtc/signaling/test/signaling_unittests.cpp b/media/webrtc/signaling/test/signaling_unittests.cpp index e8525a49946..ffe1ffa199b 100644 --- a/media/webrtc/signaling/test/signaling_unittests.cpp +++ b/media/webrtc/signaling/test/signaling_unittests.cpp @@ -1885,8 +1885,6 @@ TEST_F(SignalingTest, ChromeOfferAnswer) "a=rtpmap:100 VP8/90000\r\n" "a=rtpmap:101 red/90000\r\n" "a=rtpmap:102 ulpfec/90000\r\n" - "a=rtcp-fb:100 nack\r\n" - "a=rtcp-fb:100 ccm fir\r\n" "a=ssrc:3012607008 cname:KIXaNxUlU5DP3fVS\r\n" "a=ssrc:3012607008 msid:A5UL339RyGxT7zwgyF12BFqesxkmbUsaycp5 v0\r\n" "a=ssrc:3012607008 mslabel:A5UL339RyGxT7zwgyF12BFqesxkmbUsaycp5\r\n"