Fix errors in ViEAutoTest::ViENetworkAPITest().
BUG= TEST= ViEAutoTest::ViENetworkAPITest Review URL: https://webrtc-codereview.appspot.com/451004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1875 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
ed700db014
commit
ebb2f7b6f6
@ -218,7 +218,7 @@ void ViEAutoTest::ViENetworkAPITest()
|
||||
TbInterfaces ViE("ViENetworkAPITest"); // Create VIE
|
||||
{
|
||||
// Create a video channel
|
||||
TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecVP8);
|
||||
TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecI420);
|
||||
|
||||
//***************************************************************
|
||||
// Engine ready. Begin testing class
|
||||
@ -233,18 +233,29 @@ void ViEAutoTest::ViENetworkAPITest()
|
||||
EXPECT_NE(0, ViE.network->RegisterSendTransport(
|
||||
tbChannel.videoChannel, testTransport));
|
||||
|
||||
unsigned char packet[1500];
|
||||
// Create a empty RTP packet.
|
||||
unsigned char packet[3000];
|
||||
memset(packet, sizeof(packet), 0);
|
||||
packet[0] = 0x80; // V=2, P=0, X=0, CC=0
|
||||
packet[1] = 0x78; // M=0, PT = 120 (VP8)
|
||||
packet[1] = 0x7C; // M=0, PT = 124 (I420)
|
||||
|
||||
// Create a empty RTCP app packet.
|
||||
unsigned char rtcpacket[3000];
|
||||
memset(rtcpacket, sizeof(rtcpacket), 0);
|
||||
rtcpacket[0] = 0x80; // V=2, P=0, X=0, CC=0
|
||||
rtcpacket[1] = 0xCC; // M=0, PT = 204 (RTCP app)
|
||||
rtcpacket[2] = 0x0;
|
||||
rtcpacket[3] = 0x03; // 3 Octets long.
|
||||
|
||||
EXPECT_NE(0, ViE.network->ReceivedRTPPacket(
|
||||
tbChannel.videoChannel, packet, 1500));
|
||||
EXPECT_NE(0, ViE.network->ReceivedRTCPPacket(
|
||||
tbChannel.videoChannel, packet, 1500));
|
||||
tbChannel.videoChannel, rtcpacket, 1500));
|
||||
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
|
||||
EXPECT_EQ(0, ViE.network->ReceivedRTPPacket(
|
||||
tbChannel.videoChannel, packet, 1500));
|
||||
EXPECT_EQ(0, ViE.network->ReceivedRTCPPacket(
|
||||
tbChannel.videoChannel, packet, 1500));
|
||||
tbChannel.videoChannel, rtcpacket, 1500));
|
||||
EXPECT_NE(0, ViE.network->ReceivedRTPPacket(
|
||||
tbChannel.videoChannel, packet, 11));
|
||||
EXPECT_NE(0, ViE.network->ReceivedRTPPacket(
|
||||
@ -266,12 +277,6 @@ void ViEAutoTest::ViENetworkAPITest()
|
||||
//
|
||||
// Local receiver
|
||||
//
|
||||
// TODO (perkj) change when B 4239431 is fixed.
|
||||
/*error = ViE.ptrViENetwork->SetLocalReceiver(tbChannel.videoChannel,
|
||||
1234, 1234, "127.0.0.1");
|
||||
numberOfErrors += ViETest::TestError(error == 0,
|
||||
"ERROR: %s at line %d",
|
||||
__FUNCTION__, __LINE__);*/
|
||||
EXPECT_EQ(0, ViE.network->SetLocalReceiver(
|
||||
tbChannel.videoChannel, 1234, 1235, "127.0.0.1"));
|
||||
EXPECT_EQ(0, ViE.network->SetLocalReceiver(
|
||||
|
Loading…
x
Reference in New Issue
Block a user