Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc

Issue 1888793003: Fixed undefined shift in parsing Tmmbr, Tmmbn and Remb (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_utility.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 packet.WithReceivedPacket(1, 1000); 1237 packet.WithReceivedPacket(1, 1000);
1238 1238
1239 rtc::Buffer built_packet = packet.Build(); 1239 rtc::Buffer built_packet = packet.Build();
1240 1240
1241 EXPECT_EQ(0, InjectRtcpPacket(built_packet.data(), built_packet.size())); 1241 EXPECT_EQ(0, InjectRtcpPacket(built_packet.data(), built_packet.size()));
1242 1242
1243 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback); 1243 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback);
1244 EXPECT_TRUE(rtcp_packet_info_.transport_feedback_.get() != nullptr); 1244 EXPECT_TRUE(rtcp_packet_info_.transport_feedback_.get() != nullptr);
1245 } 1245 }
1246 1246
1247 TEST_F(RtcpReceiverTest, ReceivesRemb) {
1248 const uint32_t kSourceSsrc = 0x123456;
1249
1250 std::set<uint32_t> ssrcs;
1251 ssrcs.insert(kSourceSsrc);
1252 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs);
1253
1254 const uint32_t kBitrateBps = 500000;
1255 rtcp::Remb remb;
1256 remb.From(kSourceSsrc);
åsapersson 2016/04/19 10:06:58 kSenderSsrc
1257 remb.WithBitrateBps(kBitrateBps);
1258 rtc::Buffer built_packet = remb.Build();
1259
1260 EXPECT_EQ(0, InjectRtcpPacket(built_packet.data(), built_packet.size()));
1261
1262 EXPECT_EQ(kRtcpRemb, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb);
1263 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate);
1264 }
1265
1247 TEST_F(RtcpReceiverTest, HandlesInvalidTransportFeedback) { 1266 TEST_F(RtcpReceiverTest, HandlesInvalidTransportFeedback) {
1248 const uint32_t kSenderSsrc = 0x10203; 1267 const uint32_t kSenderSsrc = 0x10203;
1249 const uint32_t kSourceSsrc = 0x123456; 1268 const uint32_t kSourceSsrc = 0x123456;
1250 1269
1251 std::set<uint32_t> ssrcs; 1270 std::set<uint32_t> ssrcs;
1252 ssrcs.insert(kSourceSsrc); 1271 ssrcs.insert(kSourceSsrc);
1253 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs); 1272 rtcp_receiver_->SetSsrcs(kSourceSsrc, ssrcs);
1254 1273
1255 // Send a compound packet with a TransportFeedback followed by something else. 1274 // Send a compound packet with a TransportFeedback followed by something else.
1256 rtcp::TransportFeedback packet; 1275 rtcp::TransportFeedback packet;
(...skipping 20 matching lines...) Expand all
1277 1296
1278 // Transport feedback should be ignored, but next packet should work. 1297 // Transport feedback should be ignored, but next packet should work.
1279 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback); 1298 EXPECT_EQ(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpTransportFeedback);
1280 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb); 1299 EXPECT_NE(0u, rtcp_packet_info_.rtcpPacketTypeFlags & kRtcpRemb);
1281 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate); 1300 EXPECT_EQ(kBitrateBps, rtcp_packet_info_.receiverEstimatedMaxBitrate);
1282 } 1301 }
1283 1302
1284 } // Anonymous namespace 1303 } // Anonymous namespace
1285 1304
1286 } // namespace webrtc 1305 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698