Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java

Issue 1963053002: Direct IP connect functionality for AppRTC Android demo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 private boolean isError; 132 private boolean isError;
133 private boolean callControlFragmentVisible = true; 133 private boolean callControlFragmentVisible = true;
134 private long callStartedTimeMs = 0; 134 private long callStartedTimeMs = 0;
135 private boolean micEnabled = true; 135 private boolean micEnabled = true;
136 136
137 // Controls 137 // Controls
138 private CallFragment callFragment; 138 private CallFragment callFragment;
139 private HudFragment hudFragment; 139 private HudFragment hudFragment;
140 private CpuMonitor cpuMonitor; 140 private CpuMonitor cpuMonitor;
141 141
142
143 @Override 142 @Override
144 public void onCreate(Bundle savedInstanceState) { 143 public void onCreate(Bundle savedInstanceState) {
145 super.onCreate(savedInstanceState); 144 super.onCreate(savedInstanceState);
146 Thread.setDefaultUncaughtExceptionHandler( 145 Thread.setDefaultUncaughtExceptionHandler(
147 new UnhandledExceptionHandler(this)); 146 new UnhandledExceptionHandler(this));
148 147
149 // Set window styles for fullscreen-window size. Needs to be done before 148 // Set window styles for fullscreen-window size. Needs to be done before
150 // adding content. 149 // adding content.
151 requestWindowFeature(Window.FEATURE_NO_TITLE); 150 requestWindowFeature(Window.FEATURE_NO_TITLE);
152 getWindow().addFlags( 151 getWindow().addFlags(
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 intent.getBooleanExtra(EXTRA_HWCODEC_ENABLED, true), 232 intent.getBooleanExtra(EXTRA_HWCODEC_ENABLED, true),
234 intent.getBooleanExtra(EXTRA_CAPTURETOTEXTURE_ENABLED, false), 233 intent.getBooleanExtra(EXTRA_CAPTURETOTEXTURE_ENABLED, false),
235 intent.getIntExtra(EXTRA_AUDIO_BITRATE, 0), 234 intent.getIntExtra(EXTRA_AUDIO_BITRATE, 0),
236 intent.getStringExtra(EXTRA_AUDIOCODEC), 235 intent.getStringExtra(EXTRA_AUDIOCODEC),
237 intent.getBooleanExtra(EXTRA_NOAUDIOPROCESSING_ENABLED, false), 236 intent.getBooleanExtra(EXTRA_NOAUDIOPROCESSING_ENABLED, false),
238 intent.getBooleanExtra(EXTRA_AECDUMP_ENABLED, false), 237 intent.getBooleanExtra(EXTRA_AECDUMP_ENABLED, false),
239 intent.getBooleanExtra(EXTRA_OPENSLES_ENABLED, false)); 238 intent.getBooleanExtra(EXTRA_OPENSLES_ENABLED, false));
240 commandLineRun = intent.getBooleanExtra(EXTRA_CMDLINE, false); 239 commandLineRun = intent.getBooleanExtra(EXTRA_CMDLINE, false);
241 runTimeMs = intent.getIntExtra(EXTRA_RUNTIME, 0); 240 runTimeMs = intent.getIntExtra(EXTRA_RUNTIME, 0);
242 241
243 // Create connection client and connection parameters. 242 // Create connection client. Use DirectRTCClient if room name is an IP other wise use the
244 appRtcClient = new WebSocketRTCClient(this, new LooperExecutor()); 243 // standard WebSocketRTCClient.
244 if(loopback || !DirectRTCClient.IP_PATTERN.matcher(roomId).matches()) {
magjed_webrtc 2016/05/10 14:50:02 nit: space between 'if' and '('.
sakal 2016/05/11 08:38:49 Done.
245 appRtcClient = new WebSocketRTCClient(this, new LooperExecutor());
246 } else {
247 Log.i(TAG, "Using DirectRTCClient because room name looks like an IP.");
248 appRtcClient = new DirectRTCClient(this);
249 }
250 // Create connection parameters.
245 roomConnectionParameters = new RoomConnectionParameters( 251 roomConnectionParameters = new RoomConnectionParameters(
246 roomUri.toString(), roomId, loopback); 252 roomUri.toString(), roomId, loopback);
247 253
248 // Create CPU monitor 254 // Create CPU monitor
249 cpuMonitor = new CpuMonitor(this); 255 cpuMonitor = new CpuMonitor(this);
250 hudFragment.setCpuMonitor(cpuMonitor); 256 hudFragment.setCpuMonitor(cpuMonitor);
251 257
252 // Send intent arguments to fragments. 258 // Send intent arguments to fragments.
253 callFragment.setArguments(intent.getExtras()); 259 callFragment.setArguments(intent.getExtras());
254 hudFragment.setArguments(intent.getExtras()); 260 hudFragment.setArguments(intent.getExtras());
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 706 }
701 } 707 }
702 }); 708 });
703 } 709 }
704 710
705 @Override 711 @Override
706 public void onPeerConnectionError(final String description) { 712 public void onPeerConnectionError(final String description) {
707 reportError(description); 713 reportError(description);
708 } 714 }
709 } 715 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698