Chromium Code Reviews

Side by Side Diff: webrtc/api/android/java/src/org/webrtc/Camera2Session.java

Issue 2356563002: Log supported camera preview resolutions. (Closed)
Patch Set: Remove non needed comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 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 316 matching lines...)
327 327
328 private void findCaptureFormat() { 328 private void findCaptureFormat() {
329 checkIsOnCameraThread(); 329 checkIsOnCameraThread();
330 330
331 Range<Integer>[] fpsRanges = 331 Range<Integer>[] fpsRanges =
332 cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TAR GET_FPS_RANGES); 332 cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TAR GET_FPS_RANGES);
333 fpsUnitFactor = Camera2Enumerator.getFpsUnitFactor(fpsRanges); 333 fpsUnitFactor = Camera2Enumerator.getFpsUnitFactor(fpsRanges);
334 List<CaptureFormat.FramerateRange> framerateRanges = 334 List<CaptureFormat.FramerateRange> framerateRanges =
335 Camera2Enumerator.convertFramerates(fpsRanges, fpsUnitFactor); 335 Camera2Enumerator.convertFramerates(fpsRanges, fpsUnitFactor);
336 List<Size> sizes = Camera2Enumerator.getSupportedSizes(cameraCharacteristics ); 336 List<Size> sizes = Camera2Enumerator.getSupportedSizes(cameraCharacteristics );
337 Logging.d(TAG, "Available preview sizes: " + sizes);
337 Logging.d(TAG, "Available fps ranges: " + framerateRanges); 338 Logging.d(TAG, "Available fps ranges: " + framerateRanges);
338 339
339 if (framerateRanges.isEmpty() || sizes.isEmpty()) { 340 if (framerateRanges.isEmpty() || sizes.isEmpty()) {
340 reportError("No supported capture formats."); 341 reportError("No supported capture formats.");
341 } 342 }
342 343
343 final CaptureFormat.FramerateRange bestFpsRange = 344 final CaptureFormat.FramerateRange bestFpsRange =
344 CameraEnumerationAndroid.getClosestSupportedFramerateRange( 345 CameraEnumerationAndroid.getClosestSupportedFramerateRange(
345 framerateRanges, framerate); 346 framerateRanges, framerate);
346 347
(...skipping 122 matching lines...)
469 } 470 }
470 return (cameraOrientation + rotation) % 360; 471 return (cameraOrientation + rotation) % 360;
471 } 472 }
472 473
473 private void checkIsOnCameraThread() { 474 private void checkIsOnCameraThread() {
474 if (Thread.currentThread() != cameraThreadHandler.getLooper().getThread()) { 475 if (Thread.currentThread() != cameraThreadHandler.getLooper().getThread()) {
475 throw new IllegalStateException("Wrong thread"); 476 throw new IllegalStateException("Wrong thread");
476 } 477 }
477 } 478 }
478 } 479 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/android/java/src/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »

Powered by Google App Engine