Commit c254eca
authored
[Camera] Add lens type information (iOS) (#8723)
This PR adds lens type information. The goal is to identify whether the lens type is wide, ultra-wide, telephoto, etc., as discussed in flutter/flutter#119908. The iOS implementation is complete, so lens data will now be populated on iOS.
- Introduces a new CameraLensType enum to provide lens type information about the camera (e.g.: ultra-wide, telephoto, ...)
- Adds lensType in the PlatformCameraDescription and CameraDescription classes
- Implements utility functions to convert between PlatformCameraLensType and CameraLensType.
- Updates auto-generated code (using Pigeon) to reflect these changes.
**Current CameraDescription for iPhone 11**
```
[
CameraDescription(
com.apple.avfoundation.avcapturedevice.built-in_video:0,
CameraLensDirection.back,
90
),
CameraDescription(
com.apple.avfoundation.avcapturedevice.built-in_video:1,
CameraLensDirection.front,
90
),
CameraDescription(
com.apple.avfoundation.avcapturedevice.built-in_video:5,
CameraLensDirection.back,
90
)
]
```
**New CameraDescription for iPhone 11**
```
[
CameraDescription(
com.apple.avfoundation.avcapturedevice.built-in_video:0,
CameraLensDirection.back,
90,
CameraLensType.wide
),
CameraDescription(
com.apple.avfoundation.avcapturedevice.built-in_video:1,
CameraLensDirection.front,
90,
CameraLensType.wide
),
CameraDescription(
com.apple.avfoundation.avcapturedevice.built-in_video:5,
CameraLensDirection.back,
90,
CameraLensType.ultraWide
)
]
```1 parent 1977932 commit c254eca
4 files changed
Lines changed: 58 additions & 6 deletions
File tree
- packages/camera/camera_platform_interface
- lib/src/types
- test/types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
1 | 6 | | |
2 | 7 | | |
3 | 8 | | |
| |||
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
19 | 36 | | |
20 | 37 | | |
21 | 38 | | |
| |||
24 | 41 | | |
25 | 42 | | |
26 | 43 | | |
| 44 | + | |
27 | 45 | | |
28 | 46 | | |
29 | 47 | | |
| |||
41 | 59 | | |
42 | 60 | | |
43 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
44 | 65 | | |
45 | 66 | | |
46 | 67 | | |
47 | 68 | | |
48 | 69 | | |
49 | 70 | | |
50 | | - | |
| 71 | + | |
| 72 | + | |
51 | 73 | | |
52 | 74 | | |
53 | | - | |
| 75 | + | |
54 | 76 | | |
55 | 77 | | |
56 | 78 | | |
57 | 79 | | |
58 | | - | |
| 80 | + | |
59 | 81 | | |
60 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| |||
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
| 104 | + | |
95 | 105 | | |
96 | 106 | | |
97 | 107 | | |
| |||
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| 116 | + | |
106 | 117 | | |
107 | | - | |
108 | | - | |
| 118 | + | |
| 119 | + | |
109 | 120 | | |
110 | 121 | | |
111 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
112 | 137 | | |
113 | 138 | | |
0 commit comments