1 /* 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 // 12 // vie_autotest_network.cc 13 // 14 15 #include "webrtc/engine_configurations.h" 16 #include "webrtc/video_engine/test/auto_test/interface/vie_autotest.h" 17 #include "webrtc/video_engine/test/auto_test/interface/vie_autotest_defines.h" 18 19 #include "webrtc/video_engine/test/libvietest/include/tb_capture_device.h" 20 #include "webrtc/video_engine/test/libvietest/include/tb_external_transport.h" 21 #include "webrtc/video_engine/test/libvietest/include/tb_interfaces.h" 22 #include "webrtc/video_engine/test/libvietest/include/tb_video_channel.h" 23 24 #if defined(_WIN32) 25 #include <qos.h> 26 #endif 27 28 void ViEAutoTest::ViENetworkStandardTest() 29 { 30 TbInterfaces ViE("ViENetworkStandardTest"); // Create VIE 31 TbCaptureDevice tbCapture(ViE); 32 { 33 // Create a video channel 34 TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecVP8); 35 tbCapture.ConnectTo(tbChannel.videoChannel); 36 37 RenderCaptureDeviceAndOutputStream(&ViE, &tbChannel, &tbCapture); 38 39 // *************************************************************** 40 // Engine ready. Begin testing class 41 // *************************************************************** 42 43 // 44 // Transport 45 // 46 TbExternalTransport testTransport(*ViE.network, tbChannel.videoChannel, 47 NULL); 48 EXPECT_EQ(0, ViE.network->RegisterSendTransport( 49 tbChannel.videoChannel, testTransport)); 50 EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel)); 51 EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel)); 52 EXPECT_EQ(0, ViE.rtp_rtcp->SetKeyFrameRequestMethod( 53 tbChannel.videoChannel, webrtc::kViEKeyFrameRequestPliRtcp)); 54 55 ViETest::Log("Call started using external transport, video should " 56 "see video in both windows\n"); 57 AutoTestSleep(kAutoTestSleepTimeMs); 58 59 EXPECT_EQ(0, ViE.base->StopReceive(tbChannel.videoChannel)); 60 EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel)); 61 EXPECT_EQ(0, ViE.network->DeregisterSendTransport( 62 tbChannel.videoChannel)); 63 64 char myIpAddress[64]; 65 memset(myIpAddress, 0, 64); 66 unsigned short rtpPort = 1234; 67 memcpy(myIpAddress, "127.0.0.1", sizeof("127.0.0.1")); 68 EXPECT_EQ(0, ViE.network->SetLocalReceiver( 69 tbChannel.videoChannel, rtpPort, rtpPort + 1, myIpAddress)); 70 EXPECT_EQ(0, ViE.network->SetSendDestination( 71 tbChannel.videoChannel, myIpAddress, rtpPort, 72 rtpPort + 1, rtpPort)); 73 EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel)); 74 EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel)); 75 76 ViETest::Log("Changed to WebRTC SocketTransport, you should still see " 77 "video in both windows\n"); 78 AutoTestSleep(kAutoTestSleepTimeMs); 79 80 EXPECT_EQ(0, ViE.network->SetSourceFilter( 81 tbChannel.videoChannel, rtpPort + 10, rtpPort + 11, myIpAddress)); 82 ViETest::Log("Added UDP port filter for incorrect ports, you should " 83 "not see video in Window2"); 84 AutoTestSleep(2000); 85 EXPECT_EQ(0, ViE.network->SetSourceFilter( 86 tbChannel.videoChannel, rtpPort, rtpPort + 1, "123.1.1.0")); 87 ViETest::Log("Added IP filter for incorrect IP address, you should not " 88 "see video in Window2"); 89 AutoTestSleep(2000); 90 EXPECT_EQ(0, ViE.network->SetSourceFilter( 91 tbChannel.videoChannel, rtpPort, rtpPort + 1, myIpAddress)); 92 ViETest::Log("Added IP filter for this computer, you should see video " 93 "in Window2 again\n"); 94 AutoTestSleep(kAutoTestSleepTimeMs); 95 96 tbCapture.Disconnect(tbChannel.videoChannel); 97 } 98 } 99 100 void ViEAutoTest::ViENetworkExtendedTest() 101 { 102 //*************************************************************** 103 // Begin create/initialize WebRTC Video Engine for testing 104 //*************************************************************** 105 106 TbInterfaces ViE("ViENetworkExtendedTest"); // Create VIE 107 TbCaptureDevice tbCapture(ViE); 108 EXPECT_EQ(0, ViE.render->AddRenderer( 109 tbCapture.captureId, _window1, 0, 0.0, 0.0, 1.0, 1.0)); 110 EXPECT_EQ(0, ViE.render->StartRender(tbCapture.captureId)); 111 112 { 113 // 114 // ToS 115 // 116 // Create a video channel 117 TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecVP8); 118 tbCapture.ConnectTo(tbChannel.videoChannel); 119 const char* remoteIp = "192.168.200.1"; 120 int DSCP = 0; 121 bool useSetSockOpt = false; 122 123 webrtc::VideoCodec videoCodec; 124 EXPECT_EQ(0, ViE.codec->GetSendCodec( 125 tbChannel.videoChannel, videoCodec)); 126 videoCodec.maxFramerate = 5; 127 EXPECT_EQ(0, ViE.codec->SetSendCodec( 128 tbChannel.videoChannel, videoCodec)); 129 130 //*************************************************************** 131 // Engine ready. Begin testing class 132 //*************************************************************** 133 134 char myIpAddress[64]; 135 memset(myIpAddress, 0, 64); 136 unsigned short rtpPort = 9000; 137 EXPECT_EQ(0, ViE.network->GetLocalIP(myIpAddress, false)); 138 EXPECT_EQ(0, ViE.network->SetLocalReceiver( 139 tbChannel.videoChannel, rtpPort, rtpPort + 1, myIpAddress)); 140 EXPECT_EQ(0, ViE.network->SetSendDestination( 141 tbChannel.videoChannel, remoteIp, rtpPort, rtpPort + 1, rtpPort)); 142 143 // ToS 144 int tos_result = ViE.network->SetSendToS(tbChannel.videoChannel, 2); 145 EXPECT_EQ(0, tos_result); 146 if (tos_result != 0) 147 { 148 ViETest::Log("ViESetSendToS error!."); 149 ViETest::Log("You must be admin to run these tests."); 150 ViETest::Log("On Win7 and late Vista, you need to right click the " 151 "exe and choose"); 152 ViETest::Log("\"Run as administrator\"\n"); 153 getchar(); 154 } 155 EXPECT_EQ(0, ViE.network->GetSendToS( 156 tbChannel.videoChannel, DSCP, useSetSockOpt)); // No ToS set 157 158 EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel)); 159 EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel)); 160 161 ViETest::Log("Use Wireshark to capture the outgoing video stream and " 162 "verify ToS settings\n"); 163 ViETest::Log(" DSCP set to 0x%x\n", DSCP); 164 AutoTestSleep(1000); 165 166 EXPECT_EQ(0, ViE.network->SetSendToS(tbChannel.videoChannel, 63)); 167 EXPECT_EQ(0, ViE.network->GetSendToS( 168 tbChannel.videoChannel, DSCP, useSetSockOpt)); // No ToS set 169 ViETest::Log(" DSCP set to 0x%x\n", DSCP); 170 AutoTestSleep(1000); 171 172 EXPECT_EQ(0, ViE.network->SetSendToS(tbChannel.videoChannel, 0)); 173 EXPECT_EQ(0, ViE.network->SetSendToS(tbChannel.videoChannel, 2, true)); 174 EXPECT_EQ(0, ViE.network->GetSendToS( 175 tbChannel.videoChannel, DSCP, useSetSockOpt)); // No ToS set 176 ViETest::Log(" DSCP set to 0x%x\n", DSCP); 177 AutoTestSleep(1000); 178 179 EXPECT_EQ(0, ViE.network->SetSendToS(tbChannel.videoChannel, 63, true)); 180 EXPECT_EQ(0, ViE.network->GetSendToS( 181 tbChannel.videoChannel, DSCP, useSetSockOpt)); // No ToS set 182 ViETest::Log(" DSCP set to 0x%x\n", DSCP); 183 AutoTestSleep(1000); 184 185 tbCapture.Disconnect(tbChannel.videoChannel); 186 } 187 188 //*************************************************************** 189 // Testing finished. Tear down Video Engine 190 //*************************************************************** 191 } 192 193 void ViEAutoTest::ViENetworkAPITest() 194 { 195 //*************************************************************** 196 // Begin create/initialize WebRTC Video Engine for testing 197 //*************************************************************** 198 199 TbInterfaces ViE("ViENetworkAPITest"); // Create VIE 200 { 201 // Create a video channel 202 TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecI420); 203 204 //*************************************************************** 205 // Engine ready. Begin testing class 206 //*************************************************************** 207 208 // 209 // External transport 210 // 211 TbExternalTransport testTransport(*ViE.network, tbChannel.videoChannel, 212 NULL); 213 EXPECT_EQ(0, ViE.network->RegisterSendTransport( 214 tbChannel.videoChannel, testTransport)); 215 EXPECT_NE(0, ViE.network->RegisterSendTransport( 216 tbChannel.videoChannel, testTransport)); 217 218 // Create a empty RTP packet. 219 unsigned char packet[3000]; 220 memset(packet, 0, sizeof(packet)); 221 packet[0] = 0x80; // V=2, P=0, X=0, CC=0 222 packet[1] = 0x7C; // M=0, PT = 124 (I420) 223 224 // Create a empty RTCP app packet. 225 unsigned char rtcpacket[3000]; 226 memset(rtcpacket,0, sizeof(rtcpacket)); 227 rtcpacket[0] = 0x80; // V=2, P=0, X=0, CC=0 228 rtcpacket[1] = 0xCC; // M=0, PT = 204 (RTCP app) 229 rtcpacket[2] = 0x0; 230 rtcpacket[3] = 0x03; // 3 Octets long. 231 232 EXPECT_NE(0, ViE.network->ReceivedRTPPacket( 233 tbChannel.videoChannel, packet, 1500)); 234 EXPECT_NE(0, ViE.network->ReceivedRTCPPacket( 235 tbChannel.videoChannel, rtcpacket, 1500)); 236 EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel)); 237 EXPECT_EQ(0, ViE.network->ReceivedRTPPacket( 238 tbChannel.videoChannel, packet, 1500)); 239 EXPECT_EQ(0, ViE.network->ReceivedRTCPPacket( 240 tbChannel.videoChannel, rtcpacket, 1500)); 241 EXPECT_NE(0, ViE.network->ReceivedRTPPacket( 242 tbChannel.videoChannel, packet, 11)); 243 EXPECT_NE(0, ViE.network->ReceivedRTPPacket( 244 tbChannel.videoChannel, packet, 11)); 245 EXPECT_EQ(0, ViE.network->ReceivedRTPPacket( 246 tbChannel.videoChannel, packet, 3000)); 247 EXPECT_EQ(0, ViE.network->ReceivedRTPPacket( 248 tbChannel.videoChannel, packet, 3000)); 249 EXPECT_EQ(0, ViE.base->StopReceive(tbChannel.videoChannel)); 250 EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel)); 251 EXPECT_NE(0, ViE.network->DeregisterSendTransport( 252 tbChannel.videoChannel)); // Sending 253 EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel)); 254 EXPECT_EQ(0, ViE.network->DeregisterSendTransport( 255 tbChannel.videoChannel)); 256 EXPECT_NE(0, ViE.network->DeregisterSendTransport( 257 tbChannel.videoChannel)); // Already deregistered 258 259 // 260 // Local receiver 261 // 262 EXPECT_EQ(0, ViE.network->SetLocalReceiver( 263 tbChannel.videoChannel, 1234, 1235, "127.0.0.1")); 264 EXPECT_EQ(0, ViE.network->SetLocalReceiver( 265 tbChannel.videoChannel, 1234, 1235, "127.0.0.1")); 266 EXPECT_EQ(0, ViE.network->SetLocalReceiver( 267 tbChannel.videoChannel, 1236, 1237, "127.0.0.1")); 268 269 unsigned short rtpPort = 0; 270 unsigned short rtcpPort = 0; 271 char ipAddress[64]; 272 memset(ipAddress, 0, 64); 273 EXPECT_EQ(0, ViE.network->GetLocalReceiver( 274 tbChannel.videoChannel, rtpPort, rtcpPort, ipAddress)); 275 EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel)); 276 EXPECT_NE(0, ViE.network->SetLocalReceiver( 277 tbChannel.videoChannel, 1234, 1235, "127.0.0.1")); 278 EXPECT_EQ(0, ViE.network->GetLocalReceiver( 279 tbChannel.videoChannel, rtpPort, rtcpPort, ipAddress)); 280 EXPECT_EQ(0, ViE.base->StopReceive(tbChannel.videoChannel)); 281 282 // 283 // Send destination 284 // 285 EXPECT_EQ(0, ViE.network->SetSendDestination( 286 tbChannel.videoChannel, "127.0.0.1", 1234, 1235, 1234, 1235)); 287 EXPECT_EQ(0, ViE.network->SetSendDestination( 288 tbChannel.videoChannel, "127.0.0.1", 1236, 1237, 1234, 1235)); 289 290 unsigned short sourceRtpPort = 0; 291 unsigned short sourceRtcpPort = 0; 292 EXPECT_EQ(0, ViE.network->GetSendDestination( 293 tbChannel.videoChannel, ipAddress, rtpPort, rtcpPort, 294 sourceRtpPort, sourceRtcpPort)); 295 EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel)); 296 297 // Not allowed while sending 298 EXPECT_NE(0, ViE.network->SetSendDestination( 299 tbChannel.videoChannel, "127.0.0.1", 1234, 1235, 1234, 1235)); 300 EXPECT_EQ(kViENetworkAlreadySending, ViE.base->LastError()); 301 302 EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel)); 303 EXPECT_EQ(0, ViE.network->SetSendDestination( 304 tbChannel.videoChannel, "127.0.0.1", 1234, 1235, 1234, 1235)); 305 EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel)); 306 EXPECT_EQ(0, ViE.network->GetSendDestination( 307 tbChannel.videoChannel, ipAddress, rtpPort, rtcpPort, 308 sourceRtpPort, sourceRtcpPort)); 309 EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel)); 310 311 // 312 // Address information 313 // 314 315 // GetSourceInfo: Tested in functional test 316 EXPECT_EQ(0, ViE.network->GetLocalIP(ipAddress, false)); 317 318 // TODO(unknown): IPv6 319 320 // 321 // Filter 322 // 323 EXPECT_NE(0, ViE.network->GetSourceFilter( 324 tbChannel.videoChannel, rtpPort, rtcpPort, ipAddress)); 325 EXPECT_EQ(0, ViE.network->SetSourceFilter( 326 tbChannel.videoChannel, 1234, 1235, "10.10.10.10")); 327 EXPECT_EQ(0, ViE.network->SetSourceFilter( 328 tbChannel.videoChannel, 1236, 1237, "127.0.0.1")); 329 EXPECT_EQ(0, ViE.network->GetSourceFilter( 330 tbChannel.videoChannel, rtpPort, rtcpPort, ipAddress)); 331 EXPECT_EQ(0, ViE.network->SetSourceFilter( 332 tbChannel.videoChannel, 0, 0, NULL)); 333 EXPECT_NE(0, ViE.network->GetSourceFilter( 334 tbChannel.videoChannel, rtpPort, rtcpPort, ipAddress)); 335 } 336 { 337 TbVideoChannel tbChannel(ViE); // Create a video channel 338 EXPECT_EQ(0, ViE.network->SetLocalReceiver( 339 tbChannel.videoChannel, 1234)); 340 341 int DSCP = 0; 342 bool useSetSockOpt = false; 343 // SetSockOpt should work without a locally bind socket 344 EXPECT_EQ(0, ViE.network->GetSendToS( 345 tbChannel.videoChannel, DSCP, useSetSockOpt)); // No ToS set 346 EXPECT_EQ(0, DSCP); 347 348 // Invalid input 349 EXPECT_NE(0, ViE.network->SetSendToS(tbChannel.videoChannel, -1, true)); 350 351 // Invalid input 352 EXPECT_NE(0, ViE.network->SetSendToS(tbChannel.videoChannel, 64, true)); 353 354 // Valid 355 EXPECT_EQ(0, ViE.network->SetSendToS(tbChannel.videoChannel, 20, true)); 356 EXPECT_EQ(0, ViE.network->GetSendToS( 357 tbChannel.videoChannel, DSCP, useSetSockOpt)); 358 359 EXPECT_EQ(20, DSCP); 360 EXPECT_TRUE(useSetSockOpt); 361 362 // Disable 363 EXPECT_EQ(0, ViE.network->SetSendToS(tbChannel.videoChannel, 0, true)); 364 EXPECT_EQ(0, ViE.network->GetSendToS( 365 tbChannel.videoChannel, DSCP, useSetSockOpt)); 366 EXPECT_EQ(0, DSCP); 367 368 char myIpAddress[64]; 369 memset(myIpAddress, 0, 64); 370 // Get local ip to be able to set ToS withtou setSockOpt 371 EXPECT_EQ(0, ViE.network->GetLocalIP(myIpAddress, false)); 372 EXPECT_EQ(0, ViE.network->SetLocalReceiver( 373 tbChannel.videoChannel, 1234, 1235, myIpAddress)); 374 375 // Invalid input 376 EXPECT_NE(0, ViE.network->SetSendToS( 377 tbChannel.videoChannel, -1, false)); 378 EXPECT_NE(0, ViE.network->SetSendToS( 379 tbChannel.videoChannel, 64, false)); // Invalid input 380 EXPECT_EQ(0, ViE.network->GetSendToS( 381 tbChannel.videoChannel, DSCP, useSetSockOpt)); // No ToS set 382 EXPECT_EQ(0, DSCP); 383 int tos_result = ViE.network->SetSendToS( 384 tbChannel.videoChannel, 20, false); // Valid 385 EXPECT_EQ(0, tos_result); 386 if (tos_result != 0) 387 { 388 ViETest::Log("ViESetSendToS error!."); 389 ViETest::Log("You must be admin to run these tests."); 390 ViETest::Log("On Win7 and late Vista, you need to right click the " 391 "exe and choose"); 392 ViETest::Log("\"Run as administrator\"\n"); 393 getchar(); 394 } 395 EXPECT_EQ(0, ViE.network->GetSendToS( 396 tbChannel.videoChannel, DSCP, useSetSockOpt)); 397 EXPECT_EQ(20, DSCP); 398 #ifdef _WIN32 399 EXPECT_FALSE(useSetSockOpt); 400 #else // useSetSockOpt is true on Linux and Mac 401 EXPECT_TRUE(useSetSockOpt); 402 #endif 403 EXPECT_EQ(0, ViE.network->SetSendToS(tbChannel.videoChannel, 0, false)); 404 EXPECT_EQ(0, ViE.network->GetSendToS( 405 tbChannel.videoChannel, DSCP, useSetSockOpt)); 406 EXPECT_EQ(0, DSCP); 407 } 408 { 409 // From qos.h. (*) -> supported by ViE 410 // 411 // #define SERVICETYPE_NOTRAFFIC 0x00000000 412 // #define SERVICETYPE_BESTEFFORT 0x00000001 (*) 413 // #define SERVICETYPE_CONTROLLEDLOAD 0x00000002 (*) 414 // #define SERVICETYPE_GUARANTEED 0x00000003 (*) 415 // #define SERVICETYPE_NETWORK_UNAVAILABLE 0x00000004 416 // #define SERVICETYPE_GENERAL_INFORMATION 0x00000005 417 // #define SERVICETYPE_NOCHANGE 0x00000006 418 // #define SERVICETYPE_NONCONFORMING 0x00000009 419 // #define SERVICETYPE_NETWORK_CONTROL 0x0000000A 420 // #define SERVICETYPE_QUALITATIVE 0x0000000D (*) 421 // 422 // #define SERVICE_BESTEFFORT 0x80010000 423 // #define SERVICE_CONTROLLEDLOAD 0x80020000 424 // #define SERVICE_GUARANTEED 0x80040000 425 // #define SERVICE_QUALITATIVE 0x80200000 426 427 TbVideoChannel tbChannel(ViE); // Create a video channel 428 429 430 #if defined(_WIN32) 431 // These tests are disabled since they currently fail on Windows. 432 // Exact reason is unkown. 433 // See https://code.google.com/p/webrtc/issues/detail?id=1266. 434 // TODO(mflodman): remove these APIs? 435 436 //// No socket 437 //EXPECT_NE(0, ViE.network->SetSendGQoS( 438 // tbChannel.videoChannel, true, SERVICETYPE_BESTEFFORT)); 439 440 //EXPECT_EQ(0, ViE.network->SetLocalReceiver( 441 // tbChannel.videoChannel, 1234)); 442 443 //// Sender not initialized 444 //EXPECT_NE(0, ViE.network->SetSendGQoS( 445 // tbChannel.videoChannel, true, SERVICETYPE_BESTEFFORT)); 446 //EXPECT_EQ(0, ViE.network->SetSendDestination( 447 // tbChannel.videoChannel, "127.0.0.1", 12345)); 448 449 //// Try to set all non-supported service types 450 //EXPECT_NE(0, ViE.network->SetSendGQoS( 451 // tbChannel.videoChannel, true, SERVICETYPE_NOTRAFFIC)); 452 //EXPECT_NE(0, ViE.network->SetSendGQoS( 453 // tbChannel.videoChannel, true, SERVICETYPE_NETWORK_UNAVAILABLE)); 454 //EXPECT_NE(0, ViE.network->SetSendGQoS( 455 // tbChannel.videoChannel, true, SERVICETYPE_GENERAL_INFORMATION)); 456 //EXPECT_NE(0, ViE.network->SetSendGQoS( 457 // tbChannel.videoChannel, true, SERVICETYPE_NOCHANGE)); 458 //EXPECT_NE(0, ViE.network->SetSendGQoS( 459 // tbChannel.videoChannel, true, SERVICETYPE_NONCONFORMING)); 460 //EXPECT_NE(0, ViE.network->SetSendGQoS( 461 // tbChannel.videoChannel, true, SERVICETYPE_NOTRAFFIC)); 462 //EXPECT_NE(0, ViE.network->SetSendGQoS( 463 // tbChannel.videoChannel, true, SERVICETYPE_NETWORK_CONTROL)); 464 //EXPECT_NE(0, ViE.network->SetSendGQoS( 465 // tbChannel.videoChannel, true, SERVICE_BESTEFFORT)); 466 //EXPECT_NE(0, ViE.network->SetSendGQoS( 467 // tbChannel.videoChannel, true, SERVICE_CONTROLLEDLOAD)); 468 //EXPECT_NE(0, ViE.network->SetSendGQoS( 469 // tbChannel.videoChannel, true, SERVICE_GUARANTEED)); 470 //EXPECT_NE(0, ViE.network->SetSendGQoS( 471 // tbChannel.videoChannel, true, SERVICE_QUALITATIVE)); 472 473 //// Loop through valid service settings 474 //bool enabled = false; 475 //int serviceType = 0; 476 //int overrideDSCP = 0; 477 478 //EXPECT_EQ(0, ViE.network->GetSendGQoS( 479 // tbChannel.videoChannel, enabled, serviceType, overrideDSCP)); 480 //EXPECT_FALSE(enabled); 481 //EXPECT_EQ(0, ViE.network->SetSendGQoS( 482 // tbChannel.videoChannel, true, SERVICETYPE_BESTEFFORT)); 483 //EXPECT_EQ(0, ViE.network->GetSendGQoS( 484 // tbChannel.videoChannel, enabled, serviceType, overrideDSCP)); 485 //EXPECT_TRUE(enabled); 486 //EXPECT_EQ(SERVICETYPE_BESTEFFORT, serviceType); 487 //EXPECT_FALSE(overrideDSCP); 488 489 //EXPECT_EQ(0, ViE.network->SetSendGQoS( 490 // tbChannel.videoChannel, true, SERVICETYPE_CONTROLLEDLOAD)); 491 //EXPECT_EQ(0, ViE.network->GetSendGQoS( 492 // tbChannel.videoChannel, enabled, serviceType, overrideDSCP)); 493 //EXPECT_TRUE(enabled); 494 //EXPECT_EQ(SERVICETYPE_CONTROLLEDLOAD, serviceType); 495 //EXPECT_FALSE(overrideDSCP); 496 497 //EXPECT_EQ(0, ViE.network->SetSendGQoS( 498 // tbChannel.videoChannel, true, SERVICETYPE_GUARANTEED)); 499 //EXPECT_EQ(0, ViE.network->GetSendGQoS( 500 // tbChannel.videoChannel, enabled, serviceType, overrideDSCP)); 501 //EXPECT_TRUE(enabled); 502 //EXPECT_EQ(SERVICETYPE_GUARANTEED, serviceType); 503 //EXPECT_FALSE(overrideDSCP); 504 505 //EXPECT_EQ(0, ViE.network->SetSendGQoS( 506 // tbChannel.videoChannel, true, SERVICETYPE_QUALITATIVE)); 507 //EXPECT_EQ(0, ViE.network->GetSendGQoS( 508 // tbChannel.videoChannel, enabled, serviceType, overrideDSCP)); 509 //EXPECT_TRUE(enabled); 510 //EXPECT_EQ(SERVICETYPE_QUALITATIVE, serviceType); 511 //EXPECT_FALSE(overrideDSCP); 512 513 //EXPECT_EQ(0, ViE.network->SetSendGQoS( 514 // tbChannel.videoChannel, false, SERVICETYPE_QUALITATIVE)); 515 //EXPECT_EQ(0, ViE.network->GetSendGQoS( 516 // tbChannel.videoChannel, enabled, serviceType, overrideDSCP)); 517 //EXPECT_FALSE(enabled); 518 #endif 519 } 520 { 521 // 522 // MTU and packet burst 523 // 524 // Create a video channel 525 TbVideoChannel tbChannel(ViE); 526 // Invalid input 527 EXPECT_NE(0, ViE.network->SetMTU(tbChannel.videoChannel, 1600)); 528 // Valid input 529 EXPECT_EQ(0, ViE.network->SetMTU(tbChannel.videoChannel, 800)); 530 } 531 532 //*************************************************************** 533 // Testing finished. Tear down Video Engine 534 //*************************************************************** 535 } 536