-
Notifications
You must be signed in to change notification settings - Fork 68
Add NativeCapture #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add NativeCapture #156
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3e07453
Add NativeCapture to init and test it
ryantrem bbcc90f
Merge branch 'master' into capture
ryantrem 6653cad
Update CMakeLists.txt and podspec to consume NativeCapture
ryantrem ceea55a
More test code
ryantrem f8af918
Update BabylonNative submodule with capture + test code
ryantrem b681a9d
Official NativeCapture
ryantrem b5e9ef4
Merge branch 'master' into capture
ryantrem fdca082
Switch back to BabylonNative official commit
ryantrem 467e2ef
Add NativeCapture.ts
ryantrem 4e75ffc
Add NativeCapture to package
ryantrem 7824a21
Further parameterize JSI based function
ryantrem 5be8f09
Cleanup
ryantrem a0036a8
Move CaptureSession warning
ryantrem cbf764e
Remove test code
ryantrem f507a79
Move NativeCapture plugin init
ryantrem bb87145
Add NativeCapture to Windows
ryantrem a5334b1
Add NativeCapture to windows vcxproj for linking
ryantrem 8d32cf3
Add project references for windows (for Playground consuming via sour…
ryantrem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| export type CapturedFrame = { | ||
| width: number; | ||
| height: number; | ||
| pitch: number; | ||
| format: "BGRA8" | undefined; | ||
| yFlip: boolean; | ||
| data: ArrayBuffer; | ||
| }; | ||
|
|
||
| export type CaptureCallback = (capture: CapturedFrame) => void; | ||
|
|
||
| declare class NativeCapture { | ||
| public constructor(); | ||
| public addCallback(onCaptureCallback: CaptureCallback): void; | ||
| public dispose(): void; | ||
| }; | ||
|
|
||
| export class CaptureSession { | ||
| private readonly nativeCapture: NativeCapture; | ||
|
|
||
| public constructor(onCaptureCallback: CaptureCallback) { | ||
| console.warn(`CaptureSession is experimental and likely to change significantly.`); | ||
| this.nativeCapture = new NativeCapture(); | ||
| this.nativeCapture.addCallback(onCaptureCallback); | ||
| } | ||
|
|
||
| public dispose(): void { | ||
| this.nativeCapture.dispose(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export * from './EngineView'; | ||
| export * from './EngineHook'; | ||
| export * from './NativeCapture'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule BabylonNative
updated
10 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
long term are we planning to have this defined somewhere in Babylon.js?