Remove obsolete GetRemoteAudioSSL* functions.
Bug: webrtc:12054 Change-Id: I56d198cfa2c336155c5173ccd524107d12e6a382 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190921 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32528}
This commit is contained in:

committed by
Commit Bot

parent
9f52b9dc4e
commit
4efa9d0a5f
@ -1481,26 +1481,6 @@ void PeerConnection::SetAudioRecording(bool recording) {
|
||||
audio_state->SetRecording(recording);
|
||||
}
|
||||
|
||||
std::unique_ptr<rtc::SSLCertificate>
|
||||
PeerConnection::GetRemoteAudioSSLCertificate() {
|
||||
std::unique_ptr<rtc::SSLCertChain> chain = GetRemoteAudioSSLCertChain();
|
||||
if (!chain || !chain->GetSize()) {
|
||||
return nullptr;
|
||||
}
|
||||
return chain->Get(0).Clone();
|
||||
}
|
||||
|
||||
std::unique_ptr<rtc::SSLCertChain>
|
||||
PeerConnection::GetRemoteAudioSSLCertChain() {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread());
|
||||
auto audio_transceiver = rtp_manager()->GetFirstAudioTransceiver();
|
||||
if (!audio_transceiver || !audio_transceiver->internal()->channel()) {
|
||||
return nullptr;
|
||||
}
|
||||
return transport_controller_->GetRemoteSSLCertChain(
|
||||
audio_transceiver->internal()->channel()->transport_name());
|
||||
}
|
||||
|
||||
void PeerConnection::AddAdaptationResource(
|
||||
rtc::scoped_refptr<Resource> resource) {
|
||||
if (!worker_thread()->IsCurrent()) {
|
||||
|
@ -154,20 +154,6 @@ class PeerConnection : public PeerConnectionInternal,
|
||||
cricket::MediaType media_type,
|
||||
const RtpTransceiverInit& init) override;
|
||||
|
||||
// Gets the DTLS SSL certificate associated with the audio transport on the
|
||||
// remote side. This will become populated once the DTLS connection with the
|
||||
// peer has been completed, as indicated by the ICE connection state
|
||||
// transitioning to kIceConnectionCompleted.
|
||||
// Deprecated - users should insted query the DTLS transpport for this info.
|
||||
// See https://www.w3.org/TR/webrtc/#rtcdtlstransport-interface
|
||||
|
||||
RTC_DEPRECATED std::unique_ptr<rtc::SSLCertificate>
|
||||
GetRemoteAudioSSLCertificate();
|
||||
|
||||
// Version of the above method that returns the full certificate chain.
|
||||
RTC_DEPRECATED std::unique_ptr<rtc::SSLCertChain>
|
||||
GetRemoteAudioSSLCertChain();
|
||||
|
||||
rtc::scoped_refptr<RtpSenderInterface> CreateSender(
|
||||
const std::string& kind,
|
||||
const std::string& stream_id) override;
|
||||
|
@ -1950,76 +1950,6 @@ TEST_P(PeerConnectionIntegrationTest,
|
||||
ASSERT_TRUE(ExpectNewFrames(media_expectations));
|
||||
}
|
||||
|
||||
// Tests that the GetRemoteAudioSSLCertificate method returns the remote DTLS
|
||||
// certificate once the DTLS handshake has finished.
|
||||
TEST_P(PeerConnectionIntegrationTest,
|
||||
GetRemoteAudioSSLCertificateReturnsExchangedCertificate) {
|
||||
auto GetRemoteAudioSSLCertificate = [](PeerConnectionWrapper* wrapper) {
|
||||
auto pci = reinterpret_cast<PeerConnectionProxy*>(wrapper->pc());
|
||||
auto pc = reinterpret_cast<PeerConnection*>(pci->internal());
|
||||
return pc->GetRemoteAudioSSLCertificate();
|
||||
};
|
||||
auto GetRemoteAudioSSLCertChain = [](PeerConnectionWrapper* wrapper) {
|
||||
auto pci = reinterpret_cast<PeerConnectionProxy*>(wrapper->pc());
|
||||
auto pc = reinterpret_cast<PeerConnection*>(pci->internal());
|
||||
return pc->GetRemoteAudioSSLCertChain();
|
||||
};
|
||||
|
||||
auto caller_cert = rtc::RTCCertificate::FromPEM(kRsaPems[0]);
|
||||
auto callee_cert = rtc::RTCCertificate::FromPEM(kRsaPems[1]);
|
||||
|
||||
// Configure each side with a known certificate so they can be compared later.
|
||||
PeerConnectionInterface::RTCConfiguration caller_config;
|
||||
caller_config.enable_dtls_srtp.emplace(true);
|
||||
caller_config.certificates.push_back(caller_cert);
|
||||
PeerConnectionInterface::RTCConfiguration callee_config;
|
||||
callee_config.enable_dtls_srtp.emplace(true);
|
||||
callee_config.certificates.push_back(callee_cert);
|
||||
ASSERT_TRUE(
|
||||
CreatePeerConnectionWrappersWithConfig(caller_config, callee_config));
|
||||
ConnectFakeSignaling();
|
||||
|
||||
// When first initialized, there should not be a remote SSL certificate (and
|
||||
// calling this method should not crash).
|
||||
EXPECT_EQ(nullptr, GetRemoteAudioSSLCertificate(caller()));
|
||||
EXPECT_EQ(nullptr, GetRemoteAudioSSLCertificate(callee()));
|
||||
EXPECT_EQ(nullptr, GetRemoteAudioSSLCertChain(caller()));
|
||||
EXPECT_EQ(nullptr, GetRemoteAudioSSLCertChain(callee()));
|
||||
|
||||
caller()->AddAudioTrack();
|
||||
callee()->AddAudioTrack();
|
||||
caller()->CreateAndSetAndSignalOffer();
|
||||
ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
|
||||
ASSERT_TRUE_WAIT(DtlsConnected(), kDefaultTimeout);
|
||||
|
||||
// Once DTLS has been connected, each side should return the other's SSL
|
||||
// certificate when calling GetRemoteAudioSSLCertificate.
|
||||
|
||||
auto caller_remote_cert = GetRemoteAudioSSLCertificate(caller());
|
||||
ASSERT_TRUE(caller_remote_cert);
|
||||
EXPECT_EQ(callee_cert->GetSSLCertificate().ToPEMString(),
|
||||
caller_remote_cert->ToPEMString());
|
||||
|
||||
auto callee_remote_cert = GetRemoteAudioSSLCertificate(callee());
|
||||
ASSERT_TRUE(callee_remote_cert);
|
||||
EXPECT_EQ(caller_cert->GetSSLCertificate().ToPEMString(),
|
||||
callee_remote_cert->ToPEMString());
|
||||
|
||||
auto caller_remote_cert_chain = GetRemoteAudioSSLCertChain(caller());
|
||||
ASSERT_TRUE(caller_remote_cert_chain);
|
||||
ASSERT_EQ(1U, caller_remote_cert_chain->GetSize());
|
||||
auto remote_cert = &caller_remote_cert_chain->Get(0);
|
||||
EXPECT_EQ(callee_cert->GetSSLCertificate().ToPEMString(),
|
||||
remote_cert->ToPEMString());
|
||||
|
||||
auto callee_remote_cert_chain = GetRemoteAudioSSLCertChain(callee());
|
||||
ASSERT_TRUE(callee_remote_cert_chain);
|
||||
ASSERT_EQ(1U, callee_remote_cert_chain->GetSize());
|
||||
remote_cert = &callee_remote_cert_chain->Get(0);
|
||||
EXPECT_EQ(caller_cert->GetSSLCertificate().ToPEMString(),
|
||||
remote_cert->ToPEMString());
|
||||
}
|
||||
|
||||
// This test sets up a call between two parties with a source resolution of
|
||||
// 1280x720 and verifies that a 16:9 aspect ratio is received.
|
||||
TEST_P(PeerConnectionIntegrationTest,
|
||||
|
@ -440,17 +440,6 @@ void RtpTransmissionManager::RemoveVideoTrack(VideoTrackInterface* track,
|
||||
GetVideoTransceiver()->internal()->RemoveSender(sender);
|
||||
}
|
||||
|
||||
rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
|
||||
RtpTransmissionManager::GetFirstAudioTransceiver() const {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread());
|
||||
for (auto transceiver : transceivers_.List()) {
|
||||
if (transceiver->media_type() == cricket::MEDIA_TYPE_AUDIO) {
|
||||
return transceiver;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void RtpTransmissionManager::CreateAudioReceiver(
|
||||
MediaStreamInterface* stream,
|
||||
const RtpSenderInfo& remote_sender_info) {
|
||||
|
@ -136,10 +136,6 @@ class RtpTransmissionManager : public RtpSenderBase::SetStreamsObserver,
|
||||
rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
|
||||
GetVideoTransceiver() const;
|
||||
|
||||
// Gets the first audio transceiver.
|
||||
rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
|
||||
GetFirstAudioTransceiver() const;
|
||||
|
||||
// Add an audio track, reusing or creating the sender.
|
||||
void AddAudioTrack(AudioTrackInterface* track, MediaStreamInterface* stream);
|
||||
// Plan B: Remove an audio track, removing the sender.
|
||||
|
Reference in New Issue
Block a user