Commit ba0e427
feat(android): stop/release camera in non-UI thread (react-native-camera#2685)
* stop/release camera in non-UI thread so we prevent ANRs and UI freezing.
Some phones may take up to a second to release the camera and preview.
* fix for surface destroy and resume events.
Co-authored-by: Cristiano Coelho <[email protected]>1 parent c683076 commit ba0e427
File tree
2 files changed
+65
-6
lines changed- android/src/main/java
- com/google/android/cameraview
- org/reactnative/camera
2 files changed
+65
-6
lines changedLines changed: 56 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
137 | 156 | | |
138 | 157 | | |
139 | 158 | | |
140 | 159 | | |
141 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
142 | 187 | | |
143 | 188 | | |
144 | 189 | | |
| |||
235 | 280 | | |
236 | 281 | | |
237 | 282 | | |
238 | | - | |
239 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
240 | 290 | | |
241 | 291 | | |
242 | 292 | | |
| |||
247 | 297 | | |
248 | 298 | | |
249 | 299 | | |
| 300 | + | |
| 301 | + | |
250 | 302 | | |
251 | 303 | | |
252 | 304 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
526 | 525 | | |
527 | 526 | | |
528 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
529 | 536 | | |
530 | 537 | | |
531 | 538 | | |
| |||
0 commit comments