-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[web-wasm] Refactor to Web Worker (add camera)
- Loading branch information
Showing
44 changed files
with
2,531 additions
and
1,904 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,22 @@ | ||
import type { RegisterInput as CoreRegisterInput } from '@live-compositor/core'; | ||
|
||
export type RegisterInput = | ||
| ({ type: 'mp4' } & RegisterMP4Input) | ||
| { type: 'camera' } | ||
| { type: 'screen_capture' }; | ||
|
||
export type RegisterMP4Input = { | ||
url: string; | ||
}; | ||
|
||
export function intoRegisterInput(input: RegisterInput): CoreRegisterInput { | ||
if (input.type === 'mp4') { | ||
return { type: 'mp4', url: input.url }; | ||
} else if (input.type === 'camera') { | ||
return { type: 'camera' }; | ||
} else if (input.type === 'screen_capture') { | ||
return { type: 'screen_capture' }; | ||
} else { | ||
throw new Error(`Unknown input type ${(input as any).type}`); | ||
} | ||
} |
This file contains 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,24 @@ | ||
import type { Resolution } from '@live-compositor/browser-render'; | ||
import type { RegisterOutput as CoreRegisterOutput } from '@live-compositor/core'; | ||
|
||
export type RegisterOutput = { | ||
type: 'canvas'; | ||
video: { | ||
canvas: HTMLCanvasElement; | ||
resolution: Resolution; | ||
}; | ||
}; | ||
|
||
export function intoRegisterOutput(output: RegisterOutput): CoreRegisterOutput { | ||
if (output.type === 'canvas') { | ||
return { | ||
type: 'canvas', | ||
video: { | ||
resolution: output.video.resolution, | ||
canvas: output.video.canvas.transferControlToOffscreen(), | ||
}, | ||
}; | ||
} else { | ||
throw new Error(`Unknown output type ${(output as any).type}`); | ||
} | ||
} |
File renamed without changes.
This file contains 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,4 +1,3 @@ | ||
import WasmInstance from './manager/wasmInstance'; | ||
import LiveCompositor, { setWasmBundleUrl } from './compositor'; | ||
import LiveCompositor, { setWasmBundleUrl } from './compositor/compositor'; | ||
|
||
export { WasmInstance, LiveCompositor, setWasmBundleUrl }; | ||
export { LiveCompositor, setWasmBundleUrl }; |
55 changes: 0 additions & 55 deletions
55
ts/@live-compositor/web-wasm/src/input/decoder/h264Decoder.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.