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

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

Issue 1820113003: Add Mic Toggle button to AppRTCDemo (Android). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 private Toast logToast; 125 private Toast logToast;
126 private boolean commandLineRun; 126 private boolean commandLineRun;
127 private int runTimeMs; 127 private int runTimeMs;
128 private boolean activityRunning; 128 private boolean activityRunning;
129 private RoomConnectionParameters roomConnectionParameters; 129 private RoomConnectionParameters roomConnectionParameters;
130 private PeerConnectionParameters peerConnectionParameters; 130 private PeerConnectionParameters peerConnectionParameters;
131 private boolean iceConnected; 131 private boolean iceConnected;
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 136
136 // Controls 137 // Controls
137 private CallFragment callFragment; 138 private CallFragment callFragment;
138 private HudFragment hudFragment; 139 private HudFragment hudFragment;
139 private CpuMonitor cpuMonitor; 140 private CpuMonitor cpuMonitor;
140 141
141 142
142 @Override 143 @Override
143 public void onCreate(Bundle savedInstanceState) { 144 public void onCreate(Bundle savedInstanceState) {
144 super.onCreate(savedInstanceState); 145 super.onCreate(savedInstanceState);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 updateVideoView(); 331 updateVideoView();
331 } 332 }
332 333
333 @Override 334 @Override
334 public void onCaptureFormatChange(int width, int height, int framerate) { 335 public void onCaptureFormatChange(int width, int height, int framerate) {
335 if (peerConnectionClient != null) { 336 if (peerConnectionClient != null) {
336 peerConnectionClient.changeCaptureFormat(width, height, framerate); 337 peerConnectionClient.changeCaptureFormat(width, height, framerate);
337 } 338 }
338 } 339 }
339 340
341 @Override
342 public boolean onToggleMic() {
343 if (peerConnectionClient != null) {
344 micEnabled = !micEnabled;
345 peerConnectionClient.setAudioEnabled(micEnabled);
346 }
347 return micEnabled;
348 }
349
340 // Helper functions. 350 // Helper functions.
341 private void toggleCallControlFragmentVisibility() { 351 private void toggleCallControlFragmentVisibility() {
342 if (!iceConnected || !callFragment.isAdded()) { 352 if (!iceConnected || !callFragment.isAdded()) {
343 return; 353 return;
344 } 354 }
345 // Show/hide call control fragment 355 // Show/hide call control fragment
346 callControlFragmentVisible = !callControlFragmentVisible; 356 callControlFragmentVisible = !callControlFragmentVisible;
347 FragmentTransaction ft = getFragmentManager().beginTransaction(); 357 FragmentTransaction ft = getFragmentManager().beginTransaction();
348 if (callControlFragmentVisible) { 358 if (callControlFragmentVisible) {
349 ft.show(callFragment); 359 ft.show(callFragment);
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 } 700 }
691 } 701 }
692 }); 702 });
693 } 703 }
694 704
695 @Override 705 @Override
696 public void onPeerConnectionError(final String description) { 706 public void onPeerConnectionError(final String description) {
697 reportError(description); 707 reportError(description);
698 } 708 }
699 } 709 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698