Create the SrtpTransportInterface.

Create the SrtpTransportInterface, a subclass of RtpTransportInterface, which
allows the user to set the send and receive keys. The functionalities are
implemented inside the RtpTransportAdapters on top of BaseChannel.

BUG=webrtc:7013

Review-Url: https://codereview.webrtc.org/2714813004
Cr-Commit-Position: refs/heads/master@{#17023}
This commit is contained in:
zhihuang
2017-03-03 14:39:06 -08:00
committed by Commit bot
parent 716e726ef0
commit d3501adf17
18 changed files with 758 additions and 118 deletions

View File

@ -82,6 +82,24 @@ TEST_F(OrtcFactoryTest, CreateRtpTransportWithAndWithoutMux) {
EXPECT_TRUE(result.ok());
}
// Simple test for the successful cases of CreateSrtpTransport.
TEST_F(OrtcFactoryTest, CreateSrtpTransport) {
rtc::FakePacketTransport rtp("rtp");
rtc::FakePacketTransport rtcp("rtcp");
// With muxed RTCP.
RtcpParameters rtcp_parameters;
rtcp_parameters.mux = true;
auto result = ortc_factory_->CreateSrtpTransport(rtcp_parameters, &rtp,
nullptr, nullptr);
EXPECT_TRUE(result.ok());
result.MoveValue().reset();
// With non-muxed RTCP.
rtcp_parameters.mux = false;
result =
ortc_factory_->CreateSrtpTransport(rtcp_parameters, &rtp, &rtcp, nullptr);
EXPECT_TRUE(result.ok());
}
// If no CNAME is provided, one should be generated and returned by
// GetRtpParameters.
TEST_F(OrtcFactoryTest, CreateRtpTransportGeneratesCname) {