diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h index 2466300204..c99bc9fe86 100644 --- a/api/peerconnectioninterface.h +++ b/api/peerconnectioninterface.h @@ -666,24 +666,9 @@ class PeerConnectionInterface : public rtc::RefCountInterface { // - INVALID_PARAMETER: |track| is null, has a kind other than audio or video, // or a sender already exists for the track. // - INVALID_STATE: The PeerConnection is closed. - // TODO(steveanton): Remove default implementation once downstream - // implementations have been updated. virtual RTCErrorOr> AddTrack( rtc::scoped_refptr track, - const std::vector& stream_ids) { - return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented"); - } - // |streams| indicates which stream ids the track should be associated - // with. - // TODO(steveanton): Remove this overload once callers have moved to the - // signature with stream ids. - virtual rtc::scoped_refptr AddTrack( - MediaStreamTrackInterface* track, - std::vector streams) { - // Default implementation provided so downstream implementations can remove - // this. - return nullptr; - } + const std::vector& stream_ids) = 0; // Remove an RtpSender from this PeerConnection. // Returns true on success. diff --git a/api/peerconnectionproxy.h b/api/peerconnectionproxy.h index ab3b735828..6855975e1e 100644 --- a/api/peerconnectionproxy.h +++ b/api/peerconnectionproxy.h @@ -32,10 +32,6 @@ PROXY_METHOD2(RTCErrorOr>, AddTrack, rtc::scoped_refptr, const std::vector&); -PROXY_METHOD2(rtc::scoped_refptr, - AddTrack, - MediaStreamTrackInterface*, - std::vector) PROXY_METHOD1(bool, RemoveTrack, RtpSenderInterface*) PROXY_METHOD1(RTCErrorOr>, AddTransceiver, diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc index ebf7cee3c4..e205953aaa 100644 --- a/pc/peerconnection.cc +++ b/pc/peerconnection.cc @@ -1155,25 +1155,6 @@ void PeerConnection::RemoveStream(MediaStreamInterface* local_stream) { observer_->OnRenegotiationNeeded(); } -rtc::scoped_refptr PeerConnection::AddTrack( - MediaStreamTrackInterface* track, - std::vector streams) { - TRACE_EVENT0("webrtc", "PeerConnection::AddTrack"); - std::vector stream_ids; - for (auto* stream : streams) { - if (!stream) { - RTC_LOG(LS_ERROR) << "Stream list has null element."; - return nullptr; - } - stream_ids.push_back(stream->id()); - } - auto sender_or_error = AddTrack(track, stream_ids); - if (!sender_or_error.ok()) { - return nullptr; - } - return sender_or_error.MoveValue(); -} - RTCErrorOr> PeerConnection::AddTrack( rtc::scoped_refptr track, const std::vector& stream_ids) { diff --git a/pc/peerconnection.h b/pc/peerconnection.h index 7d7315d4e4..1cd9c6c36e 100644 --- a/pc/peerconnection.h +++ b/pc/peerconnection.h @@ -85,9 +85,6 @@ class PeerConnection : public PeerConnectionInternal, RTCErrorOr> AddTrack( rtc::scoped_refptr track, const std::vector& stream_ids) override; - rtc::scoped_refptr AddTrack( - MediaStreamTrackInterface* track, - std::vector streams) override; bool RemoveTrack(RtpSenderInterface* sender) override; RTCErrorOr> AddTransceiver( diff --git a/pc/peerconnection_integrationtest.cc b/pc/peerconnection_integrationtest.cc index ed5db1f585..311881a496 100644 --- a/pc/peerconnection_integrationtest.cc +++ b/pc/peerconnection_integrationtest.cc @@ -4248,16 +4248,11 @@ TEST_F(PeerConnectionIntegrationTestPlanB, RemoveAndAddTrackWithNewStreamId) { ASSERT_TRUE(CreatePeerConnectionWrappers()); ConnectFakeSignaling(); - rtc::scoped_refptr stream_1 = - caller()->pc_factory()->CreateLocalMediaStream("stream_1"); - rtc::scoped_refptr stream_2 = - caller()->pc_factory()->CreateLocalMediaStream("stream_2"); - // Add track using stream 1, do offer/answer. rtc::scoped_refptr track = caller()->CreateLocalAudioTrack(); rtc::scoped_refptr sender = - caller()->pc()->AddTrack(track, {stream_1.get()}); + caller()->AddTrack(track, {"stream_1"}); caller()->CreateAndSetAndSignalOffer(); ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); { @@ -4267,7 +4262,7 @@ TEST_F(PeerConnectionIntegrationTestPlanB, RemoveAndAddTrackWithNewStreamId) { } // Remove the sender, and create a new one with the new stream. caller()->pc()->RemoveTrack(sender); - sender = caller()->pc()->AddTrack(track, {stream_2.get()}); + sender = caller()->AddTrack(track, {"stream_2"}); caller()->CreateAndSetAndSignalOffer(); ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); // Wait for additional audio frames to be received by the callee. diff --git a/pc/test/fakepeerconnectionbase.h b/pc/test/fakepeerconnectionbase.h index 3db2d4b8e0..bbddc8a28d 100644 --- a/pc/test/fakepeerconnectionbase.h +++ b/pc/test/fakepeerconnectionbase.h @@ -47,12 +47,6 @@ class FakePeerConnectionBase : public PeerConnectionInternal { return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented"); } - rtc::scoped_refptr AddTrack( - MediaStreamTrackInterface* track, - std::vector streams) override { - return nullptr; - } - bool RemoveTrack(RtpSenderInterface* sender) override { return false; } RTCErrorOr> AddTransceiver(