Commit Graph

49 Commits

Author SHA1 Message Date
Marc Rousavy
9b7c01e8ba chore: release 2.0.0 2021-05-06 15:12:28 +02:00
Marc Rousavy
b6a67d5ced
feature: Frame Processors (iOS) (#2)
* Clean up Frame Processor

* Create FrameProcessorHolder

* Create FrameProcessorDelegate in ObjC++

* Move frame processor to FrameProcessorDelegate

* Decorate runtime, check for null

* Update FrameProcessorDelegate.mm

* Cleanup FrameProcessorBindings.mm

* Fix RuntimeDecorator.h import

* Update FrameProcessorDelegate.mm

* "React" -> "React Helper" to avoid confusion

* Rename folders again

* Fix podspec flattening a lot of headers, causing REA nameclash

* Fix header imports to avoid REA naming collision

* Lazily initialize jsi::Runtime on DispatchQueue

* Install frame processor bindings from Swift

* First try to call jsi::Function (frame processor) 👀

* Call viewForReactTag on RCT main thread

* Fix bridge accessing

* Add more logs

* Update CameraViewManager.swift

* Add more TODOs

* Re-indent .cpp files

* Fix RCTTurboModule import podspec

* Remove unnecessary include check for swift umbrella header

* Merge branch 'main' into frame-processors

* Docs: use static width for images (283)

* Create validate-cpp.yml

* Update a lot of packages to latest

* Set SWIFT_VERSION to 5.2 in podspec

* Create clean.sh

* Delete unused C++ files

* podspec: Remove CLANG_CXX_LANGUAGE_STANDARD and OTHER_CFLAGS

* Update pod lockfiles

* Regenerate lockfiles

* Remove IOSLogger

* Use NSLog

* Create FrameProcessorManager (inherits from REA RuntimeManager)

* Create reanimated::RuntimeManager shared_ptr

* Re-integrate pods

* Add react-native-reanimated >=2 peerDependency

* Add metro-config

* blacklist -> exclusionList

* Try to call worklet

* Fix jsi::Value* initializer

* Call ShareableValue::adapt (makeShareable) with React/JS Runtime

* Add null-checks

* Lift runtime manager creation out of delegate, into bindings

* Remove debug statement

* Make RuntimeManager unique_ptr

* Set _FRAME_PROCESSOR

* Extract convertJSIFunctionToFrameProcessorCallback

* Print frame

* Merge branch 'main' into frame-processors

* Reformat Swift code

* Install reanimated from npm again

* Re-integrate Pods

* Dependabot: Also scan example/ and docs/

* Update validate-cpp.yml

* Create FrameProcessorUtils

* Create Frame.h

* Abstract HostObject creation away

* Fix types

* Fix frame processor call

* Add todo

* Update lockfiles

* Add C++ contributing instructions

* Update CONTRIBUTING.md

* Add android/src/main/cpp to cpplint

* Update cpplint.sh

* Fix a few cpplint errors

* Fix globals

* Fix a few more cpplint errors

* Update App.tsx

* Update AndroidLogger.cpp

* Format

* Fix cpplint script (check-cpp)

* Try to simplify frame processor

* y

* Update FrameProcessorUtils.mm

* Update FrameProcessorBindings.mm

* Update CameraView.swift

* Update CameraViewManager.m

* Restructure everything

* fix

* Fix `@objc` export (make public)

* Refactor installFrameProcessorBindings into FrameProcessorRuntimeManager

* Add swift RCTBridge.runOnJS helper

* Fix run(onJS)

* Add pragma once

* Add `&self` to lambda

* Update FrameProcessorRuntimeManager.mm

* reorder imports

* Fix imports

* forward declare

* Rename extension

* Destroy buffer after execution

* Add FrameProcessorPluginRegistry base

* Merge branch 'main' into frame-processors

* Add frameProcessor to types

* Update Camera.tsx

* Fix rebase merge

* Remove movieOutput

* Use `useFrameProcessor`

* Fix bad merge

* Add additional ESLint rules

* Update lockfiles

* Update CameraViewManager.m

* Add support for V8 runtime

* Add frame processor plugins API

* Print plugin invoke

* Fix React Utils in podspec

* Fix runOnJS swift name

* Remove invalid redecl of `captureSession`

* Use REA 2.1.0 which includes all my big PRs 🎉

* Update validate-cpp.yml

* Update Podfile.lock

* Remove Flipper

* Fix dereferencing

* Capture `self` by value. Fucking hell, what a dumb mistake.

* Override a few HostObject functions

* Expose isReady, width, height, bytesPerRow and planesCount

* use hook again

* Expose property names

* FrameProcessor -> Frame

* Update CameraView+RecordVideo.swift

* Add Swift support for Frame Processors Plugins

* Add macros for plugin installation

* Add ObjC frame processor plugin

* Correctly install frame processor plugins

* Don't require custom name for macro

* Check if plugin already exists

* Implement QR Code Frame Processor Plugin in Swift

* Adjust ObjC style frame processor macro

* optimize

* Add `frameProcessorFrameDropRate`

* Fix types

* Only log once

* Log if it executes slowly

* Implement `frameProcessorFps`

* Implement manual encoded video recordings

* Use recommended video settings

* Add fileType types

* Ignore if input is not ready for media data

* Add completion handler

* Add audio buffer sampling

* Init only for video frame

* use AVAssetWriterInputPixelBufferAdaptor

* Remove AVAssetWriterInputPixelBufferAdaptor

* Rotate VideoWriter

* Always assume portrait orientation

* Update RecordingSession.swift

* Use a separate Queue for Audio

* Format Swift

* Update CameraView+RecordVideo.swift

* Use `videoQueue` instead of `cameraQueue`

* Move example plugins to example app

* Fix hardcoded name in plugin macro

* QRFrame... -> QRCodeFrame...

* Update FrameProcessorPlugin.h

* Add example frame processors to JS base

* Update QRCodeFrameProcessorPluginSwift.m

* Add docs to create FP Plugins

* Update FRAME_PROCESSORS_CREATE.mdx

* Update FRAME_PROCESSORS_CREATE.mdx

* Use `AVAssetWriterInputPixelBufferAdaptor` for efficient pixel buffer recycling

* Add customizable `pixelFormat`

* Use native format if available

* Update project.pbxproj

* Set video width and height as source-pixel-buffer attributes

* Catch

* Update App.tsx

* Don't explicitly set video dimensions, let CVPixelBufferPool handle it

* Add a few logs

* Cleanup

* Update CameraView+RecordVideo.swift

* Eagerly initialize asset writer to fix stutter at first frame

* Use `cameraQueue` DispatchQueue to not block CaptureDataOutputDelegate

* Fix duration calculation

* cleanup

* Cleanup

* Swiftformat

* Return available video codecs

* Only show frame drop notification for video output

* Remove photo and video codec functionality

It was too much complexity and probably never used anyways.

* Revert all android related changes for now

* Cleanup

* Remove unused header

* Update AVAssetWriter.Status+descriptor.swift

* Only call Frame Processor for Video Frames

* Fix `if`

* Add support for Frame Processor plugin parameters/arguments

* Fix arg support

* Move to JSIUtils.mm

* Update JSIUtils.h

* Update FRAME_PROCESSORS_CREATE.mdx

* Update FRAME_PROCESSORS_CREATE.mdx

* Upgrade packages for docs/

* fix docs

* Rename

* highlight lines

* docs

* community plugins

* Update FRAME_PROCESSOR_CREATE_FINAL.mdx

* Update FRAME_PROCESSOR_PLUGIN_LIST.mdx

* Update FRAME_PROCESSOR_PLUGIN_LIST.mdx

* Update dependencies (1/2)

* Update dependencies (2/2)

* Update Gemfile.lock

* add FP docs

* Update README.md

* Make `lastFrameProcessor` private

* add `frameProcessor` docs

* fix docs

* adjust docs

* Update DEVICES.mdx

* fix

* s

* Add logs demo

* add metro restart note

* Update FRAME_PROCESSOR_CREATE_PLUGIN_IOS.mdx

* Mirror video device

* Update AVCaptureVideoDataOutput+mirror.swift

* Create .swift-version

* Enable whole module optimization

* Fix recording mirrored video

* Swift format

* Clean dictionary on `markInvalid`

* Fix cleanup

* Add docs for disabling frame processors

* Update project.pbxproj

* Revert "Update project.pbxproj"

This reverts commit e67861e51b88b4888a6940e2d20388f3044211d0.

* Log frame drop reason

* Format

* add more samples

* Add clang-format

* also check .mm

* Revert "also check .mm"

This reverts commit 8b9d5e2c29866b05909530d104f6633d6c49eadd.

* Revert "Add clang-format"

This reverts commit 7643ac808e0fc34567ea1f814e73d84955381636.

* Use `kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange` as default

* Read matching video attributes from videoSettings

* Add TODO

* Swiftformat

* Conditionally disable frame processors

* Assert if trying to use frame processors when disabled

* Add frame-processors demo gif

* Allow disabling frame processors via `VISION_CAMERA_DISABLE_FRAME_PROCESSORS`

* Update FrameProcessorRuntimeManager.mm

* Update FRAME_PROCESSORS.mdx

* Update project.pbxproj

* Update FRAME_PROCESSORS_CREATE_OVERVIEW.mdx
2021-05-06 14:11:55 +02:00
Marc Rousavy
77b3d78566 chore: release 1.0.11 2021-05-06 14:07:32 +02:00
Marc Rousavy
ed754b1ac3 chore: release 1.0.10 2021-04-26 12:57:41 +02:00
Marc Rousavy
5e2e9b6912 chore: release 1.0.9 2021-04-20 10:23:42 +02:00
Marc Rousavy
7ea5702efd chore: release 1.0.8 2021-04-13 13:01:55 +02:00
Marc Rousavy
2c5ea04939 Fix npm package size 2021-04-08 12:30:22 +02:00
Marc Rousavy
7c33839e36
Reformat (#116)
* Reformat

* Prettier: Print Width 140

* SwiftFormat: Disable `organizeDeclarations`

* React Helpers -> React Utils

* Use bundle exec for pods

* Disable Hermes in Example

* Create clean.sh

* Update package.json

* Re-generate lockfiles

* Add bundle install step to bootstrap
2021-03-31 15:43:29 +02:00
Marc Rousavy
7d654dabea Remove @types/jest 2021-03-29 17:50:06 +02:00
Marc Rousavy
7368e0c2d3 chore: release 1.0.7 2021-03-29 14:13:01 +02:00
Marc Rousavy
51580bc18a chore: release 1.0.6 2021-03-29 11:47:26 +02:00
Marc Rousavy
15e0c7c595 chore: release 1.0.5 2021-03-29 11:35:20 +02:00
Marc Rousavy
501827cb87 Rename pod to VisionCamera 2021-03-26 16:22:24 +01:00
Marc Rousavy
0750e42e9f chore: release 1.0.4 2021-03-25 10:20:44 +01:00
Marc Rousavy
35806ff660
Upgrade Example to RN 0.64 (#83)
* ReactLogger: Also log function

* Run SwiftFormat & SwiftLint in example project

* Upgrade to RN 0.64 1/2

* Update lockfiles

* Upgrade a few packages

* index.tsx -> index.js

* Upgrade docusaurus

* Fix line length violation

* Update CameraView.swift

* Update gradle plugin

* Fix example to prefer higher res cameras

* Remove unused log line

* Update App.tsx
2021-03-19 15:53:19 +01:00
Marc Rousavy
7b90f4fa70 chore: release 1.0.3 2021-03-17 18:07:49 +01:00
Marc Rousavy
64fcf9f069 Fix check-all script 2021-03-17 15:35:49 +01:00
Marc Rousavy
fc4f2e6362 chore: release 1.0.2 2021-03-17 15:31:01 +01:00
Marc Rousavy
dee957648b
Fix tsc (again) (#50)
* Test forbid `<View>`

* Update validate-js.yml

* Run yarn lint with custom formatter lib

* Revert "Test forbid `<View>`"

This reverts commit d36ab54b48b7e86e594d360bd71c82b541ed63fa.

* Test: Intentional tsc error

* Update notice-new-dependencies.yml

* Update validate-js.yml

* Use reviewdog again, but with custom efm

* Fix <Camera> props

* Update validate-js.yml

* Try use github-check

* Update validate-js.yml

* Update validate-js.yml

* Add two reporters

* Update validate-js.yml

* Level error

* Use github-pr-review

* Update validate-js.yml

* Revert "Test: Intentional tsc error"

This reverts commit a4e7f6f599d403848729143f1bd87a3435c70826.
2021-03-12 14:19:22 +01:00
Marc Rousavy
b18cf3c923 chore: release 1.0.1 2021-03-09 12:22:11 +01:00
Marc Rousavy
3de4675592 Add "check-all" script 2021-03-09 12:19:18 +01:00
Marc Rousavy
64bb6f6a2a
Run SwiftFormat in GH Action (#28) 2021-03-09 10:53:29 +01:00
Marc Rousavy
f051481010
Devops/reviewdog typescript (#25)
* Use reviewdog for TSC

* Replace all `type Readonly<T>` with `interface T`

* Use --frozen-lockfile for yarn

* Give all actions a name

* Fix yarn example
2021-03-08 17:51:47 +01:00
dependabot[bot]
4e5a79fbde
Bump @types/react-native from 0.63.50 to 0.63.51 (#24)
Bumps [@types/react-native](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-native) from 0.63.50 to 0.63.51.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-native)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 13:00:04 +01:00
Marc Rousavy
c09ef156e2 Remove typedoc from package.json 2021-03-04 13:21:50 +01:00
Marc Rousavy
15709e9f53 Fix old links 2021-03-04 10:45:50 +01:00
Marc Rousavy
ece148d93e Upgrade all packages to latest 2021-03-03 21:56:03 +01:00
Marc Rousavy
ad282ce4d2 Update package.json 2021-03-03 12:39:02 +01:00
Marc Rousavy
0b7b4d50b5
Automatically build API documentation (#11)
* Automatically build API documentation using Typedoc and Docusaurus
* Move MD and move to MDX for Docusaurus Guides
2021-03-03 12:37:43 +01:00
Marc Rousavy
f5ec6886ed chore: release 1.0.0 2021-03-01 09:34:00 +01:00
Marc Rousavy
6438b9a8bc
Bump CameraX versions to alpha2/alpha22 (#7)
* Bump CameraX versions to alpha2/alpha22
* Use `setDefaultResolution` to set format's photoSize
2021-02-26 17:34:28 +01:00
Marc Rousavy
2e60110070 Update package.json 2021-02-25 22:51:20 +01:00
Marc Rousavy
0dcfdfca99 chore: release 1.0.0-alpha.6 2021-02-25 22:46:55 +01:00
Marc Rousavy
a719217078 LICENSE: GPL-3.0 -> MIT 2021-02-25 22:45:59 +01:00
Marc Rousavy
fd0b52f0d9 chore: release 1.0.0-alpha.5 2021-02-25 18:00:34 +01:00
Marc Rousavy
75e06194ba Also include "src/" in npm package 2021-02-25 18:00:11 +01:00
Marc Rousavy
de2656ba9b chore: release 1.0.0-alpha.4 2021-02-25 17:49:49 +01:00
Marc Rousavy
12eeddf3f2 Fix types directory 2021-02-25 17:48:00 +01:00
Marc Rousavy
cf357ff3f1 Update package.json 2021-02-25 15:32:12 +01:00
Marc Rousavy
3f0d3c286b chore: release 1.0.0-alpha.3 2021-02-25 15:16:30 +01:00
Marc Rousavy
1f5bf6e365 chore: release 1.0.0-alpha.2 2021-02-25 13:46:26 +01:00
Marc Rousavy
7ffb898274 License MIT -> GPLv3.0 2021-02-25 13:44:18 +01:00
Marc Rousavy
2391357c31 chore: release 1.0.0-alpha.1 2021-02-25 13:00:41 +01:00
Marc Rousavy
57c52196e6 Update package.json 2021-02-25 12:59:37 +01:00
Marc Rousavy
27ec27abcd Run lint through formatter 2021-02-23 14:17:10 +01:00
Marc Rousavy
04fd5bb069 Squash format-filter 2021-02-20 23:20:28 +01:00
Marc Rousavy
99a640238e Update package.json 2021-02-20 20:41:10 +01:00
Marc Rousavy
763b4d5372 Finish devDependencies setup 2021-02-19 16:20:19 +01:00
Marc Rousavy
c04a4b72be Bootstrap 2021-02-19 16:07:53 +01:00