OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.media; | 5 package org.chromium.media; |
6 | 6 |
7 import org.chromium.base.annotations.CalledByNative; | 7 import org.chromium.base.annotations.CalledByNative; |
8 import org.chromium.base.annotations.JNINamespace; | 8 import org.chromium.base.annotations.JNINamespace; |
9 | 9 |
10 /** | 10 /** |
(...skipping 11 matching lines...) Expand all Loading... |
22 public final int stepHeight; | 22 public final int stepHeight; |
23 public final int maxWidth; | 23 public final int maxWidth; |
24 public final int minWidth; | 24 public final int minWidth; |
25 public final int currentWidth; | 25 public final int currentWidth; |
26 public final int stepWidth; | 26 public final int stepWidth; |
27 public final double maxZoom; | 27 public final double maxZoom; |
28 public final double minZoom; | 28 public final double minZoom; |
29 public final double currentZoom; | 29 public final double currentZoom; |
30 public final double stepZoom; | 30 public final double stepZoom; |
31 public final int focusMode; | 31 public final int focusMode; |
| 32 public final int[] focusModes; |
32 public final int exposureMode; | 33 public final int exposureMode; |
| 34 public final int[] exposureModes; |
33 public final double maxExposureCompensation; | 35 public final double maxExposureCompensation; |
34 public final double minExposureCompensation; | 36 public final double minExposureCompensation; |
35 public final double currentExposureCompensation; | 37 public final double currentExposureCompensation; |
36 public final double stepExposureCompensation; | 38 public final double stepExposureCompensation; |
37 public final int whiteBalanceMode; | 39 public final int whiteBalanceMode; |
| 40 public final int[] whiteBalanceModes; |
38 public final int[] fillLightModes; | 41 public final int[] fillLightModes; |
39 public final boolean supportsTorch; | 42 public final boolean supportsTorch; |
40 public final boolean torch; | 43 public final boolean torch; |
41 public final boolean redEyeReduction; | 44 public final boolean redEyeReduction; |
42 public final int maxColorTemperature; | 45 public final int maxColorTemperature; |
43 public final int minColorTemperature; | 46 public final int minColorTemperature; |
44 public final int currentColorTemperature; | 47 public final int currentColorTemperature; |
45 public final int stepColorTemperature; | 48 public final int stepColorTemperature; |
46 | 49 |
47 PhotoCapabilities(int maxIso, int minIso, int currentIso, int stepIso, int m
axHeight, | 50 PhotoCapabilities(int maxIso, int minIso, int currentIso, int stepIso, int m
axHeight, |
48 int minHeight, int currentHeight, int stepHeight, int maxWidth, int
minWidth, | 51 int minHeight, int currentHeight, int stepHeight, int maxWidth, int
minWidth, |
49 int currentWidth, int stepWidth, double maxZoom, double minZoom, dou
ble currentZoom, | 52 int currentWidth, int stepWidth, double maxZoom, double minZoom, dou
ble currentZoom, |
50 double stepZoom, int focusMode, int exposureMode, double maxExposure
Compensation, | 53 double stepZoom, int focusMode, int[] focusModes, int exposureMode,
int[] exposureModes, |
51 double minExposureCompensation, double currentExposureCompensation, | 54 double maxExposureCompensation, double minExposureCompensation, |
52 double stepExposureCompensation, int whiteBalanceMode, int[] fillLig
htModes, | 55 double currentExposureCompensation, double stepExposureCompensation, |
| 56 int whiteBalanceMode, int[] whiteBalanceModes, int[] fillLightModes, |
53 boolean supportsTorch, boolean torch, boolean redEyeReduction, int m
axColorTemperature, | 57 boolean supportsTorch, boolean torch, boolean redEyeReduction, int m
axColorTemperature, |
54 int minColorTemperature, int currentColorTemperature, int stepColorT
emperature) { | 58 int minColorTemperature, int currentColorTemperature, int stepColorT
emperature) { |
55 this.maxIso = maxIso; | 59 this.maxIso = maxIso; |
56 this.minIso = minIso; | 60 this.minIso = minIso; |
57 this.currentIso = currentIso; | 61 this.currentIso = currentIso; |
58 this.stepIso = stepIso; | 62 this.stepIso = stepIso; |
59 this.maxHeight = maxHeight; | 63 this.maxHeight = maxHeight; |
60 this.minHeight = minHeight; | 64 this.minHeight = minHeight; |
61 this.currentHeight = currentHeight; | 65 this.currentHeight = currentHeight; |
62 this.stepHeight = stepHeight; | 66 this.stepHeight = stepHeight; |
63 this.maxWidth = maxWidth; | 67 this.maxWidth = maxWidth; |
64 this.minWidth = minWidth; | 68 this.minWidth = minWidth; |
65 this.currentWidth = currentWidth; | 69 this.currentWidth = currentWidth; |
66 this.stepWidth = stepWidth; | 70 this.stepWidth = stepWidth; |
67 this.maxZoom = maxZoom; | 71 this.maxZoom = maxZoom; |
68 this.minZoom = minZoom; | 72 this.minZoom = minZoom; |
69 this.currentZoom = currentZoom; | 73 this.currentZoom = currentZoom; |
70 this.stepZoom = stepZoom; | 74 this.stepZoom = stepZoom; |
71 this.focusMode = focusMode; | 75 this.focusMode = focusMode; |
| 76 this.focusModes = focusModes; |
72 this.exposureMode = exposureMode; | 77 this.exposureMode = exposureMode; |
| 78 this.exposureModes = exposureModes; |
73 this.maxExposureCompensation = maxExposureCompensation; | 79 this.maxExposureCompensation = maxExposureCompensation; |
74 this.minExposureCompensation = minExposureCompensation; | 80 this.minExposureCompensation = minExposureCompensation; |
75 this.currentExposureCompensation = currentExposureCompensation; | 81 this.currentExposureCompensation = currentExposureCompensation; |
76 this.stepExposureCompensation = stepExposureCompensation; | 82 this.stepExposureCompensation = stepExposureCompensation; |
77 this.whiteBalanceMode = whiteBalanceMode; | 83 this.whiteBalanceMode = whiteBalanceMode; |
| 84 this.whiteBalanceModes = whiteBalanceModes; |
78 this.fillLightModes = fillLightModes; | 85 this.fillLightModes = fillLightModes; |
79 this.supportsTorch = supportsTorch; | 86 this.supportsTorch = supportsTorch; |
80 this.torch = torch; | 87 this.torch = torch; |
81 this.redEyeReduction = redEyeReduction; | 88 this.redEyeReduction = redEyeReduction; |
82 this.maxColorTemperature = maxColorTemperature; | 89 this.maxColorTemperature = maxColorTemperature; |
83 this.minColorTemperature = minColorTemperature; | 90 this.minColorTemperature = minColorTemperature; |
84 this.currentColorTemperature = currentColorTemperature; | 91 this.currentColorTemperature = currentColorTemperature; |
85 this.stepColorTemperature = stepColorTemperature; | 92 this.stepColorTemperature = stepColorTemperature; |
86 } | 93 } |
87 | 94 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 public double getStepZoom() { | 171 public double getStepZoom() { |
165 return stepZoom; | 172 return stepZoom; |
166 } | 173 } |
167 | 174 |
168 @CalledByNative | 175 @CalledByNative |
169 public int getFocusMode() { | 176 public int getFocusMode() { |
170 return focusMode; | 177 return focusMode; |
171 } | 178 } |
172 | 179 |
173 @CalledByNative | 180 @CalledByNative |
| 181 public int[] getFocusModes() { |
| 182 return focusModes != null ? focusModes.clone() : new int[0]; |
| 183 } |
| 184 |
| 185 @CalledByNative |
174 public int getExposureMode() { | 186 public int getExposureMode() { |
175 return exposureMode; | 187 return exposureMode; |
176 } | 188 } |
177 | 189 |
178 @CalledByNative | 190 @CalledByNative |
| 191 public int[] getExposureModes() { |
| 192 return exposureModes != null ? exposureModes.clone() : new int[0]; |
| 193 } |
| 194 |
| 195 @CalledByNative |
179 public double getMinExposureCompensation() { | 196 public double getMinExposureCompensation() { |
180 return minExposureCompensation; | 197 return minExposureCompensation; |
181 } | 198 } |
182 | 199 |
183 @CalledByNative | 200 @CalledByNative |
184 public double getMaxExposureCompensation() { | 201 public double getMaxExposureCompensation() { |
185 return maxExposureCompensation; | 202 return maxExposureCompensation; |
186 } | 203 } |
187 | 204 |
188 @CalledByNative | 205 @CalledByNative |
189 public double getCurrentExposureCompensation() { | 206 public double getCurrentExposureCompensation() { |
190 return currentExposureCompensation; | 207 return currentExposureCompensation; |
191 } | 208 } |
192 | 209 |
193 @CalledByNative | 210 @CalledByNative |
194 public double getStepExposureCompensation() { | 211 public double getStepExposureCompensation() { |
195 return stepExposureCompensation; | 212 return stepExposureCompensation; |
196 } | 213 } |
197 | 214 |
198 @CalledByNative | 215 @CalledByNative |
199 public int getWhiteBalanceMode() { | 216 public int getWhiteBalanceMode() { |
200 return whiteBalanceMode; | 217 return whiteBalanceMode; |
201 } | 218 } |
202 | 219 |
203 @CalledByNative | 220 @CalledByNative |
| 221 public int[] getWhiteBalanceModes() { |
| 222 return whiteBalanceModes != null ? whiteBalanceModes.clone() : new int[0
]; |
| 223 } |
| 224 |
| 225 @CalledByNative |
204 public int[] getFillLightModes() { | 226 public int[] getFillLightModes() { |
205 return (fillLightModes != null) ? fillLightModes.clone() : new int[0]; | 227 return fillLightModes != null ? fillLightModes.clone() : new int[0]; |
206 } | 228 } |
207 | 229 |
208 @CalledByNative | 230 @CalledByNative |
209 public boolean getSupportsTorch() { | 231 public boolean getSupportsTorch() { |
210 return supportsTorch; | 232 return supportsTorch; |
211 } | 233 } |
212 | 234 |
213 @CalledByNative | 235 @CalledByNative |
214 public boolean getTorch() { | 236 public boolean getTorch() { |
215 return torch; | 237 return torch; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 public int stepHeight; | 273 public int stepHeight; |
252 public int maxWidth; | 274 public int maxWidth; |
253 public int minWidth; | 275 public int minWidth; |
254 public int currentWidth; | 276 public int currentWidth; |
255 public int stepWidth; | 277 public int stepWidth; |
256 public double maxZoom; | 278 public double maxZoom; |
257 public double minZoom; | 279 public double minZoom; |
258 public double currentZoom; | 280 public double currentZoom; |
259 public double stepZoom; | 281 public double stepZoom; |
260 public int focusMode; | 282 public int focusMode; |
| 283 public int[] focusModes; |
261 public int exposureMode; | 284 public int exposureMode; |
| 285 public int[] exposureModes; |
262 public double maxExposureCompensation; | 286 public double maxExposureCompensation; |
263 public double minExposureCompensation; | 287 public double minExposureCompensation; |
264 public double currentExposureCompensation; | 288 public double currentExposureCompensation; |
265 public double stepExposureCompensation; | 289 public double stepExposureCompensation; |
266 public int whiteBalanceMode; | 290 public int whiteBalanceMode; |
| 291 public int[] whiteBalanceModes; |
267 public int[] fillLightModes; | 292 public int[] fillLightModes; |
268 public boolean supportsTorch; | 293 public boolean supportsTorch; |
269 public boolean torch; | 294 public boolean torch; |
270 public boolean redEyeReduction; | 295 public boolean redEyeReduction; |
271 public int maxColorTemperature; | 296 public int maxColorTemperature; |
272 public int minColorTemperature; | 297 public int minColorTemperature; |
273 public int currentColorTemperature; | 298 public int currentColorTemperature; |
274 public int stepColorTemperature; | 299 public int stepColorTemperature; |
275 | 300 |
276 public Builder() {} | 301 public Builder() {} |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 public Builder setStepZoom(double stepZoom) { | 378 public Builder setStepZoom(double stepZoom) { |
354 this.stepZoom = stepZoom; | 379 this.stepZoom = stepZoom; |
355 return this; | 380 return this; |
356 } | 381 } |
357 | 382 |
358 public Builder setFocusMode(int focusMode) { | 383 public Builder setFocusMode(int focusMode) { |
359 this.focusMode = focusMode; | 384 this.focusMode = focusMode; |
360 return this; | 385 return this; |
361 } | 386 } |
362 | 387 |
| 388 public Builder setFocusModes(int[] focusModes) { |
| 389 this.focusModes = focusModes.clone(); |
| 390 return this; |
| 391 } |
| 392 |
363 public Builder setExposureMode(int exposureMode) { | 393 public Builder setExposureMode(int exposureMode) { |
364 this.exposureMode = exposureMode; | 394 this.exposureMode = exposureMode; |
365 return this; | 395 return this; |
366 } | 396 } |
367 | 397 |
| 398 public Builder setExposureModes(int[] exposureModes) { |
| 399 this.exposureModes = exposureModes.clone(); |
| 400 return this; |
| 401 } |
| 402 |
368 public Builder setMaxExposureCompensation(double maxExposureCompensation
) { | 403 public Builder setMaxExposureCompensation(double maxExposureCompensation
) { |
369 this.maxExposureCompensation = maxExposureCompensation; | 404 this.maxExposureCompensation = maxExposureCompensation; |
370 return this; | 405 return this; |
371 } | 406 } |
372 | 407 |
373 public Builder setMinExposureCompensation(double minExposureCompensation
) { | 408 public Builder setMinExposureCompensation(double minExposureCompensation
) { |
374 this.minExposureCompensation = minExposureCompensation; | 409 this.minExposureCompensation = minExposureCompensation; |
375 return this; | 410 return this; |
376 } | 411 } |
377 | 412 |
378 public Builder setCurrentExposureCompensation(double currentExposureComp
ensation) { | 413 public Builder setCurrentExposureCompensation(double currentExposureComp
ensation) { |
379 this.currentExposureCompensation = currentExposureCompensation; | 414 this.currentExposureCompensation = currentExposureCompensation; |
380 return this; | 415 return this; |
381 } | 416 } |
382 | 417 |
383 public Builder setStepExposureCompensation(double stepExposureCompensati
on) { | 418 public Builder setStepExposureCompensation(double stepExposureCompensati
on) { |
384 this.stepExposureCompensation = stepExposureCompensation; | 419 this.stepExposureCompensation = stepExposureCompensation; |
385 return this; | 420 return this; |
386 } | 421 } |
387 | 422 |
388 public Builder setWhiteBalanceMode(int whiteBalanceMode) { | 423 public Builder setWhiteBalanceMode(int whiteBalanceMode) { |
389 this.whiteBalanceMode = whiteBalanceMode; | 424 this.whiteBalanceMode = whiteBalanceMode; |
390 return this; | 425 return this; |
391 } | 426 } |
392 | 427 |
| 428 public Builder setWhiteBalanceModes(int[] whiteBalanceModes) { |
| 429 this.whiteBalanceModes = whiteBalanceModes.clone(); |
| 430 return this; |
| 431 } |
| 432 |
393 public Builder setFillLightModes(int[] fillLightModes) { | 433 public Builder setFillLightModes(int[] fillLightModes) { |
394 this.fillLightModes = fillLightModes.clone(); | 434 this.fillLightModes = fillLightModes.clone(); |
395 return this; | 435 return this; |
396 } | 436 } |
397 | 437 |
398 public Builder setSupportsTorch(boolean supportsTorch) { | 438 public Builder setSupportsTorch(boolean supportsTorch) { |
399 this.supportsTorch = supportsTorch; | 439 this.supportsTorch = supportsTorch; |
400 return this; | 440 return this; |
401 } | 441 } |
402 | 442 |
(...skipping 23 matching lines...) Expand all Loading... |
426 } | 466 } |
427 | 467 |
428 public Builder setStepColorTemperature(int stepColorTemperature) { | 468 public Builder setStepColorTemperature(int stepColorTemperature) { |
429 this.stepColorTemperature = stepColorTemperature; | 469 this.stepColorTemperature = stepColorTemperature; |
430 return this; | 470 return this; |
431 } | 471 } |
432 | 472 |
433 public PhotoCapabilities build() { | 473 public PhotoCapabilities build() { |
434 return new PhotoCapabilities(maxIso, minIso, currentIso, stepIso, ma
xHeight, minHeight, | 474 return new PhotoCapabilities(maxIso, minIso, currentIso, stepIso, ma
xHeight, minHeight, |
435 currentHeight, stepHeight, maxWidth, minWidth, currentWidth,
stepWidth, maxZoom, | 475 currentHeight, stepHeight, maxWidth, minWidth, currentWidth,
stepWidth, maxZoom, |
436 minZoom, currentZoom, stepZoom, focusMode, exposureMode, | 476 minZoom, currentZoom, stepZoom, focusMode, focusModes, expos
ureMode, |
437 maxExposureCompensation, minExposureCompensation, currentExp
osureCompensation, | 477 exposureModes, maxExposureCompensation, minExposureCompensat
ion, |
438 stepExposureCompensation, whiteBalanceMode, fillLightModes,
supportsTorch, | 478 currentExposureCompensation, stepExposureCompensation, white
BalanceMode, |
439 torch, redEyeReduction, maxColorTemperature, minColorTempera
ture, | 479 whiteBalanceModes, fillLightModes, supportsTorch, torch, red
EyeReduction, |
440 currentColorTemperature, stepColorTemperature); | 480 maxColorTemperature, minColorTemperature, currentColorTemper
ature, |
| 481 stepColorTemperature); |
441 } | 482 } |
442 } | 483 } |
443 } | 484 } |
OLD | NEW |