| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 import org.webrtc.PeerConnection.IceConnectionState; | 34 import org.webrtc.PeerConnection.IceConnectionState; |
| 35 import org.webrtc.PeerConnectionFactory; | 35 import org.webrtc.PeerConnectionFactory; |
| 36 import org.webrtc.RtpParameters; | 36 import org.webrtc.RtpParameters; |
| 37 import org.webrtc.RtpSender; | 37 import org.webrtc.RtpSender; |
| 38 import org.webrtc.SdpObserver; | 38 import org.webrtc.SdpObserver; |
| 39 import org.webrtc.SessionDescription; | 39 import org.webrtc.SessionDescription; |
| 40 import org.webrtc.StatsObserver; | 40 import org.webrtc.StatsObserver; |
| 41 import org.webrtc.StatsReport; | 41 import org.webrtc.StatsReport; |
| 42 import org.webrtc.VideoCapturer; | 42 import org.webrtc.VideoCapturer; |
| 43 import org.webrtc.VideoRenderer; | 43 import org.webrtc.VideoRenderer; |
| 44 import org.webrtc.VideoCapturerAndroid; | |
| 45 import org.webrtc.CameraVideoCapturer; | |
| 46 import org.webrtc.FileVideoCapturer; | |
| 47 import org.webrtc.VideoSource; | 44 import org.webrtc.VideoSource; |
| 48 import org.webrtc.VideoTrack; | 45 import org.webrtc.VideoTrack; |
| 49 import org.webrtc.voiceengine.WebRtcAudioManager; | 46 import org.webrtc.voiceengine.WebRtcAudioManager; |
| 50 import org.webrtc.voiceengine.WebRtcAudioUtils; | 47 import org.webrtc.voiceengine.WebRtcAudioUtils; |
| 51 | 48 |
| 52 import java.io.File; | 49 import java.io.File; |
| 53 import java.io.IOException; | 50 import java.io.IOException; |
| 54 import java.util.Collections; | |
| 55 import java.util.EnumSet; | 51 import java.util.EnumSet; |
| 56 import java.util.LinkedList; | 52 import java.util.LinkedList; |
| 57 import java.util.List; | |
| 58 import java.util.Timer; | 53 import java.util.Timer; |
| 59 import java.util.TimerTask; | 54 import java.util.TimerTask; |
| 60 import java.util.concurrent.Executors; | 55 import java.util.concurrent.Executors; |
| 61 import java.util.concurrent.ScheduledExecutorService; | 56 import java.util.concurrent.ScheduledExecutorService; |
| 62 import java.util.regex.Matcher; | 57 import java.util.regex.Matcher; |
| 63 import java.util.regex.Pattern; | 58 import java.util.regex.Pattern; |
| 64 | 59 |
| 65 /** | 60 /** |
| 66 * Peer connection client implementation. | 61 * Peer connection client implementation. |
| 67 * | 62 * |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 PeerConnectionFactory.Options options = null; | 100 PeerConnectionFactory.Options options = null; |
| 106 private AudioSource audioSource; | 101 private AudioSource audioSource; |
| 107 private VideoSource videoSource; | 102 private VideoSource videoSource; |
| 108 private boolean videoCallEnabled; | 103 private boolean videoCallEnabled; |
| 109 private boolean preferIsac; | 104 private boolean preferIsac; |
| 110 private String preferredVideoCodec; | 105 private String preferredVideoCodec; |
| 111 private boolean videoCapturerStopped; | 106 private boolean videoCapturerStopped; |
| 112 private boolean isError; | 107 private boolean isError; |
| 113 private Timer statsTimer; | 108 private Timer statsTimer; |
| 114 private VideoRenderer.Callbacks localRender; | 109 private VideoRenderer.Callbacks localRender; |
| 115 private List<VideoRenderer.Callbacks> remoteRenders; | 110 private VideoRenderer.Callbacks remoteRender; |
| 116 private SignalingParameters signalingParameters; | 111 private SignalingParameters signalingParameters; |
| 117 private MediaConstraints pcConstraints; | 112 private MediaConstraints pcConstraints; |
| 118 private int videoWidth; | 113 private int videoWidth; |
| 119 private int videoHeight; | 114 private int videoHeight; |
| 120 private int videoFps; | 115 private int videoFps; |
| 121 private MediaConstraints audioConstraints; | 116 private MediaConstraints audioConstraints; |
| 122 private ParcelFileDescriptor aecDumpFileDescriptor; | 117 private ParcelFileDescriptor aecDumpFileDescriptor; |
| 123 private MediaConstraints sdpMediaConstraints; | 118 private MediaConstraints sdpMediaConstraints; |
| 124 private PeerConnectionParameters peerConnectionParameters; | 119 private PeerConnectionParameters peerConnectionParameters; |
| 125 // Queued remote ICE candidates are consumed only after both local and | 120 // Queued remote ICE candidates are consumed only after both local and |
| 126 // remote descriptions are set. Similarly local ICE candidates are sent to | 121 // remote descriptions are set. Similarly local ICE candidates are sent to |
| 127 // remote peer after both local and remote description are set. | 122 // remote peer after both local and remote description are set. |
| 128 private LinkedList<IceCandidate> queuedRemoteCandidates; | 123 private LinkedList<IceCandidate> queuedRemoteCandidates; |
| 129 private PeerConnectionEvents events; | 124 private PeerConnectionEvents events; |
| 130 private boolean isInitiator; | 125 private boolean isInitiator; |
| 131 private SessionDescription localSdp; // either offer or answer SDP | 126 private SessionDescription localSdp; // either offer or answer SDP |
| 132 private MediaStream mediaStream; | 127 private MediaStream mediaStream; |
| 133 private int numberOfCameras; | 128 private int numberOfCameras; |
| 134 private VideoCapturer videoCapturer; | 129 private CameraVideoCapturer videoCapturer; |
| 135 // enableVideo is set to true if video should be rendered and sent. | 130 // enableVideo is set to true if video should be rendered and sent. |
| 136 private boolean renderVideo; | 131 private boolean renderVideo; |
| 137 private VideoTrack localVideoTrack; | 132 private VideoTrack localVideoTrack; |
| 138 private VideoTrack remoteVideoTrack; | 133 private VideoTrack remoteVideoTrack; |
| 139 private RtpSender localVideoSender; | 134 private RtpSender localVideoSender; |
| 140 // enableAudio is set to true if audio should be sent. | 135 // enableAudio is set to true if audio should be sent. |
| 141 private boolean enableAudio; | 136 private boolean enableAudio; |
| 142 private AudioTrack localAudioTrack; | 137 private AudioTrack localAudioTrack; |
| 143 | 138 |
| 144 /** | 139 /** |
| 145 * Peer connection parameters. | 140 * Peer connection parameters. |
| 146 */ | 141 */ |
| 147 public static class PeerConnectionParameters { | 142 public static class PeerConnectionParameters { |
| 148 public final boolean videoCallEnabled; | 143 public final boolean videoCallEnabled; |
| 149 public final boolean loopback; | 144 public final boolean loopback; |
| 150 public final boolean tracing; | 145 public final boolean tracing; |
| 146 public final boolean useCamera2; |
| 151 public final int videoWidth; | 147 public final int videoWidth; |
| 152 public final int videoHeight; | 148 public final int videoHeight; |
| 153 public final int videoFps; | 149 public final int videoFps; |
| 154 public final int videoMaxBitrate; | 150 public final int videoMaxBitrate; |
| 155 public final String videoCodec; | 151 public final String videoCodec; |
| 156 public final boolean videoCodecHwAcceleration; | 152 public final boolean videoCodecHwAcceleration; |
| 153 public final boolean captureToTexture; |
| 157 public final int audioStartBitrate; | 154 public final int audioStartBitrate; |
| 158 public final String audioCodec; | 155 public final String audioCodec; |
| 159 public final boolean noAudioProcessing; | 156 public final boolean noAudioProcessing; |
| 160 public final boolean aecDump; | 157 public final boolean aecDump; |
| 161 public final boolean useOpenSLES; | 158 public final boolean useOpenSLES; |
| 162 public final boolean disableBuiltInAEC; | 159 public final boolean disableBuiltInAEC; |
| 163 public final boolean disableBuiltInAGC; | 160 public final boolean disableBuiltInAGC; |
| 164 public final boolean disableBuiltInNS; | 161 public final boolean disableBuiltInNS; |
| 165 public final boolean enableLevelControl; | 162 public final boolean enableLevelControl; |
| 166 | 163 |
| 167 public PeerConnectionParameters(boolean videoCallEnabled, boolean loopback,
boolean tracing, | 164 public PeerConnectionParameters(boolean videoCallEnabled, boolean loopback,
boolean tracing, |
| 168 int videoWidth, int videoHeight, int videoFps, int videoMaxBitrate, Stri
ng videoCodec, | 165 boolean useCamera2, int videoWidth, int videoHeight, int videoFps, int v
ideoMaxBitrate, |
| 169 boolean videoCodecHwAcceleration, int audioStartBitrate, String audioCod
ec, | 166 String videoCodec, boolean videoCodecHwAcceleration, boolean captureToTe
xture, |
| 170 boolean noAudioProcessing, boolean aecDump, boolean useOpenSLES, boolean
disableBuiltInAEC, | 167 int audioStartBitrate, String audioCodec, boolean noAudioProcessing, boo
lean aecDump, |
| 171 boolean disableBuiltInAGC, boolean disableBuiltInNS, boolean enableLevel
Control) { | 168 boolean useOpenSLES, boolean disableBuiltInAEC, boolean disableBuiltInAG
C, |
| 169 boolean disableBuiltInNS, boolean enableLevelControl) { |
| 172 this.videoCallEnabled = videoCallEnabled; | 170 this.videoCallEnabled = videoCallEnabled; |
| 171 this.useCamera2 = useCamera2; |
| 173 this.loopback = loopback; | 172 this.loopback = loopback; |
| 174 this.tracing = tracing; | 173 this.tracing = tracing; |
| 175 this.videoWidth = videoWidth; | 174 this.videoWidth = videoWidth; |
| 176 this.videoHeight = videoHeight; | 175 this.videoHeight = videoHeight; |
| 177 this.videoFps = videoFps; | 176 this.videoFps = videoFps; |
| 178 this.videoMaxBitrate = videoMaxBitrate; | 177 this.videoMaxBitrate = videoMaxBitrate; |
| 179 this.videoCodec = videoCodec; | 178 this.videoCodec = videoCodec; |
| 180 this.videoCodecHwAcceleration = videoCodecHwAcceleration; | 179 this.videoCodecHwAcceleration = videoCodecHwAcceleration; |
| 180 this.captureToTexture = captureToTexture; |
| 181 this.audioStartBitrate = audioStartBitrate; | 181 this.audioStartBitrate = audioStartBitrate; |
| 182 this.audioCodec = audioCodec; | 182 this.audioCodec = audioCodec; |
| 183 this.noAudioProcessing = noAudioProcessing; | 183 this.noAudioProcessing = noAudioProcessing; |
| 184 this.aecDump = aecDump; | 184 this.aecDump = aecDump; |
| 185 this.useOpenSLES = useOpenSLES; | 185 this.useOpenSLES = useOpenSLES; |
| 186 this.disableBuiltInAEC = disableBuiltInAEC; | 186 this.disableBuiltInAEC = disableBuiltInAEC; |
| 187 this.disableBuiltInAGC = disableBuiltInAGC; | 187 this.disableBuiltInAGC = disableBuiltInAGC; |
| 188 this.disableBuiltInNS = disableBuiltInNS; | 188 this.disableBuiltInNS = disableBuiltInNS; |
| 189 this.enableLevelControl = enableLevelControl; | 189 this.enableLevelControl = enableLevelControl; |
| 190 } | 190 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 executor.execute(new Runnable() { | 279 executor.execute(new Runnable() { |
| 280 @Override | 280 @Override |
| 281 public void run() { | 281 public void run() { |
| 282 createPeerConnectionFactoryInternal(context); | 282 createPeerConnectionFactoryInternal(context); |
| 283 } | 283 } |
| 284 }); | 284 }); |
| 285 } | 285 } |
| 286 | 286 |
| 287 public void createPeerConnection(final EglBase.Context renderEGLContext, | 287 public void createPeerConnection(final EglBase.Context renderEGLContext, |
| 288 final VideoRenderer.Callbacks localRender, final VideoRenderer.Callbacks r
emoteRender, | 288 final VideoRenderer.Callbacks localRender, final VideoRenderer.Callbacks r
emoteRender, |
| 289 final VideoCapturer videoCapturer, final SignalingParameters signalingPara
meters) { | 289 final SignalingParameters signalingParameters) { |
| 290 createPeerConnection(renderEGLContext, localRender, Collections.singletonLis
t(remoteRender), | |
| 291 videoCapturer, signalingParameters); | |
| 292 } | |
| 293 public void createPeerConnection(final EglBase.Context renderEGLContext, | |
| 294 final VideoRenderer.Callbacks localRender, final List<VideoRenderer.Callba
cks> remoteRenders, | |
| 295 final VideoCapturer videoCapturer, final SignalingParameters signalingPara
meters) { | |
| 296 if (peerConnectionParameters == null) { | 290 if (peerConnectionParameters == null) { |
| 297 Log.e(TAG, "Creating peer connection without initializing factory."); | 291 Log.e(TAG, "Creating peer connection without initializing factory."); |
| 298 return; | 292 return; |
| 299 } | 293 } |
| 300 this.localRender = localRender; | 294 this.localRender = localRender; |
| 301 this.remoteRenders = remoteRenders; | 295 this.remoteRender = remoteRender; |
| 302 this.videoCapturer = videoCapturer; | |
| 303 this.signalingParameters = signalingParameters; | 296 this.signalingParameters = signalingParameters; |
| 304 executor.execute(new Runnable() { | 297 executor.execute(new Runnable() { |
| 305 @Override | 298 @Override |
| 306 public void run() { | 299 public void run() { |
| 307 try { | 300 try { |
| 308 createMediaConstraintsInternal(); | 301 createMediaConstraintsInternal(); |
| 309 createPeerConnectionInternal(renderEGLContext); | 302 createPeerConnectionInternal(renderEGLContext); |
| 310 } catch (Exception e) { | 303 } catch (Exception e) { |
| 311 reportError("Failed to create peer connection: " + e.getMessage()); | 304 reportError("Failed to create peer connection: " + e.getMessage()); |
| 312 throw e; | 305 throw e; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true")); | 461 new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true")); |
| 469 if (videoCallEnabled || peerConnectionParameters.loopback) { | 462 if (videoCallEnabled || peerConnectionParameters.loopback) { |
| 470 sdpMediaConstraints.mandatory.add( | 463 sdpMediaConstraints.mandatory.add( |
| 471 new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "true")); | 464 new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "true")); |
| 472 } else { | 465 } else { |
| 473 sdpMediaConstraints.mandatory.add( | 466 sdpMediaConstraints.mandatory.add( |
| 474 new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "false")); | 467 new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "false")); |
| 475 } | 468 } |
| 476 } | 469 } |
| 477 | 470 |
| 471 private void createCapturer(CameraEnumerator enumerator) { |
| 472 final String[] deviceNames = enumerator.getDeviceNames(); |
| 473 |
| 474 // First, try to find front facing camera |
| 475 Logging.d(TAG, "Looking for front facing cameras."); |
| 476 for (String deviceName : deviceNames) { |
| 477 if (enumerator.isFrontFacing(deviceName)) { |
| 478 Logging.d(TAG, "Creating front facing camera capturer."); |
| 479 videoCapturer = enumerator.createCapturer(deviceName, null); |
| 480 |
| 481 if (videoCapturer != null) { |
| 482 return; |
| 483 } |
| 484 } |
| 485 } |
| 486 |
| 487 // Front facing camera not found, try something else |
| 488 Logging.d(TAG, "Looking for other cameras."); |
| 489 for (String deviceName : deviceNames) { |
| 490 if (!enumerator.isFrontFacing(deviceName)) { |
| 491 Logging.d(TAG, "Creating other camera capturer."); |
| 492 videoCapturer = enumerator.createCapturer(deviceName, null); |
| 493 |
| 494 if (videoCapturer != null) { |
| 495 return; |
| 496 } |
| 497 } |
| 498 } |
| 499 } |
| 500 |
| 478 private void createPeerConnectionInternal(EglBase.Context renderEGLContext) { | 501 private void createPeerConnectionInternal(EglBase.Context renderEGLContext) { |
| 479 if (factory == null || isError) { | 502 if (factory == null || isError) { |
| 480 Log.e(TAG, "Peerconnection factory is not created"); | 503 Log.e(TAG, "Peerconnection factory is not created"); |
| 481 return; | 504 return; |
| 482 } | 505 } |
| 483 Log.d(TAG, "Create peer connection."); | 506 Log.d(TAG, "Create peer connection."); |
| 484 | 507 |
| 485 Log.d(TAG, "PCConstraints: " + pcConstraints.toString()); | 508 Log.d(TAG, "PCConstraints: " + pcConstraints.toString()); |
| 486 queuedRemoteCandidates = new LinkedList<IceCandidate>(); | 509 queuedRemoteCandidates = new LinkedList<IceCandidate>(); |
| 487 | 510 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 504 peerConnection = factory.createPeerConnection(rtcConfig, pcConstraints, pcOb
server); | 527 peerConnection = factory.createPeerConnection(rtcConfig, pcConstraints, pcOb
server); |
| 505 isInitiator = false; | 528 isInitiator = false; |
| 506 | 529 |
| 507 // Set default WebRTC tracing and INFO libjingle logging. | 530 // Set default WebRTC tracing and INFO libjingle logging. |
| 508 // NOTE: this _must_ happen while |factory| is alive! | 531 // NOTE: this _must_ happen while |factory| is alive! |
| 509 Logging.enableTracing("logcat:", EnumSet.of(Logging.TraceLevel.TRACE_DEFAULT
)); | 532 Logging.enableTracing("logcat:", EnumSet.of(Logging.TraceLevel.TRACE_DEFAULT
)); |
| 510 Logging.enableLogToDebugOutput(Logging.Severity.LS_INFO); | 533 Logging.enableLogToDebugOutput(Logging.Severity.LS_INFO); |
| 511 | 534 |
| 512 mediaStream = factory.createLocalMediaStream("ARDAMS"); | 535 mediaStream = factory.createLocalMediaStream("ARDAMS"); |
| 513 if (videoCallEnabled) { | 536 if (videoCallEnabled) { |
| 537 if (peerConnectionParameters.useCamera2) { |
| 538 if (!peerConnectionParameters.captureToTexture) { |
| 539 reportError(context.getString(R.string.camera2_texture_only_error)); |
| 540 return; |
| 541 } |
| 542 |
| 543 Logging.d(TAG, "Creating capturer using camera2 API."); |
| 544 createCapturer(new Camera2Enumerator(context)); |
| 545 } else { |
| 546 Logging.d(TAG, "Creating capturer using camera1 API."); |
| 547 createCapturer(new Camera1Enumerator(peerConnectionParameters.captureToT
exture)); |
| 548 } |
| 549 |
| 550 if (videoCapturer == null) { |
| 551 reportError("Failed to open camera"); |
| 552 return; |
| 553 } |
| 514 mediaStream.addTrack(createVideoTrack(videoCapturer)); | 554 mediaStream.addTrack(createVideoTrack(videoCapturer)); |
| 515 } | 555 } |
| 516 | 556 |
| 517 mediaStream.addTrack(createAudioTrack()); | 557 mediaStream.addTrack(createAudioTrack()); |
| 518 peerConnection.addStream(mediaStream); | 558 peerConnection.addStream(mediaStream); |
| 519 if (videoCallEnabled) { | 559 if (videoCallEnabled) { |
| 520 findVideoSender(); | 560 findVideoSender(); |
| 521 } | 561 } |
| 522 | 562 |
| 523 if (peerConnectionParameters.aecDump) { | 563 if (peerConnectionParameters.aecDump) { |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 if (queuedRemoteCandidates != null) { | 996 if (queuedRemoteCandidates != null) { |
| 957 Log.d(TAG, "Add " + queuedRemoteCandidates.size() + " remote candidates"); | 997 Log.d(TAG, "Add " + queuedRemoteCandidates.size() + " remote candidates"); |
| 958 for (IceCandidate candidate : queuedRemoteCandidates) { | 998 for (IceCandidate candidate : queuedRemoteCandidates) { |
| 959 peerConnection.addIceCandidate(candidate); | 999 peerConnection.addIceCandidate(candidate); |
| 960 } | 1000 } |
| 961 queuedRemoteCandidates = null; | 1001 queuedRemoteCandidates = null; |
| 962 } | 1002 } |
| 963 } | 1003 } |
| 964 | 1004 |
| 965 private void switchCameraInternal() { | 1005 private void switchCameraInternal() { |
| 966 if (videoCapturer instanceof CameraVideoCapturer) { | 1006 if (!videoCallEnabled || numberOfCameras < 2 || isError || videoCapturer ==
null) { |
| 967 if (!videoCallEnabled || numberOfCameras < 2 || isError || videoCapturer =
= null) { | 1007 Log.e(TAG, "Failed to switch camera. Video: " + videoCallEnabled + ". Erro
r : " + isError |
| 968 Log.e(TAG, "Failed to switch camera. Video: " + videoCallEnabled + ". Er
ror : " + isError | 1008 + ". Number of cameras: " + numberOfCameras); |
| 969 + ". Number of cameras: " + numberOfCameras); | 1009 return; // No video is sent or only one camera is available or error happe
ned. |
| 970 return; // No video is sent or only one camera is available or error hap
pened. | |
| 971 } | |
| 972 Log.d(TAG, "Switch camera"); | |
| 973 CameraVideoCapturer cameraVideoCapturer = (CameraVideoCapturer) videoCaptu
rer; | |
| 974 cameraVideoCapturer.switchCamera(null); | |
| 975 } else { | |
| 976 Log.d(TAG, "Will not switch camera, video caputurer is not a camera"); | |
| 977 } | 1010 } |
| 1011 Log.d(TAG, "Switch camera"); |
| 1012 videoCapturer.switchCamera(null); |
| 978 } | 1013 } |
| 979 | 1014 |
| 980 public void switchCamera() { | 1015 public void switchCamera() { |
| 981 executor.execute(new Runnable() { | 1016 executor.execute(new Runnable() { |
| 982 @Override | 1017 @Override |
| 983 public void run() { | 1018 public void run() { |
| 984 switchCameraInternal(); | 1019 switchCameraInternal(); |
| 985 } | 1020 } |
| 986 }); | 1021 }); |
| 987 } | 1022 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 if (peerConnection == null || isError) { | 1102 if (peerConnection == null || isError) { |
| 1068 return; | 1103 return; |
| 1069 } | 1104 } |
| 1070 if (stream.audioTracks.size() > 1 || stream.videoTracks.size() > 1) { | 1105 if (stream.audioTracks.size() > 1 || stream.videoTracks.size() > 1) { |
| 1071 reportError("Weird-looking stream: " + stream); | 1106 reportError("Weird-looking stream: " + stream); |
| 1072 return; | 1107 return; |
| 1073 } | 1108 } |
| 1074 if (stream.videoTracks.size() == 1) { | 1109 if (stream.videoTracks.size() == 1) { |
| 1075 remoteVideoTrack = stream.videoTracks.get(0); | 1110 remoteVideoTrack = stream.videoTracks.get(0); |
| 1076 remoteVideoTrack.setEnabled(renderVideo); | 1111 remoteVideoTrack.setEnabled(renderVideo); |
| 1077 for (VideoRenderer.Callbacks remoteRender : remoteRenders) { | 1112 remoteVideoTrack.addRenderer(new VideoRenderer(remoteRender)); |
| 1078 remoteVideoTrack.addRenderer(new VideoRenderer(remoteRender)); | |
| 1079 } | |
| 1080 } | 1113 } |
| 1081 } | 1114 } |
| 1082 }); | 1115 }); |
| 1083 } | 1116 } |
| 1084 | 1117 |
| 1085 @Override | 1118 @Override |
| 1086 public void onRemoveStream(final MediaStream stream) { | 1119 public void onRemoveStream(final MediaStream stream) { |
| 1087 executor.execute(new Runnable() { | 1120 executor.execute(new Runnable() { |
| 1088 @Override | 1121 @Override |
| 1089 public void run() { | 1122 public void run() { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 public void onCreateFailure(final String error) { | 1210 public void onCreateFailure(final String error) { |
| 1178 reportError("createSDP error: " + error); | 1211 reportError("createSDP error: " + error); |
| 1179 } | 1212 } |
| 1180 | 1213 |
| 1181 @Override | 1214 @Override |
| 1182 public void onSetFailure(final String error) { | 1215 public void onSetFailure(final String error) { |
| 1183 reportError("setSDP error: " + error); | 1216 reportError("setSDP error: " + error); |
| 1184 } | 1217 } |
| 1185 } | 1218 } |
| 1186 } | 1219 } |
| OLD | NEW |