Add SSRC to RtpEncodingParameters for audio.
Was added for video initially, but not for audio. BUG=webrtc:6862 Review-Url: https://codereview.webrtc.org/2568553002 Cr-Commit-Position: refs/heads/master@{#15552}
This commit is contained in:
parent
ccecdd4560
commit
cb44343006
@ -1217,6 +1217,7 @@ class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
|
||||
config_.voe_channel_id = ch;
|
||||
config_.rtp.extensions = extensions;
|
||||
config_.audio_network_adaptor_config = audio_network_adaptor_config;
|
||||
rtp_parameters_.encodings[0].ssrc = rtc::Optional<uint32_t>(ssrc);
|
||||
RecreateAudioSendStream(send_codec_spec);
|
||||
}
|
||||
|
||||
@ -1742,6 +1743,7 @@ webrtc::RtpParameters WebRtcVoiceMediaChannel::GetRtpReceiveParameters(
|
||||
for (const AudioCodec& codec : recv_codecs_) {
|
||||
rtp_params.codecs.push_back(codec.ToCodecParameters());
|
||||
}
|
||||
rtp_params.encodings[0].ssrc = rtc::Optional<uint32_t>(ssrc);
|
||||
return rtp_params;
|
||||
}
|
||||
|
||||
|
||||
@ -1113,6 +1113,14 @@ TEST_F(WebRtcVoiceEngineTestFake, GetRtpSendParametersCodecs) {
|
||||
EXPECT_EQ(kPcmuCodec.ToCodecParameters(), rtp_parameters.codecs[1]);
|
||||
}
|
||||
|
||||
// Test that GetRtpSendParameters returns an SSRC.
|
||||
TEST_F(WebRtcVoiceEngineTestFake, GetRtpSendParametersSsrc) {
|
||||
EXPECT_TRUE(SetupSendStream());
|
||||
webrtc::RtpParameters rtp_parameters = channel_->GetRtpSendParameters(kSsrc1);
|
||||
ASSERT_EQ(1u, rtp_parameters.encodings.size());
|
||||
EXPECT_EQ(kSsrc1, rtp_parameters.encodings[0].ssrc);
|
||||
}
|
||||
|
||||
// Test that if we set/get parameters multiple times, we get the same results.
|
||||
TEST_F(WebRtcVoiceEngineTestFake, SetAndGetRtpSendParameters) {
|
||||
EXPECT_TRUE(SetupSendStream());
|
||||
@ -1146,6 +1154,15 @@ TEST_F(WebRtcVoiceEngineTestFake, GetRtpReceiveParametersCodecs) {
|
||||
EXPECT_EQ(kPcmuCodec.ToCodecParameters(), rtp_parameters.codecs[1]);
|
||||
}
|
||||
|
||||
// Test that GetRtpReceiveParameters returns an SSRC.
|
||||
TEST_F(WebRtcVoiceEngineTestFake, GetRtpReceiveParametersSsrc) {
|
||||
EXPECT_TRUE(SetupRecvStream());
|
||||
webrtc::RtpParameters rtp_parameters =
|
||||
channel_->GetRtpReceiveParameters(kSsrc1);
|
||||
ASSERT_EQ(1u, rtp_parameters.encodings.size());
|
||||
EXPECT_EQ(kSsrc1, rtp_parameters.encodings[0].ssrc);
|
||||
}
|
||||
|
||||
// Test that if we set/get parameters multiple times, we get the same results.
|
||||
TEST_F(WebRtcVoiceEngineTestFake, SetAndGetRtpReceiveParameters) {
|
||||
EXPECT_TRUE(SetupRecvStream());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user