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 |
(...skipping 22 matching lines...) Expand all Loading... |
33 private String keyprefCaptureToTexture; | 33 private String keyprefCaptureToTexture; |
34 | 34 |
35 private String keyprefStartAudioBitrateType; | 35 private String keyprefStartAudioBitrateType; |
36 private String keyprefStartAudioBitrateValue; | 36 private String keyprefStartAudioBitrateValue; |
37 private String keyPrefAudioCodec; | 37 private String keyPrefAudioCodec; |
38 private String keyprefNoAudioProcessing; | 38 private String keyprefNoAudioProcessing; |
39 private String keyprefOpenSLES; | 39 private String keyprefOpenSLES; |
40 | 40 |
41 private String keyPrefRoomServerUrl; | 41 private String keyPrefRoomServerUrl; |
42 private String keyPrefDisplayHud; | 42 private String keyPrefDisplayHud; |
| 43 private String keyPrefTracing; |
43 | 44 |
44 @Override | 45 @Override |
45 protected void onCreate(Bundle savedInstanceState) { | 46 protected void onCreate(Bundle savedInstanceState) { |
46 super.onCreate(savedInstanceState); | 47 super.onCreate(savedInstanceState); |
47 keyprefVideoCall = getString(R.string.pref_videocall_key); | 48 keyprefVideoCall = getString(R.string.pref_videocall_key); |
48 keyprefResolution = getString(R.string.pref_resolution_key); | 49 keyprefResolution = getString(R.string.pref_resolution_key); |
49 keyprefFps = getString(R.string.pref_fps_key); | 50 keyprefFps = getString(R.string.pref_fps_key); |
50 keyprefCaptureQualitySlider = getString(R.string.pref_capturequalityslider_k
ey); | 51 keyprefCaptureQualitySlider = getString(R.string.pref_capturequalityslider_k
ey); |
51 keyprefStartVideoBitrateType = getString(R.string.pref_startvideobitrate_key
); | 52 keyprefStartVideoBitrateType = getString(R.string.pref_startvideobitrate_key
); |
52 keyprefStartVideoBitrateValue = getString(R.string.pref_startvideobitrateval
ue_key); | 53 keyprefStartVideoBitrateValue = getString(R.string.pref_startvideobitrateval
ue_key); |
53 keyPrefVideoCodec = getString(R.string.pref_videocodec_key); | 54 keyPrefVideoCodec = getString(R.string.pref_videocodec_key); |
54 keyprefHwCodec = getString(R.string.pref_hwcodec_key); | 55 keyprefHwCodec = getString(R.string.pref_hwcodec_key); |
55 keyprefCaptureToTexture = getString(R.string.pref_capturetotexture_key); | 56 keyprefCaptureToTexture = getString(R.string.pref_capturetotexture_key); |
56 | 57 |
57 keyprefStartAudioBitrateType = getString(R.string.pref_startaudiobitrate_key
); | 58 keyprefStartAudioBitrateType = getString(R.string.pref_startaudiobitrate_key
); |
58 keyprefStartAudioBitrateValue = getString(R.string.pref_startaudiobitrateval
ue_key); | 59 keyprefStartAudioBitrateValue = getString(R.string.pref_startaudiobitrateval
ue_key); |
59 keyPrefAudioCodec = getString(R.string.pref_audiocodec_key); | 60 keyPrefAudioCodec = getString(R.string.pref_audiocodec_key); |
60 keyprefNoAudioProcessing = getString(R.string.pref_noaudioprocessing_key); | 61 keyprefNoAudioProcessing = getString(R.string.pref_noaudioprocessing_key); |
61 keyprefOpenSLES = getString(R.string.pref_opensles_key); | 62 keyprefOpenSLES = getString(R.string.pref_opensles_key); |
62 | 63 |
63 keyPrefRoomServerUrl = getString(R.string.pref_room_server_url_key); | 64 keyPrefRoomServerUrl = getString(R.string.pref_room_server_url_key); |
64 keyPrefDisplayHud = getString(R.string.pref_displayhud_key); | 65 keyPrefDisplayHud = getString(R.string.pref_displayhud_key); |
| 66 keyPrefTracing = getString(R.string.pref_tracing_key); |
65 | 67 |
66 // Display the fragment as the main content. | 68 // Display the fragment as the main content. |
67 settingsFragment = new SettingsFragment(); | 69 settingsFragment = new SettingsFragment(); |
68 getFragmentManager().beginTransaction() | 70 getFragmentManager().beginTransaction() |
69 .replace(android.R.id.content, settingsFragment) | 71 .replace(android.R.id.content, settingsFragment) |
70 .commit(); | 72 .commit(); |
71 } | 73 } |
72 | 74 |
73 @Override | 75 @Override |
74 protected void onResume() { | 76 protected void onResume() { |
(...skipping 15 matching lines...) Expand all Loading... |
90 | 92 |
91 updateSummary(sharedPreferences, keyprefStartAudioBitrateType); | 93 updateSummary(sharedPreferences, keyprefStartAudioBitrateType); |
92 updateSummaryBitrate(sharedPreferences, keyprefStartAudioBitrateValue); | 94 updateSummaryBitrate(sharedPreferences, keyprefStartAudioBitrateValue); |
93 setAudioBitrateEnable(sharedPreferences); | 95 setAudioBitrateEnable(sharedPreferences); |
94 updateSummary(sharedPreferences, keyPrefAudioCodec); | 96 updateSummary(sharedPreferences, keyPrefAudioCodec); |
95 updateSummaryB(sharedPreferences, keyprefNoAudioProcessing); | 97 updateSummaryB(sharedPreferences, keyprefNoAudioProcessing); |
96 updateSummaryB(sharedPreferences, keyprefOpenSLES); | 98 updateSummaryB(sharedPreferences, keyprefOpenSLES); |
97 | 99 |
98 updateSummary(sharedPreferences, keyPrefRoomServerUrl); | 100 updateSummary(sharedPreferences, keyPrefRoomServerUrl); |
99 updateSummaryB(sharedPreferences, keyPrefDisplayHud); | 101 updateSummaryB(sharedPreferences, keyPrefDisplayHud); |
| 102 updateSummaryB(sharedPreferences, keyPrefTracing); |
100 } | 103 } |
101 | 104 |
102 @Override | 105 @Override |
103 protected void onPause() { | 106 protected void onPause() { |
104 super.onPause(); | 107 super.onPause(); |
105 SharedPreferences sharedPreferences = | 108 SharedPreferences sharedPreferences = |
106 settingsFragment.getPreferenceScreen().getSharedPreferences(); | 109 settingsFragment.getPreferenceScreen().getSharedPreferences(); |
107 sharedPreferences.unregisterOnSharedPreferenceChangeListener(this); | 110 sharedPreferences.unregisterOnSharedPreferenceChangeListener(this); |
108 } | 111 } |
109 | 112 |
110 @Override | 113 @Override |
111 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, | 114 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, |
112 String key) { | 115 String key) { |
113 if (key.equals(keyprefResolution) | 116 if (key.equals(keyprefResolution) |
114 || key.equals(keyprefFps) | 117 || key.equals(keyprefFps) |
115 || key.equals(keyprefStartVideoBitrateType) | 118 || key.equals(keyprefStartVideoBitrateType) |
116 || key.equals(keyPrefVideoCodec) | 119 || key.equals(keyPrefVideoCodec) |
117 || key.equals(keyprefStartAudioBitrateType) | 120 || key.equals(keyprefStartAudioBitrateType) |
118 || key.equals(keyPrefAudioCodec) | 121 || key.equals(keyPrefAudioCodec) |
119 || key.equals(keyPrefRoomServerUrl)) { | 122 || key.equals(keyPrefRoomServerUrl)) { |
120 updateSummary(sharedPreferences, key); | 123 updateSummary(sharedPreferences, key); |
121 } else if (key.equals(keyprefStartVideoBitrateValue) | 124 } else if (key.equals(keyprefStartVideoBitrateValue) |
122 || key.equals(keyprefStartAudioBitrateValue)) { | 125 || key.equals(keyprefStartAudioBitrateValue)) { |
123 updateSummaryBitrate(sharedPreferences, key); | 126 updateSummaryBitrate(sharedPreferences, key); |
124 } else if (key.equals(keyprefVideoCall) | 127 } else if (key.equals(keyprefVideoCall) |
| 128 || key.equals(keyPrefTracing) |
125 || key.equals(keyprefCaptureQualitySlider) | 129 || key.equals(keyprefCaptureQualitySlider) |
126 || key.equals(keyprefHwCodec) | 130 || key.equals(keyprefHwCodec) |
127 || key.equals(keyprefCaptureToTexture) | 131 || key.equals(keyprefCaptureToTexture) |
128 || key.equals(keyprefNoAudioProcessing) | 132 || key.equals(keyprefNoAudioProcessing) |
129 || key.equals(keyprefOpenSLES) | 133 || key.equals(keyprefOpenSLES) |
130 || key.equals(keyPrefDisplayHud)) { | 134 || key.equals(keyPrefDisplayHud)) { |
131 updateSummaryB(sharedPreferences, key); | 135 updateSummaryB(sharedPreferences, key); |
132 } | 136 } |
133 if (key.equals(keyprefStartVideoBitrateType)) { | 137 if (key.equals(keyprefStartVideoBitrateType)) { |
134 setVideoBitrateEnable(sharedPreferences); | 138 setVideoBitrateEnable(sharedPreferences); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 String bitrateTypeDefault = getString(R.string.pref_startaudiobitrate_defaul
t); | 180 String bitrateTypeDefault = getString(R.string.pref_startaudiobitrate_defaul
t); |
177 String bitrateType = sharedPreferences.getString( | 181 String bitrateType = sharedPreferences.getString( |
178 keyprefStartAudioBitrateType, bitrateTypeDefault); | 182 keyprefStartAudioBitrateType, bitrateTypeDefault); |
179 if (bitrateType.equals(bitrateTypeDefault)) { | 183 if (bitrateType.equals(bitrateTypeDefault)) { |
180 bitratePreferenceValue.setEnabled(false); | 184 bitratePreferenceValue.setEnabled(false); |
181 } else { | 185 } else { |
182 bitratePreferenceValue.setEnabled(true); | 186 bitratePreferenceValue.setEnabled(true); |
183 } | 187 } |
184 } | 188 } |
185 } | 189 } |
OLD | NEW |