OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 } catch (Exception e) { | 75 } catch (Exception e) { |
76 Logging.e(TAG, "getSupportedFormats() failed on camera index " + cameraId,
e); | 76 Logging.e(TAG, "getSupportedFormats() failed on camera index " + cameraId,
e); |
77 } | 77 } |
78 | 78 |
79 final long endTimeMs = SystemClock.elapsedRealtime(); | 79 final long endTimeMs = SystemClock.elapsedRealtime(); |
80 Logging.d(TAG, "Get supported formats for camera index " + cameraId + " done
." | 80 Logging.d(TAG, "Get supported formats for camera index " + cameraId + " done
." |
81 + " Time spent: " + (endTimeMs - startTimeMs) + " ms."); | 81 + " Time spent: " + (endTimeMs - startTimeMs) + " ms."); |
82 return formatList; | 82 return formatList; |
83 } | 83 } |
| 84 |
| 85 // Convert from int[2] to CaptureFormat.FramerateRange. |
| 86 public static List<CaptureFormat.FramerateRange> convertFramerates( |
| 87 List<int[]> arrayRanges) { |
| 88 final List<CaptureFormat.FramerateRange> ranges = new ArrayList<CaptureForma
t.FramerateRange>(); |
| 89 for (int[] range : arrayRanges) { |
| 90 ranges.add(new CaptureFormat.FramerateRange( |
| 91 range[android.hardware.Camera.Parameters.PREVIEW_FPS_MIN_INDEX], |
| 92 range[android.hardware.Camera.Parameters.PREVIEW_FPS_MAX_INDEX])); |
| 93 } |
| 94 return ranges; |
| 95 } |
84 } | 96 } |
OLD | NEW |