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.app.Activity; | 13 import android.app.Activity; |
14 import android.content.SharedPreferences; | 14 import android.content.SharedPreferences; |
15 import android.content.SharedPreferences.OnSharedPreferenceChangeListener; | 15 import android.content.SharedPreferences.OnSharedPreferenceChangeListener; |
16 import android.os.Bundle; | 16 import android.os.Bundle; |
17 import android.preference.ListPreference; | 17 import android.preference.ListPreference; |
18 import android.preference.Preference; | 18 import android.preference.Preference; |
19 | |
20 import org.webrtc.Camera2Enumerator; | 19 import org.webrtc.Camera2Enumerator; |
21 import org.webrtc.voiceengine.WebRtcAudioUtils; | 20 import org.webrtc.voiceengine.WebRtcAudioUtils; |
22 | 21 |
23 /** | 22 /** |
24 * Settings activity for AppRTC. | 23 * Settings activity for AppRTC. |
25 */ | 24 */ |
26 public class SettingsActivity extends Activity implements OnSharedPreferenceChan
geListener { | 25 public class SettingsActivity extends Activity implements OnSharedPreferenceChan
geListener { |
27 private SettingsFragment settingsFragment; | 26 private SettingsFragment settingsFragment; |
28 private String keyprefVideoCall; | 27 private String keyprefVideoCall; |
| 28 private String keyprefScreencapture; |
29 private String keyprefCamera2; | 29 private String keyprefCamera2; |
30 private String keyprefResolution; | 30 private String keyprefResolution; |
31 private String keyprefFps; | 31 private String keyprefFps; |
32 private String keyprefCaptureQualitySlider; | 32 private String keyprefCaptureQualitySlider; |
33 private String keyprefMaxVideoBitrateType; | 33 private String keyprefMaxVideoBitrateType; |
34 private String keyprefMaxVideoBitrateValue; | 34 private String keyprefMaxVideoBitrateValue; |
35 private String keyPrefVideoCodec; | 35 private String keyPrefVideoCodec; |
36 private String keyprefHwCodec; | 36 private String keyprefHwCodec; |
37 private String keyprefCaptureToTexture; | 37 private String keyprefCaptureToTexture; |
38 | 38 |
(...skipping 10 matching lines...) Expand all Loading... |
49 private String keyprefSpeakerphone; | 49 private String keyprefSpeakerphone; |
50 | 50 |
51 private String keyPrefRoomServerUrl; | 51 private String keyPrefRoomServerUrl; |
52 private String keyPrefDisplayHud; | 52 private String keyPrefDisplayHud; |
53 private String keyPrefTracing; | 53 private String keyPrefTracing; |
54 | 54 |
55 @Override | 55 @Override |
56 protected void onCreate(Bundle savedInstanceState) { | 56 protected void onCreate(Bundle savedInstanceState) { |
57 super.onCreate(savedInstanceState); | 57 super.onCreate(savedInstanceState); |
58 keyprefVideoCall = getString(R.string.pref_videocall_key); | 58 keyprefVideoCall = getString(R.string.pref_videocall_key); |
| 59 keyprefScreencapture = getString(R.string.pref_screencapture_key); |
59 keyprefCamera2 = getString(R.string.pref_camera2_key); | 60 keyprefCamera2 = getString(R.string.pref_camera2_key); |
60 keyprefResolution = getString(R.string.pref_resolution_key); | 61 keyprefResolution = getString(R.string.pref_resolution_key); |
61 keyprefFps = getString(R.string.pref_fps_key); | 62 keyprefFps = getString(R.string.pref_fps_key); |
62 keyprefCaptureQualitySlider = getString(R.string.pref_capturequalityslider_k
ey); | 63 keyprefCaptureQualitySlider = getString(R.string.pref_capturequalityslider_k
ey); |
63 keyprefMaxVideoBitrateType = getString(R.string.pref_maxvideobitrate_key); | 64 keyprefMaxVideoBitrateType = getString(R.string.pref_maxvideobitrate_key); |
64 keyprefMaxVideoBitrateValue = getString(R.string.pref_maxvideobitratevalue_k
ey); | 65 keyprefMaxVideoBitrateValue = getString(R.string.pref_maxvideobitratevalue_k
ey); |
65 keyPrefVideoCodec = getString(R.string.pref_videocodec_key); | 66 keyPrefVideoCodec = getString(R.string.pref_videocodec_key); |
66 keyprefHwCodec = getString(R.string.pref_hwcodec_key); | 67 keyprefHwCodec = getString(R.string.pref_hwcodec_key); |
67 keyprefCaptureToTexture = getString(R.string.pref_capturetotexture_key); | 68 keyprefCaptureToTexture = getString(R.string.pref_capturetotexture_key); |
68 | 69 |
(...skipping 22 matching lines...) Expand all Loading... |
91 } | 92 } |
92 | 93 |
93 @Override | 94 @Override |
94 protected void onResume() { | 95 protected void onResume() { |
95 super.onResume(); | 96 super.onResume(); |
96 // Set summary to be the user-description for the selected value | 97 // Set summary to be the user-description for the selected value |
97 SharedPreferences sharedPreferences = | 98 SharedPreferences sharedPreferences = |
98 settingsFragment.getPreferenceScreen().getSharedPreferences(); | 99 settingsFragment.getPreferenceScreen().getSharedPreferences(); |
99 sharedPreferences.registerOnSharedPreferenceChangeListener(this); | 100 sharedPreferences.registerOnSharedPreferenceChangeListener(this); |
100 updateSummaryB(sharedPreferences, keyprefVideoCall); | 101 updateSummaryB(sharedPreferences, keyprefVideoCall); |
| 102 updateSummaryB(sharedPreferences, keyprefScreencapture); |
101 updateSummaryB(sharedPreferences, keyprefCamera2); | 103 updateSummaryB(sharedPreferences, keyprefCamera2); |
102 updateSummary(sharedPreferences, keyprefResolution); | 104 updateSummary(sharedPreferences, keyprefResolution); |
103 updateSummary(sharedPreferences, keyprefFps); | 105 updateSummary(sharedPreferences, keyprefFps); |
104 updateSummaryB(sharedPreferences, keyprefCaptureQualitySlider); | 106 updateSummaryB(sharedPreferences, keyprefCaptureQualitySlider); |
105 updateSummary(sharedPreferences, keyprefMaxVideoBitrateType); | 107 updateSummary(sharedPreferences, keyprefMaxVideoBitrateType); |
106 updateSummaryBitrate(sharedPreferences, keyprefMaxVideoBitrateValue); | 108 updateSummaryBitrate(sharedPreferences, keyprefMaxVideoBitrateValue); |
107 setVideoBitrateEnable(sharedPreferences); | 109 setVideoBitrateEnable(sharedPreferences); |
108 updateSummary(sharedPreferences, keyPrefVideoCodec); | 110 updateSummary(sharedPreferences, keyPrefVideoCodec); |
109 updateSummaryB(sharedPreferences, keyprefHwCodec); | 111 updateSummaryB(sharedPreferences, keyprefHwCodec); |
110 updateSummaryB(sharedPreferences, keyprefCaptureToTexture); | 112 updateSummaryB(sharedPreferences, keyprefCaptureToTexture); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 || key.equals(keyprefMaxVideoBitrateType) | 181 || key.equals(keyprefMaxVideoBitrateType) |
180 || key.equals(keyPrefVideoCodec) | 182 || key.equals(keyPrefVideoCodec) |
181 || key.equals(keyprefStartAudioBitrateType) | 183 || key.equals(keyprefStartAudioBitrateType) |
182 || key.equals(keyPrefAudioCodec) | 184 || key.equals(keyPrefAudioCodec) |
183 || key.equals(keyPrefRoomServerUrl)) { | 185 || key.equals(keyPrefRoomServerUrl)) { |
184 updateSummary(sharedPreferences, key); | 186 updateSummary(sharedPreferences, key); |
185 } else if (key.equals(keyprefMaxVideoBitrateValue) | 187 } else if (key.equals(keyprefMaxVideoBitrateValue) |
186 || key.equals(keyprefStartAudioBitrateValue)) { | 188 || key.equals(keyprefStartAudioBitrateValue)) { |
187 updateSummaryBitrate(sharedPreferences, key); | 189 updateSummaryBitrate(sharedPreferences, key); |
188 } else if (key.equals(keyprefVideoCall) | 190 } else if (key.equals(keyprefVideoCall) |
| 191 || key.equals(keyprefScreencapture) |
189 || key.equals(keyprefCamera2) | 192 || key.equals(keyprefCamera2) |
190 || key.equals(keyPrefTracing) | 193 || key.equals(keyPrefTracing) |
191 || key.equals(keyprefCaptureQualitySlider) | 194 || key.equals(keyprefCaptureQualitySlider) |
192 || key.equals(keyprefHwCodec) | 195 || key.equals(keyprefHwCodec) |
193 || key.equals(keyprefCaptureToTexture) | 196 || key.equals(keyprefCaptureToTexture) |
194 || key.equals(keyprefNoAudioProcessing) | 197 || key.equals(keyprefNoAudioProcessing) |
195 || key.equals(keyprefAecDump) | 198 || key.equals(keyprefAecDump) |
196 || key.equals(keyprefOpenSLES) | 199 || key.equals(keyprefOpenSLES) |
197 || key.equals(keyprefDisableBuiltInAEC) | 200 || key.equals(keyprefDisableBuiltInAEC) |
198 || key.equals(keyprefDisableBuiltInAGC) | 201 || key.equals(keyprefDisableBuiltInAGC) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 String bitrateTypeDefault = getString(R.string.pref_startaudiobitrate_defaul
t); | 257 String bitrateTypeDefault = getString(R.string.pref_startaudiobitrate_defaul
t); |
255 String bitrateType = | 258 String bitrateType = |
256 sharedPreferences.getString(keyprefStartAudioBitrateType, bitrateTypeDef
ault); | 259 sharedPreferences.getString(keyprefStartAudioBitrateType, bitrateTypeDef
ault); |
257 if (bitrateType.equals(bitrateTypeDefault)) { | 260 if (bitrateType.equals(bitrateTypeDefault)) { |
258 bitratePreferenceValue.setEnabled(false); | 261 bitratePreferenceValue.setEnabled(false); |
259 } else { | 262 } else { |
260 bitratePreferenceValue.setEnabled(true); | 263 bitratePreferenceValue.setEnabled(true); |
261 } | 264 } |
262 } | 265 } |
263 } | 266 } |
OLD | NEW |