From 7898ba65cda7c0fe2339a7cb2c114a0fb2fb4370 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 20 Apr 2020 17:05:27 +0200 Subject: [PATCH] extend extended webrtcwrapper logging --- .../conversations/xmpp/jingle/WebRTCWrapper.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java index e987be4ef..defe85291 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java @@ -28,9 +28,11 @@ import org.webrtc.EglBase; import org.webrtc.IceCandidate; import org.webrtc.MediaConstraints; import org.webrtc.MediaStream; +import org.webrtc.MediaStreamTrack; import org.webrtc.PeerConnection; import org.webrtc.PeerConnectionFactory; import org.webrtc.RtpReceiver; +import org.webrtc.RtpTransceiver; import org.webrtc.SdpObserver; import org.webrtc.SessionDescription; import org.webrtc.SurfaceTextureHelper; @@ -68,7 +70,7 @@ public class WebRTCWrapper { private final PeerConnection.Observer peerConnectionObserver = new PeerConnection.Observer() { @Override public void onSignalingChange(PeerConnection.SignalingState signalingState) { - Log.d(Config.LOGTAG, "onSignalingChange(" + signalingState + ")"); + Log.d(EXTENDED_LOGGING_TAG, "onSignalingChange(" + signalingState + ")"); //this is called after removeTrack or addTrack //and should then trigger a content-add or content-remove or something //https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/removeTrack @@ -112,6 +114,7 @@ public class WebRTCWrapper { @Override public void onAddStream(MediaStream mediaStream) { + Log.d(EXTENDED_LOGGING_TAG, "onAddStream(numAudioTracks=" + mediaStream.audioTracks.size() + ",numVideoTracks=" + mediaStream.videoTracks.size() + ")"); final List videoTracks = mediaStream.videoTracks; if (videoTracks.size() > 0) { remoteVideoTrack = videoTracks.get(0); @@ -138,8 +141,13 @@ public class WebRTCWrapper { @Override public void onAddTrack(RtpReceiver rtpReceiver, MediaStream[] mediaStreams) { - Log.d(Config.LOGTAG, "onAddTrack()"); + final MediaStreamTrack track = rtpReceiver.track(); + Log.d(EXTENDED_LOGGING_TAG, "onAddTrack(kind=" + (track == null ? "null" : track.kind()) + ",numMediaStreams=" + mediaStreams.length + ")"); + } + @Override + public void onTrack(RtpTransceiver transceiver) { + Log.d(EXTENDED_LOGGING_TAG, "onTrack(mid=" + transceiver.getMid() + ",media=" + transceiver.getMediaType() + ")"); } }; @Nullable