Revert of Adding "first packet received" notification to PeerConnectionObserver. (patchset #5 id:80001 of https://codereview.webrtc.org/1581693006/ )
Reason for revert: onFirstMediaPacketReceived() breaks bot. Original issue's description: > Adding "first packet received" notification to PeerConnectionObserver. > > R=glaznev@webrtc.org, pthatcher@webrtc.org, tkchin@webrtc.org > > Committed: https://crrev.com/42265a8cc3b3f3db4aa2c29005aed2fb4393adef > Cr-Commit-Position: refs/heads/master@{#11401} > > Committed: https://crrev.com/08a6eab75e13613183509d91d3892c1db57f6fc5 > Cr-Commit-Position: refs/heads/master@{#11404} TBR=pthatcher@webrtc.org,tkchin@webrtc.org,glaznev@webrtc.org,deadbeef@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.webrtc.org/1647483004 Cr-Commit-Position: refs/heads/master@{#11415}
This commit is contained in:
@ -374,14 +374,6 @@ class PCOJava : public PeerConnectionObserver {
|
|||||||
CHECK_EXCEPTION(jni()) << "error during CallVoidMethod";
|
CHECK_EXCEPTION(jni()) << "error during CallVoidMethod";
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnFirstMediaPacketReceived() override {
|
|
||||||
ScopedLocalRefFrame local_ref_frame(jni());
|
|
||||||
jmethodID m = GetMethodID(jni(), *j_observer_class_,
|
|
||||||
"onFirstMediaPacketReceived", "()V");
|
|
||||||
jni()->CallVoidMethod(*j_observer_global_, m);
|
|
||||||
CHECK_EXCEPTION(jni()) << "error during CallVoidMethod";
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetConstraints(ConstraintsWrapper* constraints) {
|
void SetConstraints(ConstraintsWrapper* constraints) {
|
||||||
RTC_CHECK(!constraints_.get()) << "constraints already set!";
|
RTC_CHECK(!constraints_.get()) << "constraints already set!";
|
||||||
constraints_.reset(constraints);
|
constraints_.reset(constraints);
|
||||||
|
|||||||
@ -86,9 +86,6 @@ public class PeerConnection {
|
|||||||
|
|
||||||
/** Triggered when renegotiation is necessary. */
|
/** Triggered when renegotiation is necessary. */
|
||||||
public void onRenegotiationNeeded();
|
public void onRenegotiationNeeded();
|
||||||
|
|
||||||
/** Called when the first RTP packet is received. */
|
|
||||||
public void onFirstMediaPacketReceived();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Java version of PeerConnectionInterface.IceServer. */
|
/** Java version of PeerConnectionInterface.IceServer. */
|
||||||
|
|||||||
@ -289,9 +289,6 @@ public class PeerConnectionTest {
|
|||||||
++expectedStatsCallbacks;
|
++expectedStatsCallbacks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public synchronized void onFirstMediaPacketReceived() {}
|
|
||||||
|
|
||||||
public synchronized LinkedList<StatsReport[]> takeStatsReports() {
|
public synchronized LinkedList<StatsReport[]> takeStatsReports() {
|
||||||
LinkedList<StatsReport[]> got = gotStatsReports;
|
LinkedList<StatsReport[]> got = gotStatsReports;
|
||||||
gotStatsReports = new LinkedList<StatsReport[]>();
|
gotStatsReports = new LinkedList<StatsReport[]>();
|
||||||
|
|||||||
@ -68,9 +68,6 @@ class RTCPeerConnectionObserver : public PeerConnectionObserver {
|
|||||||
// New Ice candidate have been found.
|
// New Ice candidate have been found.
|
||||||
void OnIceCandidate(const IceCandidateInterface* candidate) override;
|
void OnIceCandidate(const IceCandidateInterface* candidate) override;
|
||||||
|
|
||||||
// Called when the first RTP packet is received.
|
|
||||||
void OnFirstMediaPacketReceived() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
__weak RTCPeerConnection* _peerConnection;
|
__weak RTCPeerConnection* _peerConnection;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -105,9 +105,4 @@ void RTCPeerConnectionObserver::OnIceCandidate(
|
|||||||
gotICECandidate:iceCandidate];
|
gotICECandidate:iceCandidate];
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTCPeerConnectionObserver::OnFirstMediaPacketReceived() {
|
|
||||||
id<RTCPeerConnectionDelegate> delegate = _peerConnection.delegate;
|
|
||||||
[delegate peerConnectionOnFirstMediaPacketReceived:_peerConnection];
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -69,8 +69,4 @@
|
|||||||
- (void)peerConnection:(RTCPeerConnection*)peerConnection
|
- (void)peerConnection:(RTCPeerConnection*)peerConnection
|
||||||
didOpenDataChannel:(RTCDataChannel*)dataChannel;
|
didOpenDataChannel:(RTCDataChannel*)dataChannel;
|
||||||
|
|
||||||
// Called when the first RTP packet is received.
|
|
||||||
- (void)peerConnectionOnFirstMediaPacketReceived:
|
|
||||||
(RTCPeerConnection *)peerConnection;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -233,10 +233,6 @@
|
|||||||
@"Unexpected state");
|
@"Unexpected state");
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)peerConnectionOnFirstMediaPacketReceived:
|
|
||||||
(RTCPeerConnection*)peerConnection {
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - RTCDataChannelDelegate
|
#pragma mark - RTCDataChannelDelegate
|
||||||
|
|
||||||
- (void)channelDidChangeState:(RTCDataChannel*)channel {
|
- (void)channelDidChangeState:(RTCDataChannel*)channel {
|
||||||
|
|||||||
@ -663,8 +663,6 @@ bool PeerConnection::Initialize(
|
|||||||
this, &PeerConnection::OnDataChannelDestroyed);
|
this, &PeerConnection::OnDataChannelDestroyed);
|
||||||
session_->SignalDataChannelOpenMessage.connect(
|
session_->SignalDataChannelOpenMessage.connect(
|
||||||
this, &PeerConnection::OnDataChannelOpenMessage);
|
this, &PeerConnection::OnDataChannelOpenMessage);
|
||||||
session_->SignalFirstMediaPacketReceived.connect(
|
|
||||||
this, &PeerConnection::OnFirstMediaPacketReceived);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2031,11 +2029,6 @@ void PeerConnection::OnDataChannelOpenMessage(
|
|||||||
DataChannelProxy::Create(signaling_thread(), channel));
|
DataChannelProxy::Create(signaling_thread(), channel));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerConnection::OnFirstMediaPacketReceived() {
|
|
||||||
RTC_DCHECK(signaling_thread()->IsCurrent());
|
|
||||||
observer_->OnFirstMediaPacketReceived();
|
|
||||||
}
|
|
||||||
|
|
||||||
RtpSenderInterface* PeerConnection::FindSenderById(const std::string& id) {
|
RtpSenderInterface* PeerConnection::FindSenderById(const std::string& id) {
|
||||||
auto it =
|
auto it =
|
||||||
std::find_if(senders_.begin(), senders_.end(),
|
std::find_if(senders_.begin(), senders_.end(),
|
||||||
|
|||||||
@ -326,7 +326,6 @@ class PeerConnection : public PeerConnectionInterface,
|
|||||||
// webrtc::DataChannel should be opened.
|
// webrtc::DataChannel should be opened.
|
||||||
void OnDataChannelOpenMessage(const std::string& label,
|
void OnDataChannelOpenMessage(const std::string& label,
|
||||||
const InternalDataChannelInit& config);
|
const InternalDataChannelInit& config);
|
||||||
void OnFirstMediaPacketReceived();
|
|
||||||
|
|
||||||
RtpSenderInterface* FindSenderById(const std::string& id);
|
RtpSenderInterface* FindSenderById(const std::string& id);
|
||||||
|
|
||||||
|
|||||||
@ -251,7 +251,6 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
|
|||||||
signaling_message_receiver_->ReceiveIceMessage(
|
signaling_message_receiver_->ReceiveIceMessage(
|
||||||
candidate->sdp_mid(), candidate->sdp_mline_index(), ice_sdp);
|
candidate->sdp_mid(), candidate->sdp_mline_index(), ice_sdp);
|
||||||
}
|
}
|
||||||
void OnFirstMediaPacketReceived() override { received_media_packet_ = true; }
|
|
||||||
|
|
||||||
// MediaStreamInterface callback
|
// MediaStreamInterface callback
|
||||||
void OnChanged() override {
|
void OnChanged() override {
|
||||||
@ -387,8 +386,6 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool received_media_packet() const { return received_media_packet_; }
|
|
||||||
|
|
||||||
void OnIceComplete() override { LOG(INFO) << id_ << "OnIceComplete"; }
|
void OnIceComplete() override { LOG(INFO) << id_ << "OnIceComplete"; }
|
||||||
|
|
||||||
void OnDataChannel(DataChannelInterface* data_channel) override {
|
void OnDataChannel(DataChannelInterface* data_channel) override {
|
||||||
@ -927,10 +924,6 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
|
|||||||
|
|
||||||
rtc::scoped_refptr<DataChannelInterface> data_channel_;
|
rtc::scoped_refptr<DataChannelInterface> data_channel_;
|
||||||
rtc::scoped_ptr<MockDataChannelObserver> data_observer_;
|
rtc::scoped_ptr<MockDataChannelObserver> data_observer_;
|
||||||
|
|
||||||
// "true" if the PeerConnection indicated that a packet was received,
|
|
||||||
// through PeerConnectionObserverInterface.
|
|
||||||
bool received_media_packet_ = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class P2PTestConductor : public testing::Test {
|
class P2PTestConductor : public testing::Test {
|
||||||
@ -1111,12 +1104,6 @@ class P2PTestConductor : public testing::Test {
|
|||||||
|
|
||||||
EXPECT_TRUE_WAIT(FramesNotPending(audio_frame_count, video_frame_count),
|
EXPECT_TRUE_WAIT(FramesNotPending(audio_frame_count, video_frame_count),
|
||||||
kMaxWaitForFramesMs);
|
kMaxWaitForFramesMs);
|
||||||
if (audio_frame_count != -1 || video_frame_count != -1) {
|
|
||||||
EXPECT_TRUE_WAIT(initiating_client_->received_media_packet(),
|
|
||||||
kMaxWaitForFramesMs);
|
|
||||||
EXPECT_TRUE_WAIT(receiving_client_->received_media_packet(),
|
|
||||||
kMaxWaitForFramesMs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupAndVerifyDtlsCall() {
|
void SetupAndVerifyDtlsCall() {
|
||||||
|
|||||||
@ -501,9 +501,6 @@ class PeerConnectionObserver {
|
|||||||
// Called when the ICE connection receiving status changes.
|
// Called when the ICE connection receiving status changes.
|
||||||
virtual void OnIceConnectionReceivingChange(bool receiving) {}
|
virtual void OnIceConnectionReceivingChange(bool receiving) {}
|
||||||
|
|
||||||
// Called when the first RTP packet is received.
|
|
||||||
virtual void OnFirstMediaPacketReceived() {}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Dtor protected as objects shouldn't be deleted via this interface.
|
// Dtor protected as objects shouldn't be deleted via this interface.
|
||||||
~PeerConnectionObserver() {}
|
~PeerConnectionObserver() {}
|
||||||
|
|||||||
@ -1844,8 +1844,6 @@ bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) {
|
|||||||
|
|
||||||
voice_channel_->SignalDtlsSetupFailure.connect(
|
voice_channel_->SignalDtlsSetupFailure.connect(
|
||||||
this, &WebRtcSession::OnDtlsSetupFailure);
|
this, &WebRtcSession::OnDtlsSetupFailure);
|
||||||
voice_channel_->SignalFirstPacketReceived.connect(
|
|
||||||
this, &WebRtcSession::OnChannelFirstPacketReceived);
|
|
||||||
|
|
||||||
SignalVoiceChannelCreated();
|
SignalVoiceChannelCreated();
|
||||||
voice_channel_->transport_channel()->SignalSentPacket.connect(
|
voice_channel_->transport_channel()->SignalSentPacket.connect(
|
||||||
@ -1863,8 +1861,6 @@ bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) {
|
|||||||
|
|
||||||
video_channel_->SignalDtlsSetupFailure.connect(
|
video_channel_->SignalDtlsSetupFailure.connect(
|
||||||
this, &WebRtcSession::OnDtlsSetupFailure);
|
this, &WebRtcSession::OnDtlsSetupFailure);
|
||||||
video_channel_->SignalFirstPacketReceived.connect(
|
|
||||||
this, &WebRtcSession::OnChannelFirstPacketReceived);
|
|
||||||
|
|
||||||
SignalVideoChannelCreated();
|
SignalVideoChannelCreated();
|
||||||
video_channel_->transport_channel()->SignalSentPacket.connect(
|
video_channel_->transport_channel()->SignalSentPacket.connect(
|
||||||
@ -1899,14 +1895,6 @@ void WebRtcSession::OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp) {
|
|||||||
rtcp ? kDtlsSetupFailureRtcp : kDtlsSetupFailureRtp);
|
rtcp ? kDtlsSetupFailureRtcp : kDtlsSetupFailureRtp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebRtcSession::OnChannelFirstPacketReceived(cricket::BaseChannel*) {
|
|
||||||
ASSERT(signaling_thread()->IsCurrent());
|
|
||||||
if (!has_received_media_packet_) {
|
|
||||||
has_received_media_packet_ = true;
|
|
||||||
SignalFirstMediaPacketReceived();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebRtcSession::OnDataChannelMessageReceived(
|
void WebRtcSession::OnDataChannelMessageReceived(
|
||||||
cricket::DataChannel* channel,
|
cricket::DataChannel* channel,
|
||||||
const cricket::ReceiveDataParams& params,
|
const cricket::ReceiveDataParams& params,
|
||||||
|
|||||||
@ -309,7 +309,6 @@ class WebRtcSession : public AudioProviderInterface,
|
|||||||
void OnCertificateReady(
|
void OnCertificateReady(
|
||||||
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
|
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate);
|
||||||
void OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp);
|
void OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp);
|
||||||
void OnChannelFirstPacketReceived(cricket::BaseChannel*);
|
|
||||||
|
|
||||||
// For unit test.
|
// For unit test.
|
||||||
bool waiting_for_certificate_for_testing() const;
|
bool waiting_for_certificate_for_testing() const;
|
||||||
@ -336,9 +335,6 @@ class WebRtcSession : public AudioProviderInterface,
|
|||||||
sigslot::signal2<const std::string&, const InternalDataChannelInit&>
|
sigslot::signal2<const std::string&, const InternalDataChannelInit&>
|
||||||
SignalDataChannelOpenMessage;
|
SignalDataChannelOpenMessage;
|
||||||
|
|
||||||
// Called when the first RTP packet is received.
|
|
||||||
sigslot::signal0<> SignalFirstMediaPacketReceived;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Indicates the type of SessionDescription in a call to SetLocalDescription
|
// Indicates the type of SessionDescription in a call to SetLocalDescription
|
||||||
// and SetRemoteDescription.
|
// and SetRemoteDescription.
|
||||||
@ -522,8 +518,6 @@ class WebRtcSession : public AudioProviderInterface,
|
|||||||
// Declares the RTCP mux policy for the WebRTCSession.
|
// Declares the RTCP mux policy for the WebRTCSession.
|
||||||
PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_;
|
PeerConnectionInterface::RtcpMuxPolicy rtcp_mux_policy_;
|
||||||
|
|
||||||
bool has_received_media_packet_ = false;
|
|
||||||
|
|
||||||
RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
|
RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcSession);
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -1000,10 +1000,6 @@ public class PeerConnectionClient {
|
|||||||
// No need to do anything; AppRTC follows a pre-agreed-upon
|
// No need to do anything; AppRTC follows a pre-agreed-upon
|
||||||
// signaling/negotiation protocol.
|
// signaling/negotiation protocol.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFirstMediaPacketReceived() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementation detail: handle offer creation/signaling and answer setting,
|
// Implementation detail: handle offer creation/signaling and answer setting,
|
||||||
|
|||||||
@ -384,11 +384,6 @@ static NSInteger const kARDAppClientErrorInvalidRoom = -6;
|
|||||||
didOpenDataChannel:(RTCDataChannel *)dataChannel {
|
didOpenDataChannel:(RTCDataChannel *)dataChannel {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)peerConnectionOnFirstMediaPacketReceived:
|
|
||||||
(RTCPeerConnection *)peerConnection {
|
|
||||||
RTCLog(@"Received first media packet.");
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - RTCStatsDelegate
|
#pragma mark - RTCStatsDelegate
|
||||||
|
|
||||||
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
||||||
|
|||||||
Reference in New Issue
Block a user