Add new Camera2Enumerator.isSupported with Context parameter.

The old method is marked deprecated and will be removed soon. The new
method checks if all cameras on the device support better than legacy
implementation of the camera2 API.

BUG=webrtc:6390

Review-Url: https://codereview.webrtc.org/2354883002
Cr-Commit-Position: refs/heads/master@{#14350}
This commit is contained in:
sakal
2016-09-22 05:52:08 -07:00
committed by Commit bot
parent 09baefeaf9
commit 1c6d3f7eae
5 changed files with 39 additions and 4 deletions

View File

@ -232,7 +232,7 @@ public class CallActivity extends Activity
boolean loopback = intent.getBooleanExtra(EXTRA_LOOPBACK, false);
boolean tracing = intent.getBooleanExtra(EXTRA_TRACING, false);
boolean useCamera2 = Camera2Enumerator.isSupported()
boolean useCamera2 = Camera2Enumerator.isSupported(this)
&& intent.getBooleanExtra(EXTRA_CAMERA2, true);
peerConnectionParameters = new PeerConnectionParameters(

View File

@ -126,7 +126,7 @@ public class SettingsActivity extends Activity
updateSummaryB(sharedPreferences, keyPrefDisplayHud);
updateSummaryB(sharedPreferences, keyPrefTracing);
if (!Camera2Enumerator.isSupported()) {
if (!Camera2Enumerator.isSupported(this)) {
Preference camera2Preference =
settingsFragment.findPreference(keyprefCamera2);