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

Side by Side Diff: talk/media/webrtc/webrtcvideoengine2_unittest.cc

Issue 1429753003: Filter overlapping RTP header extensions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 // Test support for absolute send time header extension. 1192 // Test support for absolute send time header extension.
1193 TEST_F(WebRtcVideoChannel2Test, SendAbsoluteSendTimeHeaderExtensions) { 1193 TEST_F(WebRtcVideoChannel2Test, SendAbsoluteSendTimeHeaderExtensions) {
1194 TestSetSendRtpHeaderExtensions(kRtpAbsoluteSenderTimeHeaderExtension, 1194 TestSetSendRtpHeaderExtensions(kRtpAbsoluteSenderTimeHeaderExtension,
1195 webrtc::RtpExtension::kAbsSendTime); 1195 webrtc::RtpExtension::kAbsSendTime);
1196 } 1196 }
1197 TEST_F(WebRtcVideoChannel2Test, RecvAbsoluteSendTimeHeaderExtensions) { 1197 TEST_F(WebRtcVideoChannel2Test, RecvAbsoluteSendTimeHeaderExtensions) {
1198 TestSetRecvRtpHeaderExtensions(kRtpAbsoluteSenderTimeHeaderExtension, 1198 TestSetRecvRtpHeaderExtensions(kRtpAbsoluteSenderTimeHeaderExtension,
1199 webrtc::RtpExtension::kAbsSendTime); 1199 webrtc::RtpExtension::kAbsSendTime);
1200 } 1200 }
1201 1201
1202 TEST_F(WebRtcVideoChannel2Test, FiltersOverlappingExtensions) {
1203 // Enable three overlapping extensions.
1204 cricket::VideoSendParameters parameters = send_parameters_;
1205 int id = 1;
1206 parameters.extensions.push_back(
1207 cricket::RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, id++));
1208 parameters.extensions.push_back(
1209 cricket::RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension, id++));
1210 parameters.extensions.push_back(cricket::RtpHeaderExtension(
1211 kRtpTransportSequenceNumberHeaderExtension, id));
1212 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1213 FakeVideoSendStream* send_stream =
1214 AddSendStream(cricket::StreamParams::CreateLegacy(123));
1215
1216 // Verify that only one of them has been set, and that it is the one with
1217 // highest priority (transport sequence number).
1218 ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
1219 EXPECT_EQ(id, send_stream->GetConfig().rtp.extensions[0].id);
1220 EXPECT_EQ(webrtc::RtpExtension::kTransportSequenceNumber,
1221 send_stream->GetConfig().rtp.extensions[0].name);
1222 }
1223
1202 class WebRtcVideoChannel2WithSendSideBweTest : public WebRtcVideoChannel2Test { 1224 class WebRtcVideoChannel2WithSendSideBweTest : public WebRtcVideoChannel2Test {
1203 public: 1225 public:
1204 WebRtcVideoChannel2WithSendSideBweTest() 1226 WebRtcVideoChannel2WithSendSideBweTest()
1205 : WebRtcVideoChannel2Test("WebRTC-SendSideBwe/Enabled/") {} 1227 : WebRtcVideoChannel2Test("WebRTC-SendSideBwe/Enabled/") {}
1206 }; 1228 };
1207 1229
1208 // Test support for transport sequence number header extension. 1230 // Test support for transport sequence number header extension.
1209 TEST_F(WebRtcVideoChannel2WithSendSideBweTest, 1231 TEST_F(WebRtcVideoChannel2WithSendSideBweTest,
1210 SendTransportSequenceNumberHeaderExtensions) { 1232 SendTransportSequenceNumberHeaderExtensions) {
1211 TestSetSendRtpHeaderExtensions( 1233 TestSetSendRtpHeaderExtensions(
(...skipping 11 matching lines...) Expand all
1223 TEST_F(WebRtcVideoChannel2Test, SendVideoRotationHeaderExtensions) { 1245 TEST_F(WebRtcVideoChannel2Test, SendVideoRotationHeaderExtensions) {
1224 TestSetSendRtpHeaderExtensions(kRtpVideoRotationHeaderExtension, 1246 TestSetSendRtpHeaderExtensions(kRtpVideoRotationHeaderExtension,
1225 webrtc::RtpExtension::kVideoRotation); 1247 webrtc::RtpExtension::kVideoRotation);
1226 } 1248 }
1227 TEST_F(WebRtcVideoChannel2Test, RecvVideoRotationHeaderExtensions) { 1249 TEST_F(WebRtcVideoChannel2Test, RecvVideoRotationHeaderExtensions) {
1228 TestSetRecvRtpHeaderExtensions(kRtpVideoRotationHeaderExtension, 1250 TestSetRecvRtpHeaderExtensions(kRtpVideoRotationHeaderExtension,
1229 webrtc::RtpExtension::kVideoRotation); 1251 webrtc::RtpExtension::kVideoRotation);
1230 } 1252 }
1231 1253
1232 TEST_F(WebRtcVideoChannel2Test, IdenticalSendExtensionsDoesntRecreateStream) { 1254 TEST_F(WebRtcVideoChannel2Test, IdenticalSendExtensionsDoesntRecreateStream) {
1233 const int kTOffsetId = 1; 1255 const int kAbsSendTimeId = 1;
1234 const int kAbsSendTimeId = 2; 1256 const int kVideoRotationId = 2;
1235 const int kVideoRotationId = 3;
1236 send_parameters_.extensions.push_back(cricket::RtpHeaderExtension( 1257 send_parameters_.extensions.push_back(cricket::RtpHeaderExtension(
1237 kRtpAbsoluteSenderTimeHeaderExtension, kAbsSendTimeId)); 1258 kRtpAbsoluteSenderTimeHeaderExtension, kAbsSendTimeId));
1238 send_parameters_.extensions.push_back(cricket::RtpHeaderExtension( 1259 send_parameters_.extensions.push_back(cricket::RtpHeaderExtension(
1239 kRtpTimestampOffsetHeaderExtension, kTOffsetId));
1240 send_parameters_.extensions.push_back(cricket::RtpHeaderExtension(
1241 kRtpVideoRotationHeaderExtension, kVideoRotationId)); 1260 kRtpVideoRotationHeaderExtension, kVideoRotationId));
1242 1261
1243 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 1262 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
1244 FakeVideoSendStream* send_stream = 1263 FakeVideoSendStream* send_stream =
1245 AddSendStream(cricket::StreamParams::CreateLegacy(123)); 1264 AddSendStream(cricket::StreamParams::CreateLegacy(123));
1246 1265
1247 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams()); 1266 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
1248 ASSERT_EQ(3u, send_stream->GetConfig().rtp.extensions.size()); 1267 ASSERT_EQ(2u, send_stream->GetConfig().rtp.extensions.size());
1249 1268
1250 // Setting the same extensions (even if in different order) shouldn't 1269 // Setting the same extensions (even if in different order) shouldn't
1251 // reallocate the stream. 1270 // reallocate the stream.
1252 std::reverse(send_parameters_.extensions.begin(), 1271 std::reverse(send_parameters_.extensions.begin(),
1253 send_parameters_.extensions.end()); 1272 send_parameters_.extensions.end());
1254 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 1273 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
1255 1274
1256 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams()); 1275 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
1257 1276
1258 // Setting different extensions should recreate the stream. 1277 // Setting different extensions should recreate the stream.
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after
3234 // Ensures that the correct settings are applied to the codec when two temporal 3253 // Ensures that the correct settings are applied to the codec when two temporal
3235 // layer screencasting is enabled, and that the correct simulcast settings are 3254 // layer screencasting is enabled, and that the correct simulcast settings are
3236 // reapplied when disabling screencasting. 3255 // reapplied when disabling screencasting.
3237 TEST_F(WebRtcVideoChannel2SimulcastTest, 3256 TEST_F(WebRtcVideoChannel2SimulcastTest,
3238 DISABLED_TwoTemporalLayerScreencastSettings) { 3257 DISABLED_TwoTemporalLayerScreencastSettings) {
3239 // TODO(pbos): Implement. 3258 // TODO(pbos): Implement.
3240 FAIL() << "Not implemented."; 3259 FAIL() << "Not implemented.";
3241 } 3260 }
3242 3261
3243 } // namespace cricket 3262 } // namespace cricket
OLDNEW
« talk/media/webrtc/webrtcmediaengine.cc ('K') | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698