forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-native-vision-camera+4.6.1.patch
5513 lines (5465 loc) · 270 KB
/
react-native-vision-camera+4.6.1.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/node_modules/react-native-vision-camera/android/.editorconfig b/node_modules/react-native-vision-camera/android/.editorconfig
new file mode 100644
index 0000000..2f08d6d
--- /dev/null
+++ b/node_modules/react-native-vision-camera/android/.editorconfig
@@ -0,0 +1,15 @@
+[*.{kt,kts}]
+indent_style=space
+indent_size=2
+continuation_indent_size=4
+insert_final_newline=true
+max_line_length=140
+ktlint_code_style=android_studio
+ktlint_standard=enabled
+ktlint_experimental=enabled
+ktlint_standard_filename=disabled # dont require PascalCase filenames
+ktlint_standard_no-wildcard-imports=disabled # allow .* imports
+ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than=5
+ktlint_function_signature_body_expression_wrapping=multiline
+ij_kotlin_allow_trailing_comma_on_call_site=false
+ij_kotlin_allow_trailing_comma=false
diff --git a/node_modules/react-native-vision-camera/android/.project b/node_modules/react-native-vision-camera/android/.project
new file mode 100644
index 0000000..0e0a1ba
--- /dev/null
+++ b/node_modules/react-native-vision-camera/android/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>android_</name>
+ <comment>Project android_ created by Buildship.</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
+ </natures>
+</projectDescription>
diff --git a/node_modules/react-native-vision-camera/android/gradlew b/node_modules/react-native-vision-camera/android/gradlew
new file mode 100644
index 0000000..1b6c787
--- /dev/null
+++ b/node_modules/react-native-vision-camera/android/gradlew
@@ -0,0 +1,234 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+APP_NAME="Gradle"
+APP_BASE_NAME=${0##*/}
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+# Collect all arguments for the java command;
+# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+# shell script including quotes and variable substitutions, so put them in
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/node_modules/react-native-vision-camera/android/gradlew.bat b/node_modules/react-native-vision-camera/android/gradlew.bat
new file mode 100644
index 0000000..107acd3
--- /dev/null
+++ b/node_modules/react-native-vision-camera/android/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/node_modules/react-native-vision-camera/android/oldarch/src/main/java/com/facebook/react/viewmanagers/CameraViewManagerDelegate.java b/node_modules/react-native-vision-camera/android/oldarch/src/main/java/com/facebook/react/viewmanagers/CameraViewManagerDelegate.java
new file mode 100644
index 0000000..a1bed79
--- /dev/null
+++ b/node_modules/react-native-vision-camera/android/oldarch/src/main/java/com/facebook/react/viewmanagers/CameraViewManagerDelegate.java
@@ -0,0 +1,113 @@
+/**
+* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
+*
+* Do not edit this file as changes may cause incorrect behavior and will be lost
+* once the code is regenerated.
+*
+* @generated by codegen project: GeneratePropsJavaDelegate.js
+*/
+
+package com.facebook.react.viewmanagers;
+
+import android.view.View;
+import androidx.annotation.Nullable;
+import com.facebook.react.bridge.ReadableMap;
+import com.facebook.react.uimanager.BaseViewManagerDelegate;
+import com.facebook.react.uimanager.BaseViewManagerInterface;
+
+public class CameraViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & CameraViewManagerInterface<T>> extends aseViewManagerDelegate<T, U> {
+ public CameraViewManagerDelegate(U viewManager) {
+ super(viewManager);
+ }
+ @Override
+ public void setProperty(T view, String propName, @Nullable Object value) {
+ switch (propName) {
+ case "enableGpuBuffers":
+ mViewManager.setEnableGpuBuffers(view, value == null ? false : (boolean) value);
+ break;
+ case "androidPreviewViewType":
+ mViewManager.setAndroidPreviewViewType(view, value == null ? null : (String) value);
+ break;
+ case "codeScannerOptions":
+ mViewManager.setCodeScannerOptions(view, (ReadableMap) value);
+ break;
+ case "cameraId":
+ mViewManager.setCameraId(view, value == null ? null : (String) value);
+ break;
+ case "enableFrameProcessor":
+ mViewManager.setEnableFrameProcessor(view, value == null ? false : (boolean) value);
+ break;
+ case "enableLocation":
+ mViewManager.setEnableLocation(view, value == null ? false : (boolean) value);
+ break;
+ case "enableBufferCompression":
+ mViewManager.setEnableBufferCompression(view, value == null ? false : (boolean) value);
+ break;
+ case "photoQualityBalance":
+ mViewManager.setPhotoQualityBalance(view, value == null ? null : (String) value);
+ break;
+ case "isActive":
+ mViewManager.setIsActive(view, value == null ? false : (boolean) value);
+ break;
+ case "photo":
+ mViewManager.setPhoto(view, value == null ? false : (boolean) value);
+ break;
+ case "video":
+ mViewManager.setVideo(view, value == null ? false : (boolean) value);
+ break;
+ case "audio":
+ mViewManager.setAudio(view, value == null ? false : (boolean) value);
+ break;
+ case "torch":
+ mViewManager.setTorch(view, value == null ? null : (String) value);
+ break;
+ case "zoom":
+ mViewManager.setZoom(view, value == null ? 0f : ((Double) value).doubleValue());
+ break;
+ case "exposure":
+ mViewManager.setExposure(view, value == null ? 0f : ((Double) value).doubleValue());
+ break;
+ case "enableZoomGesture":
+ mViewManager.setEnableZoomGesture(view, value == null ? false : (boolean) value);
+ break;
+ case "enableFpsGraph":
+ mViewManager.setEnableFpsGraph(view, value == null ? false : (boolean) value);
+ break;
+ case "resizeMode":
+ mViewManager.setResizeMode(view, value == null ? null : (String) value);
+ break;
+ case "format":
+ mViewManager.setFormat(view, (ReadableMap) value);
+ break;
+ case "pixelFormat":
+ mViewManager.setPixelFormat(view, value == null ? null : (String) value);
+ break;
+ case "fps":
+ mViewManager.setFps(view, value == null ? 0 : ((Double) value).intValue());
+ break;
+ case "videoHdr":
+ mViewManager.setVideoHdr(view, value == null ? false : (boolean) value);
+ break;
+ case "photoHdr":
+ mViewManager.setPhotoHdr(view, value == null ? false : (boolean) value);
+ break;
+ case "lowLightBoost":
+ mViewManager.setLowLightBoost(view, value == null ? false : (boolean) value);
+ break;
+ case "videoStabilizationMode":
+ mViewManager.setVideoStabilizationMode(view, value == null ? null : (String) value);
+ break;
+ case "enableDepthData":
+ mViewManager.setEnableDepthData(view, value == null ? false : (boolean) value);
+ break;
+ case "enablePortraitEffectsMatteDelivery":
+ mViewManager.setEnablePortraitEffectsMatteDelivery(view, value == null ? false : (boolean) value);
+ break;
+ case "orientation":
+ mViewManager.setOrientation(view, value == null ? null : (String) value);
+ break;
+ default:
+ super.setProperty(view, propName, value);
+ }
+ }
+}
diff --git a/node_modules/react-native-vision-camera/android/oldarch/src/main/java/com/facebook/react/viewmanagers/CameraViewManagerInterface.java b/node_modules/react-native-vision-camera/android/oldarch/src/main/java/com/facebook/react/viewmanagers/CameraViewManagerInterface.java
new file mode 100644
index 0000000..94079b2
--- /dev/null
+++ b/node_modules/react-native-vision-camera/android/oldarch/src/main/java/com/facebook/react/viewmanagers/CameraViewManagerInterface.java
@@ -0,0 +1,45 @@
+/**
+* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
+*
+* Do not edit this file as changes may cause incorrect behavior and will be lost
+* once the code is regenerated.
+*
+* @generated by codegen project: GeneratePropsJavaInterface.js
+*/
+
+package com.facebook.react.viewmanagers;
+
+import android.view.View;
+import androidx.annotation.Nullable;
+import com.facebook.react.bridge.ReadableMap;
+
+public interface CameraViewManagerInterface<T extends View> {
+ void setEnableGpuBuffers(T view, boolean value);
+ void setAndroidPreviewViewType(T view, @Nullable String value);
+ void setCodeScannerOptions(T view, @Nullable ReadableMap value);
+ void setCameraId(T view, @Nullable String value);
+ void setEnableFrameProcessor(T view, boolean value);
+ void setEnableLocation(T view, boolean value);
+ void setEnableBufferCompression(T view, boolean value);
+ void setPhotoQualityBalance(T view, @Nullable String value);
+ void setIsActive(T view, boolean value);
+ void setPhoto(T view, boolean value);
+ void setVideo(T view, boolean value);
+ void setAudio(T view, boolean value);
+ void setTorch(T view, @Nullable String value);
+ void setZoom(T view, double value);
+ void setExposure(T view, double value);
+ void setEnableZoomGesture(T view, boolean value);
+ void setEnableFpsGraph(T view, boolean value);
+ void setResizeMode(T view, @Nullable String value);
+ void setFormat(T view, @Nullable ReadableMap value);
+ void setPixelFormat(T view, @Nullable String value);
+ void setFps(T view, int value);
+ void setVideoHdr(T view, boolean value);
+ void setPhotoHdr(T view, boolean value);
+ void setLowLightBoost(T view, boolean value);
+ void setVideoStabilizationMode(T view, @Nullable String value);
+ void setEnableDepthData(T view, boolean value);
+ void setEnablePortraitEffectsMatteDelivery(T view, boolean value);
+ void setOrientation(T view, @Nullable String value);
+}
diff --git a/node_modules/react-native-vision-camera/android/settings.gradle b/node_modules/react-native-vision-camera/android/settings.gradle
new file mode 100644
index 0000000..56a6c3d
--- /dev/null
+++ b/node_modules/react-native-vision-camera/android/settings.gradle
@@ -0,0 +1,3 @@
+rootProject.name = 'VisionCamera'
+
+include ':VisionCamera'
diff --git a/node_modules/react-native-vision-camera/android/src/main/.DS_Store b/node_modules/react-native-vision-camera/android/src/main/.DS_Store
new file mode 100644
index 0000000..e69de29
diff --git a/node_modules/react-native-vision-camera/ios/.swiftformat b/node_modules/react-native-vision-camera/ios/.swiftformat
new file mode 100644
index 0000000..95e71c1
--- /dev/null
+++ b/node_modules/react-native-vision-camera/ios/.swiftformat
@@ -0,0 +1,12 @@
+--allman false
+--indent 2
+--exclude Pods,Generated
+
+--disable andOperator
+--disable redundantReturn
+--disable wrapMultilineStatementBraces
+--disable organizeDeclarations
+
+--enable markTypes
+
+--enable isEmpty
diff --git a/node_modules/react-native-vision-camera/ios/.swiftlint.yml b/node_modules/react-native-vision-camera/ios/.swiftlint.yml
new file mode 100644
index 0000000..1a72686
--- /dev/null
+++ b/node_modules/react-native-vision-camera/ios/.swiftlint.yml
@@ -0,0 +1,52 @@
+disabled_rules:
+ - identifier_name
+ - trailing_comma
+ - todo
+ - type_body_length
+ - cyclomatic_complexity
+ - function_body_length
+ - for_where
+opt_in_rules:
+ - contains_over_filter_count
+ - contains_over_filter_is_empty
+ - contains_over_first_not_nil
+ - contains_over_range_nil_comparison
+ - empty_collection_literal
+ - empty_count
+ - empty_string
+ - first_where
+ - flatmap_over_map_reduce
+ - last_where
+ - reduce_boolean
+ - reduce_into
+ - yoda_condition
+ - vertical_whitespace_opening_braces
+ - vertical_whitespace_closing_braces
+ - vertical_parameter_alignment_on_call
+ - untyped_error_in_catch
+ - unowned_variable_capture
+ - unavailable_function
+ - switch_case_on_newline
+ - static_operator
+ - strict_fileprivate
+ - sorted_imports
+ - sorted_first_last
+ - required_enum_case
+ - redundant_type_annotation
+ - redundant_nil_coalescing
+ - attributes
+ - convenience_type
+analyzer_rules:
+ - explicit_self
+ - unused_declaration
+ - unused_import
+
+excluded: # paths to ignore during linting. Takes precedence over `included`.
+ - Pods
+
+# Adjust rule numbers
+line_length: 160
+file_length: 500
+
+# reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging)
+reporter: 'xcode'
diff --git a/node_modules/react-native-vision-camera/ios/RNCameraView.h b/node_modules/react-native-vision-camera/ios/RNCameraView.h
new file mode 100644
index 0000000..46c2c2c
--- /dev/null
+++ b/node_modules/react-native-vision-camera/ios/RNCameraView.h
@@ -0,0 +1,14 @@
+// This guard prevent this file to be compiled in the old architecture.
+#ifdef RCT_NEW_ARCH_ENABLED
+#import <React/RCTViewComponentView.h>
+#import <UIKit/UIKit.h>
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface RNCameraView : RCTViewComponentView
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif /* RCT_NEW_ARCH_ENABLED */
diff --git a/node_modules/react-native-vision-camera/ios/RNCameraView.mm b/node_modules/react-native-vision-camera/ios/RNCameraView.mm
new file mode 100644
index 0000000..20f4996
--- /dev/null
+++ b/node_modules/react-native-vision-camera/ios/RNCameraView.mm
@@ -0,0 +1,394 @@
+// This guard prevent the code from being compiled in the old architecture
+#ifdef RCT_NEW_ARCH_ENABLED
+#import <React/RCTViewComponentView.h>
+
+#import <react/renderer/components/RNVisionCameraSpec/ComponentDescriptors.h>
+#import <react/renderer/components/RNVisionCameraSpec/EventEmitters.h>
+#import <react/renderer/components/RNVisionCameraSpec/Props.h>
+#import <react/renderer/components/RNVisionCameraSpec/RCTComponentViewHelpers.h>
+
+#import "RCTFabricComponentsPlugins.h"
+#import <AVFoundation/AVCaptureAudioDataOutput.h>
+#import <AVFoundation/AVCaptureVideoDataOutput.h>
+#import <React/RCTViewManager.h>
+#import <React/RCTConversions.h>
+
+#ifdef USE_FRAMEWORKS
+#import <VisionCamera/VisionCamera-Swift.h>
+#else
+#import "VisionCamera-Swift.h"
+#endif
+
+@interface RNCameraView : RCTViewComponentView <RNCameraViewDirectEventDelegate>
+@end
+
+
+using namespace facebook::react;
+
+@implementation RNCameraView {
+ CameraView * _view;
+}
+
++ (ComponentDescriptorProvider)componentDescriptorProvider
+{
+ return concreteComponentDescriptorProvider<CameraViewComponentDescriptor>();
+}
+
+- (void) initCamera {
+ static const auto defaultProps = std::make_shared<const CameraViewProps>();
+ _props = defaultProps;
+
+ // The remaining part of the initializer is standard bjective-C code to create views and layout them with utoLayout. Here we can change whatever we want to.
+ _view = [[CameraView alloc] init];
+ _view.delegate = self;
+
+ self.contentView = _view;
+}
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self) {
+ [self initCamera];
+ }
+
+ return self;
+}
+
+- (void) prepareForRecycle {
+ [super prepareForRecycle];
+
+ self.contentView = _view;
+ _view.delegate = nil;
+ _view = nil;
+ self.contentView = nil;
+}
+
+// why we need this func -> https://reactnative.dev/docs/next/the-new-architecture/pillars-fabric-components#write-the-native-ios-code
+- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
+{
+ if (_view == nil) {
+ [self initCamera];
+ }
+
+ const auto &newViewProps = *std::static_pointer_cast<CameraViewProps const>(props);
+ const auto &oldViewProps = *std::static_pointer_cast<CameraViewProps const>(_props);
+
+ NSMutableArray* changedProps = [[NSMutableArray alloc] init];
+
+ if(oldViewProps.isActive != newViewProps.isActive){
+ _view.isActive = newViewProps.isActive;
+ [changedProps addObject:@"isActive"];
+ }
+ if(oldViewProps.cameraId != newViewProps.cameraId){
+ _view.cameraId = RCTNSStringFromString(newViewProps.cameraId);
+ [changedProps addObject:@"cameraId"];
+ }
+ if(oldViewProps.photoQualityBalance != newViewProps.photoQualityBalance){
+ _view.photoQualityBalance = RCTNSStringFromString(newViewProps.photoQualityBalance);
+ [changedProps addObject:@"photoQualityBalance"];
+ }
+ if(oldViewProps.enableDepthData != newViewProps.enableDepthData){
+ _view.enableDepthData = newViewProps.enableDepthData;
+ [changedProps addObject:@"enableDepthData"];
+ }
+ if(oldViewProps.enablePortraitEffectsMatteDelivery != newViewProps.enablePortraitEffectsMatteDelivery){
+ _view.enablePortraitEffectsMatteDelivery = newViewProps.enablePortraitEffectsMatteDelivery;
+ [changedProps addObject:@"enablePortraitEffectsMatteDelivery"];
+ }
+ if(oldViewProps.photo != newViewProps.photo){
+ _view.photo = [NSNumber numberWithBool:newViewProps.photo];
+ [changedProps addObject:@"photo"];
+ }
+ if(oldViewProps.video != newViewProps.video){
+ _view.video = [NSNumber numberWithBool:newViewProps.video];
+ [changedProps addObject:@"video"];
+ }
+ if(oldViewProps.audio != newViewProps.audio){
+ _view.audio = [NSNumber numberWithBool:newViewProps.audio];
+ [changedProps addObject:@"audio"];
+ }
+ if(oldViewProps.enableFrameProcessor != newViewProps.enableFrameProcessor){
+ _view.enableFrameProcessor = newViewProps.enableFrameProcessor;
+ [changedProps addObject:@"enableFrameProcessor"];
+ }
+ if(oldViewProps.enableLocation != newViewProps.enableLocation){
+ _view.enableLocation = newViewProps.enableLocation;
+ [changedProps addObject:@"enableLocation"];
+ }
+ if(oldViewProps.enableBufferCompression != newViewProps.enableBufferCompression){
+ _view.enableBufferCompression = newViewProps.enableBufferCompression;
+ [changedProps addObject:@"enableBufferCompression"];
+ }
+ if(oldViewProps.fps != newViewProps.fps){
+ _view.fps = [NSNumber numberWithInt:newViewProps.fps];
+ [changedProps addObject:@"fps"];
+ }
+ if(oldViewProps.videoHdr != newViewProps.videoHdr){
+ _view.videoHdr = newViewProps.videoHdr;
+ [changedProps addObject:@"videoHdr"];
+ }
+ if(oldViewProps.photoHdr != newViewProps.photoHdr){
+ _view.photoHdr = newViewProps.photoHdr;
+ [changedProps addObject:@"photoHdr"];
+ }
+ if(oldViewProps.lowLightBoost != newViewProps.lowLightBoost){
+ _view.lowLightBoost = newViewProps.lowLightBoost;
+ [changedProps addObject:@"lowLightBoost"];
+ }
+ if(oldViewProps.videoStabilizationMode != newViewProps.videoStabilizationMode){
+ _view.videoStabilizationMode = RCTNSStringFromString(newViewProps.videoStabilizationMode);
+ [changedProps addObject:@"videoStabilizationMode"];
+ }
+ if(oldViewProps.torch != newViewProps.torch){
+ _view.torch = RCTNSStringFromString(newViewProps.torch);
+ [changedProps addObject:@"torch"];
+ }
+ if(oldViewProps.orientation != newViewProps.orientation){
+ _view.orientation = RCTNSStringFromString(newViewProps.orientation);
+ [changedProps addObject:@"orientation"];
+ }
+ if(oldViewProps.resizeMode != newViewProps.resizeMode){
+ _view.resizeMode = RCTNSStringFromString(newViewProps.resizeMode);
+ [changedProps addObject:@"resizeMode"];
+ }
+ if(oldViewProps.pixelFormat != newViewProps.pixelFormat){
+ _view.pixelFormat = RCTNSStringFromString(newViewProps.pixelFormat);
+ [changedProps addObject:@"pixelFormat"];
+ }
+ if(oldViewProps.zoom != newViewProps.zoom){
+ _view.zoom = [NSNumber numberWithDouble:newViewProps.zoom];
+ [changedProps addObject:@"zoom"];
+ }
+ if(oldViewProps.exposure != newViewProps.exposure){
+ _view.exposure = [NSNumber numberWithDouble:newViewProps.exposure];
+ [changedProps addObject:@"exposure"];
+ }
+ if(oldViewProps.enableZoomGesture != newViewProps.enableZoomGesture){
+ _view.enableZoomGesture = newViewProps.enableZoomGesture;
+ [changedProps addObject:@"enableZoomGesture"];
+ }
+ if(oldViewProps.enableFpsGraph != newViewProps.enableFpsGraph){
+ _view.enableFpsGraph = newViewProps.enableFpsGraph;
+ [changedProps addObject:@"enableFpsGraph"];
+ }
+
+
+ if(_view.format == nil){
+ _view.format =[ [NSMutableDictionary alloc] init];
+ }
+
+
+ //Checking format props, TODO: find cleaner way to do it
+ if(oldViewProps.format.supportsDepthCapture != newViewProps.format.supportsDepthCapture){
+ NSNumber* supportsDepthCapture = newViewProps.format.supportsDepthCapture ? @1 : @0;
+ [_view.format setValue:supportsDepthCapture forKey:@"supportsDepthCapture"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.autoFocusSystem != newViewProps.format.autoFocusSystem){
+ [_view.format setValue:RCTNSStringFromString(newViewProps.format.autoFocusSystem) forKey:@"autoFocusSystem"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.pixelFormats.size() != newViewProps.format.pixelFormats.size()){
+ NSMutableArray* newPixelFormats = [[NSMutableArray alloc] init];
+ for(int i = 0; i < newViewProps.format.pixelFormats.size(); i++){
+ [newPixelFormats addObject:RCTNSStringFromString(newViewProps.format.pixelFormats.at(i))];
+ }
+ [_view.format setValue:newPixelFormats forKey:@"pixelFormats"];
+ [changedProps addObject:@"format"];
+ }
+
+ if(oldViewProps.format.videoStabilizationModes.size() != newViewProps.format.videoStabilizationModes.size()){
+ NSMutableArray* newVideoStabilizationModes = [[NSMutableArray alloc] init];
+ for(int i = 0; i < newViewProps.format.videoStabilizationModes.size(); i++){
+ [newVideoStabilizationModes addObject:RCTNSStringFromString(newViewProps.format.videoStabilizationModes.at(i))];
+ }
+ [_view.format setValue:newVideoStabilizationModes forKey:@"videoStabilizationModes"];
+ [changedProps addObject:@"format"];
+ }
+
+ if(oldViewProps.format.photoHeight != newViewProps.format.photoHeight){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.photoHeight] forKey:@"photoHeight"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.photoWidth != newViewProps.format.photoWidth){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.photoWidth] forKey:@"photoWidth"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.videoHeight != newViewProps.format.videoHeight){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.videoHeight] forKey:@"videoHeight"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.videoWidth != newViewProps.format.videoWidth){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.videoWidth] forKey:@"videoWidth"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.maxISO != newViewProps.format.maxISO){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.maxISO] forKey:@"maxISO"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.minISO != newViewProps.format.minISO){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.minISO] forKey:@"minISO"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.maxFps != newViewProps.format.maxFps){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.maxFps] forKey:@"maxFps"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.minFps != newViewProps.format.minFps){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.minFps] forKey:@"minFps"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.fieldOfView != newViewProps.format.fieldOfView){
+ [_view.format setValue:[NSNumber numberWithDouble:newViewProps.format.fieldOfView] forKey:@"fieldOfView"];
+ [changedProps addObject:@"format"];
+ }
+
+ if(oldViewProps.format.supportsVideoHDR != newViewProps.format.supportsVideoHDR){
+ NSNumber* supportsVideoHDR = newViewProps.format.supportsVideoHDR ? @1 : @0;
+ [_view.format setValue:supportsVideoHDR forKey:@"supportsVideoHDR"];
+ [changedProps addObject:@"format"];
+ }
+ if(oldViewProps.format.supportsPhotoHDR != newViewProps.format.supportsPhotoHDR){
+ NSNumber* supportsPhotoHDR = newViewProps.format.supportsPhotoHDR ? @1 : @0;
+ [_view.format setValue:supportsPhotoHDR forKey:@"supportsPhotoHDR"];
+ [changedProps addObject:@"format"];
+ }
+
+ if (_view.format.count == 0) {
+ _view.format = nil;
+ }
+
+ if(_view.codeScannerOptions == nil){
+ _view.codeScannerOptions =[[NSMutableDictionary alloc] init];
+ }
+
+ if(oldViewProps.codeScannerOptions.codeTypes.size() != newViewProps.codeScannerOptions.codeTypes.size()){
+ NSMutableArray* newCodeTypes = [[NSMutableArray alloc] init];
+ for(int i = 0; i < newViewProps.codeScannerOptions.codeTypes.size(); i++){
+ [newCodeTypes addObject:RCTNSStringFromString(newViewProps.codeScannerOptions.codeTypes.at(i))];
+ }
+ [_view.codeScannerOptions setValue:newCodeTypes forKey:@"codeTypes"];
+ [changedProps addObject:@"codeScannerOptions"];
+ }
+
+ if(oldViewProps.codeScannerOptions.interval != newViewProps.codeScannerOptions.interval){
+ [_view.codeScannerOptions setValue:[NSNumber numberWithDouble:newViewProps.codeScannerOptions.interval] forKey:@"interval"];
+ [changedProps addObject:@"codeScannerOptions"];
+ }
+
+ if(
+ oldViewProps.codeScannerOptions.regionOfInterest.x != newViewProps.codeScannerOptions.regionOfInterest.x ||
+ oldViewProps.codeScannerOptions.regionOfInterest.y != newViewProps.codeScannerOptions.regionOfInterest.y ||
+ oldViewProps.codeScannerOptions.regionOfInterest.width != newViewProps.codeScannerOptions.regionOfInterest.width ||
+ oldViewProps.codeScannerOptions.regionOfInterest.height != newViewProps.codeScannerOptions.regionOfInterest.height
+ ){
+ NSDictionary *newRegionOfInterest = @{
+ @"x": @(newViewProps.codeScannerOptions.regionOfInterest.x),
+ @"y": @(newViewProps.codeScannerOptions.regionOfInterest.y),
+ @"width": @(newViewProps.codeScannerOptions.regionOfInterest.width),
+ @"height": @(newViewProps.codeScannerOptions.regionOfInterest.height),
+ };
+ [_view.codeScannerOptions setValue:newRegionOfInterest forKey:@"regionOfInterest"];
+ [changedProps addObject:@"codeScannerOptions"];
+ }
+
+ if (_view.codeScannerOptions.count == 0) {
+ _view.codeScannerOptions = nil;
+ }
+
+ [_view didSetProps:changedProps];
+
+ [super updateProps:props oldProps:oldProps];
+}
+
+- (void)onViewReady{
+ if(_eventEmitter){
+ std::dynamic_pointer_cast<const CameraViewEventEmitter>(_eventEmitter)
+ ->onViewReady( CameraViewEventEmitter::OnViewReady{});
+ }
+}
+
+- (void)onErrorWithError:(NSDictionary *)error{
+ if(_eventEmitter){
+ std::dynamic_pointer_cast<const CameraViewEventEmitter>(_eventEmitter)
+ ->onError( CameraViewEventEmitter::OnError{
+ .code = std::string([(error != nil ? [error objectForKey:@"code"] : @"") UTF8String]),
+ .message = std::string([(error != nil ? [error objectForKey:@"message"] : @"") UTF8String]),
+ .cause = {
+ .code = std::string([(error != nil ? [[error objectForKey:@"cause"] objectForKey:@"code"] : @"") UTF8String]), // TODO: Further ecure type safety to prevent crashes
+ .domain = std::string([(error != nil ? [[error objectForKey:@"cause"] objectForKey:@"domain"] : @"") UTF8String]),
+ .message = std::string([(error != nil ? [[error objectForKey:@"cause"] objectForKey:@"message"] : @"") UTF8String]),
+ .details = std::string([(error != nil ? [[error objectForKey:@"cause"] objectForKey:@"details"] : @"") UTF8String])
+ }
+ });
+ }
+}
+
+- (void)onInitialized{
+ if(_eventEmitter){
+ std::dynamic_pointer_cast<const CameraViewEventEmitter>(_eventEmitter)
+ ->onInitialized( CameraViewEventEmitter::OnInitialized{});
+ }
+}
+
+- (void)onCodeScannedWithMessage:(NSDictionary *)message {
+ if(_eventEmitter){
+ std::dynamic_pointer_cast<const CameraViewEventEmitter>(_eventEmitter)