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 |
11 package org.appspot.apprtc; | 11 package org.appspot.apprtc; |
12 | 12 |
13 import android.content.Context; | 13 import android.content.Context; |
14 import android.util.Log; | 14 import android.util.Log; |
15 | 15 |
16 import org.appspot.apprtc.AppRTCClient.SignalingParameters; | 16 import org.appspot.apprtc.AppRTCClient.SignalingParameters; |
17 import org.appspot.apprtc.util.LooperExecutor; | 17 import org.appspot.apprtc.util.LooperExecutor; |
18 import org.webrtc.CameraEnumerationAndroid; | 18 import org.webrtc.CameraEnumerationAndroid; |
19 import org.webrtc.DataChannel; | 19 import org.webrtc.DataChannel; |
| 20 import org.webrtc.EglBase; |
20 import org.webrtc.IceCandidate; | 21 import org.webrtc.IceCandidate; |
21 import org.webrtc.Logging; | 22 import org.webrtc.Logging; |
22 import org.webrtc.MediaCodecVideoEncoder; | 23 import org.webrtc.MediaCodecVideoEncoder; |
23 import org.webrtc.MediaConstraints; | 24 import org.webrtc.MediaConstraints; |
24 import org.webrtc.MediaConstraints.KeyValuePair; | 25 import org.webrtc.MediaConstraints.KeyValuePair; |
25 import org.webrtc.MediaStream; | 26 import org.webrtc.MediaStream; |
26 import org.webrtc.PeerConnection; | 27 import org.webrtc.PeerConnection; |
27 import org.webrtc.PeerConnection.IceConnectionState; | 28 import org.webrtc.PeerConnection.IceConnectionState; |
28 import org.webrtc.PeerConnectionFactory; | 29 import org.webrtc.PeerConnectionFactory; |
29 import org.webrtc.SdpObserver; | 30 import org.webrtc.SdpObserver; |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 mediaStream = factory.createLocalMediaStream("ARDAMS"); | 459 mediaStream = factory.createLocalMediaStream("ARDAMS"); |
459 if (videoCallEnabled) { | 460 if (videoCallEnabled) { |
460 String cameraDeviceName = CameraEnumerationAndroid.getDeviceName(0); | 461 String cameraDeviceName = CameraEnumerationAndroid.getDeviceName(0); |
461 String frontCameraDeviceName = | 462 String frontCameraDeviceName = |
462 CameraEnumerationAndroid.getNameOfFrontFacingDevice(); | 463 CameraEnumerationAndroid.getNameOfFrontFacingDevice(); |
463 if (numberOfCameras > 1 && frontCameraDeviceName != null) { | 464 if (numberOfCameras > 1 && frontCameraDeviceName != null) { |
464 cameraDeviceName = frontCameraDeviceName; | 465 cameraDeviceName = frontCameraDeviceName; |
465 } | 466 } |
466 Log.d(TAG, "Opening camera: " + cameraDeviceName); | 467 Log.d(TAG, "Opening camera: " + cameraDeviceName); |
467 videoCapturer = VideoCapturerAndroid.create(cameraDeviceName, null, | 468 videoCapturer = VideoCapturerAndroid.create(cameraDeviceName, null, |
468 peerConnectionParameters.captureToTexture ? renderEGLContext : null
); | 469 peerConnectionParameters.captureToTexture ? new EglBase.Context(render
EGLContext) : null); |
469 if (videoCapturer == null) { | 470 if (videoCapturer == null) { |
470 reportError("Failed to open camera"); | 471 reportError("Failed to open camera"); |
471 return; | 472 return; |
472 } | 473 } |
473 mediaStream.addTrack(createVideoTrack(videoCapturer)); | 474 mediaStream.addTrack(createVideoTrack(videoCapturer)); |
474 } | 475 } |
475 | 476 |
476 mediaStream.addTrack(factory.createAudioTrack( | 477 mediaStream.addTrack(factory.createAudioTrack( |
477 AUDIO_TRACK_ID, | 478 AUDIO_TRACK_ID, |
478 factory.createAudioSource(audioConstraints))); | 479 factory.createAudioSource(audioConstraints))); |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 public void onCreateFailure(final String error) { | 1046 public void onCreateFailure(final String error) { |
1046 reportError("createSDP error: " + error); | 1047 reportError("createSDP error: " + error); |
1047 } | 1048 } |
1048 | 1049 |
1049 @Override | 1050 @Override |
1050 public void onSetFailure(final String error) { | 1051 public void onSetFailure(final String error) { |
1051 reportError("setSDP error: " + error); | 1052 reportError("setSDP error: " + error); |
1052 } | 1053 } |
1053 } | 1054 } |
1054 } | 1055 } |
OLD | NEW |