OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 import org.webrtc.EglBase; | 48 import org.webrtc.EglBase; |
49 import org.webrtc.FileVideoCapturer; | 49 import org.webrtc.FileVideoCapturer; |
50 import org.webrtc.IceCandidate; | 50 import org.webrtc.IceCandidate; |
51 import org.webrtc.Logging; | 51 import org.webrtc.Logging; |
52 import org.webrtc.PeerConnectionFactory; | 52 import org.webrtc.PeerConnectionFactory; |
53 import org.webrtc.RendererCommon.ScalingType; | 53 import org.webrtc.RendererCommon.ScalingType; |
54 import org.webrtc.ScreenCapturerAndroid; | 54 import org.webrtc.ScreenCapturerAndroid; |
55 import org.webrtc.SessionDescription; | 55 import org.webrtc.SessionDescription; |
56 import org.webrtc.StatsReport; | 56 import org.webrtc.StatsReport; |
57 import org.webrtc.SurfaceViewRenderer; | 57 import org.webrtc.SurfaceViewRenderer; |
58 import org.webrtc.TextureViewRenderer; | |
58 import org.webrtc.VideoCapturer; | 59 import org.webrtc.VideoCapturer; |
59 import org.webrtc.VideoFileRenderer; | 60 import org.webrtc.VideoFileRenderer; |
60 import org.webrtc.VideoRenderer; | 61 import org.webrtc.VideoRenderer; |
61 | 62 |
62 /** | 63 /** |
63 * Activity for peer connection call setup, call waiting | 64 * Activity for peer connection call setup, call waiting |
64 * and call view. | 65 * and call view. |
65 */ | 66 */ |
66 public class CallActivity extends Activity implements AppRTCClient.SignalingEven ts, | 67 public class CallActivity extends Activity implements AppRTCClient.SignalingEven ts, |
67 PeerConnectionClient.PeerC onnectionEvents, | 68 PeerConnectionClient.PeerC onnectionEvents, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 } | 155 } |
155 | 156 |
156 private final ProxyRenderer remoteProxyRenderer = new ProxyRenderer(); | 157 private final ProxyRenderer remoteProxyRenderer = new ProxyRenderer(); |
157 private final ProxyRenderer localProxyRenderer = new ProxyRenderer(); | 158 private final ProxyRenderer localProxyRenderer = new ProxyRenderer(); |
158 private PeerConnectionClient peerConnectionClient = null; | 159 private PeerConnectionClient peerConnectionClient = null; |
159 private AppRTCClient appRtcClient; | 160 private AppRTCClient appRtcClient; |
160 private SignalingParameters signalingParameters; | 161 private SignalingParameters signalingParameters; |
161 private AppRTCAudioManager audioManager = null; | 162 private AppRTCAudioManager audioManager = null; |
162 private EglBase rootEglBase; | 163 private EglBase rootEglBase; |
163 private SurfaceViewRenderer pipRenderer; | 164 private SurfaceViewRenderer pipRenderer; |
164 private SurfaceViewRenderer fullscreenRenderer; | 165 private TextureViewRenderer fullscreenRenderer; |
sakal
2017/06/16 07:47:02
Please do not change this or make it a setting.
| |
165 private VideoFileRenderer videoFileRenderer; | 166 private VideoFileRenderer videoFileRenderer; |
166 private final List<VideoRenderer.Callbacks> remoteRenderers = | 167 private final List<VideoRenderer.Callbacks> remoteRenderers = |
167 new ArrayList<VideoRenderer.Callbacks>(); | 168 new ArrayList<VideoRenderer.Callbacks>(); |
168 private Toast logToast; | 169 private Toast logToast; |
169 private boolean commandLineRun; | 170 private boolean commandLineRun; |
170 private int runTimeMs; | 171 private int runTimeMs; |
171 private boolean activityRunning; | 172 private boolean activityRunning; |
172 private RoomConnectionParameters roomConnectionParameters; | 173 private RoomConnectionParameters roomConnectionParameters; |
173 private PeerConnectionParameters peerConnectionParameters; | 174 private PeerConnectionParameters peerConnectionParameters; |
174 private boolean iceConnected; | 175 private boolean iceConnected; |
(...skipping 24 matching lines...) Expand all Loading... | |
199 | LayoutParams.FLAG_DISMISS_KEYGUARD | LayoutParams.FLAG_SHOW_WHEN_LOCKE D | 200 | LayoutParams.FLAG_DISMISS_KEYGUARD | LayoutParams.FLAG_SHOW_WHEN_LOCKE D |
200 | LayoutParams.FLAG_TURN_SCREEN_ON); | 201 | LayoutParams.FLAG_TURN_SCREEN_ON); |
201 getWindow().getDecorView().setSystemUiVisibility(getSystemUiVisibility()); | 202 getWindow().getDecorView().setSystemUiVisibility(getSystemUiVisibility()); |
202 setContentView(R.layout.activity_call); | 203 setContentView(R.layout.activity_call); |
203 | 204 |
204 iceConnected = false; | 205 iceConnected = false; |
205 signalingParameters = null; | 206 signalingParameters = null; |
206 | 207 |
207 // Create UI controls. | 208 // Create UI controls. |
208 pipRenderer = (SurfaceViewRenderer) findViewById(R.id.pip_video_view); | 209 pipRenderer = (SurfaceViewRenderer) findViewById(R.id.pip_video_view); |
209 fullscreenRenderer = (SurfaceViewRenderer) findViewById(R.id.fullscreen_vide o_view); | 210 fullscreenRenderer = (TextureViewRenderer) findViewById(R.id.fullscreen_vide o_view); |
210 callFragment = new CallFragment(); | 211 callFragment = new CallFragment(); |
211 hudFragment = new HudFragment(); | 212 hudFragment = new HudFragment(); |
212 | 213 |
213 // Show/hide call control fragment on view click. | 214 // Show/hide call control fragment on view click. |
214 View.OnClickListener listener = new View.OnClickListener() { | 215 View.OnClickListener listener = new View.OnClickListener() { |
215 @Override | 216 @Override |
216 public void onClick(View view) { | 217 public void onClick(View view) { |
217 toggleCallControlFragmentVisibility(); | 218 toggleCallControlFragmentVisibility(); |
218 } | 219 } |
219 }; | 220 }; |
(...skipping 26 matching lines...) Expand all Loading... | |
246 saveRemoteVideoToFile, videoOutWidth, videoOutHeight, rootEglBase.ge tEglBaseContext()); | 247 saveRemoteVideoToFile, videoOutWidth, videoOutHeight, rootEglBase.ge tEglBaseContext()); |
247 remoteRenderers.add(videoFileRenderer); | 248 remoteRenderers.add(videoFileRenderer); |
248 } catch (IOException e) { | 249 } catch (IOException e) { |
249 throw new RuntimeException( | 250 throw new RuntimeException( |
250 "Failed to open video file for output: " + saveRemoteVideoToFile, e) ; | 251 "Failed to open video file for output: " + saveRemoteVideoToFile, e) ; |
251 } | 252 } |
252 } | 253 } |
253 fullscreenRenderer.init(rootEglBase.getEglBaseContext(), null); | 254 fullscreenRenderer.init(rootEglBase.getEglBaseContext(), null); |
254 fullscreenRenderer.setScalingType(ScalingType.SCALE_ASPECT_FILL); | 255 fullscreenRenderer.setScalingType(ScalingType.SCALE_ASPECT_FILL); |
255 | 256 |
256 pipRenderer.setZOrderMediaOverlay(true); | 257 //pipRenderer.setZOrderMediaOverlay(true); |
257 pipRenderer.setEnableHardwareScaler(true /* enabled */); | 258 pipRenderer.setEnableHardwareScaler(true /* enabled */); |
258 fullscreenRenderer.setEnableHardwareScaler(true /* enabled */); | 259 fullscreenRenderer.setEnableHardwareScaler(true /* enabled */); |
259 // Start with local feed in fullscreen and swap it to the pip when the call is connected. | 260 // Start with local feed in fullscreen and swap it to the pip when the call is connected. |
260 setSwappedFeeds(true /* isSwappedFeeds */); | 261 setSwappedFeeds(true /* isSwappedFeeds */); |
261 | 262 |
262 // Check for mandatory permissions. | 263 // Check for mandatory permissions. |
263 for (String permission : MANDATORY_PERMISSIONS) { | 264 for (String permission : MANDATORY_PERMISSIONS) { |
264 if (checkCallingOrSelfPermission(permission) != PackageManager.PERMISSION_ GRANTED) { | 265 if (checkCallingOrSelfPermission(permission) != PackageManager.PERMISSION_ GRANTED) { |
265 logAndToast("Permission " + permission + " is not granted"); | 266 logAndToast("Permission " + permission + " is not granted"); |
266 setResult(RESULT_CANCELED); | 267 setResult(RESULT_CANCELED); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
930 } | 931 } |
931 } | 932 } |
932 }); | 933 }); |
933 } | 934 } |
934 | 935 |
935 @Override | 936 @Override |
936 public void onPeerConnectionError(final String description) { | 937 public void onPeerConnectionError(final String description) { |
937 reportError(description); | 938 reportError(description); |
938 } | 939 } |
939 } | 940 } |
OLD | NEW |