4package org.qtproject.qt.android.multimedia;
6import android.annotation.TargetApi;
7import android.content.Context;
8import android.graphics.ImageFormat;
9import android.graphics.Rect;
10import android.hardware.camera2.CameraCharacteristics;
11import android.hardware.camera2.CameraManager;
12import android.hardware.camera2.CaptureRequest;
13import android.hardware.camera2.params.StreamConfigurationMap;
14import android.util.Range;
15import android.util.Size;
16import android.util.Log;
18import java.lang.String;
19import java.util.ArrayList;
21import java.util.WeakHashMap;
25 CameraManager mCameraManager;
26 Map<String, CameraCharacteristics> cache;
29 mCameraManager = (CameraManager)
context.getSystemService(Context.CAMERA_SERVICE);
30 cache =
new WeakHashMap<String, CameraCharacteristics>();
35 if (
cache.containsKey(cameraId))
36 return cache.get(cameraId);
39 CameraCharacteristics cameraCharacteristics = mCameraManager.getCameraCharacteristics(cameraId);
40 cache.put(cameraId, cameraCharacteristics);
41 return cameraCharacteristics;
42 }
catch (Exception
e) {
50 return mCameraManager.getCameraIdList();
51 }
catch (Exception
e) {
59 if (characteristics ==
null)
61 return characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
66 if (characteristics ==
null)
68 return characteristics.get(CameraCharacteristics.LENS_FACING);
74 if (characteristics ==
null)
77 Range<Integer>[] ranges = characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
79 String[] fps =
new String[ranges.length];
92 if (characteristics !=
null)
93 maxZoom = characteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM);
98 Rect activeArraySize =
new Rect();
100 if (characteristics !=
null)
101 activeArraySize = characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE);
102 return activeArraySize;
108 if (characteristics ==
null)
109 return new String[0];
111 StreamConfigurationMap
map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
126 return CaptureRequest.CONTROL_AE_MODE_ON;
128 return CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH;
130 return CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH;
132 return CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE;
134 return CaptureRequest.CONTROL_AE_MODE_ON_EXTERNAL_FLASH;
142 case CaptureRequest.CONTROL_AE_MODE_ON:
144 case CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH:
146 case CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH:
148 case CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE:
150 case CaptureRequest.CONTROL_AE_MODE_ON_EXTERNAL_FLASH:
152 case CaptureRequest.CONTROL_AE_MODE_OFF:
161 if (characteristics ==
null)
162 return new String[0];
164 int supportedFlashModes[] = characteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES);
165 ArrayList<String> supportedFlashModesList =
new ArrayList<String>();
170 String[]
ret =
new String[ supportedFlashModesList.size() ];
171 return supportedFlashModesList.toArray(
ret);
177 if (characteristics !=
null)
178 ret = characteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
QMap< QString, QString > map
[6]
QCache< int, Employee > cache
[0]
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes