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

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java

Issue 2077663003: Camera2 in AppRTC Android Demo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@camera2_only
Patch Set: Create peer connection factory with the target context in the test Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java
index bb959ed67a4cb54d58ae272958ababdf0eb6bbea..26ce40755a0ec6d6f639aa39c5beec66294a1360 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java
@@ -14,8 +14,10 @@ import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
+import android.preference.ListPreference;
import android.preference.Preference;
+import org.webrtc.Camera2Enumerator;
import org.webrtc.voiceengine.WebRtcAudioUtils;
/**
@@ -25,6 +27,7 @@ public class SettingsActivity extends Activity
implements OnSharedPreferenceChangeListener{
private SettingsFragment settingsFragment;
private String keyprefVideoCall;
+ private String keyprefCamera2;
private String keyprefResolution;
private String keyprefFps;
private String keyprefCaptureQualitySlider;
@@ -50,6 +53,7 @@ public class SettingsActivity extends Activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
keyprefVideoCall = getString(R.string.pref_videocall_key);
+ keyprefCamera2 = getString(R.string.pref_camera2_key);
keyprefResolution = getString(R.string.pref_resolution_key);
keyprefFps = getString(R.string.pref_fps_key);
keyprefCaptureQualitySlider = getString(R.string.pref_capturequalityslider_key);
@@ -86,6 +90,7 @@ public class SettingsActivity extends Activity
settingsFragment.getPreferenceScreen().getSharedPreferences();
sharedPreferences.registerOnSharedPreferenceChangeListener(this);
updateSummaryB(sharedPreferences, keyprefVideoCall);
+ updateSummaryB(sharedPreferences, keyprefCamera2);
updateSummary(sharedPreferences, keyprefResolution);
updateSummary(sharedPreferences, keyprefFps);
updateSummaryB(sharedPreferences, keyprefCaptureQualitySlider);
@@ -109,6 +114,14 @@ public class SettingsActivity extends Activity
updateSummaryB(sharedPreferences, keyPrefDisplayHud);
updateSummaryB(sharedPreferences, keyPrefTracing);
+ if (!Camera2Enumerator.isSupported()) {
+ Preference camera2Preference =
+ settingsFragment.findPreference(keyprefCamera2);
+
+ camera2Preference.setSummary(getString(R.string.pref_camera2_not_supported));
+ camera2Preference.setEnabled(false);
+ }
+
// Disable forcing WebRTC based AEC so it won't affect our value.
// Otherwise, if it was enabled, isAcousticEchoCancelerSupported would always return false.
WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(false);
@@ -116,7 +129,6 @@ public class SettingsActivity extends Activity
Preference disableBuiltInAECPreference =
settingsFragment.findPreference(keyprefDisableBuiltInAEC);
-
disableBuiltInAECPreference.setSummary(getString(R.string.pref_built_in_aec_not_available));
disableBuiltInAECPreference.setEnabled(false);
}
@@ -145,6 +157,7 @@ public class SettingsActivity extends Activity
|| key.equals(keyprefStartAudioBitrateValue)) {
updateSummaryBitrate(sharedPreferences, key);
} else if (key.equals(keyprefVideoCall)
+ || key.equals(keyprefCamera2)
|| key.equals(keyPrefTracing)
|| key.equals(keyprefCaptureQualitySlider)
|| key.equals(keyprefHwCodec)

Powered by Google App Engine
This is Rietveld 408576698