Add standalone RustDesk web client (reverse-engineered)
Complete browser-based remote desktop client built from protocol analysis: - Protobuf message definitions (75+ message types, 10 enums) - NaCl encryption (Ed25519 + Curve25519 ECDH + XSalsa20-Poly1305) - WebSocket signaling (hbbs) + relay (hbbr) connection lifecycle - VP8/VP9/AV1 video decoding via ogvjs WASM + yuv-canvas WebGL - Opus audio decoding via libopus WASM + Web Audio API - Full mouse/keyboard input forwarding to protobuf events - Connection dialog, status bar, toolbar, log panel UI Also tracked web_deps (codec libraries) in rustdesk-as-ref/
This commit is contained in:
parent
04d0eac748
commit
7b758ebe01
5555
shelled/rustdesk-as-ref/web_deps/libopus.js
Normal file
5555
shelled/rustdesk-as-ref/web_deps/libopus.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
shelled/rustdesk-as-ref/web_deps/libopus.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/libopus.wasm
Executable file
Binary file not shown.
21
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/COPYING
Normal file
21
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/COPYING
Normal file
@ -0,0 +1,21 @@
|
||||
ogv.js wrapper and player code
|
||||
|
||||
Copyright (c) 2013-2019 Brion Vibber and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@ -0,0 +1,23 @@
|
||||
Copyright © 2018-2019, VideoLAN and dav1d authors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
28
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/COPYING-ogg.txt
Normal file
28
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/COPYING-ogg.txt
Normal file
@ -0,0 +1,28 @@
|
||||
Copyright (c) 2002, Xiph.org Foundation
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@ -0,0 +1,44 @@
|
||||
Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
|
||||
Jean-Marc Valin, Timothy B. Terriberry,
|
||||
CSIRO, Gregory Maxwell, Mark Borgerding,
|
||||
Erik de Castro Lopo
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Internet Society, IETF or IETF Trust, nor the
|
||||
names of specific contributors, may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Opus is subject to the royalty-free patent licenses which are
|
||||
specified at:
|
||||
|
||||
Xiph.Org Foundation:
|
||||
https://datatracker.ietf.org/ipr/1524/
|
||||
|
||||
Microsoft Corporation:
|
||||
https://datatracker.ietf.org/ipr/1914/
|
||||
|
||||
Broadcom Corporation:
|
||||
https://datatracker.ietf.org/ipr/1526/
|
||||
@ -0,0 +1,28 @@
|
||||
Copyright (C) 2002-2009 Xiph.org Foundation
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@ -0,0 +1,28 @@
|
||||
Copyright (c) 2002-2018 Xiph.org Foundation
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@ -0,0 +1,13 @@
|
||||
Copyright © 2010 Mozilla Foundation
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
31
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/LICENSE-vpx.txt
Normal file
31
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/LICENSE-vpx.txt
Normal file
@ -0,0 +1,31 @@
|
||||
Copyright (c) 2010, The WebM Project authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the name of Google, nor the WebM Project, nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
23
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/PATENTS-vpx.txt
Normal file
23
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/PATENTS-vpx.txt
Normal file
@ -0,0 +1,23 @@
|
||||
Additional IP Rights Grant (Patents)
|
||||
------------------------------------
|
||||
|
||||
"These implementations" means the copyrightable works that implement the WebM
|
||||
codecs distributed by Google as part of the WebM Project.
|
||||
|
||||
Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable (except as stated in this section) patent license to
|
||||
make, have made, use, offer to sell, sell, import, transfer, and otherwise
|
||||
run, modify and propagate the contents of these implementations of WebM, where
|
||||
such license applies only to those patent claims, both currently owned by
|
||||
Google and acquired in the future, licensable by Google that are necessarily
|
||||
infringed by these implementations of WebM. This grant does not include claims
|
||||
that would be infringed only as a consequence of further modification of these
|
||||
implementations. If you or your agent or exclusive licensee institute or order
|
||||
or agree to the institution of patent litigation or any other patent
|
||||
enforcement activity against any entity (including a cross-claim or
|
||||
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
||||
or any code incorporated within any of these implementations of WebM
|
||||
constitute direct or contributory patent infringement, or inducement of
|
||||
patent infringement, then any patent rights granted to you under this License
|
||||
for these implementations of WebM shall terminate as of the date such
|
||||
litigation is filed.
|
||||
391
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/README.md
Normal file
391
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/README.md
Normal file
@ -0,0 +1,391 @@
|
||||
ogv.js
|
||||
======
|
||||
|
||||
Media decoder and player for Ogg Vorbis/Opus/Theora and WebM VP8/VP9/AV1 video.
|
||||
|
||||
Based around libogg, libvorbis, libtheora, libopus, libvpx, libnestegg and dav1d compiled to JavaScript and WebAssembly with Emscripten.
|
||||
|
||||
## Updates
|
||||
|
||||
1.8.6 - 2022-01-12
|
||||
* Bump to yuv-canvas
|
||||
* Fix demo for removal of video-canvas mode
|
||||
|
||||
1.8.5 - 2022-01-11
|
||||
* Remove unnecessary user-agent checks
|
||||
* Remove flaky, obsolete support for faking CSS `object-fit`
|
||||
* Remove experimental support for streaming `<canvas>` into `<video>`
|
||||
|
||||
1.8.4 - 2021-07-02
|
||||
* Fix for fix for OGVLoader.base fix
|
||||
|
||||
1.8.3 - 2021-07-02
|
||||
* Fixes for build with emscripten 2.0.25
|
||||
* Fix for nextTick/setImmediate-style polyfill in front-end
|
||||
* Provisional fix for OGVLoader.base not working with CDNs
|
||||
* the fallback code for loading a non-local worker had been broken with WebAssembly for some time, sorry!
|
||||
|
||||
1.8.2 - errored out
|
||||
|
||||
1.8.1 - 2021-02-18
|
||||
* Fixed OGVCompat APIs to correctly return false without WebAssembly and Web Audio
|
||||
|
||||
1.8.0 - 2021-02-09
|
||||
* Dropping IE support and Flash audio backend
|
||||
* Updated to stream-file 0.3.0
|
||||
* Updated to audio-feeder 0.5.0
|
||||
* The old IE 10/11 support _no longer works_ due to the Flash plugin being disabled, and so is being removed
|
||||
* Drop es6-promise shim
|
||||
* Now requires WebAssembly, which requires native Promise support
|
||||
* Build & fixes
|
||||
* Demo fixed (removed test files that are now offline)
|
||||
* Builds with emscripten 2.0.13
|
||||
* Requires latest meson from git pending a fix hitting release
|
||||
|
||||
1.7.0 - 2020-09-28
|
||||
* Builds with emscripten's LLVM upstream backend
|
||||
* Updated to build with emscripten 2.0.4
|
||||
* Reduced amount of memory used between GC runs by reusing frame buffers
|
||||
* Removed `memoryLimit` option
|
||||
* JS, Wasm, and threaded Wasm builds now all use dynamic memory growth
|
||||
* Updated dav1d
|
||||
* Updated libvpx to 1.8.1
|
||||
* Experimental SIMD builds of AV1 decoder optional, with `make SIMD=1`
|
||||
* These work in Chrome with the "WebAssembly SIMD" flag enabled in chrome://flags/
|
||||
* Significant speed boost when available.
|
||||
* Available with and without multithreading.
|
||||
* Must enable explicitly with `simd: true` in `options`.
|
||||
* Experimental SIMD work for VP9 as well, incomplete.
|
||||
|
||||
1.6.1 - 2019-06-18
|
||||
* playbackSpeed attribute now supported
|
||||
* updated audio-feeder to 0.4.21;
|
||||
* mono audio is now less loud, matching native playback better
|
||||
* audio resampling now uses linear interpolation for upscaling
|
||||
* fix for IE in bundling scenarios that use strict mode
|
||||
* tempo change support thanks to a great patch from velochy!
|
||||
* updated yuv-canvas to 1.2.6;
|
||||
* fixes for capturing WebGL canvas as MediaStream
|
||||
* fixes for seeks on low frame rate video
|
||||
* updated emscripten toolchain to 1.38.36
|
||||
* drop OUTLINING_LIMIT from AV1 JS build; doesn't work in newer emscripten and not really needed
|
||||
|
||||
1.6.0 - 2019-02-26
|
||||
* experimental support for AV1 video in WebM
|
||||
* update buildchain to emscripten 1.38.28
|
||||
* fix a stray global
|
||||
* starting to move to ES6 classes and modules
|
||||
* building with babel for ES5/IE11 compat
|
||||
* updated eslint
|
||||
* updated yuv-canvas to 1.2.4; fixes for software GL rendering
|
||||
* updated audio-feeder to 0.4.15; fixes for resampling and Flash perf
|
||||
* retooled buffer copies
|
||||
* sync fix for audio packets with discard padding
|
||||
* clients can pass a custom `StreamFile` instance as `{stream:foo}` in options. This can be useful for custom streaming until MSE interfaces are ready.
|
||||
* refactored WebM keyframe detection
|
||||
* prefill the frame pipeline as well as the audio pipeline before starting audio
|
||||
* removed BINARYEN_IGNORE_IMPLICIT_TRAPS=1 option which can cause intermittent breakages
|
||||
* changed download streaming method to avoid data corruption problem on certain files
|
||||
* fix for seek on very short WebM files
|
||||
* fix for replay-after-end-of-playback in WebM
|
||||
|
||||
See more details and history in [CHANGES.md](https://github.com/brion/ogv.js/blob/master/CHANGES.md)
|
||||
|
||||
## Current status
|
||||
|
||||
Note that as of 2021 ogv.js works pretty nicely but may still have some packagine oddities with tools like webpack. It should work via CDNs again as of 1.8.2 if you can't or don't want to package locally, but this is not documented well yet. Improved documentation will come with the next major update & code cleanup!
|
||||
|
||||
Since August 2015, ogv.js can be seen in action [on Wikipedia and Wikimedia Commons](https://commons.wikimedia.org/wiki/Commons:Video) in Safari and IE/Edge where native Ogg and WebM playback is not available. (See [technical details on MediaWiki integration](https://www.mediawiki.org/wiki/Extension:TimedMediaHandler/ogv.js).)
|
||||
|
||||
See also a standalone demo with performance metrics at https://brionv.com/misc/ogv.js/demo/
|
||||
|
||||
* streaming: yes (with Range header)
|
||||
* seeking: yes for Ogg and WebM (with Range header)
|
||||
* color: yes
|
||||
* audio: yes, with a/v sync (requires Web Audio or Flash)
|
||||
* background threading: yes (video, audio decoders in Workers)
|
||||
* [GPU accelerated drawing: yes (WebGL)](https://github.com/brion/ogv.js/wiki/GPU-acceleration)
|
||||
* GPU accelerated decoding: no
|
||||
* SIMD acceleration: no
|
||||
* Web Assembly: yes (with asm.js fallback)
|
||||
* multithreaded VP8, VP9, AV1: in development (set `options.threading` to `true`; requires flags to be enabled in Firefox 65 and Chrome 72, no support yet in Safari)
|
||||
* controls: no (currently provided by demo or other UI harness)
|
||||
|
||||
Ogg and WebM files are fairly well supported.
|
||||
|
||||
|
||||
## Goals
|
||||
|
||||
Long-form goal is to create a drop-in replacement for the HTML5 video and audio tags which can be used for basic playback of Ogg Theora and Vorbis or WebM media on browsers that don't support Ogg or WebM natively.
|
||||
|
||||
The API isn't quite complete, but works pretty well.
|
||||
|
||||
|
||||
## Compatibility
|
||||
|
||||
ogv.js requires a fast JS engine with typed arrays, and Web Audio for audio playback.
|
||||
|
||||
The primary target browsers are (testing 360p/30fps and up):
|
||||
* Safari 6.1-12 on Mac OS X 10.7-10.14
|
||||
* Safari on iOS 10-11 64-bit
|
||||
|
||||
Older versions of Safari have flaky JIT compilers. IE 9 and below lack typed arrays, and IE 10/11 no longer support an audio channel since the Flash plugin was sunset.
|
||||
|
||||
(Note that Windows and Mac OS X can support Ogg and WebM by installing codecs or alternate browsers with built-in support, but this is not possible on iOS where all browsers are really Safari.)
|
||||
|
||||
Testing browsers (these support .ogv and .webm natively):
|
||||
* Firefox 65
|
||||
* Chrome 73
|
||||
|
||||
|
||||
## Package installation
|
||||
|
||||
Pre-built releases of ogv.js are available as [.zip downloads from the GitHub releases page](https://github.com/brion/ogv.js/releases) and through the npm package manager.
|
||||
|
||||
You can load the `ogv.js` main entry point directly in a script tag, or bundle it through whatever build process you like. The other .js files must be made available for runtime loading, together in the same directory.
|
||||
|
||||
ogv.js will try to auto-detect the path to its resources based on the script element that loads ogv.js or ogv-support.js. If you load ogv.js through another bundler (such as browserify or MediaWiki's ResourceLoader) you may need to override this manually before instantiating players:
|
||||
|
||||
```
|
||||
// Path to ogv-demuxer-ogg.js, ogv-worker-audio.js, etc
|
||||
OGVLoader.base = '/path/to/resources';
|
||||
```
|
||||
|
||||
To fetch from npm:
|
||||
|
||||
```
|
||||
npm install ogv
|
||||
```
|
||||
|
||||
The distribution-ready files will appear in 'node_modules/ogv/dist'.
|
||||
|
||||
To load the player library into your browserify or webpack project:
|
||||
|
||||
```
|
||||
var ogv = require('ogv');
|
||||
|
||||
// Access public classes either as ogv.OGVPlayer or just OGVPlayer.
|
||||
// Your build/lint tools may be happier with ogv.OGVPlayer!
|
||||
ogv.OGVLoader.base = '/path/to/resources';
|
||||
var player = new ogv.OGVPlayer();
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The `OGVPlayer` class implements a player, and supports a subset of the events, properties and methods from [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) and [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement).
|
||||
|
||||
```
|
||||
// Create a new player with the constructor
|
||||
var player = new OGVPlayer();
|
||||
|
||||
// Or with options
|
||||
var player = new OGVPlayer({
|
||||
debug: true,
|
||||
debugFilter: /demuxer/
|
||||
});
|
||||
|
||||
// Now treat it just like a video or audio element
|
||||
containerElement.appendChild(player);
|
||||
player.src = 'path/to/media.ogv';
|
||||
player.play();
|
||||
player.addEventListener('ended', function() {
|
||||
// ta-da!
|
||||
});
|
||||
```
|
||||
|
||||
To check for compatibility before creating a player, include `ogv-support.js` and use the `OGVCompat` API:
|
||||
|
||||
```
|
||||
if (OGVCompat.supported('OGVPlayer')) {
|
||||
// go load the full player from ogv.js and instantiate stuff
|
||||
}
|
||||
```
|
||||
|
||||
This will check for typed arrays, web audio, blacklisted iOS versions, and super-slow/broken JIT compilers.
|
||||
|
||||
If you need a URL versioning/cache-buster parameter for dynamic loading of `ogv.js`, you can use the `OGVVersion` symbol provided by `ogv-support.js` or the even tinier `ogv-version.js`:
|
||||
|
||||
```
|
||||
var script = document.createElement('script');
|
||||
script.src = 'ogv.js?version=' + encodeURIComponent(OGVVersion);
|
||||
document.querySelector('head').appendChild(script);
|
||||
```
|
||||
|
||||
## Distribution notes
|
||||
|
||||
Entry points:
|
||||
* `ogv.js` contains the main runtime classes, including OGVPlayer, OGVLoader, and OGVCompat.
|
||||
* `ogv-support.js` contains the OGVCompat class and OGVVersion symbol, useful for checking for runtime support before loading the main `ogv.js`.
|
||||
* `ogv-version.js` contains only the OGVVersion symbol.
|
||||
|
||||
These entry points may be loaded directly from a script element, or concatenated into a larger project, or otherwise loaded as you like.
|
||||
|
||||
Further code modules are loaded at runtime, which must be available with their defined names together in a directory. If the files are not hosted same-origin to the web page that includes them, you will need to set up appropriate CORS headers to allow loading of the worker JS modules.
|
||||
|
||||
Dynamically loaded assets:
|
||||
* `ogv-worker-audio.js`, `ogv-worker-video.js`, and `*.worker.js` are Worker entry points, used to run video and audio decoders in the background.
|
||||
* `ogv-demuxer-ogg-wasm.js/.wasm` are used in playing .ogg, .oga, and .ogv files.
|
||||
* `ogv-demuxer-webm-wasm.js/.wasm` are used in playing .webm files.
|
||||
* `ogv-decoder-audio-vorbis-wasm.js/.wasm` and `ogv-decoder-audio-opus-wasm.js/.wasm` are used in playing both Ogg and WebM files containing audio.
|
||||
* `ogv-decoder-video-theora-wasm.js/.wasm` are used in playing .ogg and .ogv video files.
|
||||
* `ogv-decoder-video-vp8-wasm.js/.wasm` and `ogv-decoder-video-vp9-wasm.js/.wasm` are used in playing .webm video files.
|
||||
* `*-mt.js/.wasm` are the multithreaded versions of some of the above modules. They have additional support files.
|
||||
|
||||
If you know you will never use particular formats or codecs you can skip bundling them; for instance if you only need to play Ogg files you don't need `ogv-demuxer-webm-wasm.js` or `ogv-decoder-video-vp8-wasm.js` which are only used for WebM.
|
||||
|
||||
|
||||
## Performance
|
||||
|
||||
(This section is somewhat out of date.)
|
||||
|
||||
As of 2015, for SD-or-less resolution basic Ogg Theora decoding speed is reliable on desktop and newer high-end mobile devices; current high-end desktops and laptops can even reach HD resolutions. Older and low-end mobile devices may have difficulty on any but audio and the lowest-resolution video files.
|
||||
|
||||
WebM VP8/VP9 is slower, but works pretty well at a resolution step below Theora.
|
||||
|
||||
AV1 is slower still, and tops out around 360p for single-threaded decoding on a fast desktop or iOS device.
|
||||
|
||||
*Low-res targets*
|
||||
|
||||
I've gotten acceptable performance for Vorbis audio and 160p/15fps Theora files on 32-bit iOS devices: iPhone 4s, iPod Touch 5th-gen and iPad 3. These have difficulty at 240p and above, and just won't keep up with higher resolutions.
|
||||
|
||||
Meanwhile, newer 64-bit iPhones and iPads are comparable to low-end laptops, and videos at 360p and often 480p play acceptably. Since 32-bit and 64-bit iOS devices have the same user-agent, a benchmark must be used to approximately test minimum CPU speed.
|
||||
|
||||
(On iOS, Safari performs significantly better than some alternative browsers that are unable to enable the JIT due to use of the old UIWebView API. Chrome 49 and Firefox for iOS are known to work using the newer WKWebView API internally. Again, a benchmark must be used to detect slow performance, as the browser remains otherwise compatible.)
|
||||
|
||||
|
||||
Windows on 32-bit ARM platforms is similar... IE 11 on Windows RT 8.1 on a Surface tablet (NVidia Tegra 3) does not work (crashes IE), while Edge on Windows 10 Mobile works ok at low resolutions, having trouble starting around 240p.
|
||||
|
||||
|
||||
In both cases, a native application looms as a possibly better alternative. See [OGVKit](https://github.com/brion/OGVKit) and [OgvRt](https://github.com/brion/OgvRT) projects for experiments in those directions.
|
||||
|
||||
|
||||
Note that at these lower resolutions, Vorbis audio and Theora video decoding are about equally expensive operations -- dual-core phones and tablets should be able to eke out a little parallelism here thanks to audio and video being in separate Worker threads.
|
||||
|
||||
|
||||
*WebGL drawing acceleration*
|
||||
|
||||
Accelerated YCbCr->RGB conversion and drawing is done using WebGL on supporting browsers, or through software CPU conversion if not. This is abstracted in the [yuv-canvas](https://github.com/brion/yuv-canvas) package, now separately installable.
|
||||
|
||||
It may be possible to do further acceleration of actual decoding operations using WebGL shaders, but this could be ... tricky. WebGL is also only available on the main thread, and there are no compute shaders yet so would have to use fragment shaders.
|
||||
|
||||
|
||||
## Difficulties
|
||||
|
||||
*Threading*
|
||||
|
||||
Currently the video and audio codecs run in worker threads by default, while the demuxer and player logic run on the UI thread. This seems to work pretty well.
|
||||
|
||||
There is some overhead in extracting data out of each emscripten module's heap and in the thread-to-thread communications, but the parallelism and smoother main thread makes up for it.
|
||||
|
||||
*Streaming download*
|
||||
|
||||
Streaming buffering is done by chunking the requests at up to a megabyte each, using the HTTP Range header. For cross-site playback, this requires CORS setup to whitelist the Range header! Chunks are downloaded as ArrayBuffers, so a chunk must be loaded in full before demuxing or playback can start.
|
||||
|
||||
Old versions of [Safari have a bug with Range headers](https://bugs.webkit.org/show_bug.cgi?id=82672) which is worked around as necessary with a 'cache-busting' URL string parameter.
|
||||
|
||||
|
||||
*Seeking*
|
||||
|
||||
Seeking is implemented via the HTTP Range: header.
|
||||
|
||||
For Ogg files with keyframe indices in a skeleton index, seeking is very fast. Otherwise, a bisection search is used to locate the target frame or audio position, which is very slow over the internet as it creates a lot of short-lived HTTP requests.
|
||||
|
||||
For WebM files with cues, efficient seeking is supported as well as of 1.1.2. WebM files without cues can be seeked in 1.5.5, but inefficiently via linear seek from the beginning. This is fine for small audio-only files, but might be improved for large files with a bisection in future.
|
||||
|
||||
As with chunked streaming, cross-site playback requires CORS support for the Range header.
|
||||
|
||||
|
||||
*Audio output*
|
||||
|
||||
Audio output is handled through the [AudioFeeder](https://github.com/brion/audio-feeder) library, which encapsulates use of Web Audio API:
|
||||
|
||||
Firefox, Safari, Chrome, and Edge support the W3C Web Audio API.
|
||||
|
||||
IE is no longer supported; the workaround using Flash no longer works due to sunsetting of the Flash plugin.
|
||||
|
||||
A/V synchronization is performed on files with both audio and video, and seems to actually work. Yay!
|
||||
|
||||
Note that autoplay with audio doesn't work on iOS Safari due to limitations with starting audio playback from event handlers; if playback is started outside an event handler, the player will hang due to broken audio.
|
||||
|
||||
As of 1.1.1, muting before script-triggered playback allows things to work:
|
||||
|
||||
```
|
||||
player = new OGVPlayer();
|
||||
player.muted = true;
|
||||
player.src = 'path/to/file-with-audio.ogv';
|
||||
player.play();
|
||||
```
|
||||
|
||||
You can then unmute the video in response to a touch or click handler. Alternately if audio is not required, do not include an audio track in the file.
|
||||
|
||||
|
||||
*WebM*
|
||||
|
||||
WebM support was added in June 2015, with some major issues finally worked out in May 2016. Initial VP9 support was added in February 2017. It's pretty stable in production use at Wikipedia and is enabled by default as of October 2015.
|
||||
|
||||
Beware that performance of WebM VP8 is much slower than Ogg Theora, and VP9 is slightly slower still.
|
||||
|
||||
For best WebM decode speed, consider encoding VP8 with "profile 1" (simple deblocking filter) which will sacrifice quality modestly, mainly in high-motion scenes. When encoding with ffmpeg, this is the `-profile:v 1` option to the `libvpx` codec.
|
||||
|
||||
It is also recommended to use the `-slices` option for VP8, or `-tile-columns` for VP9, to maximize ability to use multithreaded decoding when available in the future.
|
||||
|
||||
*AV1*
|
||||
|
||||
WebM files containing the AV1 codec are supported as of 1.6.0 (February 2019) using the [dav1d](https://code.videolan.org/videolan/dav1d) decoder.
|
||||
|
||||
Currently this is experimental, and does not advertise support via `canPlayType`.
|
||||
|
||||
Performance is about 2-3x slower than VP8 or VP9, and may require bumping down a resolution step or two to maintain frame rate. There may be further optimizations that can be done to improve this a bit, but the best improvements will come from future improvements to WebAssembly multithreading and SIMD.
|
||||
|
||||
Currently AV1 in MP4 container is not supported.
|
||||
|
||||
## Upstream library notes
|
||||
|
||||
We've experimented with tremor (libivorbis), an integer-only variant of libvorbis. This actually does *not* decode faster, but does save about 200kb off our generated JavaScript, presumably thanks to not including an encoder in the library. However on slow devices like iPod Touch 5th-generation, it makes a significant negative impact on the decode time so we've gone back to libvorbis.
|
||||
|
||||
The Ogg Skeleton library (libskeleton) is a bit ... unfinished and is slightly modified here.
|
||||
|
||||
libvpx is slightly modified to work around emscripten threading limitations in the VP8 decoder.
|
||||
|
||||
|
||||
## WebAssembly
|
||||
|
||||
WebAssembly (Wasm) builds are used exclusively as of 1.8.0, as Safari's Wasm support is pretty well established now and IE no longer works due to the Flash plugin deprecation.
|
||||
|
||||
|
||||
## Multithreading
|
||||
|
||||
Experimental multithreaded VP8, VP9, and AV1 decoding up to 4 cores is in development, requiring emscripten 1.38.27 to build.
|
||||
|
||||
Multithreading is used only if `options.threading` is true. This requires browser support for the new `SharedArrayBuffer` and `Atomics` APIs, currently available in Firefox and Chrome with experimental flags enabled.
|
||||
|
||||
Threading currently requires WebAssembly; JavaScript builds are possible but perform poorly.
|
||||
|
||||
Speedups will only be noticeable when using the "slices" or "token partitions" option for VP8 encoding, or the "tile columns" option for VP9 encoding.
|
||||
|
||||
If you are making a slim build and will not use the `threading` option, you can leave out the `*-mt.*` files.
|
||||
|
||||
|
||||
## Building JS components
|
||||
|
||||
Building ogv.js is known to work on Mac OS X and Linux (tested Fedora 29 and Ubuntu 18.10 with Meson manually updated).
|
||||
|
||||
1. You will need autoconf, automake, libtool, pkg-config, meson, ninja, and node (nodejs). These can be installed through Homebrew on Mac OS X, or through distribution-specific methods on Linux. For meson, you may need a newer version than your distro packages -- install it manually with `pip3` or from source.
|
||||
2. Install [Emscripten](http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html); currently building with 2.0.13.
|
||||
3. `git submodule update --init`
|
||||
4. Run `npm install` to install build utilities
|
||||
5. Run `make js` to configure and build the libraries and the C wrapper
|
||||
|
||||
|
||||
## Building the demo
|
||||
|
||||
If you did all the setup above, just run `make demo` or `make`. Look in build/demo/ and enjoy!
|
||||
|
||||
|
||||
## License
|
||||
|
||||
libogg, libvorbis, libtheora, libopus, nestegg, libvpx, and dav1d are available under their respective licenses, and the JavaScript and C wrapper code in this repo is licensed under MIT.
|
||||
|
||||
Based on build scripts from https://github.com/devongovett/ogg.js
|
||||
|
||||
See [AUTHORS.md](https://github.com/brion/ogv.js/blob/master/AUTHORS.md) and/or the git history for a list of contributors.
|
||||
@ -0,0 +1,39 @@
|
||||
|
||||
var OGVDecoderAudioOpusW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderAudioOpusW) {
|
||||
OGVDecoderAudioOpusW = OGVDecoderAudioOpusW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderAudioOpusW !== 'undefined' ? OGVDecoderAudioOpusW : {});var g=Object.assign,h,m;a.ready=new Promise(function(b,c){h=b;m=c});var n=a,p=g({},a),q="object"===typeof window,r="function"===typeof importScripts,t="",u,v,w,fs,x,y;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)t=r?require("path").dirname(t)+"/":__dirname+"/",y=function(){x||(fs=require("fs"),x=require("path"))},u=function(b,c){y();b=x.normalize(b);return fs.readFileSync(b,c?null:"utf8")},w=function(b){b=u(b,!0);b.buffer||(b=new Uint8Array(b));return b},v=function(b,c,e){y();b=x.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(q||r)r?t=self.location.href:"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",u=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(w=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),v=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var z=a.printErr||console.warn.bind(console);g(a,p);p=null;var A;a.wasmBinary&&(A=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&B("no native wasm support detected");
|
||||
var C,D=!1,E,F;function G(){var b=C.buffer;E=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=F=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var H,I=[],J=[],K=[];function aa(){var b=a.preRun.shift();I.unshift(b)}var L=0,M=null,N=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function B(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";z(b);D=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");m(b);throw b;}function O(){return P.startsWith("data:application/octet-stream;base64,")}var P;P="ogv-decoder-audio-opus-wasm.wasm";if(!O()){var Q=P;P=a.locateFile?a.locateFile(Q,t):t+Q}function R(){var b=P;try{if(b==P&&A)return new Uint8Array(A);if(w)return w(b);throw"both async and sync fetching of the wasm failed";}catch(c){B(c)}}
|
||||
function ba(){if(!A&&(q||r)){if("function"===typeof fetch&&!P.startsWith("file://"))return fetch(P,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+P+"'";return b.arrayBuffer()}).catch(function(){return R()});if(v)return new Promise(function(b,c){v(P,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return R()})}
|
||||
function S(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.s;"number"===typeof e?void 0===c.o?ca(e)():ca(e)(c.o):e(void 0===c.o?null:c.o)}}}var T=[];function ca(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=H.get(b));return c}
|
||||
var da={a:function(b,c,e){F.copyWithin(b,c,c+e)},b:function(b){var c=F.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{C.grow(Math.min(2147483648,d)-E.byteLength+65535>>>16);G();var f=1;break a}catch(k){}f=void 0}if(f)return!0}return!1},c:function(b,c,e){var d=C.buffer,f=new Uint32Array(d,b,c),k=[];if(0!==b)for(b=0;b<c;b++){var l=f[b];d.slice?(l=d.slice(l,l+4*e),l=new Float32Array(l)):(l=
|
||||
new Float32Array(d,l,e),l=new Float32Array(l));k.push(l)}a.audioBuffer=k},d:function(b,c){a.audioFormat={channels:b,rate:c};a.loadedMetadata=!0}};
|
||||
(function(){function b(f){a.asm=f.exports;C=a.asm.e;G();H=a.asm.m;J.unshift(a.asm.f);L--;a.monitorRunDependencies&&a.monitorRunDependencies(L);0==L&&(null!==M&&(clearInterval(M),M=null),N&&(f=N,N=null,f()))}function c(f){b(f.instance)}function e(f){return ba().then(function(k){return WebAssembly.instantiate(k,d)}).then(function(k){return k}).then(f,function(k){z("failed to asynchronously prepare wasm: "+k);B(k)})}var d={a:da};L++;a.monitorRunDependencies&&a.monitorRunDependencies(L);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return z("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return A||"function"!==typeof WebAssembly.instantiateStreaming||O()||P.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(P,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(k){z("wasm streaming compile failed: "+k);z("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(m);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.f).apply(null,arguments)};a._ogv_audio_decoder_init=function(){return(a._ogv_audio_decoder_init=a.asm.g).apply(null,arguments)};a._ogv_audio_decoder_process_header=function(){return(a._ogv_audio_decoder_process_header=a.asm.h).apply(null,arguments)};a._ogv_audio_decoder_process_audio=function(){return(a._ogv_audio_decoder_process_audio=a.asm.i).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.j).apply(null,arguments)};
|
||||
a._free=function(){return(a._free=a.asm.k).apply(null,arguments)};a._ogv_audio_decoder_destroy=function(){return(a._ogv_audio_decoder_destroy=a.asm.l).apply(null,arguments)};var U;N=function ea(){U||V();U||(N=ea)};
|
||||
function V(){function b(){if(!U&&(U=!0,a.calledRun=!0,!D)){S(J);h(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();K.unshift(c)}S(K)}}if(!(0<L)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)aa();S(I);0<L||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=V;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();V();var W,X;function fa(b){if(W&&X>=b)return W;W&&a._free(W);X=b;return W=a._malloc(X)}var Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!n.audioFormat;a.audioFormat=n.audioFormat||null;a.audioBuffer=null;a.cpuTime=0;
|
||||
Object.defineProperty(a,"processing",{get:function(){return!1}});a.init=function(b){Z(function(){a._ogv_audio_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength,f=fa(d);(new Uint8Array(C.buffer,f,d)).set(new Uint8Array(b));return a._ogv_audio_decoder_process_header(f,d)});c(e)};a.processAudio=function(b,c){var e=Z(function(){var d=b.byteLength,f=fa(d);(new Uint8Array(C.buffer,f,d)).set(new Uint8Array(b));return a._ogv_audio_decoder_process_audio(f,d)});c(e)};
|
||||
a.close=function(){};
|
||||
|
||||
|
||||
return OGVDecoderAudioOpusW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderAudioOpusW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderAudioOpusW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderAudioOpusW"] = OGVDecoderAudioOpusW;
|
||||
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-audio-opus-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-audio-opus-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1,40 @@
|
||||
|
||||
var OGVDecoderAudioVorbisW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderAudioVorbisW) {
|
||||
OGVDecoderAudioVorbisW = OGVDecoderAudioVorbisW || {};
|
||||
|
||||
|
||||
var b;b||(b=typeof OGVDecoderAudioVorbisW !== 'undefined' ? OGVDecoderAudioVorbisW : {});var g=Object.assign,h,m;b.ready=new Promise(function(a,c){h=a;m=c});var n=b,p=g({},b),q=(a,c)=>{throw c;},r="object"===typeof window,t="function"===typeof importScripts,u="",v,w,x,fs,y,z;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)u=t?require("path").dirname(u)+"/":__dirname+"/",z=function(){y||(fs=require("fs"),y=require("path"))},v=function(a,c){z();a=y.normalize(a);return fs.readFileSync(a,c?null:"utf8")},x=function(a){a=v(a,!0);a.buffer||(a=new Uint8Array(a));return a},w=function(a,c,e){z();a=y.normalize(a);fs.readFile(a,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(a){throw a;}),q=(a,c)=>{if(noExitRuntime||0<A)throw process.exitCode=a,c;c instanceof B||C("exiting due to exception: "+c);process.exit(a)},b.inspect=function(){return"[Emscripten Module object]"};else if(r||t)t?u=self.location.href:"undefined"!==typeof document&&document.currentScript&&(u=document.currentScript.src),_scriptDir&&(u=_scriptDir),0!==u.indexOf("blob:")?u=u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):u="",v=function(a){var c=new XMLHttpRequest;
|
||||
c.open("GET",a,!1);c.send(null);return c.responseText},t&&(x=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),w=function(a,c,e){var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};b.print||console.log.bind(console);var C=b.printErr||console.warn.bind(console);g(b,p);p=null;b.quit&&(q=b.quit);
|
||||
var D;b.wasmBinary&&(D=b.wasmBinary);var noExitRuntime=b.noExitRuntime||!0;"object"!==typeof WebAssembly&&E("no native wasm support detected");var F,G=!1,H,I;function J(){var a=F.buffer;H=a;b.HEAP8=new Int8Array(a);b.HEAP16=new Int16Array(a);b.HEAP32=new Int32Array(a);b.HEAPU8=I=new Uint8Array(a);b.HEAPU16=new Uint16Array(a);b.HEAPU32=new Uint32Array(a);b.HEAPF32=new Float32Array(a);b.HEAPF64=new Float64Array(a)}var K,L=[],M=[],N=[],A=0;function aa(){var a=b.preRun.shift();L.unshift(a)}
|
||||
var O=0,P=null,Q=null;b.preloadedImages={};b.preloadedAudios={};function E(a){if(b.onAbort)b.onAbort(a);a="Aborted("+a+")";C(a);G=!0;a=new WebAssembly.RuntimeError(a+". Build with -s ASSERTIONS=1 for more info.");m(a);throw a;}function ba(){return R.startsWith("data:application/octet-stream;base64,")}var R;R="ogv-decoder-audio-vorbis-wasm.wasm";if(!ba()){var ca=R;R=b.locateFile?b.locateFile(ca,u):u+ca}
|
||||
function da(){var a=R;try{if(a==R&&D)return new Uint8Array(D);if(x)return x(a);throw"both async and sync fetching of the wasm failed";}catch(c){E(c)}}
|
||||
function ea(){if(!D&&(r||t)){if("function"===typeof fetch&&!R.startsWith("file://"))return fetch(R,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+R+"'";return a.arrayBuffer()}).catch(function(){return da()});if(w)return new Promise(function(a,c){w(R,function(e){a(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return da()})}
|
||||
function S(a){for(;0<a.length;){var c=a.shift();if("function"==typeof c)c(b);else{var e=c.s;"number"===typeof e?void 0===c.o?fa(e)():fa(e)(c.o):e(void 0===c.o?null:c.o)}}}var T=[];function fa(a){var c=T[a];c||(a>=T.length&&(T.length=a+1),T[a]=c=K.get(a));return c}
|
||||
var ha={a:function(a,c,e){I.copyWithin(a,c,c+e)},b:function(a){var c=I.length;a>>>=0;if(2147483648<a)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,a+100663296);d=Math.max(a,d);0<d%65536&&(d+=65536-d%65536);a:{try{F.grow(Math.min(2147483648,d)-H.byteLength+65535>>>16);J();var f=1;break a}catch(k){}f=void 0}if(f)return!0}return!1},c:function(a){if(!(noExitRuntime||0<A)){if(b.onExit)b.onExit(a);G=!0}q(a,new B(a))},d:function(a,c,e){var d=F.buffer,f=new Uint32Array(d,a,c),k=[];if(0!==
|
||||
a)for(a=0;a<c;a++){var l=f[a];d.slice?(l=d.slice(l,l+4*e),l=new Float32Array(l)):(l=new Float32Array(d,l,e),l=new Float32Array(l));k.push(l)}b.audioBuffer=k},e:function(a,c){b.audioFormat={channels:a,rate:c};b.loadedMetadata=!0}};
|
||||
(function(){function a(f){b.asm=f.exports;F=b.asm.f;J();K=b.asm.n;M.unshift(b.asm.g);O--;b.monitorRunDependencies&&b.monitorRunDependencies(O);0==O&&(null!==P&&(clearInterval(P),P=null),Q&&(f=Q,Q=null,f()))}function c(f){a(f.instance)}function e(f){return ea().then(function(k){return WebAssembly.instantiate(k,d)}).then(function(k){return k}).then(f,function(k){C("failed to asynchronously prepare wasm: "+k);E(k)})}var d={a:ha};O++;b.monitorRunDependencies&&b.monitorRunDependencies(O);if(b.instantiateWasm)try{return b.instantiateWasm(d,
|
||||
a)}catch(f){return C("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return D||"function"!==typeof WebAssembly.instantiateStreaming||ba()||R.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(R,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(k){C("wasm streaming compile failed: "+k);C("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(m);return{}})();
|
||||
b.___wasm_call_ctors=function(){return(b.___wasm_call_ctors=b.asm.g).apply(null,arguments)};b._ogv_audio_decoder_init=function(){return(b._ogv_audio_decoder_init=b.asm.h).apply(null,arguments)};b._ogv_audio_decoder_process_header=function(){return(b._ogv_audio_decoder_process_header=b.asm.i).apply(null,arguments)};b._ogv_audio_decoder_process_audio=function(){return(b._ogv_audio_decoder_process_audio=b.asm.j).apply(null,arguments)};
|
||||
b._ogv_audio_decoder_destroy=function(){return(b._ogv_audio_decoder_destroy=b.asm.k).apply(null,arguments)};b._malloc=function(){return(b._malloc=b.asm.l).apply(null,arguments)};b._free=function(){return(b._free=b.asm.m).apply(null,arguments)};var U;function B(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}Q=function ia(){U||V();U||(Q=ia)};
|
||||
function V(){function a(){if(!U&&(U=!0,b.calledRun=!0,!G)){S(M);h(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();N.unshift(c)}S(N)}}if(!(0<O)){if(b.preRun)for("function"==typeof b.preRun&&(b.preRun=[b.preRun]);b.preRun.length;)aa();S(L);0<O||(b.setStatus?(b.setStatus("Running..."),setTimeout(function(){setTimeout(function(){b.setStatus("")},1);a()},1)):a())}}b.run=V;
|
||||
if(b.preInit)for("function"==typeof b.preInit&&(b.preInit=[b.preInit]);0<b.preInit.length;)b.preInit.pop()();V();var W,X;function ja(a){if(W&&X>=a)return W;W&&b._free(W);X=a;return W=b._malloc(X)}var Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(a){var c=Y();a=a();b.cpuTime+=Y()-c;return a}b.loadedMetadata=!!n.audioFormat;b.audioFormat=n.audioFormat||null;b.audioBuffer=null;b.cpuTime=0;
|
||||
Object.defineProperty(b,"processing",{get:function(){return!1}});b.init=function(a){Z(function(){b._ogv_audio_decoder_init()});a()};b.processHeader=function(a,c){var e=Z(function(){var d=a.byteLength,f=ja(d);(new Uint8Array(F.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_header(f,d)});c(e)};b.processAudio=function(a,c){var e=Z(function(){var d=a.byteLength,f=ja(d);(new Uint8Array(F.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_audio(f,d)});c(e)};
|
||||
b.close=function(){};
|
||||
|
||||
|
||||
return OGVDecoderAudioVorbisW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderAudioVorbisW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderAudioVorbisW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderAudioVorbisW"] = OGVDecoderAudioVorbisW;
|
||||
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-audio-vorbis-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-audio-vorbis-wasm.wasm
Executable file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-av1-mt-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-av1-mt-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoAV1MTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoAV1SIMDMTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
@ -0,0 +1,43 @@
|
||||
|
||||
var OGVDecoderVideoAV1SIMDW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoAV1SIMDW) {
|
||||
OGVDecoderVideoAV1SIMDW = OGVDecoderVideoAV1SIMDW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoAV1SIMDW !== 'undefined' ? OGVDecoderVideoAV1SIMDW : {});var aa=Object.assign,ba,q;a.ready=new Promise(function(b,c){ba=b;q=c});var ca=a,da=aa({},a),ea="object"===typeof window,r="function"===typeof importScripts,A="",fa,F,G,fs,I,ha;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)A=r?require("path").dirname(A)+"/":__dirname+"/",ha=function(){I||(fs=require("fs"),I=require("path"))},fa=function(b,c){ha();b=I.normalize(b);return fs.readFileSync(b,c?null:"utf8")},G=function(b){b=fa(b,!0);b.buffer||(b=new Uint8Array(b));return b},F=function(b,c,e){ha();b=I.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),
|
||||
process.argv.slice(2),process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ea||r)r?A=self.location.href:"undefined"!==typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),0!==A.indexOf("blob:")?A=A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):A="",fa=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(G=function(b){var c=new XMLHttpRequest;
|
||||
c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),F=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};var ia=a.print||console.log.bind(console),J=a.printErr||console.warn.bind(console);aa(a,da);da=null;var K;a.wasmBinary&&(K=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&M("no native wasm support detected");
|
||||
var N,ja=!1,ka="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0,la,O,P;function ma(){var b=N.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=P=new Int32Array(b);a.HEAPU8=O=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var na,oa=[],pa=[],qa=[];function ra(){var b=a.preRun.shift();oa.unshift(b)}var Q=0,sa=null,R=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function M(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";J(b);ja=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");q(b);throw b;}function ta(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-av1-simd-wasm.wasm";if(!ta()){var ua=S;S=a.locateFile?a.locateFile(ua,A):A+ua}function va(){var b=S;try{if(b==S&&K)return new Uint8Array(K);if(G)return G(b);throw"both async and sync fetching of the wasm failed";}catch(c){M(c)}}
|
||||
function wa(){if(!K&&(ea||r)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return va()});if(F)return new Promise(function(b,c){F(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return va()})}
|
||||
function xa(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.B;"number"===typeof e?void 0===c.s?Ja(e)():Ja(e)(c.s):e(void 0===c.s?null:c.s)}}}var T=[];function Ja(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=na.get(b));return c}
|
||||
var Ka=[null,[],[]],La={b:function(){M("")},d:function(b,c,e){O.copyWithin(b,c,c+e)},e:function(b){var c=O.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{N.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);ma();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},f:function(){return 0},c:function(){},a:function(b,c,e,d){for(var f=0,g=0;g<e;g++){var x=P[c>>2],u=P[c+4>>2];c+=8;for(var y=
|
||||
0;y<u;y++){var n=O[x+y],w=Ka[b];if(0===n||10===n){n=1===b?ia:J;var l=w;for(var p=0,t=p+NaN,v=p;l[v]&&!(v>=t);)++v;if(16<v-p&&l.subarray&&ka)l=ka.decode(l.subarray(p,v));else{for(t="";p<v;){var h=l[p++];if(h&128){var B=l[p++]&63;if(192==(h&224))t+=String.fromCharCode((h&31)<<6|B);else{var U=l[p++]&63;h=224==(h&240)?(h&15)<<12|B<<6|U:(h&7)<<18|B<<12|U<<6|l[p++]&63;65536>h?t+=String.fromCharCode(h):(h-=65536,t+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else t+=String.fromCharCode(h)}l=t}n(l);w.length=
|
||||
0}else w.push(n)}f+=u}P[d>>2]=f;return 0},g:function(b,c,e,d,f,g,x,u,y,n,w,l,p,t,v,h){function B(H,k,C,ya,za,Aa,Na,Oa,V){H.set(new Uint8Array(U,k,C*ya));var D,z;for(D=z=0;D<Aa;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;for(;D<Aa+Oa;D++,z+=C){for(k=0;k<za;k++)H[z+k]=V;for(k=za+Na;k<C;k++)H[z+k]=V}for(;D<ya;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;return H}var U=N.buffer,m=a.videoFormat,Ba=(p&-2)*y/x,Ca=(t&-2)*n/u,Da=w*y/x,Ea=l*n/u;w===m.cropWidth&&l===m.cropHeight&&(v=m.displayWidth,h=m.displayHeight);for(var Fa=
|
||||
a.recycledFrames,E,Ga=u*c,Ha=n*d,Ia=n*g;0<Fa.length;){var L=Fa.shift();m=L.format;if(m.width===x&&m.height===u&&m.chromaWidth===y&&m.chromaHeight===n&&m.cropLeft===p&&m.cropTop===t&&m.cropWidth===w&&m.cropHeight===l&&m.displayWidth===v&&m.displayHeight===h&&L.y.bytes.length===Ga&&L.u.bytes.length===Ha&&L.v.bytes.length===Ia){E=L;break}}E||(E={format:{width:x,height:u,chromaWidth:y,chromaHeight:n,cropLeft:p,cropTop:t,cropWidth:w,cropHeight:l,displayWidth:v,displayHeight:h},y:{bytes:new Uint8Array(Ga),
|
||||
stride:c},u:{bytes:new Uint8Array(Ha),stride:d},v:{bytes:new Uint8Array(Ia),stride:g}});B(E.y.bytes,b,c,u,p,t,w,l,0);B(E.u.bytes,e,d,n,Ba,Ca,Da,Ea,128);B(E.v.bytes,f,g,n,Ba,Ca,Da,Ea,128);a.frameBuffer=E}};
|
||||
(function(){function b(f){a.asm=f.exports;N=a.asm.h;ma();na=a.asm.p;pa.unshift(a.asm.i);Q--;a.monitorRunDependencies&&a.monitorRunDependencies(Q);0==Q&&(null!==sa&&(clearInterval(sa),sa=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return wa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){J("failed to asynchronously prepare wasm: "+g);M(g)})}var d={a:La};Q++;a.monitorRunDependencies&&a.monitorRunDependencies(Q);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return J("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return K||"function"!==typeof WebAssembly.instantiateStreaming||ta()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){J("wasm streaming compile failed: "+g);J("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(q);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.i).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.k).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.l).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.m).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.n).apply(null,arguments)};a._free=function(){return(a._free=a.asm.o).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.q).apply(null,arguments)};var W;R=function Ma(){W||Pa();W||(R=Ma)};
|
||||
function Pa(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ja)){xa(pa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();qa.unshift(c)}xa(qa)}}if(!(0<Q)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)ra();xa(oa);0<Q||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Pa;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Pa();var X,Qa,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Qa>=d||(X&&a._free(X),Qa=d,X=a._malloc(Qa));var f=X;(new Uint8Array(N.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.A=[];
|
||||
a.processFrame=function(b,c){function e(u){a._free(g);c(u)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.A.push(e);var x=Z(function(){(new Uint8Array(N.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(x)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.A.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoAV1SIMDW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoAV1SIMDW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoAV1SIMDW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoAV1SIMDW"] = OGVDecoderVideoAV1SIMDW;
|
||||
Binary file not shown.
@ -0,0 +1,43 @@
|
||||
|
||||
var OGVDecoderVideoAV1W = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoAV1W) {
|
||||
OGVDecoderVideoAV1W = OGVDecoderVideoAV1W || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoAV1W !== 'undefined' ? OGVDecoderVideoAV1W : {});var aa=Object.assign,ba,q;a.ready=new Promise(function(b,c){ba=b;q=c});var ca=a,da=aa({},a),ea="object"===typeof window,r="function"===typeof importScripts,A="",fa,F,G,fs,I,ha;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)A=r?require("path").dirname(A)+"/":__dirname+"/",ha=function(){I||(fs=require("fs"),I=require("path"))},fa=function(b,c){ha();b=I.normalize(b);return fs.readFileSync(b,c?null:"utf8")},G=function(b){b=fa(b,!0);b.buffer||(b=new Uint8Array(b));return b},F=function(b,c,e){ha();b=I.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),
|
||||
process.argv.slice(2),process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ea||r)r?A=self.location.href:"undefined"!==typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),0!==A.indexOf("blob:")?A=A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):A="",fa=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(G=function(b){var c=new XMLHttpRequest;
|
||||
c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),F=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};var ia=a.print||console.log.bind(console),J=a.printErr||console.warn.bind(console);aa(a,da);da=null;var K;a.wasmBinary&&(K=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&M("no native wasm support detected");
|
||||
var N,ja=!1,ka="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0,la,O,P;function ma(){var b=N.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=P=new Int32Array(b);a.HEAPU8=O=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var na,oa=[],pa=[],qa=[];function ra(){var b=a.preRun.shift();oa.unshift(b)}var Q=0,sa=null,R=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function M(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";J(b);ja=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");q(b);throw b;}function ta(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-av1-wasm.wasm";if(!ta()){var ua=S;S=a.locateFile?a.locateFile(ua,A):A+ua}function va(){var b=S;try{if(b==S&&K)return new Uint8Array(K);if(G)return G(b);throw"both async and sync fetching of the wasm failed";}catch(c){M(c)}}
|
||||
function wa(){if(!K&&(ea||r)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return va()});if(F)return new Promise(function(b,c){F(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return va()})}
|
||||
function xa(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.B;"number"===typeof e?void 0===c.s?Ja(e)():Ja(e)(c.s):e(void 0===c.s?null:c.s)}}}var T=[];function Ja(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=na.get(b));return c}
|
||||
var Ka=[null,[],[]],La={f:function(){M("")},c:function(b,c,e){O.copyWithin(b,c,c+e)},d:function(b){var c=O.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{N.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);ma();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},e:function(){return 0},b:function(){},a:function(b,c,e,d){for(var f=0,g=0;g<e;g++){var x=P[c>>2],u=P[c+4>>2];c+=8;for(var y=
|
||||
0;y<u;y++){var n=O[x+y],w=Ka[b];if(0===n||10===n){n=1===b?ia:J;var l=w;for(var p=0,t=p+NaN,v=p;l[v]&&!(v>=t);)++v;if(16<v-p&&l.subarray&&ka)l=ka.decode(l.subarray(p,v));else{for(t="";p<v;){var h=l[p++];if(h&128){var B=l[p++]&63;if(192==(h&224))t+=String.fromCharCode((h&31)<<6|B);else{var U=l[p++]&63;h=224==(h&240)?(h&15)<<12|B<<6|U:(h&7)<<18|B<<12|U<<6|l[p++]&63;65536>h?t+=String.fromCharCode(h):(h-=65536,t+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else t+=String.fromCharCode(h)}l=t}n(l);w.length=
|
||||
0}else w.push(n)}f+=u}P[d>>2]=f;return 0},g:function(b,c,e,d,f,g,x,u,y,n,w,l,p,t,v,h){function B(H,k,C,ya,za,Aa,Na,Oa,V){H.set(new Uint8Array(U,k,C*ya));var D,z;for(D=z=0;D<Aa;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;for(;D<Aa+Oa;D++,z+=C){for(k=0;k<za;k++)H[z+k]=V;for(k=za+Na;k<C;k++)H[z+k]=V}for(;D<ya;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;return H}var U=N.buffer,m=a.videoFormat,Ba=(p&-2)*y/x,Ca=(t&-2)*n/u,Da=w*y/x,Ea=l*n/u;w===m.cropWidth&&l===m.cropHeight&&(v=m.displayWidth,h=m.displayHeight);for(var Fa=
|
||||
a.recycledFrames,E,Ga=u*c,Ha=n*d,Ia=n*g;0<Fa.length;){var L=Fa.shift();m=L.format;if(m.width===x&&m.height===u&&m.chromaWidth===y&&m.chromaHeight===n&&m.cropLeft===p&&m.cropTop===t&&m.cropWidth===w&&m.cropHeight===l&&m.displayWidth===v&&m.displayHeight===h&&L.y.bytes.length===Ga&&L.u.bytes.length===Ha&&L.v.bytes.length===Ia){E=L;break}}E||(E={format:{width:x,height:u,chromaWidth:y,chromaHeight:n,cropLeft:p,cropTop:t,cropWidth:w,cropHeight:l,displayWidth:v,displayHeight:h},y:{bytes:new Uint8Array(Ga),
|
||||
stride:c},u:{bytes:new Uint8Array(Ha),stride:d},v:{bytes:new Uint8Array(Ia),stride:g}});B(E.y.bytes,b,c,u,p,t,w,l,0);B(E.u.bytes,e,d,n,Ba,Ca,Da,Ea,128);B(E.v.bytes,f,g,n,Ba,Ca,Da,Ea,128);a.frameBuffer=E}};
|
||||
(function(){function b(f){a.asm=f.exports;N=a.asm.h;ma();na=a.asm.p;pa.unshift(a.asm.i);Q--;a.monitorRunDependencies&&a.monitorRunDependencies(Q);0==Q&&(null!==sa&&(clearInterval(sa),sa=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return wa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){J("failed to asynchronously prepare wasm: "+g);M(g)})}var d={a:La};Q++;a.monitorRunDependencies&&a.monitorRunDependencies(Q);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return J("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return K||"function"!==typeof WebAssembly.instantiateStreaming||ta()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){J("wasm streaming compile failed: "+g);J("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(q);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.i).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.k).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.l).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.m).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.n).apply(null,arguments)};a._free=function(){return(a._free=a.asm.o).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.q).apply(null,arguments)};var W;R=function Ma(){W||Pa();W||(R=Ma)};
|
||||
function Pa(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ja)){xa(pa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();qa.unshift(c)}xa(qa)}}if(!(0<Q)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)ra();xa(oa);0<Q||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Pa;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Pa();var X,Qa,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Qa>=d||(X&&a._free(X),Qa=d,X=a._malloc(Qa));var f=X;(new Uint8Array(N.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.A=[];
|
||||
a.processFrame=function(b,c){function e(u){a._free(g);c(u)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.A.push(e);var x=Z(function(){(new Uint8Array(N.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(x)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.A.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoAV1W.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoAV1W;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoAV1W; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoAV1W"] = OGVDecoderVideoAV1W;
|
||||
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-av1-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-av1-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1,42 @@
|
||||
|
||||
var OGVDecoderVideoTheoraW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoTheoraW) {
|
||||
OGVDecoderVideoTheoraW = OGVDecoderVideoTheoraW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoTheoraW !== 'undefined' ? OGVDecoderVideoTheoraW : {});var ca=Object.assign,da,l;a.ready=new Promise(function(b,c){da=b;l=c});var ea=a,fa=ca({},a),ha="object"===typeof window,m="function"===typeof importScripts,t="",y,B,C,fs,D,E;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)t=m?require("path").dirname(t)+"/":__dirname+"/",E=function(){D||(fs=require("fs"),D=require("path"))},y=function(b,c){E();b=D.normalize(b);return fs.readFileSync(b,c?null:"utf8")},C=function(b){b=y(b,!0);b.buffer||(b=new Uint8Array(b));return b},B=function(b,c,e){E();b=D.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ha||m)m?t=self.location.href:"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",y=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},m&&(C=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),B=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var H=a.printErr||console.warn.bind(console);ca(a,fa);fa=null;var I;a.wasmBinary&&(I=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&J("no native wasm support detected");
|
||||
var K,ia=!1,ja,L;function ka(){var b=K.buffer;ja=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=L=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var la,ma=[],na=[],oa=[];function pa(){var b=a.preRun.shift();ma.unshift(b)}var P=0,Q=null,R=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function J(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";H(b);ia=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");l(b);throw b;}function qa(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-theora-wasm.wasm";if(!qa()){var ra=S;S=a.locateFile?a.locateFile(ra,t):t+ra}function sa(){var b=S;try{if(b==S&&I)return new Uint8Array(I);if(C)return C(b);throw"both async and sync fetching of the wasm failed";}catch(c){J(c)}}
|
||||
function ta(){if(!I&&(ha||m)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return sa()});if(B)return new Promise(function(b,c){B(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return sa()})}
|
||||
function T(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.A;"number"===typeof e?void 0===c.o?ua(e)():ua(e)(c.o):e(void 0===c.o?null:c.o)}}}var U=[];function ua(b){var c=U[b];c||(b>=U.length&&(U.length=b+1),U[b]=c=la.get(b));return c}
|
||||
var Ga={a:function(b,c,e){L.copyWithin(b,c,c+e)},b:function(b){var c=L.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{K.grow(Math.min(2147483648,d)-ja.byteLength+65535>>>16);ka();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},c:function(b,c,e,d,f,g,q,n,z,p,u,F,M,N,Z,aa){function ba(A,h,v,va,wa,xa,Ia,Ja,O){A.set(new Uint8Array(Ka,h,v*va));var w,r;for(w=r=0;w<xa;w++,r+=v)for(h=
|
||||
0;h<v;h++)A[r+h]=O;for(;w<xa+Ja;w++,r+=v){for(h=0;h<wa;h++)A[r+h]=O;for(h=wa+Ia;h<v;h++)A[r+h]=O}for(;w<va;w++,r+=v)for(h=0;h<v;h++)A[r+h]=O;return A}var Ka=K.buffer,k=a.videoFormat,ya=(M&-2)*z/q,za=(N&-2)*p/n,Aa=u*z/q,Ba=F*p/n;u===k.cropWidth&&F===k.cropHeight&&(Z=k.displayWidth,aa=k.displayHeight);for(var Ca=a.recycledFrames,x,Da=n*c,Ea=p*d,Fa=p*g;0<Ca.length;){var G=Ca.shift();k=G.format;if(k.width===q&&k.height===n&&k.chromaWidth===z&&k.chromaHeight===p&&k.cropLeft===M&&k.cropTop===N&&k.cropWidth===
|
||||
u&&k.cropHeight===F&&k.displayWidth===Z&&k.displayHeight===aa&&G.y.bytes.length===Da&&G.u.bytes.length===Ea&&G.v.bytes.length===Fa){x=G;break}}x||(x={format:{width:q,height:n,chromaWidth:z,chromaHeight:p,cropLeft:M,cropTop:N,cropWidth:u,cropHeight:F,displayWidth:Z,displayHeight:aa},y:{bytes:new Uint8Array(Da),stride:c},u:{bytes:new Uint8Array(Ea),stride:d},v:{bytes:new Uint8Array(Fa),stride:g}});ba(x.y.bytes,b,c,n,M,N,u,F,0);ba(x.u.bytes,e,d,p,ya,za,Aa,Ba,128);ba(x.v.bytes,f,g,p,ya,za,Aa,Ba,128);
|
||||
a.frameBuffer=x},d:function(b,c,e,d,f,g,q,n,z,p,u){a.videoFormat={width:b,height:c,chromaWidth:e,chromaHeight:d,cropLeft:n,cropTop:z,cropWidth:g,cropHeight:q,displayWidth:p,displayHeight:u,fps:f};a.loadedMetadata=!0}};
|
||||
(function(){function b(f){a.asm=f.exports;K=a.asm.e;ka();la=a.asm.n;na.unshift(a.asm.f);P--;a.monitorRunDependencies&&a.monitorRunDependencies(P);0==P&&(null!==Q&&(clearInterval(Q),Q=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return ta().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){H("failed to asynchronously prepare wasm: "+g);J(g)})}var d={a:Ga};P++;a.monitorRunDependencies&&a.monitorRunDependencies(P);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return H("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return I||"function"!==typeof WebAssembly.instantiateStreaming||qa()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){H("wasm streaming compile failed: "+g);H("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(l);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.f).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.g).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.h).apply(null,arguments)};a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.i).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.k).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.l).apply(null,arguments)};a._free=function(){return(a._free=a.asm.m).apply(null,arguments)};var V;R=function Ha(){V||La();V||(R=Ha)};
|
||||
function La(){function b(){if(!V&&(V=!0,a.calledRun=!0,!ia)){T(na);da(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();oa.unshift(c)}T(oa)}}if(!(0<P)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)pa();T(ma);0<P||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=La;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();La();var W,Ma,X;"undefined"===typeof performance||"undefined"===typeof performance.now?X=Date.now:X=performance.now.bind(performance);function Y(b){var c=X();b=b();a.cpuTime+=X()-c;return b}a.loadedMetadata=!!ea.videoFormat;a.videoFormat=ea.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Y(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Y(function(){var d=b.byteLength;W&&Ma>=d||(W&&a._free(W),Ma=d,W=a._malloc(Ma));var f=W;(new Uint8Array(K.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.s=[];
|
||||
a.processFrame=function(b,c){function e(n){a._free(g);c(n)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.s.push(e);var q=Y(function(){(new Uint8Array(K.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(q)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.s.push(function(){}),Y(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoTheoraW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoTheoraW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoTheoraW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoTheoraW"] = OGVDecoderVideoTheoraW;
|
||||
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-theora-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-theora-wasm.wasm
Executable file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-vp8-mt-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-vp8-mt-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoVP8MTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
@ -0,0 +1,44 @@
|
||||
|
||||
var OGVDecoderVideoVP8W = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoVP8W) {
|
||||
OGVDecoderVideoVP8W = OGVDecoderVideoVP8W || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoVP8W !== 'undefined' ? OGVDecoderVideoVP8W : {});var aa=Object.assign,ba,n;a.ready=new Promise(function(b,c){ba=b;n=c});var ca=a,ha=aa({},a),ia="object"===typeof window,p="function"===typeof importScripts,t="",x,y,A,fs,B,C;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)t=p?require("path").dirname(t)+"/":__dirname+"/",C=function(){B||(fs=require("fs"),B=require("path"))},x=function(b,c){C();b=B.normalize(b);return fs.readFileSync(b,c?null:"utf8")},A=function(b){b=x(b,!0);b.buffer||(b=new Uint8Array(b));return b},y=function(b,c,e){C();b=B.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ia||p)p?t=self.location.href:"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",x=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},p&&(A=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),y=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var D=a.printErr||console.warn.bind(console);aa(a,ha);ha=null;var ja=0,E;a.wasmBinary&&(E=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&F("no native wasm support detected");
|
||||
var G,ka=!1,la,ma;function na(){var b=G.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=ma=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var oa,pa=[],qa=[],ra=[];function sa(){var b=a.preRun.shift();pa.unshift(b)}var K=0,ta=null,L=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function F(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";D(b);ka=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");n(b);throw b;}function ua(){return M.startsWith("data:application/octet-stream;base64,")}var M;M="ogv-decoder-video-vp8-wasm.wasm";if(!ua()){var va=M;M=a.locateFile?a.locateFile(va,t):t+va}function wa(){var b=M;try{if(b==M&&E)return new Uint8Array(E);if(A)return A(b);throw"both async and sync fetching of the wasm failed";}catch(c){F(c)}}
|
||||
function xa(){if(!E&&(ia||p)){if("function"===typeof fetch&&!M.startsWith("file://"))return fetch(M,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+M+"'";return b.arrayBuffer()}).catch(function(){return wa()});if(y)return new Promise(function(b,c){y(M,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return wa()})}
|
||||
function ya(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.C;"number"===typeof e?void 0===c.A?N(e)():N(e)(c.A):e(void 0===c.A?null:c.A)}}}var O=[];function N(b){var c=O[b];c||(b>=O.length&&(O.length=b+1),O[b]=c=oa.get(b));return c}
|
||||
var Pa={g:function(){throw"longjmp";},e:function(b,c,e){ma.copyWithin(b,c,c+e)},f:function(b){var c=ma.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{G.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);na();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},a:function(){return ja},d:Ka,i:La,j:Ma,h:Na,c:Oa,k:function(b,c,e,d,f,g,l,m,P,q,H,I,Q,R,da,ea){function fa(z,h,u,za,Aa,Ba,
|
||||
Sa,Ta,S){z.set(new Uint8Array(Ua,h,u*za));var v,r;for(v=r=0;v<Ba;v++,r+=u)for(h=0;h<u;h++)z[r+h]=S;for(;v<Ba+Ta;v++,r+=u){for(h=0;h<Aa;h++)z[r+h]=S;for(h=Aa+Sa;h<u;h++)z[r+h]=S}for(;v<za;v++,r+=u)for(h=0;h<u;h++)z[r+h]=S;return z}var Ua=G.buffer,k=a.videoFormat,Ca=(Q&-2)*P/l,Da=(R&-2)*q/m,Ea=H*P/l,Fa=I*q/m;H===k.cropWidth&&I===k.cropHeight&&(da=k.displayWidth,ea=k.displayHeight);for(var Ga=a.recycledFrames,w,Ha=m*c,Ia=q*d,Ja=q*g;0<Ga.length;){var J=Ga.shift();k=J.format;if(k.width===l&&k.height===
|
||||
m&&k.chromaWidth===P&&k.chromaHeight===q&&k.cropLeft===Q&&k.cropTop===R&&k.cropWidth===H&&k.cropHeight===I&&k.displayWidth===da&&k.displayHeight===ea&&J.y.bytes.length===Ha&&J.u.bytes.length===Ia&&J.v.bytes.length===Ja){w=J;break}}w||(w={format:{width:l,height:m,chromaWidth:P,chromaHeight:q,cropLeft:Q,cropTop:R,cropWidth:H,cropHeight:I,displayWidth:da,displayHeight:ea},y:{bytes:new Uint8Array(Ha),stride:c},u:{bytes:new Uint8Array(Ia),stride:d},v:{bytes:new Uint8Array(Ja),stride:g}});fa(w.y.bytes,
|
||||
b,c,m,Q,R,H,I,0);fa(w.u.bytes,e,d,q,Ca,Da,Ea,Fa,128);fa(w.v.bytes,f,g,q,Ca,Da,Ea,Fa,128);a.frameBuffer=w},b:function(b){ja=b}};
|
||||
(function(){function b(f){a.asm=f.exports;G=a.asm.l;na();oa=a.asm.s;qa.unshift(a.asm.m);K--;a.monitorRunDependencies&&a.monitorRunDependencies(K);0==K&&(null!==ta&&(clearInterval(ta),ta=null),L&&(f=L,L=null,f()))}function c(f){b(f.instance)}function e(f){return xa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){D("failed to asynchronously prepare wasm: "+g);F(g)})}var d={a:Pa};K++;a.monitorRunDependencies&&a.monitorRunDependencies(K);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return D("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return E||"function"!==typeof WebAssembly.instantiateStreaming||ua()||M.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(M,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){D("wasm streaming compile failed: "+g);D("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(n);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.m).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.n).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.o).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.p).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.q).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.r).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.t).apply(null,arguments)};a._free=function(){return(a._free=a.asm.u).apply(null,arguments)};
|
||||
var T=a._setThrew=function(){return(T=a._setThrew=a.asm.v).apply(null,arguments)},U=a.stackSave=function(){return(U=a.stackSave=a.asm.w).apply(null,arguments)},V=a.stackRestore=function(){return(V=a.stackRestore=a.asm.x).apply(null,arguments)},Qa=a.dynCall_iiiij=function(){return(Qa=a.dynCall_iiiij=a.asm.y).apply(null,arguments)};function Oa(b,c,e,d,f){var g=U();try{N(b)(c,e,d,f)}catch(l){V(g);if(l!==l+0&&"longjmp"!==l)throw l;T(1,0)}}
|
||||
function Ka(b,c,e){var d=U();try{return N(b)(c,e)}catch(f){V(d);if(f!==f+0&&"longjmp"!==f)throw f;T(1,0)}}function La(b,c,e,d){var f=U();try{return N(b)(c,e,d)}catch(g){V(f);if(g!==g+0&&"longjmp"!==g)throw g;T(1,0)}}function Na(b,c){var e=U();try{N(b)(c)}catch(d){V(e);if(d!==d+0&&"longjmp"!==d)throw d;T(1,0)}}function Ma(b,c,e,d,f,g){var l=U();try{return Qa(b,c,e,d,f,g)}catch(m){V(l);if(m!==m+0&&"longjmp"!==m)throw m;T(1,0)}}var W;L=function Ra(){W||Va();W||(L=Ra)};
|
||||
function Va(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ka)){ya(qa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();ra.unshift(c)}ya(ra)}}if(!(0<K)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)sa();ya(pa);0<K||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Va;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Va();var X,Wa,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Wa>=d||(X&&a._free(X),Wa=d,X=a._malloc(Wa));var f=X;(new Uint8Array(G.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.B=[];
|
||||
a.processFrame=function(b,c){function e(m){a._free(g);c(m)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.B.push(e);var l=Z(function(){(new Uint8Array(G.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(l)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.B.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoVP8W.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoVP8W;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoVP8W; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoVP8W"] = OGVDecoderVideoVP8W;
|
||||
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-vp8-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-vp8-wasm.wasm
Executable file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-vp9-mt-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-vp9-mt-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoVP9MTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoVP9SIMDMTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
@ -0,0 +1,45 @@
|
||||
|
||||
var OGVDecoderVideoVP9SIMDW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoVP9SIMDW) {
|
||||
OGVDecoderVideoVP9SIMDW = OGVDecoderVideoVP9SIMDW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoVP9SIMDW !== 'undefined' ? OGVDecoderVideoVP9SIMDW : {});var aa=Object.assign,ba,n;a.ready=new Promise(function(b,c){ba=b;n=c});var ca=a,ha=aa({},a),ia="object"===typeof window,p="function"===typeof importScripts,r="",v,w,x,fs,z,D;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)r=p?require("path").dirname(r)+"/":__dirname+"/",D=function(){z||(fs=require("fs"),z=require("path"))},v=function(b,c){D();b=z.normalize(b);return fs.readFileSync(b,c?null:"utf8")},x=function(b){b=v(b,!0);b.buffer||(b=new Uint8Array(b));return b},w=function(b,c,e){D();b=z.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ia||p)p?r=self.location.href:"undefined"!==typeof document&&document.currentScript&&(r=document.currentScript.src),_scriptDir&&(r=_scriptDir),0!==r.indexOf("blob:")?r=r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1):r="",v=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},p&&(x=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),w=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var F=a.printErr||console.warn.bind(console);aa(a,ha);ha=null;var ja=0,G;a.wasmBinary&&(G=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&H("no native wasm support detected");
|
||||
var I,ka=!1,la,ma;function na(){var b=I.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=ma=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var oa,pa=[],qa=[],ra=[];function sa(){var b=a.preRun.shift();pa.unshift(b)}var L=0,ta=null,M=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function H(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";F(b);ka=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");n(b);throw b;}function ua(){return N.startsWith("data:application/octet-stream;base64,")}var N;N="ogv-decoder-video-vp9-simd-wasm.wasm";if(!ua()){var va=N;N=a.locateFile?a.locateFile(va,r):r+va}function wa(){var b=N;try{if(b==N&&G)return new Uint8Array(G);if(x)return x(b);throw"both async and sync fetching of the wasm failed";}catch(c){H(c)}}
|
||||
function xa(){if(!G&&(ia||p)){if("function"===typeof fetch&&!N.startsWith("file://"))return fetch(N,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+N+"'";return b.arrayBuffer()}).catch(function(){return wa()});if(w)return new Promise(function(b,c){w(N,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return wa()})}
|
||||
function ya(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.D;"number"===typeof e?void 0===c.B?O(e)():O(e)(c.B):e(void 0===c.B?null:c.B)}}}var P=[];function O(b){var c=P[b];c||(b>=P.length&&(P.length=b+1),P[b]=c=oa.get(b));return c}
|
||||
var Sa={m:function(){throw"longjmp";},k:function(b,c,e){ma.copyWithin(b,c,c+e)},l:function(b){var c=ma.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{I.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);na();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},a:function(){return ja},d:Ka,f:La,i:Ma,g:Na,e:Oa,c:Pa,j:Qa,h:Ra,n:function(b,c,e,d,f,g,h,k,q,t,u,J,Q,R,da,ea){function fa(E,
|
||||
l,A,za,Aa,Ba,Ua,Va,S){E.set(new Uint8Array(Wa,l,A*za));var B,y;for(B=y=0;B<Ba;B++,y+=A)for(l=0;l<A;l++)E[y+l]=S;for(;B<Ba+Va;B++,y+=A){for(l=0;l<Aa;l++)E[y+l]=S;for(l=Aa+Ua;l<A;l++)E[y+l]=S}for(;B<za;B++,y+=A)for(l=0;l<A;l++)E[y+l]=S;return E}var Wa=I.buffer,m=a.videoFormat,Ca=(Q&-2)*q/h,Da=(R&-2)*t/k,Ea=u*q/h,Fa=J*t/k;u===m.cropWidth&&J===m.cropHeight&&(da=m.displayWidth,ea=m.displayHeight);for(var Ga=a.recycledFrames,C,Ha=k*c,Ia=t*d,Ja=t*g;0<Ga.length;){var K=Ga.shift();m=K.format;if(m.width===
|
||||
h&&m.height===k&&m.chromaWidth===q&&m.chromaHeight===t&&m.cropLeft===Q&&m.cropTop===R&&m.cropWidth===u&&m.cropHeight===J&&m.displayWidth===da&&m.displayHeight===ea&&K.y.bytes.length===Ha&&K.u.bytes.length===Ia&&K.v.bytes.length===Ja){C=K;break}}C||(C={format:{width:h,height:k,chromaWidth:q,chromaHeight:t,cropLeft:Q,cropTop:R,cropWidth:u,cropHeight:J,displayWidth:da,displayHeight:ea},y:{bytes:new Uint8Array(Ha),stride:c},u:{bytes:new Uint8Array(Ia),stride:d},v:{bytes:new Uint8Array(Ja),stride:g}});
|
||||
fa(C.y.bytes,b,c,k,Q,R,u,J,0);fa(C.u.bytes,e,d,t,Ca,Da,Ea,Fa,128);fa(C.v.bytes,f,g,t,Ca,Da,Ea,Fa,128);a.frameBuffer=C},b:function(b){ja=b}};
|
||||
(function(){function b(f){a.asm=f.exports;I=a.asm.o;na();oa=a.asm.v;qa.unshift(a.asm.p);L--;a.monitorRunDependencies&&a.monitorRunDependencies(L);0==L&&(null!==ta&&(clearInterval(ta),ta=null),M&&(f=M,M=null,f()))}function c(f){b(f.instance)}function e(f){return xa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){F("failed to asynchronously prepare wasm: "+g);H(g)})}var d={a:Sa};L++;a.monitorRunDependencies&&a.monitorRunDependencies(L);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return F("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return G||"function"!==typeof WebAssembly.instantiateStreaming||ua()||N.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(N,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){F("wasm streaming compile failed: "+g);F("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(n);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.p).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.q).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.r).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.s).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.t).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.u).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.w).apply(null,arguments)};a._free=function(){return(a._free=a.asm.x).apply(null,arguments)};
|
||||
var T=a._setThrew=function(){return(T=a._setThrew=a.asm.y).apply(null,arguments)},U=a.stackSave=function(){return(U=a.stackSave=a.asm.z).apply(null,arguments)},V=a.stackRestore=function(){return(V=a.stackRestore=a.asm.A).apply(null,arguments)};function Ma(b,c,e,d,f){var g=U();try{return O(b)(c,e,d,f)}catch(h){V(g);if(h!==h+0&&"longjmp"!==h)throw h;T(1,0)}}function Pa(b,c,e,d,f){var g=U();try{O(b)(c,e,d,f)}catch(h){V(g);if(h!==h+0&&"longjmp"!==h)throw h;T(1,0)}}
|
||||
function Ra(b,c,e,d,f,g,h,k,q){var t=U();try{O(b)(c,e,d,f,g,h,k,q)}catch(u){V(t);if(u!==u+0&&"longjmp"!==u)throw u;T(1,0)}}function Na(b,c,e,d,f,g){var h=U();try{return O(b)(c,e,d,f,g)}catch(k){V(h);if(k!==k+0&&"longjmp"!==k)throw k;T(1,0)}}function La(b,c,e,d){var f=U();try{return O(b)(c,e,d)}catch(g){V(f);if(g!==g+0&&"longjmp"!==g)throw g;T(1,0)}}function Qa(b,c,e,d,f,g,h){var k=U();try{O(b)(c,e,d,f,g,h)}catch(q){V(k);if(q!==q+0&&"longjmp"!==q)throw q;T(1,0)}}
|
||||
function Ka(b,c,e){var d=U();try{return O(b)(c,e)}catch(f){V(d);if(f!==f+0&&"longjmp"!==f)throw f;T(1,0)}}function Oa(b,c){var e=U();try{O(b)(c)}catch(d){V(e);if(d!==d+0&&"longjmp"!==d)throw d;T(1,0)}}var W;M=function Ta(){W||Xa();W||(M=Ta)};
|
||||
function Xa(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ka)){ya(qa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();ra.unshift(c)}ya(ra)}}if(!(0<L)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)sa();ya(pa);0<L||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Xa;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Xa();var X,Ya,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Ya>=d||(X&&a._free(X),Ya=d,X=a._malloc(Ya));var f=X;(new Uint8Array(I.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.C=[];
|
||||
a.processFrame=function(b,c){function e(k){a._free(g);c(k)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.C.push(e);var h=Z(function(){(new Uint8Array(I.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(h)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.C.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoVP9SIMDW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoVP9SIMDW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoVP9SIMDW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoVP9SIMDW"] = OGVDecoderVideoVP9SIMDW;
|
||||
Binary file not shown.
@ -0,0 +1,45 @@
|
||||
|
||||
var OGVDecoderVideoVP9W = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoVP9W) {
|
||||
OGVDecoderVideoVP9W = OGVDecoderVideoVP9W || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoVP9W !== 'undefined' ? OGVDecoderVideoVP9W : {});var aa=Object.assign,ba,n;a.ready=new Promise(function(b,c){ba=b;n=c});var ca=a,ha=aa({},a),ia="object"===typeof window,p="function"===typeof importScripts,r="",v,w,x,fs,z,D;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)r=p?require("path").dirname(r)+"/":__dirname+"/",D=function(){z||(fs=require("fs"),z=require("path"))},v=function(b,c){D();b=z.normalize(b);return fs.readFileSync(b,c?null:"utf8")},x=function(b){b=v(b,!0);b.buffer||(b=new Uint8Array(b));return b},w=function(b,c,e){D();b=z.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ia||p)p?r=self.location.href:"undefined"!==typeof document&&document.currentScript&&(r=document.currentScript.src),_scriptDir&&(r=_scriptDir),0!==r.indexOf("blob:")?r=r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1):r="",v=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},p&&(x=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),w=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var F=a.printErr||console.warn.bind(console);aa(a,ha);ha=null;var ja=0,G;a.wasmBinary&&(G=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&H("no native wasm support detected");
|
||||
var I,ka=!1,la,ma;function na(){var b=I.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=ma=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var oa,pa=[],qa=[],ra=[];function sa(){var b=a.preRun.shift();pa.unshift(b)}var L=0,ta=null,M=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function H(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";F(b);ka=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");n(b);throw b;}function ua(){return N.startsWith("data:application/octet-stream;base64,")}var N;N="ogv-decoder-video-vp9-wasm.wasm";if(!ua()){var va=N;N=a.locateFile?a.locateFile(va,r):r+va}function wa(){var b=N;try{if(b==N&&G)return new Uint8Array(G);if(x)return x(b);throw"both async and sync fetching of the wasm failed";}catch(c){H(c)}}
|
||||
function xa(){if(!G&&(ia||p)){if("function"===typeof fetch&&!N.startsWith("file://"))return fetch(N,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+N+"'";return b.arrayBuffer()}).catch(function(){return wa()});if(w)return new Promise(function(b,c){w(N,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return wa()})}
|
||||
function ya(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.D;"number"===typeof e?void 0===c.B?O(e)():O(e)(c.B):e(void 0===c.B?null:c.B)}}}var P=[];function O(b){var c=P[b];c||(b>=P.length&&(P.length=b+1),P[b]=c=oa.get(b));return c}
|
||||
var Sa={m:function(){throw"longjmp";},k:function(b,c,e){ma.copyWithin(b,c,c+e)},l:function(b){var c=ma.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{I.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);na();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},a:function(){return ja},d:Ka,f:La,i:Ma,g:Na,e:Oa,c:Pa,j:Qa,h:Ra,n:function(b,c,e,d,f,g,h,k,q,t,u,J,Q,R,da,ea){function fa(E,
|
||||
l,A,za,Aa,Ba,Ua,Va,S){E.set(new Uint8Array(Wa,l,A*za));var B,y;for(B=y=0;B<Ba;B++,y+=A)for(l=0;l<A;l++)E[y+l]=S;for(;B<Ba+Va;B++,y+=A){for(l=0;l<Aa;l++)E[y+l]=S;for(l=Aa+Ua;l<A;l++)E[y+l]=S}for(;B<za;B++,y+=A)for(l=0;l<A;l++)E[y+l]=S;return E}var Wa=I.buffer,m=a.videoFormat,Ca=(Q&-2)*q/h,Da=(R&-2)*t/k,Ea=u*q/h,Fa=J*t/k;u===m.cropWidth&&J===m.cropHeight&&(da=m.displayWidth,ea=m.displayHeight);for(var Ga=a.recycledFrames,C,Ha=k*c,Ia=t*d,Ja=t*g;0<Ga.length;){var K=Ga.shift();m=K.format;if(m.width===
|
||||
h&&m.height===k&&m.chromaWidth===q&&m.chromaHeight===t&&m.cropLeft===Q&&m.cropTop===R&&m.cropWidth===u&&m.cropHeight===J&&m.displayWidth===da&&m.displayHeight===ea&&K.y.bytes.length===Ha&&K.u.bytes.length===Ia&&K.v.bytes.length===Ja){C=K;break}}C||(C={format:{width:h,height:k,chromaWidth:q,chromaHeight:t,cropLeft:Q,cropTop:R,cropWidth:u,cropHeight:J,displayWidth:da,displayHeight:ea},y:{bytes:new Uint8Array(Ha),stride:c},u:{bytes:new Uint8Array(Ia),stride:d},v:{bytes:new Uint8Array(Ja),stride:g}});
|
||||
fa(C.y.bytes,b,c,k,Q,R,u,J,0);fa(C.u.bytes,e,d,t,Ca,Da,Ea,Fa,128);fa(C.v.bytes,f,g,t,Ca,Da,Ea,Fa,128);a.frameBuffer=C},b:function(b){ja=b}};
|
||||
(function(){function b(f){a.asm=f.exports;I=a.asm.o;na();oa=a.asm.v;qa.unshift(a.asm.p);L--;a.monitorRunDependencies&&a.monitorRunDependencies(L);0==L&&(null!==ta&&(clearInterval(ta),ta=null),M&&(f=M,M=null,f()))}function c(f){b(f.instance)}function e(f){return xa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){F("failed to asynchronously prepare wasm: "+g);H(g)})}var d={a:Sa};L++;a.monitorRunDependencies&&a.monitorRunDependencies(L);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return F("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return G||"function"!==typeof WebAssembly.instantiateStreaming||ua()||N.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(N,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){F("wasm streaming compile failed: "+g);F("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(n);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.p).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.q).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.r).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.s).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.t).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.u).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.w).apply(null,arguments)};a._free=function(){return(a._free=a.asm.x).apply(null,arguments)};
|
||||
var T=a._setThrew=function(){return(T=a._setThrew=a.asm.y).apply(null,arguments)},U=a.stackSave=function(){return(U=a.stackSave=a.asm.z).apply(null,arguments)},V=a.stackRestore=function(){return(V=a.stackRestore=a.asm.A).apply(null,arguments)};function Ma(b,c,e,d,f){var g=U();try{return O(b)(c,e,d,f)}catch(h){V(g);if(h!==h+0&&"longjmp"!==h)throw h;T(1,0)}}function Pa(b,c,e,d,f){var g=U();try{O(b)(c,e,d,f)}catch(h){V(g);if(h!==h+0&&"longjmp"!==h)throw h;T(1,0)}}
|
||||
function Ra(b,c,e,d,f,g,h,k,q){var t=U();try{O(b)(c,e,d,f,g,h,k,q)}catch(u){V(t);if(u!==u+0&&"longjmp"!==u)throw u;T(1,0)}}function Na(b,c,e,d,f,g){var h=U();try{return O(b)(c,e,d,f,g)}catch(k){V(h);if(k!==k+0&&"longjmp"!==k)throw k;T(1,0)}}function La(b,c,e,d){var f=U();try{return O(b)(c,e,d)}catch(g){V(f);if(g!==g+0&&"longjmp"!==g)throw g;T(1,0)}}function Qa(b,c,e,d,f,g,h){var k=U();try{O(b)(c,e,d,f,g,h)}catch(q){V(k);if(q!==q+0&&"longjmp"!==q)throw q;T(1,0)}}
|
||||
function Ka(b,c,e){var d=U();try{return O(b)(c,e)}catch(f){V(d);if(f!==f+0&&"longjmp"!==f)throw f;T(1,0)}}function Oa(b,c){var e=U();try{O(b)(c)}catch(d){V(e);if(d!==d+0&&"longjmp"!==d)throw d;T(1,0)}}var W;M=function Ta(){W||Xa();W||(M=Ta)};
|
||||
function Xa(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ka)){ya(qa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();ra.unshift(c)}ya(ra)}}if(!(0<L)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)sa();ya(pa);0<L||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Xa;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Xa();var X,Ya,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Ya>=d||(X&&a._free(X),Ya=d,X=a._malloc(Ya));var f=X;(new Uint8Array(I.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.C=[];
|
||||
a.processFrame=function(b,c){function e(k){a._free(g);c(k)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.C.push(e);var h=Z(function(){(new Uint8Array(I.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(h)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.C.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoVP9W.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoVP9W;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoVP9W; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoVP9W"] = OGVDecoderVideoVP9W;
|
||||
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-vp9-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-decoder-video-vp9-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1,43 @@
|
||||
|
||||
var OGVDemuxerOggW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDemuxerOggW) {
|
||||
OGVDemuxerOggW = OGVDemuxerOggW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDemuxerOggW !== 'undefined' ? OGVDemuxerOggW : {});var h=Object.assign,k,l;a.ready=new Promise(function(b,c){k=b;l=c});var m=h({},a),n="object"===typeof window,p="function"===typeof importScripts,q="",r,t,u,fs,v,w;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)q=p?require("path").dirname(q)+"/":__dirname+"/",w=function(){v||(fs=require("fs"),v=require("path"))},r=function(b,c){w();b=v.normalize(b);return fs.readFileSync(b,c?null:"utf8")},u=function(b){b=r(b,!0);b.buffer||(b=new Uint8Array(b));return b},t=function(b,c,d){w();b=v.normalize(b);fs.readFile(b,function(e,f){e?d(e):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(n||p)p?q=self.location.href:"undefined"!==typeof document&&document.currentScript&&(q=document.currentScript.src),_scriptDir&&(q=_scriptDir),0!==q.indexOf("blob:")?q=q.substr(0,q.replace(/[?#].*/,"").lastIndexOf("/")+1):q="",r=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},p&&(u=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),t=function(b,c,d){var e=new XMLHttpRequest;e.open("GET",b,!0);e.responseType="arraybuffer";e.onload=function(){200==e.status||0==e.status&&e.response?c(e.response):d()};e.onerror=d;e.send(null)};a.print||console.log.bind(console);var x=a.printErr||console.warn.bind(console);h(a,m);m=null;var y;a.wasmBinary&&(y=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&z("no native wasm support detected");
|
||||
var A,B=!1;"undefined"!==typeof TextDecoder&&new TextDecoder("utf8");var C,D,E;function F(){var b=A.buffer;C=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=E=new Int32Array(b);a.HEAPU8=D=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var G,H=[],I=[],J=[];function aa(){var b=a.preRun.shift();H.unshift(b)}var K=0,L=null,M=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function z(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";x(b);B=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");l(b);throw b;}function N(){return O.startsWith("data:application/octet-stream;base64,")}var O;O="ogv-demuxer-ogg-wasm.wasm";if(!N()){var P=O;O=a.locateFile?a.locateFile(P,q):q+P}function Q(){var b=O;try{if(b==O&&y)return new Uint8Array(y);if(u)return u(b);throw"both async and sync fetching of the wasm failed";}catch(c){z(c)}}
|
||||
function ba(){if(!y&&(n||p)){if("function"===typeof fetch&&!O.startsWith("file://"))return fetch(O,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+O+"'";return b.arrayBuffer()}).catch(function(){return Q()});if(t)return new Promise(function(b,c){t(O,function(d){b(new Uint8Array(d))},c)})}return Promise.resolve().then(function(){return Q()})}
|
||||
function R(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var d=c.B;"number"===typeof d?void 0===c.v?S(d)():S(d)(c.v):d(void 0===c.v?null:c.v)}}}var T=[];function S(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=G.get(b));return c}
|
||||
var ca={},da={d:function(b,c,d){D.copyWithin(b,c,c+d)},e:function(b){var c=D.length;b>>>=0;if(2147483648<b)return!1;for(var d=1;4>=d;d*=2){var e=c*(1+.2/d);e=Math.min(e,b+100663296);e=Math.max(b,e);0<e%65536&&(e+=65536-e%65536);a:{try{A.grow(Math.min(2147483648,e)-C.byteLength+65535>>>16);F();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},f:function(b,c,d,e){b=ca.C(b);c=ca.A(b,c,d);E[e>>2]=c;return 0},a:function(b,c,d,e){var f=A.buffer;a.audioPackets.push({data:f.slice?f.slice(b,b+c):
|
||||
(new Uint8Array(new Uint8Array(f,b,c))).buffer,timestamp:d,discardPadding:e})},c:function(b,c){function d(e){for(var f="",g=new Uint8Array(A.buffer);0!=g[e];e++)f+=String.fromCharCode(g[e]);return f}b&&(a.videoCodec=d(b));c&&(a.audioCodec=d(c));b=a._ogv_demuxer_media_duration();a.duration=0<=b?b:NaN;a.loadedMetadata=!0},b:function(b,c,d,e,f){var g=A.buffer;a.videoPackets.push({data:g.slice?g.slice(b,b+c):(new Uint8Array(new Uint8Array(g,b,c))).buffer,timestamp:d,keyframeTimestamp:e,isKeyframe:!!f})}};
|
||||
(function(){function b(f){a.asm=f.exports;A=a.asm.g;F();G=a.asm.s;I.unshift(a.asm.h);K--;a.monitorRunDependencies&&a.monitorRunDependencies(K);0==K&&(null!==L&&(clearInterval(L),L=null),M&&(f=M,M=null,f()))}function c(f){b(f.instance)}function d(f){return ba().then(function(g){return WebAssembly.instantiate(g,e)}).then(function(g){return g}).then(f,function(g){x("failed to asynchronously prepare wasm: "+g);z(g)})}var e={a:da};K++;a.monitorRunDependencies&&a.monitorRunDependencies(K);if(a.instantiateWasm)try{return a.instantiateWasm(e,
|
||||
b)}catch(f){return x("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return y||"function"!==typeof WebAssembly.instantiateStreaming||N()||O.startsWith("file://")||"function"!==typeof fetch?d(c):fetch(O,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(c,function(g){x("wasm streaming compile failed: "+g);x("falling back to ArrayBuffer instantiation");return d(c)})})})().catch(l);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.h).apply(null,arguments)};a._ogv_demuxer_init=function(){return(a._ogv_demuxer_init=a.asm.i).apply(null,arguments)};a._ogv_demuxer_receive_input=function(){return(a._ogv_demuxer_receive_input=a.asm.j).apply(null,arguments)};a._ogv_demuxer_process=function(){return(a._ogv_demuxer_process=a.asm.k).apply(null,arguments)};a._ogv_demuxer_destroy=function(){return(a._ogv_demuxer_destroy=a.asm.l).apply(null,arguments)};
|
||||
a._ogv_demuxer_media_length=function(){return(a._ogv_demuxer_media_length=a.asm.m).apply(null,arguments)};a._ogv_demuxer_media_duration=function(){return(a._ogv_demuxer_media_duration=a.asm.n).apply(null,arguments)};a._ogv_demuxer_seekable=function(){return(a._ogv_demuxer_seekable=a.asm.o).apply(null,arguments)};a._ogv_demuxer_keypoint_offset=function(){return(a._ogv_demuxer_keypoint_offset=a.asm.p).apply(null,arguments)};
|
||||
a._ogv_demuxer_seek_to_keypoint=function(){return(a._ogv_demuxer_seek_to_keypoint=a.asm.q).apply(null,arguments)};a._ogv_demuxer_flush=function(){return(a._ogv_demuxer_flush=a.asm.r).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.t).apply(null,arguments)};a._free=function(){return(a._free=a.asm.u).apply(null,arguments)};var U;M=function ea(){U||V();U||(M=ea)};
|
||||
function V(){function b(){if(!U&&(U=!0,a.calledRun=!0,!B)){R(I);k(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();J.unshift(c)}R(J)}}if(!(0<K)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)aa();R(H);0<K||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=V;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();V();var W,X,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();c=Y()-c;a.cpuTime+=c;return b}a.loadedMetadata=!1;a.videoCodec=null;a.audioCodec=null;a.duration=NaN;a.onseek=null;a.cpuTime=0;a.audioPackets=[];Object.defineProperty(a,"hasAudio",{get:function(){return a.loadedMetadata&&a.audioCodec}});
|
||||
Object.defineProperty(a,"audioReady",{get:function(){return 0<a.audioPackets.length}});Object.defineProperty(a,"audioTimestamp",{get:function(){return 0<a.audioPackets.length?a.audioPackets[0].timestamp:-1}});a.videoPackets=[];Object.defineProperty(a,"hasVideo",{get:function(){return a.loadedMetadata&&a.videoCodec}});Object.defineProperty(a,"frameReady",{get:function(){return 0<a.videoPackets.length}});
|
||||
Object.defineProperty(a,"frameTimestamp",{get:function(){return 0<a.videoPackets.length?a.videoPackets[0].timestamp:-1}});Object.defineProperty(a,"keyframeTimestamp",{get:function(){return 0<a.videoPackets.length?a.videoPackets[0].keyframeTimestamp:-1}});Object.defineProperty(a,"nextKeyframeTimestamp",{get:function(){for(var b=0;b<a.videoPackets.length;b++){var c=a.videoPackets[b];if(c.isKeyframe)return c.timestamp}return-1}});Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
Object.defineProperty(a,"seekable",{get:function(){return!!a._ogv_demuxer_seekable()}});a.init=function(b){Z(function(){a._ogv_demuxer_init()});b()};a.receiveInput=function(b,c){Z(function(){var d=b.byteLength;W&&X>=d||(W&&a._free(W),X=d,W=a._malloc(X));var e=W;(new Uint8Array(A.buffer,e,d)).set(new Uint8Array(b));a._ogv_demuxer_receive_input(e,d)});c()};a.process=function(b){var c=Z(function(){return a._ogv_demuxer_process()});b(!!c)};
|
||||
a.dequeueVideoPacket=function(b){if(a.videoPackets.length){var c=a.videoPackets.shift().data;b(c)}else b(null)};a.dequeueAudioPacket=function(b){if(a.audioPackets.length){var c=a.audioPackets.shift();b(c.data,c.discardPadding)}else b(null)};a.getKeypointOffset=function(b,c){var d=Z(function(){return a._ogv_demuxer_keypoint_offset(1E3*b)});c(d)};
|
||||
a.seekToKeypoint=function(b,c){var d=Z(function(){return a._ogv_demuxer_seek_to_keypoint(1E3*b)});d&&(a.audioPackets.splice(0,a.audioPackets.length),a.videoPackets.splice(0,a.videoPackets.length));c(!!d)};a.flush=function(b){Z(function(){a.audioPackets.splice(0,a.audioPackets.length);a.videoPackets.splice(0,a.videoPackets.length);a._ogv_demuxer_flush()});b()};a.close=function(){};
|
||||
|
||||
|
||||
return OGVDemuxerOggW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDemuxerOggW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDemuxerOggW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDemuxerOggW"] = OGVDemuxerOggW;
|
||||
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-demuxer-ogg-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-demuxer-ogg-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1,46 @@
|
||||
|
||||
var OGVDemuxerWebMW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDemuxerWebMW) {
|
||||
OGVDemuxerWebMW = OGVDemuxerWebMW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDemuxerWebMW !== 'undefined' ? OGVDemuxerWebMW : {});var h=Object.assign,k,l;a.ready=new Promise(function(b,c){k=b;l=c});var m=h({},a),n="object"===typeof window,q="function"===typeof importScripts,r="",t,u,v,fs,w,A;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)r=q?require("path").dirname(r)+"/":__dirname+"/",A=function(){w||(fs=require("fs"),w=require("path"))},t=function(b,c){A();b=w.normalize(b);return fs.readFileSync(b,c?null:"utf8")},v=function(b){b=t(b,!0);b.buffer||(b=new Uint8Array(b));return b},u=function(b,c,d){A();b=w.normalize(b);fs.readFile(b,function(e,f){e?d(e):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(n||q)q?r=self.location.href:"undefined"!==typeof document&&document.currentScript&&(r=document.currentScript.src),_scriptDir&&(r=_scriptDir),0!==r.indexOf("blob:")?r=r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1):r="",t=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},q&&(v=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),u=function(b,c,d){var e=new XMLHttpRequest;e.open("GET",b,!0);e.responseType="arraybuffer";e.onload=function(){200==e.status||0==e.status&&e.response?c(e.response):d()};e.onerror=d;e.send(null)};var aa=a.print||console.log.bind(console),B=a.printErr||console.warn.bind(console);h(a,m);m=null;var C;a.wasmBinary&&(C=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&D("no native wasm support detected");
|
||||
var E,F=!1,H="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
|
||||
function I(b,c,d){var e=c+d;for(d=c;b[d]&&!(d>=e);)++d;if(16<d-c&&b.subarray&&H)return H.decode(b.subarray(c,d));for(e="";c<d;){var f=b[c++];if(f&128){var g=b[c++]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|g);else{var p=b[c++]&63;f=224==(f&240)?(f&15)<<12|g<<6|p:(f&7)<<18|g<<12|p<<6|b[c++]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e}function J(b){return b?I(K,b,void 0):""}var L,K,M;
|
||||
function N(){var b=E.buffer;L=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=M=new Int32Array(b);a.HEAPU8=K=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var ba,ca=[],da=[],ea=[];function fa(){var b=a.preRun.shift();ca.unshift(b)}var O=0,P=null,Q=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function D(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";B(b);F=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");l(b);throw b;}function ha(){return R.startsWith("data:application/octet-stream;base64,")}var R;R="ogv-demuxer-webm-wasm.wasm";if(!ha()){var ia=R;R=a.locateFile?a.locateFile(ia,r):r+ia}function ja(){var b=R;try{if(b==R&&C)return new Uint8Array(C);if(v)return v(b);throw"both async and sync fetching of the wasm failed";}catch(c){D(c)}}
|
||||
function ka(){if(!C&&(n||q)){if("function"===typeof fetch&&!R.startsWith("file://"))return fetch(R,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+R+"'";return b.arrayBuffer()}).catch(function(){return ja()});if(u)return new Promise(function(b,c){u(R,function(d){b(new Uint8Array(d))},c)})}return Promise.resolve().then(function(){return ja()})}
|
||||
function S(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var d=c.B;"number"===typeof d?void 0===c.A?la(d)():la(d)(c.A):d(void 0===c.A?null:c.A)}}}var T=[];function la(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=ba.get(b));return c}
|
||||
var ma=[null,[],[]],na={a:function(b,c,d,e){D("Assertion failed: "+J(b)+", at: "+[c?J(c):"unknown filename",d,e?J(e):"unknown function"])},f:function(){D("")},d:function(b,c,d){K.copyWithin(b,c,c+d)},e:function(b){var c=K.length;b>>>=0;if(2147483648<b)return!1;for(var d=1;4>=d;d*=2){var e=c*(1+.2/d);e=Math.min(e,b+100663296);e=Math.max(b,e);0<e%65536&&(e+=65536-e%65536);a:{try{E.grow(Math.min(2147483648,e)-L.byteLength+65535>>>16);N();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},b:function(b,
|
||||
c,d,e){for(var f=0,g=0;g<d;g++){var p=M[c>>2],G=M[c+4>>2];c+=8;for(var x=0;x<G;x++){var y=K[p+x],z=ma[b];0===y||10===y?((1===b?aa:B)(I(z,0)),z.length=0):z.push(y)}f+=G}M[e>>2]=f;return 0},c:function(b,c,d,e){var f=E.buffer;a.audioPackets.push({data:f.slice?f.slice(b,b+c):(new Uint8Array(new Uint8Array(f,b,c))).buffer,timestamp:d,discardPadding:e})},j:function(b,c,d,e,f,g,p,G,x,y,z){a.videoFormat={width:b,height:c,chromaWidth:d,chromaHeight:e,cropLeft:G,cropTop:x,cropWidth:g,cropHeight:p,displayWidth:y,
|
||||
displayHeight:z,fps:f}},h:function(b,c){function d(e){for(var f="",g=new Uint8Array(E.buffer);0!=g[e];e++)f+=String.fromCharCode(g[e]);return f}b&&(a.videoCodec=d(b));c&&(a.audioCodec=d(c));b=a._ogv_demuxer_media_duration();a.duration=0<=b?b:NaN;a.loadedMetadata=!0},i:function(b,c){if(a.onseek)a.onseek(b+4294967296*c)},g:function(b,c,d,e,f){var g=E.buffer;a.videoPackets.push({data:g.slice?g.slice(b,b+c):(new Uint8Array(new Uint8Array(g,b,c))).buffer,timestamp:d,keyframeTimestamp:e,isKeyframe:!!f})}};
|
||||
(function(){function b(f){a.asm=f.exports;E=a.asm.k;N();ba=a.asm.w;da.unshift(a.asm.l);O--;a.monitorRunDependencies&&a.monitorRunDependencies(O);0==O&&(null!==P&&(clearInterval(P),P=null),Q&&(f=Q,Q=null,f()))}function c(f){b(f.instance)}function d(f){return ka().then(function(g){return WebAssembly.instantiate(g,e)}).then(function(g){return g}).then(f,function(g){B("failed to asynchronously prepare wasm: "+g);D(g)})}var e={a:na};O++;a.monitorRunDependencies&&a.monitorRunDependencies(O);if(a.instantiateWasm)try{return a.instantiateWasm(e,
|
||||
b)}catch(f){return B("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return C||"function"!==typeof WebAssembly.instantiateStreaming||ha()||R.startsWith("file://")||"function"!==typeof fetch?d(c):fetch(R,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(c,function(g){B("wasm streaming compile failed: "+g);B("falling back to ArrayBuffer instantiation");return d(c)})})})().catch(l);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.l).apply(null,arguments)};a._ogv_demuxer_init=function(){return(a._ogv_demuxer_init=a.asm.m).apply(null,arguments)};a._ogv_demuxer_receive_input=function(){return(a._ogv_demuxer_receive_input=a.asm.n).apply(null,arguments)};a._ogv_demuxer_process=function(){return(a._ogv_demuxer_process=a.asm.o).apply(null,arguments)};a._ogv_demuxer_destroy=function(){return(a._ogv_demuxer_destroy=a.asm.p).apply(null,arguments)};
|
||||
a._ogv_demuxer_flush=function(){return(a._ogv_demuxer_flush=a.asm.q).apply(null,arguments)};a._ogv_demuxer_media_length=function(){return(a._ogv_demuxer_media_length=a.asm.r).apply(null,arguments)};a._ogv_demuxer_media_duration=function(){return(a._ogv_demuxer_media_duration=a.asm.s).apply(null,arguments)};a._ogv_demuxer_seekable=function(){return(a._ogv_demuxer_seekable=a.asm.t).apply(null,arguments)};
|
||||
a._ogv_demuxer_keypoint_offset=function(){return(a._ogv_demuxer_keypoint_offset=a.asm.u).apply(null,arguments)};a._ogv_demuxer_seek_to_keypoint=function(){return(a._ogv_demuxer_seek_to_keypoint=a.asm.v).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.x).apply(null,arguments)};a._free=function(){return(a._free=a.asm.y).apply(null,arguments)};var U;Q=function oa(){U||V();U||(Q=oa)};
|
||||
function V(){function b(){if(!U&&(U=!0,a.calledRun=!0,!F)){S(da);k(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();ea.unshift(c)}S(ea)}}if(!(0<O)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)fa();S(ca);0<O||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=V;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();V();var W,X,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();c=Y()-c;a.cpuTime+=c;return b}a.loadedMetadata=!1;a.videoCodec=null;a.audioCodec=null;a.duration=NaN;a.onseek=null;a.cpuTime=0;a.audioPackets=[];Object.defineProperty(a,"hasAudio",{get:function(){return a.loadedMetadata&&a.audioCodec}});
|
||||
Object.defineProperty(a,"audioReady",{get:function(){return 0<a.audioPackets.length}});Object.defineProperty(a,"audioTimestamp",{get:function(){return 0<a.audioPackets.length?a.audioPackets[0].timestamp:-1}});a.videoPackets=[];Object.defineProperty(a,"hasVideo",{get:function(){return a.loadedMetadata&&a.videoCodec}});Object.defineProperty(a,"frameReady",{get:function(){return 0<a.videoPackets.length}});
|
||||
Object.defineProperty(a,"frameTimestamp",{get:function(){return 0<a.videoPackets.length?a.videoPackets[0].timestamp:-1}});Object.defineProperty(a,"keyframeTimestamp",{get:function(){return 0<a.videoPackets.length?a.videoPackets[0].keyframeTimestamp:-1}});Object.defineProperty(a,"nextKeyframeTimestamp",{get:function(){for(var b=0;b<a.videoPackets.length;b++){var c=a.videoPackets[b];if(c.isKeyframe)return c.timestamp}return-1}});Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
Object.defineProperty(a,"seekable",{get:function(){return!!a._ogv_demuxer_seekable()}});a.init=function(b){Z(function(){a._ogv_demuxer_init()});b()};a.receiveInput=function(b,c){Z(function(){var d=b.byteLength;W&&X>=d||(W&&a._free(W),X=d,W=a._malloc(X));var e=W;(new Uint8Array(E.buffer,e,d)).set(new Uint8Array(b));a._ogv_demuxer_receive_input(e,d)});c()};a.process=function(b){var c=Z(function(){return a._ogv_demuxer_process()});b(!!c)};
|
||||
a.dequeueVideoPacket=function(b){if(a.videoPackets.length){var c=a.videoPackets.shift().data;b(c)}else b(null)};a.dequeueAudioPacket=function(b){if(a.audioPackets.length){var c=a.audioPackets.shift();b(c.data,c.discardPadding)}else b(null)};a.getKeypointOffset=function(b,c){var d=Z(function(){return a._ogv_demuxer_keypoint_offset(1E3*b)});c(d)};
|
||||
a.seekToKeypoint=function(b,c){var d=Z(function(){return a._ogv_demuxer_seek_to_keypoint(1E3*b)});d&&(a.audioPackets.splice(0,a.audioPackets.length),a.videoPackets.splice(0,a.videoPackets.length));c(!!d)};a.flush=function(b){Z(function(){a.audioPackets.splice(0,a.audioPackets.length);a.videoPackets.splice(0,a.videoPackets.length);a._ogv_demuxer_flush()});b()};a.close=function(){};
|
||||
|
||||
|
||||
return OGVDemuxerWebMW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDemuxerWebMW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDemuxerWebMW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDemuxerWebMW"] = OGVDemuxerWebMW;
|
||||
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-demuxer-webm-wasm.wasm
Executable file
BIN
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv-demuxer-webm-wasm.wasm
Executable file
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
(()=>{var e={575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},913:e=>{function t(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,o,r){return o&&t(e.prototype,o),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},8:e=>{function t(o){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},523:(e,t,o)=>{"use strict";var r=o(318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(o(575)),u=r(o(913)),s=new(function(){function e(){(0,n.default)(this,e)}return(0,u.default)(e,[{key:"hasTypedArrays",value:function(){return!!window.Uint32Array}},{key:"hasWebAssembly",value:function(){return!!window.WebAssembly}},{key:"hasWebAudio",value:function(){return!(!window.AudioContext&&!window.webkitAudioContext)}},{key:"hasFlash",value:function(){return!1}},{key:"hasAudio",value:function(){return this.hasWebAudio()}},{key:"isBlacklisted",value:function(e){return!1}},{key:"isSlow",value:function(){return!1}},{key:"isTooSlow",value:function(){return!1}},{key:"supported",value:function(e){return"OGVDecoder"===e?this.hasWebAssembly():"OGVPlayer"===e&&this.supported("OGVDecoder")&&this.hasAudio()}}]),e}());t.default=s}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var u=t[r]={exports:{}};return e[r](u,u.exports,o),u.exports}(()=>{"use strict";var e=o(318),t=e(o(8)),r=e(o(523));"object"===("undefined"==typeof window?"undefined":(0,t.default)(window))&&(window.OGVCompat=r.default,window.OGVVersion="1.8.6-20220111172545-1f60d9d")})()})();
|
||||
@ -0,0 +1 @@
|
||||
(()=>{var e={318:e=>{e.exports=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},8:e=>{function _typeof(o){return e.exports=_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,_typeof(o)}e.exports=_typeof,e.exports.__esModule=!0,e.exports.default=e.exports}},o={};function __webpack_require__(t){var r=o[t];if(void 0!==r)return r.exports;var p=o[t]={exports:{}};return e[t](p,p.exports,__webpack_require__),p.exports}(()=>{"use strict";var e=__webpack_require__(318)(__webpack_require__(8)),o="1.8.6-20220111172545-1f60d9d";"object"===("undefined"==typeof window?"undefined":(0,e.default)(window))&&(window.OGVVersion=o)})()})();
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv.js
Normal file
2
shelled/rustdesk-as-ref/web_deps/ogvjs-1.8.6/ogv.js
Normal file
File diff suppressed because one or more lines are too long
1234
shelled/rustdesk-as-ref/web_deps/yuv-canvas-1.2.6.js
Normal file
1234
shelled/rustdesk-as-ref/web_deps/yuv-canvas-1.2.6.js
Normal file
File diff suppressed because it is too large
Load Diff
468
shelled/rustdesk-web-client/css/style.css
Normal file
468
shelled/rustdesk-web-client/css/style.css
Normal file
@ -0,0 +1,468 @@
|
||||
/* RustDesk Standalone Web Client - Styles */
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
:root {
|
||||
--bg-primary: #0a0a0f;
|
||||
--bg-secondary: #12121a;
|
||||
--bg-tertiary: #1a1a2e;
|
||||
--text-primary: #e0e0e0;
|
||||
--text-secondary: #888;
|
||||
--accent: #4a9eff;
|
||||
--accent-hover: #3a8eef;
|
||||
--danger: #ff4444;
|
||||
--success: #44cc44;
|
||||
--warning: #ffaa00;
|
||||
--border: #2a2a3e;
|
||||
--shadow: rgba(0, 0, 0, 0.4);
|
||||
--radius: 8px;
|
||||
}
|
||||
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
/* ===== Connection Dialog ===== */
|
||||
|
||||
#connection-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--bg-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 100;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
#connection-overlay.hidden {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.connection-card {
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 16px;
|
||||
padding: 40px;
|
||||
width: 420px;
|
||||
max-width: 90%;
|
||||
box-shadow: 0 20px 60px var(--shadow);
|
||||
}
|
||||
|
||||
.connection-card h1 {
|
||||
text-align: center;
|
||||
font-size: 24px;
|
||||
margin-bottom: 8px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.connection-card .subtitle {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 6px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.form-group input {
|
||||
width: 100%;
|
||||
padding: 10px 14px;
|
||||
background: var(--bg-tertiary);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
color: var(--text-primary);
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.form-group input::placeholder {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.form-row .form-group {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border: none;
|
||||
border-radius: var(--radius);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--accent);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: var(--accent-hover);
|
||||
}
|
||||
|
||||
.btn-primary:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: var(--danger);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #cc3333;
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
padding: 6px 12px;
|
||||
font-size: 12px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
padding: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 6px;
|
||||
background: var(--bg-tertiary);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-icon:hover {
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.btn-icon.active {
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
/* ===== Password Dialog ===== */
|
||||
|
||||
#password-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 200;
|
||||
}
|
||||
|
||||
#password-overlay.visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.password-card {
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 16px;
|
||||
padding: 30px;
|
||||
width: 380px;
|
||||
max-width: 90%;
|
||||
box-shadow: 0 20px 60px var(--shadow);
|
||||
}
|
||||
|
||||
.password-card h2 {
|
||||
font-size: 18px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
/* ===== Status Bar ===== */
|
||||
|
||||
#status-bar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 32px;
|
||||
background: var(--bg-secondary);
|
||||
border-bottom: 1px solid var(--border);
|
||||
display: none;
|
||||
align-items: center;
|
||||
padding: 0 12px;
|
||||
font-size: 12px;
|
||||
z-index: 50;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
#status-bar.visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.status-indicator {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--danger);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.status-indicator.connected {
|
||||
background: var(--success);
|
||||
box-shadow: 0 0 6px var(--success);
|
||||
}
|
||||
|
||||
.status-text {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.status-text strong {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.status-right {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.fps-display {
|
||||
color: var(--text-secondary);
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
/* ===== Toolbar ===== */
|
||||
|
||||
#toolbar {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 6px;
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
box-shadow: 0 10px 40px var(--shadow);
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
#toolbar.visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.toolbar-divider {
|
||||
width: 1px;
|
||||
height: 24px;
|
||||
background: var(--border);
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
/* ===== Remote Canvas ===== */
|
||||
|
||||
#remote-canvas-wrapper {
|
||||
position: fixed;
|
||||
top: 32px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #000;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#remote-canvas-wrapper.visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#remote-canvas {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
image-rendering: auto;
|
||||
background: #111;
|
||||
}
|
||||
|
||||
/* ===== Log Panel ===== */
|
||||
|
||||
#log-panel {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 200px;
|
||||
background: var(--bg-secondary);
|
||||
border-top: 1px solid var(--border);
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
z-index: 60;
|
||||
}
|
||||
|
||||
#log-panel.visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#log-panel .log-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 6px 12px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#log-panel .log-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 8px 12px;
|
||||
font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
|
||||
font-size: 11px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.log-entry {
|
||||
color: var(--text-secondary);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.log-entry.error {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.log-entry.warn {
|
||||
color: var(--warning);
|
||||
}
|
||||
|
||||
.log-entry.info {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
/* ===== Toast Notifications ===== */
|
||||
|
||||
#toast-container {
|
||||
position: fixed;
|
||||
top: 44px;
|
||||
right: 16px;
|
||||
z-index: 300;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.toast {
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 12px 16px;
|
||||
font-size: 13px;
|
||||
box-shadow: 0 10px 30px var(--shadow);
|
||||
animation: toastIn 0.3s ease;
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
.toast.error {
|
||||
border-color: var(--danger);
|
||||
}
|
||||
|
||||
.toast.success {
|
||||
border-color: var(--success);
|
||||
}
|
||||
|
||||
@keyframes toastIn {
|
||||
from { opacity: 0; transform: translateX(20px); }
|
||||
to { opacity: 1; transform: translateX(0); }
|
||||
}
|
||||
|
||||
/* ===== Loading Spinner ===== */
|
||||
|
||||
.spinner {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 2px solid var(--border);
|
||||
border-top-color: var(--accent);
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* ===== Responsive ===== */
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.connection-card {
|
||||
padding: 24px;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
#toolbar {
|
||||
bottom: 10px;
|
||||
padding: 4px;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
152
shelled/rustdesk-web-client/index.html
Normal file
152
shelled/rustdesk-web-client/index.html
Normal file
@ -0,0 +1,152 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
||||
<title>RustDesk - Remote Desktop</title>
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🖥️</text></svg>">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Connection Overlay -->
|
||||
<div id="connection-overlay">
|
||||
<div class="connection-card">
|
||||
<h1>RustDesk</h1>
|
||||
<p class="subtitle">Standalone Web Client — Remote Desktop</p>
|
||||
|
||||
<form id="connection-form" onsubmit="return false;">
|
||||
<div class="form-group">
|
||||
<label for="server-addr">Server Address</label>
|
||||
<input type="text" id="server-addr" placeholder="hbbs.example.com or 192.168.1.100:21115"
|
||||
value="" autocomplete="off" spellcheck="false">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="peer-id">Remote Peer ID</label>
|
||||
<input type="text" id="peer-id" placeholder="e.g. 9-digit peer ID"
|
||||
autocomplete="off" spellcheck="false" style="font-family: monospace; font-size: 18px; letter-spacing: 2px;">
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group" style="flex: 2;">
|
||||
<label for="server-key">Server Public Key (optional)</label>
|
||||
<input type="text" id="server-key" placeholder="For encrypted connections"
|
||||
autocomplete="off" spellcheck="false" style="font-family: monospace; font-size: 11px;">
|
||||
</div>
|
||||
<div class="form-group" style="flex: 0; display: flex; align-items: flex-end;">
|
||||
<label style="display: flex; align-items: center; gap: 6px; cursor: pointer; margin-bottom: 2px;">
|
||||
<input type="checkbox" id="tls-check" checked>
|
||||
<span style="font-size: 12px; color: var(--text-secondary);">TLS</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" id="btn-connect" class="btn btn-primary">Connect</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Password Dialog -->
|
||||
<div id="password-overlay">
|
||||
<div class="password-card">
|
||||
<h2>🔐 Authentication Required</h2>
|
||||
<p style="font-size: 13px; color: var(--text-secondary); margin-bottom: 16px;">
|
||||
The remote peer requires a password to connect.
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<input type="password" id="password-input" placeholder="Enter password" autocomplete="off">
|
||||
</div>
|
||||
<div style="display: flex; gap: 8px;">
|
||||
<button type="button" class="btn btn-primary" id="btn-password-submit">Connect</button>
|
||||
<button type="button" class="btn btn-danger" id="btn-password-cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Status Bar -->
|
||||
<div id="status-bar">
|
||||
<span class="status-indicator" id="status-indicator"></span>
|
||||
<span class="status-text" id="status-text">Disconnected</span>
|
||||
<span class="status-text" style="margin-left: 16px;">
|
||||
Peer: <strong id="peer-id-display">—</strong>
|
||||
</span>
|
||||
<span class="status-text" style="margin-left: 16px;">
|
||||
Client: <strong id="client-id-display">—</strong>
|
||||
</span>
|
||||
<div class="status-right">
|
||||
<span class="fps-display" id="fps-display">— FPS</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Remote Desktop Canvas -->
|
||||
<div id="remote-canvas-wrapper">
|
||||
<canvas id="remote-canvas" tabindex="0"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- Toolbar -->
|
||||
<div id="toolbar">
|
||||
<button class="btn-icon" id="btn-disconnect" title="Disconnect">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M18.36 6.64a9 9 0 11-12.73 0M12 2v10"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="toolbar-divider"></div>
|
||||
<button class="btn-icon" id="btn-fullscreen" title="Fullscreen">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="toolbar-divider"></div>
|
||||
<button class="btn-icon" id="btn-mute" title="Toggle Audio">
|
||||
🔊
|
||||
</button>
|
||||
<button class="btn-icon" id="btn-ctrl-alt-del" title="Ctrl+Alt+Del">
|
||||
⌨️
|
||||
</button>
|
||||
<button class="btn-icon" id="btn-keyboard" title="Toggle Keyboard Mode">
|
||||
🔣
|
||||
</button>
|
||||
<div class="toolbar-divider"></div>
|
||||
<button class="btn-icon" id="btn-log" title="Toggle Log">
|
||||
📋
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Log Panel -->
|
||||
<div id="log-panel">
|
||||
<div class="log-header">
|
||||
<span>Connection Log</span>
|
||||
<button class="btn-icon btn-sm" id="btn-log-close">✕</button>
|
||||
</div>
|
||||
<div class="log-content" id="log-content"></div>
|
||||
</div>
|
||||
|
||||
<!-- Toast Container -->
|
||||
<div id="toast-container"></div>
|
||||
|
||||
<!-- External Libraries -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/protobufjs@7/dist/protobuf.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/tweetnacl@1/nacl.min.js"></script>
|
||||
|
||||
<!-- Codec Libraries (from web_deps) -->
|
||||
<script src="lib/ogvjs-1.8.6/ogv-support.js"></script>
|
||||
<script src="lib/ogvjs-1.8.6/ogv-decoder-video-vp8-wasm.js"></script>
|
||||
<script src="lib/ogvjs-1.8.6/ogv-decoder-video-vp9-wasm.js"></script>
|
||||
<script src="lib/ogvjs-1.8.6/ogv-decoder-video-av1-wasm.js"></script>
|
||||
<script src="lib/ogvjs-1.8.6/ogv-worker-video.js"></script>
|
||||
<script src="lib/ogvjs-1.8.6/ogv.js"></script>
|
||||
<script src="lib/yuv-canvas-1.2.6.js"></script>
|
||||
<script src="lib/libopus.js"></script>
|
||||
|
||||
<!-- Application -->
|
||||
<script src="js/proto.js"></script>
|
||||
<script src="js/crypto.js"></script>
|
||||
<script src="js/connection.js"></script>
|
||||
<script src="js/video.js"></script>
|
||||
<script src="js/audio.js"></script>
|
||||
<script src="js/input.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
586
shelled/rustdesk-web-client/js/app.js
Normal file
586
shelled/rustdesk-web-client/js/app.js
Normal file
@ -0,0 +1,586 @@
|
||||
/**
|
||||
* RustDesk Standalone Web Client - Application
|
||||
*
|
||||
* Main application logic, UI management, and event coordination.
|
||||
*/
|
||||
|
||||
const RDApp = (() => {
|
||||
let _logEntries = [];
|
||||
let _logVisible = false;
|
||||
let _toasts = [];
|
||||
|
||||
/**
|
||||
* Initialize the application
|
||||
*/
|
||||
async function init() {
|
||||
log('info', 'Initializing RustDesk Standalone Web Client...');
|
||||
|
||||
// Initialize protobuf definitions
|
||||
if (!RDProto.init()) {
|
||||
showError('Failed to initialize protocol definitions');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setup UI event listeners
|
||||
setupUI();
|
||||
|
||||
// Initialize audio (will be activated on user gesture)
|
||||
// RDAudio.init() called on first user interaction
|
||||
|
||||
log('info', 'Protocol definitions loaded successfully');
|
||||
log('info', 'Ready to connect. Enter server address and peer ID.');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup UI event listeners
|
||||
*/
|
||||
function setupUI() {
|
||||
// Connect button
|
||||
document.getElementById('btn-connect').addEventListener('click', handleConnect);
|
||||
|
||||
// Password dialog
|
||||
document.getElementById('btn-password-submit').addEventListener('click', handlePasswordSubmit);
|
||||
document.getElementById('btn-password-cancel').addEventListener('click', handlePasswordCancel);
|
||||
document.getElementById('password-input').addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') handlePasswordSubmit();
|
||||
if (e.key === 'Escape') handlePasswordCancel();
|
||||
});
|
||||
|
||||
// Enter key on connect form
|
||||
const inputs = document.querySelectorAll('#connection-form input');
|
||||
inputs.forEach(input => {
|
||||
input.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') handleConnect();
|
||||
});
|
||||
});
|
||||
|
||||
// Toolbar buttons
|
||||
document.getElementById('btn-disconnect').addEventListener('click', handleDisconnect);
|
||||
document.getElementById('btn-fullscreen').addEventListener('click', handleFullscreen);
|
||||
document.getElementById('btn-mute').addEventListener('click', handleToggleMute);
|
||||
document.getElementById('btn-ctrl-alt-del').addEventListener('click', handleCtrlAltDel);
|
||||
document.getElementById('btn-keyboard').addEventListener('click', handleToggleKeyboard);
|
||||
document.getElementById('btn-log').addEventListener('click', handleToggleLog);
|
||||
|
||||
// Canvas resize
|
||||
window.addEventListener('resize', handleResize);
|
||||
|
||||
// Log panel close
|
||||
document.getElementById('btn-log-close').addEventListener('click', () => {
|
||||
_logVisible = false;
|
||||
document.getElementById('log-panel').classList.remove('visible');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle connect button click
|
||||
*/
|
||||
function handleConnect() {
|
||||
const serverAddr = document.getElementById('server-addr').value.trim();
|
||||
const peerId = document.getElementById('peer-id').value.trim();
|
||||
const serverKey = document.getElementById('server-key').value.trim();
|
||||
const tls = document.getElementById('tls-check').checked;
|
||||
|
||||
if (!serverAddr) {
|
||||
showToast('Please enter a server address', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!peerId) {
|
||||
showToast('Please enter a remote peer ID', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
log('info', `Connecting to ${serverAddr} (TLS: ${tls})...`);
|
||||
log('info', `Target peer: ${peerId}`);
|
||||
|
||||
const btn = document.getElementById('btn-connect');
|
||||
btn.disabled = true;
|
||||
btn.innerHTML = '<span class="spinner"></span> Connecting...';
|
||||
|
||||
// Connect
|
||||
RDConnection.connect(serverAddr, {
|
||||
tls: tls,
|
||||
serverKey: serverKey,
|
||||
onPassword: handlePasswordRequired,
|
||||
on2FA: handle2FARequired,
|
||||
onPeerInfo: handlePeerInfo,
|
||||
onVideoFrame: handleVideoFrame,
|
||||
onAudioFrame: handleAudioFrame,
|
||||
onCursorData: handleCursorData,
|
||||
onCursorPosition: handleCursorPosition,
|
||||
onMiscEvent: handleMiscEvent,
|
||||
onClipboard: handleClipboard,
|
||||
onClose: handleSessionClose,
|
||||
onStateChange: handleStateChange,
|
||||
onError: handleError,
|
||||
});
|
||||
|
||||
// Set target peer after connecting to hbbs
|
||||
setTimeout(() => {
|
||||
RDConnection.connectToPeer(peerId);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle password required callback
|
||||
*/
|
||||
let _passwordResolve = null;
|
||||
function handlePasswordRequired(hash, resolve) {
|
||||
_passwordResolve = resolve;
|
||||
document.getElementById('password-overlay').classList.add('visible');
|
||||
document.getElementById('password-input').value = '';
|
||||
document.getElementById('password-input').focus();
|
||||
}
|
||||
|
||||
function handlePasswordSubmit() {
|
||||
const password = document.getElementById('password-input').value;
|
||||
document.getElementById('password-overlay').classList.remove('visible');
|
||||
if (_passwordResolve) {
|
||||
_passwordResolve(password);
|
||||
_passwordResolve = null;
|
||||
}
|
||||
}
|
||||
|
||||
function handlePasswordCancel() {
|
||||
document.getElementById('password-overlay').classList.remove('visible');
|
||||
if (_passwordResolve) {
|
||||
_passwordResolve(null);
|
||||
_passwordResolve = null;
|
||||
}
|
||||
}
|
||||
|
||||
function handle2FARequired(resolve) {
|
||||
// Simple prompt for 2FA (in production, use a proper dialog)
|
||||
const code = prompt('Enter 2FA code:');
|
||||
resolve(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle state changes
|
||||
*/
|
||||
function handleStateChange(newState, oldState) {
|
||||
const statusText = document.getElementById('status-text');
|
||||
const indicator = document.getElementById('status-indicator');
|
||||
|
||||
switch (newState) {
|
||||
case RDConnection.STATE.CONNECTING:
|
||||
statusText.textContent = 'Connecting to server...';
|
||||
break;
|
||||
case RDConnection.STATE.REGISTERING:
|
||||
statusText.textContent = 'Registering...';
|
||||
break;
|
||||
case RDConnection.STATE.PUNCHING:
|
||||
statusText.textContent = 'Discovering peer...';
|
||||
break;
|
||||
case RDConnection.STATE.RELAYING:
|
||||
statusText.textContent = 'Establishing relay...';
|
||||
break;
|
||||
case RDConnection.STATE.KEY_EXCHANGE:
|
||||
statusText.textContent = 'Exchanging keys...';
|
||||
break;
|
||||
case RDConnection.STATE.AUTHENTICATING:
|
||||
statusText.textContent = 'Authenticating...';
|
||||
break;
|
||||
case RDConnection.STATE.CONNECTED:
|
||||
statusText.textContent = 'Connected';
|
||||
indicator.classList.add('connected');
|
||||
onSessionConnected();
|
||||
break;
|
||||
case RDConnection.STATE.FAILED:
|
||||
statusText.textContent = 'Connection failed';
|
||||
onSessionFailed();
|
||||
break;
|
||||
case RDConnection.STATE.CLOSED:
|
||||
statusText.textContent = 'Disconnected';
|
||||
indicator.classList.remove('connected');
|
||||
onSessionClosed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle peer info received after login
|
||||
*/
|
||||
function handlePeerInfo(peerInfo) {
|
||||
log('info', `Connected to: ${peerInfo.username}@${peerInfo.hostname} (${peerInfo.platform}) v${peerInfo.version}`);
|
||||
|
||||
if (peerInfo.displays && peerInfo.displays.length > 0) {
|
||||
const display = peerInfo.displays[0];
|
||||
log('info', `Display: ${display.width}x${display.height} (${display.name})`);
|
||||
RDInput.setDisplaySize(display.width, display.height);
|
||||
RDVideo.resize(display.width, display.height);
|
||||
}
|
||||
|
||||
// Enable audio
|
||||
RDAudio.init();
|
||||
|
||||
// Enable input
|
||||
RDInput.setEnabled(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle video frame
|
||||
*/
|
||||
function handleVideoFrame(videoFrame) {
|
||||
RDVideo.handleVideoFrame(videoFrame);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle audio frame
|
||||
*/
|
||||
function handleAudioFrame(audioFrame) {
|
||||
RDAudio.handleAudioFrame(audioFrame);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle cursor data
|
||||
*/
|
||||
function handleCursorData(cursorData) {
|
||||
if (!cursorData) return;
|
||||
|
||||
const canvas = document.getElementById('remote-canvas');
|
||||
const width = cursorData.width || 0;
|
||||
const height = cursorData.height || 0;
|
||||
|
||||
if (width === 0 || height === 0 || !cursorData.colors || cursorData.colors.length === 0) {
|
||||
canvas.style.cursor = 'default';
|
||||
return;
|
||||
}
|
||||
|
||||
// Create cursor from RGBA data
|
||||
const hotx = cursorData.hotx || 0;
|
||||
const hoty = cursorData.hoty || 0;
|
||||
const colors = new Uint8Array(cursorData.colors.buffer || cursorData.colors);
|
||||
|
||||
// Create a canvas for the cursor image
|
||||
const cursorCanvas = document.createElement('canvas');
|
||||
cursorCanvas.width = width;
|
||||
cursorCanvas.height = height;
|
||||
const ctx = cursorCanvas.getContext('2d');
|
||||
const imageData = ctx.createImageData(width, height);
|
||||
|
||||
for (let i = 0; i < width * height; i++) {
|
||||
const srcIdx = i * 4;
|
||||
const dstIdx = i * 4;
|
||||
// RustDesk sends BGRA, convert to RGBA
|
||||
imageData.data[dstIdx] = colors[srcIdx + 2]; // R
|
||||
imageData.data[dstIdx + 1] = colors[srcIdx + 1]; // G
|
||||
imageData.data[dstIdx + 2] = colors[srcIdx]; // B
|
||||
imageData.data[dstIdx + 3] = colors[srcIdx + 3]; // A
|
||||
}
|
||||
|
||||
ctx.putImageData(imageData, 0, 0);
|
||||
const url = cursorCanvas.toDataURL();
|
||||
canvas.style.cursor = `url(${url}) ${hotx} ${hoty}, default`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle cursor position update
|
||||
*/
|
||||
function handleCursorPosition(pos) {
|
||||
// Position updates are informational; the local cursor is already tracked
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle misc events
|
||||
*/
|
||||
function handleMiscEvent(field, data) {
|
||||
switch (field) {
|
||||
case 'audio_format':
|
||||
if (data.sample_rate) {
|
||||
RDAudio.setFormat(data.sample_rate, data.channels || 2);
|
||||
}
|
||||
break;
|
||||
case 'switch_display':
|
||||
if (data.width && data.height) {
|
||||
RDInput.setDisplaySize(data.width, data.height);
|
||||
RDVideo.resize(data.width, data.height);
|
||||
}
|
||||
break;
|
||||
case 'close_reason':
|
||||
log('warn', `Session closed by peer: ${data.close_reason}`);
|
||||
break;
|
||||
case 'permission_info':
|
||||
const permName = data.permission_info.permission;
|
||||
const enabled = data.permission_info.enabled;
|
||||
log('info', `Permission ${permName}: ${enabled ? 'granted' : 'revoked'}`);
|
||||
break;
|
||||
case 'message_box':
|
||||
showToast(`${data.title}: ${data.text}`, 'info');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle clipboard event
|
||||
*/
|
||||
function handleClipboard(clipboard) {
|
||||
if (!clipboard || !clipboard.contents || clipboard.contents.length === 0) return;
|
||||
|
||||
for (const content of clipboard.contents) {
|
||||
if (content.format === 0 && content.data) { // Text format
|
||||
const text = new TextDecoder().decode(content.data);
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(text).catch(() => {});
|
||||
}
|
||||
log('info', 'Clipboard updated from remote');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle errors
|
||||
*/
|
||||
function handleError(error) {
|
||||
log('error', error);
|
||||
showToast(error, 'error');
|
||||
resetConnectButton();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle session close
|
||||
*/
|
||||
function handleSessionClose(reason) {
|
||||
log('warn', 'Session closed:', reason);
|
||||
showToast('Session closed: ' + (reason || 'Unknown reason'), 'info');
|
||||
onSessionClosed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when session is connected
|
||||
*/
|
||||
function onSessionConnected() {
|
||||
resetConnectButton();
|
||||
|
||||
// Hide connection overlay, show remote desktop
|
||||
document.getElementById('connection-overlay').classList.add('hidden');
|
||||
document.getElementById('status-bar').classList.add('visible');
|
||||
document.getElementById('toolbar').classList.add('visible');
|
||||
document.getElementById('remote-canvas-wrapper').classList.add('visible');
|
||||
|
||||
// Initialize video and input
|
||||
const canvas = document.getElementById('remote-canvas');
|
||||
RDVideo.init(canvas);
|
||||
RDInput.init(canvas);
|
||||
|
||||
// Update status
|
||||
const peerId = document.getElementById('peer-id').value.trim();
|
||||
document.getElementById('peer-id-display').textContent = peerId;
|
||||
|
||||
log('info', 'Session established!');
|
||||
|
||||
// Start FPS display update
|
||||
setInterval(updateFpsDisplay, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when session fails
|
||||
*/
|
||||
function onSessionFailed() {
|
||||
resetConnectButton();
|
||||
RDConnection.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when session is closed
|
||||
*/
|
||||
function onSessionClosed() {
|
||||
resetConnectButton();
|
||||
|
||||
// Show connection overlay, hide remote desktop
|
||||
document.getElementById('connection-overlay').classList.remove('hidden');
|
||||
document.getElementById('status-bar').classList.remove('visible');
|
||||
document.getElementById('toolbar').classList.remove('visible');
|
||||
document.getElementById('remote-canvas-wrapper').classList.remove('visible');
|
||||
|
||||
// Disable input
|
||||
RDInput.setEnabled(false);
|
||||
|
||||
// Cleanup audio
|
||||
RDAudio.cleanup();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset connect button state
|
||||
*/
|
||||
function resetConnectButton() {
|
||||
const btn = document.getElementById('btn-connect');
|
||||
btn.disabled = false;
|
||||
btn.innerHTML = 'Connect';
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle disconnect button
|
||||
*/
|
||||
function handleDisconnect() {
|
||||
RDConnection.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle fullscreen toggle
|
||||
*/
|
||||
function handleFullscreen() {
|
||||
if (document.fullscreenElement) {
|
||||
document.exitFullscreen();
|
||||
} else {
|
||||
document.documentElement.requestFullscreen().catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle mute toggle
|
||||
*/
|
||||
function handleToggleMute() {
|
||||
const muted = RDAudio.toggleMute();
|
||||
const btn = document.getElementById('btn-mute');
|
||||
btn.classList.toggle('active', muted);
|
||||
btn.textContent = muted ? '🔇' : '🔊';
|
||||
log('info', muted ? 'Audio muted' : 'Audio unmuted');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle Ctrl+Alt+Del
|
||||
*/
|
||||
function handleCtrlAltDel() {
|
||||
RDConnection.sendCtrlAltDel();
|
||||
log('info', 'Sent Ctrl+Alt+Del');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle keyboard toggle
|
||||
*/
|
||||
function handleToggleKeyboard() {
|
||||
// Toggle keyboard capture mode
|
||||
const btn = document.getElementById('btn-keyboard');
|
||||
btn.classList.toggle('active');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle log toggle
|
||||
*/
|
||||
function handleToggleLog() {
|
||||
_logVisible = !_logVisible;
|
||||
const panel = document.getElementById('log-panel');
|
||||
panel.classList.toggle('visible', _logVisible);
|
||||
const btn = document.getElementById('btn-log');
|
||||
btn.classList.toggle('active', _logVisible);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle window resize
|
||||
*/
|
||||
function handleResize() {
|
||||
if (RDConnection.isConnected) {
|
||||
RDInput.setDisplaySize(RDVideo.getDisplaySize().width, RDVideo.getDisplaySize().height);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update FPS display
|
||||
*/
|
||||
function updateFpsDisplay() {
|
||||
if (!RDConnection.isConnected) return;
|
||||
const fps = RDVideo.getFps();
|
||||
document.getElementById('fps-display').textContent = `${fps} FPS`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add log entry
|
||||
*/
|
||||
function log(level, message) {
|
||||
const timestamp = new Date().toLocaleTimeString();
|
||||
const entry = { level, message, timestamp };
|
||||
_logEntries.push(entry);
|
||||
|
||||
// Update log panel if visible
|
||||
const logContent = document.getElementById('log-content');
|
||||
if (logContent) {
|
||||
const div = document.createElement('div');
|
||||
div.className = `log-entry ${level}`;
|
||||
div.textContent = `[${timestamp}] ${message}`;
|
||||
logContent.appendChild(div);
|
||||
logContent.scrollTop = logContent.scrollHeight;
|
||||
}
|
||||
|
||||
// Also log to console
|
||||
const prefix = { info: 'ℹ️', warn: '⚠️', error: '❌', debug: '🐛' }[level] || '';
|
||||
console.log(`${prefix} [RD] ${message}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show error
|
||||
*/
|
||||
function showError(message) {
|
||||
log('error', message);
|
||||
showToast(message, 'error');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show toast notification
|
||||
*/
|
||||
function showToast(message, type = 'info') {
|
||||
const container = document.getElementById('toast-container');
|
||||
const toast = document.createElement('div');
|
||||
toast.className = `toast ${type}`;
|
||||
toast.textContent = message;
|
||||
container.appendChild(toast);
|
||||
|
||||
setTimeout(() => {
|
||||
toast.style.opacity = '0';
|
||||
toast.style.transform = 'translateX(20px)';
|
||||
toast.style.transition = 'all 0.3s ease';
|
||||
setTimeout(() => toast.remove(), 300);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
return { init, log, showError, showToast };
|
||||
})();
|
||||
|
||||
// ===== Bootstrap =====
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
// Wait for external libraries to load
|
||||
const waitForLib = (name, check, timeout = 5000) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (check()) { resolve(); return; }
|
||||
const start = Date.now();
|
||||
const interval = setInterval(() => {
|
||||
if (check()) { clearInterval(interval); resolve(); return; }
|
||||
if (Date.now() - start > timeout) {
|
||||
clearInterval(interval);
|
||||
reject(new Error(`${name} not available after ${timeout}ms`));
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
};
|
||||
|
||||
try {
|
||||
// Wait for protobuf.js
|
||||
await waitForLib('protobuf.js', () => typeof protobuf !== 'undefined');
|
||||
// Wait for TweetNaCl.js
|
||||
await waitForLib('TweetNaCl.js', () => typeof nacl !== 'undefined');
|
||||
|
||||
RDApp.log('info', 'External libraries loaded');
|
||||
|
||||
// Try to load yuv-canvas
|
||||
if (typeof YUVCanvas !== 'undefined') {
|
||||
RDApp.log('info', 'yuv-canvas loaded');
|
||||
} else {
|
||||
RDApp.log('warn', 'yuv-canvas not available, video rendering may be limited');
|
||||
}
|
||||
|
||||
// Initialize the app
|
||||
await RDApp.init();
|
||||
|
||||
RDApp.log('info', 'RustDesk Standalone Web Client ready!');
|
||||
RDApp.log('info', 'Supported codecs: VP8, VP9, AV1 (via ogvjs)');
|
||||
RDApp.log('info', 'Audio: Opus (via libopus)');
|
||||
|
||||
} catch (e) {
|
||||
RDApp.log('error', `Initialization failed: ${e.message}`);
|
||||
RDApp.showToast('Failed to initialize. Check console for details.', 'error');
|
||||
}
|
||||
});
|
||||
260
shelled/rustdesk-web-client/js/audio.js
Normal file
260
shelled/rustdesk-web-client/js/audio.js
Normal file
@ -0,0 +1,260 @@
|
||||
/**
|
||||
* RustDesk Standalone Web Client - Audio Decoder
|
||||
*
|
||||
* Handles Opus audio decoding using libopus WASM and playback
|
||||
* through the Web Audio API.
|
||||
*/
|
||||
|
||||
const RDAudio = (() => {
|
||||
let _audioContext = null;
|
||||
let _opusDecoder = null;
|
||||
let _sampleRate = 48000;
|
||||
let _channels = 2;
|
||||
let _gainNode = null;
|
||||
let _isMuted = false;
|
||||
let _volume = 1.0;
|
||||
let _isEnabled = true;
|
||||
let _nextPlayTime = 0;
|
||||
let _initialized = false;
|
||||
|
||||
/**
|
||||
* Initialize audio subsystem
|
||||
*/
|
||||
async function init() {
|
||||
if (_initialized) return true;
|
||||
|
||||
try {
|
||||
_audioContext = new (window.AudioContext || window.webkitAudioContext)({
|
||||
sampleRate: _sampleRate,
|
||||
latencyHint: 'interactive'
|
||||
});
|
||||
|
||||
_gainNode = _audioContext.createGain();
|
||||
_gainNode.connect(_audioContext.destination);
|
||||
_gainNode.gain.value = _volume;
|
||||
|
||||
// Initialize libopus decoder
|
||||
await initOpusDecoder();
|
||||
|
||||
_initialized = true;
|
||||
console.log('[RDAudio] Initialized. Sample rate:', _sampleRate, 'Channels:', _channels);
|
||||
return true;
|
||||
} catch (e) {
|
||||
console.error('[RDAudio] Initialization failed:', e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the Opus decoder from libopus WASM
|
||||
*/
|
||||
async function initOpusDecoder() {
|
||||
if (typeof OpusDecoder === 'undefined') {
|
||||
console.warn('[RDAudio] OpusDecoder not available, audio disabled');
|
||||
_isEnabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
_opusDecoder = new OpusDecoder();
|
||||
// Initialize with sample rate and channels
|
||||
const initResult = await _opusDecoder.init(_sampleRate, _channels);
|
||||
if (initResult !== 0) {
|
||||
console.error('[RDAudio] Opus decoder init failed:', initResult);
|
||||
_opusDecoder = null;
|
||||
_isEnabled = false;
|
||||
return;
|
||||
}
|
||||
console.log('[RDAudio] Opus decoder initialized');
|
||||
} catch (e) {
|
||||
console.warn('[RDAudio] Opus decoder creation failed:', e);
|
||||
_opusDecoder = null;
|
||||
_isEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle incoming AudioFrame from the session
|
||||
* @param {Object} audioFrame - Decoded protobuf AudioFrame
|
||||
*/
|
||||
function handleAudioFrame(audioFrame) {
|
||||
if (!_isEnabled || !_audioContext) return;
|
||||
if (_audioContext.state === 'suspended') {
|
||||
_audioContext.resume();
|
||||
}
|
||||
|
||||
if (!audioFrame.data || audioFrame.data.byteLength === 0) return;
|
||||
|
||||
try {
|
||||
if (_opusDecoder) {
|
||||
decodeAndPlayOpus(audioFrame.data);
|
||||
} else {
|
||||
// Fallback: try to play raw PCM data
|
||||
playPCMData(audioFrame.data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[RDAudio] Audio decode error:', e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode Opus data and play through Web Audio API
|
||||
*/
|
||||
function decodeAndPlayOpus(opusData) {
|
||||
if (!_opusDecoder || !_audioContext) return;
|
||||
|
||||
const inputData = new Uint8Array(opusData.buffer || opusData);
|
||||
|
||||
// Decode Opus to PCM
|
||||
const pcmBuffer = _opusDecoder.decode(inputData);
|
||||
|
||||
if (pcmBuffer && pcmBuffer.length > 0) {
|
||||
playPCMData(pcmBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Play PCM data through Web Audio API
|
||||
* @param {Float32Array|Uint8Array} pcmData - PCM audio data
|
||||
*/
|
||||
function playPCMData(pcmData) {
|
||||
if (!_audioContext || _isMuted) return;
|
||||
|
||||
let float32Data;
|
||||
|
||||
if (pcmData instanceof Float32Array) {
|
||||
float32Data = pcmData;
|
||||
} else {
|
||||
// Convert bytes to Float32
|
||||
const dataView = new DataView(pcmData.buffer || pcmData);
|
||||
float32Data = new Float32Array(dataView.byteLength / 4);
|
||||
for (let i = 0; i < float32Data.length; i++) {
|
||||
float32Data[i] = dataView.getFloat32(i * 4, true); // Little-endian
|
||||
}
|
||||
}
|
||||
|
||||
const frameCount = float32Data.length / _channels;
|
||||
if (frameCount === 0) return;
|
||||
|
||||
// Create AudioBuffer
|
||||
const audioBuffer = _audioContext.createBuffer(_channels, frameCount, _sampleRate);
|
||||
|
||||
for (let ch = 0; ch < _channels; ch++) {
|
||||
const channelData = audioBuffer.getChannelData(ch);
|
||||
for (let i = 0; i < frameCount; i++) {
|
||||
channelData[i] = float32Data[i * _channels + ch];
|
||||
}
|
||||
}
|
||||
|
||||
// Schedule playback
|
||||
schedulePlayback(audioBuffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule audio buffer playback with gapless transition
|
||||
*/
|
||||
function schedulePlayback(audioBuffer) {
|
||||
const currentTime = _audioContext.currentTime;
|
||||
const startTime = Math.max(currentTime, _nextPlayTime);
|
||||
|
||||
const source = _audioContext.createBufferSource();
|
||||
source.buffer = audioBuffer;
|
||||
source.connect(_gainNode);
|
||||
|
||||
source.onended = () => {
|
||||
source.disconnect();
|
||||
};
|
||||
|
||||
source.start(startTime);
|
||||
_nextPlayTime = startTime + audioBuffer.duration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set audio format from server's AudioFormat message
|
||||
*/
|
||||
function setFormat(sampleRate, channels) {
|
||||
if (sampleRate > 0) _sampleRate = sampleRate;
|
||||
if (channels > 0) _channels = channels;
|
||||
console.log('[RDAudio] Format updated:', _sampleRate, 'Hz,', _channels, 'channels');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set volume (0.0 to 1.0)
|
||||
*/
|
||||
function setVolume(volume) {
|
||||
_volume = Math.max(0, Math.min(1, volume));
|
||||
if (_gainNode) {
|
||||
_gainNode.gain.value = _volume;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mute/unmute audio
|
||||
*/
|
||||
function setMuted(muted) {
|
||||
_isMuted = muted;
|
||||
if (_gainNode) {
|
||||
_gainNode.gain.value = muted ? 0 : _volume;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle mute
|
||||
*/
|
||||
function toggleMute() {
|
||||
setMuted(!_isMuted);
|
||||
return _isMuted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mute state
|
||||
*/
|
||||
function isMuted() {
|
||||
return _isMuted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if audio is enabled and initialized
|
||||
*/
|
||||
function isEnabled() {
|
||||
return _isEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resume audio context (needed after user gesture)
|
||||
*/
|
||||
async function resume() {
|
||||
if (_audioContext && _audioContext.state === 'suspended') {
|
||||
await _audioContext.resume();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up audio resources
|
||||
*/
|
||||
function cleanup() {
|
||||
if (_opusDecoder) {
|
||||
try { _opusDecoder.destroy(); } catch (e) {}
|
||||
_opusDecoder = null;
|
||||
}
|
||||
if (_audioContext) {
|
||||
_audioContext.close().catch(() => {});
|
||||
_audioContext = null;
|
||||
}
|
||||
_initialized = false;
|
||||
_nextPlayTime = 0;
|
||||
}
|
||||
|
||||
return {
|
||||
init,
|
||||
handleAudioFrame,
|
||||
setFormat,
|
||||
setVolume,
|
||||
setMuted,
|
||||
toggleMute,
|
||||
isMuted,
|
||||
isEnabled,
|
||||
resume,
|
||||
cleanup
|
||||
};
|
||||
})();
|
||||
1017
shelled/rustdesk-web-client/js/connection.js
Normal file
1017
shelled/rustdesk-web-client/js/connection.js
Normal file
File diff suppressed because it is too large
Load Diff
341
shelled/rustdesk-web-client/js/crypto.js
Normal file
341
shelled/rustdesk-web-client/js/crypto.js
Normal file
@ -0,0 +1,341 @@
|
||||
/**
|
||||
* RustDesk Standalone Web Client - Cryptography Module
|
||||
*
|
||||
* Handles NaCl encryption/decryption, key exchange, and password hashing.
|
||||
* Uses TweetNaCl.js for all cryptographic operations.
|
||||
*/
|
||||
|
||||
const RDCrypto = (() => {
|
||||
let _sessionKey = null; // 32-byte symmetric key for session encryption
|
||||
let _sendSeq = 0; // Send sequence counter
|
||||
let _recvSeq = 0; // Receive sequence counter
|
||||
let _peerPk = null; // Peer's Ed25519 public key (from PunchHoleResponse)
|
||||
let _mySignKeyPair = null; // Our Ed25519 signing keypair
|
||||
let _myBoxKeyPair = null; // Our Curve25519 box keypair (per-session)
|
||||
|
||||
/**
|
||||
* Generate a random Ed25519 signing keypair
|
||||
*/
|
||||
function generateSignKeyPair() {
|
||||
_mySignKeyPair = nacl.sign.keyPair();
|
||||
return _mySignKeyPair;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a random Curve25519 keypair for ECDH
|
||||
*/
|
||||
function generateBoxKeyPair() {
|
||||
_myBoxKeyPair = nacl.box.keyPair();
|
||||
return _myBoxKeyPair;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get our Ed25519 public key (32 bytes)
|
||||
*/
|
||||
function getSignPublicKey() {
|
||||
return _mySignKeyPair ? _mySignKeyPair.publicKey : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get our Curve25519 public key (32 bytes)
|
||||
*/
|
||||
function getBoxPublicKey() {
|
||||
return _myBoxKeyPair ? _myBoxKeyPair.publicKey : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the peer's Ed25519 public key (from PunchHoleResponse.pk)
|
||||
*/
|
||||
function setPeerPublicKey(pk) {
|
||||
_peerPk = new Uint8Array(pk);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify a SignedId message
|
||||
* SignedId.id = Ed25519 signature (64 bytes) || serialized IdPk protobuf
|
||||
* Verification uses the peer's Ed25519 public key from PunchHoleResponse
|
||||
* Returns the deserialized IdPk { id, pk } on success
|
||||
*/
|
||||
function verifySignedId(signedIdBytes) {
|
||||
if (!_peerPk || _peerPk.length < 32) {
|
||||
throw new Error('Peer public key not set');
|
||||
}
|
||||
|
||||
const signed = new Uint8Array(signedIdBytes);
|
||||
if (signed.length < 64) {
|
||||
throw new Error('SignedId too short');
|
||||
}
|
||||
|
||||
// NaCl sign format: signature (64 bytes) || message
|
||||
const signature = signed.slice(0, 64);
|
||||
const message = signed.slice(64);
|
||||
|
||||
// Verify Ed25519 signature
|
||||
// Note: nacl.sign.detached.verify expects (message, signature, publicKey)
|
||||
const verified = nacl.sign.detached.verify(message, signature, _peerPk);
|
||||
if (!verified) {
|
||||
throw new Error('SignedId verification failed');
|
||||
}
|
||||
|
||||
// Parse the message as IdPk protobuf
|
||||
const IdPk = RDProto.lookup('IdPk');
|
||||
const idPk = IdPk.decode(message);
|
||||
|
||||
console.log('[RDCrypto] SignedId verified. Peer ID:', idPk.id,
|
||||
'Curve25519 pk length:', idPk.pk.length);
|
||||
return idPk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a PublicKey message for key exchange response
|
||||
* Generates a random 32-byte symmetric key and encrypts it with nacl.box
|
||||
*
|
||||
* @param {Uint8Array} peerCurvePk - Peer's ephemeral Curve25519 public key (from IdPk.pk)
|
||||
* @returns {Object} { asymmetric_value, symmetric_value }
|
||||
*/
|
||||
function createKeyExchangeResponse(peerCurvePk) {
|
||||
if (!_myBoxKeyPair) {
|
||||
generateBoxKeyPair();
|
||||
}
|
||||
|
||||
// Generate random 32-byte symmetric session key
|
||||
_sessionKey = nacl.randomBytes(32);
|
||||
_sendSeq = 0;
|
||||
_recvSeq = 0;
|
||||
|
||||
// Compute shared key via ECDH: box.before(peer_pk, our_sk)
|
||||
const sharedKey = nacl.box.before(new Uint8Array(peerCurvePk), _myBoxKeyPair.secretKey);
|
||||
|
||||
// Encrypt the session key with the shared key
|
||||
// nacl.box.after(message, nonce, sharedKey) returns MAC(16) + ciphertext
|
||||
const nonce = new Uint8Array(24); // All zeros for key exchange
|
||||
const encrypted = nacl.box.after(_sessionKey, nonce, sharedKey);
|
||||
|
||||
const result = {
|
||||
asymmetric_value: _myBoxKeyPair.publicKey, // Our Curve25519 pk (32 bytes)
|
||||
symmetric_value: encrypted // MAC(16) + encrypted key (32) = 48 bytes
|
||||
};
|
||||
|
||||
console.log('[RDCrypto] Key exchange response created. Session key established.');
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypt session data using NaCl secretbox
|
||||
* Format: MAC (16 bytes) + ciphertext
|
||||
* Nonce: 24-byte LE encoding of sequence number
|
||||
*/
|
||||
function encrypt(data) {
|
||||
if (!_sessionKey) return data;
|
||||
|
||||
const nonce = new Uint8Array(24);
|
||||
const view = new DataView(nonce.buffer);
|
||||
_sendSeq++;
|
||||
view.setBigUint64(0, BigInt(_sendSeq), true); // LE
|
||||
|
||||
const encrypted = nacl.secretbox(new Uint8Array(data), nonce, _sessionKey);
|
||||
return encrypted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrypt session data using NaCl secretbox
|
||||
*/
|
||||
function decrypt(data) {
|
||||
if (!_sessionKey) return new Uint8Array(data);
|
||||
|
||||
const nonce = new Uint8Array(24);
|
||||
const view = new DataView(nonce.buffer);
|
||||
_recvSeq++;
|
||||
view.setBigUint64(0, BigInt(_recvSeq), true); // LE
|
||||
|
||||
const decrypted = nacl.secretbox.open(new Uint8Array(data), nonce, _sessionKey);
|
||||
if (!decrypted) {
|
||||
console.error('[RDCrypto] Decryption failed! Seq:', _recvSeq);
|
||||
return null;
|
||||
}
|
||||
return decrypted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if encryption is active
|
||||
*/
|
||||
function isEncrypted() {
|
||||
return _sessionKey !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset encryption state
|
||||
*/
|
||||
function reset() {
|
||||
_sessionKey = null;
|
||||
_sendSeq = 0;
|
||||
_recvSeq = 0;
|
||||
_peerPk = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hash password for RustDesk authentication
|
||||
* RustDesk expects: SHA256(salt + password)
|
||||
*
|
||||
* @param {string} salt - The salt from the Hash challenge
|
||||
* @param {string} password - The user's password
|
||||
* @returns {Promise<Uint8Array>} - SHA256 hash as bytes
|
||||
*/
|
||||
async hashPassword(salt, password) {
|
||||
const data = new TextEncoder().encode(salt + password);
|
||||
const hash = await crypto.subtle.digest('SHA-256', data);
|
||||
return new Uint8Array(hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify hbbs server key exchange signature
|
||||
* The server sends KeyExchange { keys: [signed_ephemeral_pk] }
|
||||
* where signed_ephemeral_pk is Ed25519-sign(signature || ephemeral_pk)
|
||||
*
|
||||
* @param {Uint8Array} signedKey - The signed key from server's KeyExchange
|
||||
* @param {Uint8Array} serverPk - The server's long-term Ed25519 public key
|
||||
* @returns {Uint8Array|null} - The server's ephemeral Curve25519 public key
|
||||
*/
|
||||
function verifyServerKey(signedKey, serverPk) {
|
||||
const signed = new Uint8Array(signedKey);
|
||||
if (signed.length < 64) return null;
|
||||
|
||||
const signature = signed.slice(0, 64);
|
||||
const message = signed.slice(64);
|
||||
|
||||
const verified = nacl.sign.detached.verify(message, signature, new Uint8Array(serverPk));
|
||||
if (!verified) {
|
||||
console.error('[RDCrypto] Server key verification failed');
|
||||
return null;
|
||||
}
|
||||
|
||||
console.log('[RDCrypto] Server key verified, ephemeral pk length:', message.length);
|
||||
return message; // This is the server's ephemeral Curve25519 pk
|
||||
}
|
||||
|
||||
/**
|
||||
* Create client response for hbbs server key exchange
|
||||
* @param {Uint8Array} serverEphemeralPk - Server's ephemeral Curve25519 pk
|
||||
* @returns {Uint8Array[]} - [our_ephemeral_pk, encrypted_symmetric_key]
|
||||
*/
|
||||
function createServerKeyResponse(serverEphemeralPk) {
|
||||
if (!_myBoxKeyPair) {
|
||||
generateBoxKeyPair();
|
||||
}
|
||||
|
||||
// Generate symmetric key for hbbs communication
|
||||
const symmetricKey = nacl.randomBytes(32);
|
||||
|
||||
// Compute shared key via ECDH
|
||||
const sharedKey = nacl.box.before(new Uint8Array(serverEphemeralPk), _myBoxKeyPair.secretKey);
|
||||
|
||||
// Encrypt symmetric key
|
||||
const nonce = new Uint8Array(24);
|
||||
const encrypted = nacl.box.after(symmetricKey, nonce, sharedKey);
|
||||
|
||||
// Store the symmetric key for hbbs communication
|
||||
// We'll handle this separately from the session key
|
||||
// For now, just return the response
|
||||
return [
|
||||
_myBoxKeyPair.publicKey, // Our ephemeral Curve25519 pk
|
||||
encrypted // Encrypted symmetric key
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get our Curve25519 secret key (32 bytes)
|
||||
*/
|
||||
function getBoxSecretKey() {
|
||||
return _myBoxKeyPair ? _myBoxKeyPair.secretKey : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a fresh Curve25519 keypair for hbbs encryption
|
||||
* Separate from the session keypair used for peer-to-peer
|
||||
*/
|
||||
let _hbbsBoxKeyPair = null;
|
||||
let _hbbsSharedKey = null;
|
||||
let _hbbsSendSeq = 0;
|
||||
let _hbbsRecvSeq = 0;
|
||||
|
||||
function generateHbbsKeyPair() {
|
||||
_hbbsBoxKeyPair = nacl.box.keyPair();
|
||||
return _hbbsBoxKeyPair;
|
||||
}
|
||||
|
||||
function setupHbbsEncryption(serverEphemeralPk) {
|
||||
if (!_hbbsBoxKeyPair) generateHbbsKeyPair();
|
||||
_hbbsSharedKey = nacl.box.before(
|
||||
new Uint8Array(serverEphemeralPk),
|
||||
_hbbsBoxKeyPair.secretKey
|
||||
);
|
||||
_hbbsSendSeq = 0;
|
||||
_hbbsRecvSeq = 0;
|
||||
}
|
||||
|
||||
function hbbsEncrypt(data) {
|
||||
if (!_hbbsSharedKey) return data;
|
||||
_hbbsSendSeq++;
|
||||
const nonce = new Uint8Array(24);
|
||||
new DataView(nonce.buffer).setBigUint64(0, BigInt(_hbbsSendSeq), true);
|
||||
return nacl.secretbox(new Uint8Array(data), nonce, _hbbsSharedKey);
|
||||
}
|
||||
|
||||
function hbbsDecrypt(data) {
|
||||
if (!_hbbsSharedKey) return new Uint8Array(data);
|
||||
_hbbsRecvSeq++;
|
||||
const nonce = new Uint8Array(24);
|
||||
new DataView(nonce.buffer).setBigUint64(0, BigInt(_hbbsRecvSeq), true);
|
||||
const decrypted = nacl.secretbox.open(new Uint8Array(data), nonce, _hbbsSharedKey);
|
||||
if (!decrypted) {
|
||||
console.error('[RDCrypto] hbbs decryption failed!');
|
||||
return null;
|
||||
}
|
||||
return decrypted;
|
||||
}
|
||||
|
||||
function isHbbsEncrypted() {
|
||||
return _hbbsSharedKey !== null;
|
||||
}
|
||||
|
||||
function createHbbsKeyResponse(serverEphemeralPk) {
|
||||
if (!_hbbsBoxKeyPair) generateHbbsKeyPair();
|
||||
setupHbbsEncryption(serverEphemeralPk);
|
||||
return [
|
||||
_hbbsBoxKeyPair.publicKey, // Our ephemeral Curve25519 pk
|
||||
null // The shared key is derived via ECDH, no separate encrypted key needed
|
||||
];
|
||||
}
|
||||
|
||||
function resetHbbs() {
|
||||
_hbbsBoxKeyPair = null;
|
||||
_hbbsSharedKey = null;
|
||||
_hbbsSendSeq = 0;
|
||||
_hbbsRecvSeq = 0;
|
||||
}
|
||||
|
||||
return {
|
||||
generateSignKeyPair,
|
||||
generateBoxKeyPair,
|
||||
getSignPublicKey,
|
||||
getBoxPublicKey,
|
||||
getBoxSecretKey,
|
||||
setPeerPublicKey,
|
||||
verifySignedId,
|
||||
createKeyExchangeResponse,
|
||||
encrypt,
|
||||
decrypt,
|
||||
isEncrypted,
|
||||
reset,
|
||||
hashPassword,
|
||||
verifyServerKey,
|
||||
createServerKeyResponse: createHbbsKeyResponse,
|
||||
setupHbbsEncryption,
|
||||
hbbsEncrypt,
|
||||
hbbsDecrypt,
|
||||
isHbbsEncrypted,
|
||||
generateHbbsKeyPair,
|
||||
get hbbsBoxPublicKey() { return _hbbsBoxKeyPair ? _hbbsBoxKeyPair.publicKey : null; },
|
||||
resetHbbs
|
||||
};
|
||||
})();
|
||||
412
shelled/rustdesk-web-client/js/input.js
Normal file
412
shelled/rustdesk-web-client/js/input.js
Normal file
@ -0,0 +1,412 @@
|
||||
/**
|
||||
* RustDesk Standalone Web Client - Input Handler
|
||||
*
|
||||
* Captures mouse and keyboard events from the remote desktop canvas
|
||||
* and converts them to RustDesk protocol messages.
|
||||
*/
|
||||
|
||||
const RDInput = (() => {
|
||||
let _canvas = null;
|
||||
let _enabled = false;
|
||||
let _displayWidth = 0;
|
||||
let _displayHeight = 0;
|
||||
let _scaleX = 1;
|
||||
let _scaleY = 1;
|
||||
let _mouseButtons = 0; // Current mouse button mask
|
||||
let _modifiers = []; // Current modifier keys
|
||||
let _keyboardLocked = false;
|
||||
let _viewOnly = false;
|
||||
|
||||
// Mouse button masks
|
||||
const MOUSE = {
|
||||
LEFT: 1,
|
||||
RIGHT: 2,
|
||||
MIDDLE: 4,
|
||||
BUTTON4: 8,
|
||||
BUTTON5: 16
|
||||
};
|
||||
|
||||
// Modifier key mappings
|
||||
const MODIFIER_MAP = {
|
||||
'ControlLeft': 50, // LeftControl
|
||||
'ControlRight': 54, // RightControl
|
||||
'ShiftLeft': 51, // LeftShift
|
||||
'ShiftRight': 55, // RightShift
|
||||
'AltLeft': 52, // LeftAlt
|
||||
'AltRight': 56, // RightAlt
|
||||
'MetaLeft': 53, // LeftMeta
|
||||
'MetaRight': 57, // RightMeta
|
||||
};
|
||||
|
||||
// Key name to ControlKey enum mapping
|
||||
const KEY_MAP = {
|
||||
'Alt': 1, 'Backspace': 2, 'CapsLock': 3, 'Control': 4, 'Delete': 5,
|
||||
'ArrowDown': 6, 'End': 7, 'Escape': 8,
|
||||
'F1': 9, 'F10': 10, 'F11': 11, 'F12': 12,
|
||||
'F2': 13, 'F3': 14, 'F4': 15, 'F5': 16, 'F6': 17,
|
||||
'F7': 18, 'F8': 19, 'F9': 20,
|
||||
'Home': 21, 'ArrowLeft': 22, 'Meta': 23,
|
||||
'PageDown': 24, 'PageUp': 25, 'Enter': 26, 'Return': 26,
|
||||
'ArrowRight': 27, 'Shift': 28, ' ': 29, 'Space': 29,
|
||||
'Tab': 30, 'ArrowUp': 31,
|
||||
'Insert': 49,
|
||||
'NumLock': 63, 'ScrollLock': 64,
|
||||
'PrintScreen': 66,
|
||||
'Numpad0': 32, 'Numpad1': 33, 'Numpad2': 34, 'Numpad3': 35,
|
||||
'Numpad4': 36, 'Numpad5': 37, 'Numpad6': 38, 'Numpad7': 39,
|
||||
'Numpad8': 40, 'Numpad9': 41,
|
||||
'NumpadAdd': 42, 'NumpadDecimal': 43, 'NumpadDelete': 44,
|
||||
'NumpadDivide': 45, 'NumpadEnter': 46,
|
||||
'NumpadMultiply': 47, 'NumpadSubtract': 48,
|
||||
'VolumeDown': 58, 'VolumeMute': 59, 'VolumeUp': 60,
|
||||
'ContextMenu': 61,
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize input handler
|
||||
* @param {HTMLCanvasElement} canvas - The canvas to capture events from
|
||||
*/
|
||||
function init(canvas) {
|
||||
_canvas = canvas;
|
||||
attachMouseEvents();
|
||||
attachKeyboardEvents();
|
||||
attachTouchEvents();
|
||||
attachWheelEvents();
|
||||
console.log('[RDInput] Initialized');
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable input capture
|
||||
*/
|
||||
function setEnabled(enabled) {
|
||||
_enabled = enabled;
|
||||
if (enabled) {
|
||||
_canvas.style.cursor = 'default';
|
||||
} else {
|
||||
_canvas.style.cursor = 'not-allowed';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set view-only mode
|
||||
*/
|
||||
function setViewOnly(viewOnly) {
|
||||
_viewOnly = viewOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update display dimensions for coordinate mapping
|
||||
*/
|
||||
function setDisplaySize(width, height) {
|
||||
_displayWidth = width;
|
||||
_displayHeight = height;
|
||||
updateScale();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate scale factors for coordinate mapping
|
||||
*/
|
||||
function updateScale() {
|
||||
if (_canvas && _displayWidth > 0 && _displayHeight > 0) {
|
||||
_scaleX = _displayWidth / _canvas.clientWidth;
|
||||
_scaleY = _displayHeight / _canvas.clientHeight;
|
||||
} else {
|
||||
_scaleX = 1;
|
||||
_scaleY = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert canvas coordinates to display coordinates
|
||||
*/
|
||||
function canvasToDisplay(canvasX, canvasY) {
|
||||
return {
|
||||
x: Math.round(canvasX * _scaleX),
|
||||
y: Math.round(canvasY * _scaleY)
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach mouse event listeners
|
||||
*/
|
||||
function attachMouseEvents() {
|
||||
_canvas.addEventListener('mousedown', onMouseDown);
|
||||
_canvas.addEventListener('mouseup', onMouseUp);
|
||||
_canvas.addEventListener('mousemove', onMouseMove);
|
||||
_canvas.addEventListener('mouseenter', onMouseEnter);
|
||||
_canvas.addEventListener('mouseleave', onMouseLeave);
|
||||
_canvas.addEventListener('contextmenu', (e) => e.preventDefault());
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach keyboard event listeners
|
||||
*/
|
||||
function attachKeyboardEvents() {
|
||||
document.addEventListener('keydown', onKeyDown);
|
||||
document.addEventListener('keyup', onKeyUp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach touch event listeners
|
||||
*/
|
||||
function attachTouchEvents() {
|
||||
_canvas.addEventListener('touchstart', onTouchStart, { passive: false });
|
||||
_canvas.addEventListener('touchmove', onTouchMove, { passive: false });
|
||||
_canvas.addEventListener('touchend', onTouchEnd, { passive: false });
|
||||
_canvas.addEventListener('touchcancel', onTouchEnd, { passive: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach wheel event listeners
|
||||
*/
|
||||
function attachWheelEvents() {
|
||||
_canvas.addEventListener('wheel', onWheel, { passive: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle mouse down
|
||||
*/
|
||||
function onMouseDown(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
e.preventDefault();
|
||||
|
||||
updateModifiers(e);
|
||||
|
||||
let buttonMask = 0;
|
||||
switch (e.button) {
|
||||
case 0: buttonMask = MOUSE.LEFT; break;
|
||||
case 1: buttonMask = MOUSE.MIDDLE; break;
|
||||
case 2: buttonMask = MOUSE.RIGHT; break;
|
||||
case 3: buttonMask = MOUSE.BUTTON4; break;
|
||||
case 4: buttonMask = MOUSE.BUTTON5; break;
|
||||
}
|
||||
|
||||
_mouseButtons |= buttonMask;
|
||||
|
||||
const pos = canvasToDisplay(e.offsetX, e.offsetY);
|
||||
RDConnection.sendMouseEvent(_mouseButtons | getModifierMask(), pos.x, pos.y, getModifierList());
|
||||
|
||||
// Focus for keyboard events
|
||||
_canvas.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle mouse up
|
||||
*/
|
||||
function onMouseUp(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
e.preventDefault();
|
||||
|
||||
updateModifiers(e);
|
||||
|
||||
let buttonMask = 0;
|
||||
switch (e.button) {
|
||||
case 0: buttonMask = MOUSE.LEFT; break;
|
||||
case 1: buttonMask = MOUSE.MIDDLE; break;
|
||||
case 2: buttonMask = MOUSE.RIGHT; break;
|
||||
case 3: buttonMask = MOUSE.BUTTON4; break;
|
||||
case 4: buttonMask = MOUSE.BUTTON5; break;
|
||||
}
|
||||
|
||||
_mouseButtons &= ~buttonMask;
|
||||
|
||||
const pos = canvasToDisplay(e.offsetX, e.offsetY);
|
||||
RDConnection.sendMouseEvent(_mouseButtons | getModifierMask(), pos.x, pos.y, getModifierList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle mouse move
|
||||
*/
|
||||
function onMouseMove(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
|
||||
const pos = canvasToDisplay(e.offsetX, e.offsetY);
|
||||
RDConnection.sendMouseEvent(_mouseButtons | getModifierMask(), pos.x, pos.y, getModifierList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle mouse enter
|
||||
*/
|
||||
function onMouseEnter(e) {
|
||||
// Notify peer that mouse entered the canvas
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle mouse leave
|
||||
*/
|
||||
function onMouseLeave(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
|
||||
// Send a release event when mouse leaves
|
||||
RDConnection.sendMouseEvent(0, -1, -1, []);
|
||||
_mouseButtons = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle mouse wheel
|
||||
*/
|
||||
function onWheel(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
e.preventDefault();
|
||||
|
||||
const buttonMask = e.deltaY > 0 ? MOUSE.BUTTON5 : MOUSE.BUTTON4;
|
||||
const pos = canvasToDisplay(e.offsetX, e.offsetY);
|
||||
|
||||
// Press
|
||||
RDConnection.sendMouseEvent(buttonMask | getModifierMask(), pos.x, pos.y, getModifierList());
|
||||
// Release
|
||||
setTimeout(() => {
|
||||
RDConnection.sendMouseEvent(getModifierMask(), pos.x, pos.y, getModifierList());
|
||||
}, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle touch start
|
||||
*/
|
||||
function onTouchStart(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
e.preventDefault();
|
||||
|
||||
if (e.touches.length === 1) {
|
||||
const touch = e.touches[0];
|
||||
const rect = _canvas.getBoundingClientRect();
|
||||
const x = touch.clientX - rect.left;
|
||||
const y = touch.clientY - rect.top;
|
||||
const pos = canvasToDisplay(x, y);
|
||||
|
||||
RDConnection.sendMouseEvent(MOUSE.LEFT | getModifierMask(), pos.x, pos.y, getModifierList());
|
||||
_mouseButtons = MOUSE.LEFT;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle touch move
|
||||
*/
|
||||
function onTouchMove(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
e.preventDefault();
|
||||
|
||||
if (e.touches.length === 1) {
|
||||
const touch = e.touches[0];
|
||||
const rect = _canvas.getBoundingClientRect();
|
||||
const x = touch.clientX - rect.left;
|
||||
const y = touch.clientY - rect.top;
|
||||
const pos = canvasToDisplay(x, y);
|
||||
|
||||
RDConnection.sendMouseEvent(MOUSE.LEFT | getModifierMask(), pos.x, pos.y, getModifierList());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle touch end
|
||||
*/
|
||||
function onTouchEnd(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
e.preventDefault();
|
||||
|
||||
RDConnection.sendMouseEvent(getModifierMask(), -1, -1, []);
|
||||
_mouseButtons = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle key down
|
||||
*/
|
||||
function onKeyDown(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
|
||||
// Don't capture if we're typing in an input field
|
||||
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
updateModifiers(e);
|
||||
|
||||
const controlKey = KEY_MAP[e.key] || KEY_MAP[e.code];
|
||||
if (controlKey) {
|
||||
// Special key
|
||||
RDConnection.sendKeyEvent(controlKey, true, false, getModifierList());
|
||||
} else {
|
||||
// Regular character
|
||||
const charCode = e.key.charCodeAt(0);
|
||||
if (charCode > 0 && charCode < 65536) {
|
||||
RDConnection.sendCharEvent(charCode, true, false, getModifierList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle key up
|
||||
*/
|
||||
function onKeyUp(e) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
|
||||
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
updateModifiers(e);
|
||||
|
||||
const controlKey = KEY_MAP[e.key] || KEY_MAP[e.code];
|
||||
if (controlKey) {
|
||||
RDConnection.sendKeyEvent(controlKey, false, false, getModifierList());
|
||||
} else {
|
||||
const charCode = e.key.charCodeAt(0);
|
||||
if (charCode > 0 && charCode < 65536) {
|
||||
RDConnection.sendCharEvent(charCode, false, false, getModifierList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update current modifier state
|
||||
*/
|
||||
function updateModifiers(e) {
|
||||
_modifiers = [];
|
||||
if (e.ctrlKey || e.metaKey) _modifiers.push(4); // Control
|
||||
if (e.shiftKey) _modifiers.push(28); // Shift
|
||||
if (e.altKey) _modifiers.push(1); // Alt
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current modifier key list
|
||||
*/
|
||||
function getModifierList() {
|
||||
return [..._modifiers];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get modifier bitmask for mouse events
|
||||
*/
|
||||
function getModifierMask() {
|
||||
let mask = 0;
|
||||
if (_modifiers.includes(4)) mask |= 0x10; // Ctrl
|
||||
if (_modifiers.includes(28)) mask |= 0x20; // Shift
|
||||
if (_modifiers.includes(1)) mask |= 0x40; // Alt
|
||||
if (_modifiers.includes(23)) mask |= 0x80; // Meta
|
||||
return mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type a string of text (for paste/keyboard input)
|
||||
*/
|
||||
function typeString(text) {
|
||||
if (!_enabled || _viewOnly) return;
|
||||
|
||||
for (const char of text) {
|
||||
const charCode = char.charCodeAt(0);
|
||||
RDConnection.sendCharEvent(charCode, true, true, getModifierList());
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
init,
|
||||
setEnabled,
|
||||
setViewOnly,
|
||||
setDisplaySize,
|
||||
typeString,
|
||||
MOUSE,
|
||||
get enabled() { return _enabled; }
|
||||
};
|
||||
})();
|
||||
1209
shelled/rustdesk-web-client/js/proto.js
Normal file
1209
shelled/rustdesk-web-client/js/proto.js
Normal file
File diff suppressed because it is too large
Load Diff
409
shelled/rustdesk-web-client/js/video.js
Normal file
409
shelled/rustdesk-web-client/js/video.js
Normal file
@ -0,0 +1,409 @@
|
||||
/**
|
||||
* RustDesk Standalone Web Client - Video Decoder
|
||||
*
|
||||
* Handles video decoding using ogvjs (VP8/VP9/AV1 WebAssembly decoders)
|
||||
* and rendering to canvas using yuv-canvas (WebGL YUV→RGB conversion).
|
||||
*/
|
||||
|
||||
const RDVideo = (() => {
|
||||
let _canvas = null;
|
||||
let _ctx = null;
|
||||
let _yuvCanvas = null;
|
||||
let _decoders = {}; // Codec-specific decoders
|
||||
let _currentCodec = null; // Currently active codec
|
||||
let _displayWidth = 0;
|
||||
let _displayHeight = 0;
|
||||
let _lastRenderTime = 0;
|
||||
let _frameCount = 0;
|
||||
let _fpsCounter = 0;
|
||||
let _fpsTime = 0;
|
||||
let _currentFps = 0;
|
||||
let _ogvSupport = null;
|
||||
|
||||
// Supported codecs
|
||||
const CODEC = {
|
||||
VP8: 'vp8',
|
||||
VP9: 'vp9',
|
||||
AV1: 'av1',
|
||||
H264: 'h264',
|
||||
H265: 'h265'
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize video subsystem
|
||||
* @param {HTMLCanvasElement} canvas - The canvas to render to
|
||||
*/
|
||||
function init(canvas) {
|
||||
_canvas = canvas;
|
||||
_ctx = canvas.getContext('2d');
|
||||
_yuvCanvas = new YUVCanvas({
|
||||
canvas: canvas,
|
||||
webgl: true
|
||||
});
|
||||
_fpsTime = performance.now();
|
||||
|
||||
console.log('[RDVideo] Initialized with canvas:', canvas.width, 'x', canvas.height);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a video decoder for the given codec
|
||||
*/
|
||||
function initDecoder(codec) {
|
||||
if (_decoders[codec]) return _decoders[codec];
|
||||
|
||||
console.log('[RDVideo] Initializing decoder for codec:', codec);
|
||||
|
||||
try {
|
||||
switch (codec) {
|
||||
case CODEC.VP9:
|
||||
_decoders[codec] = createOgvVideoDecoder('ogv-decoder-video-vp9-wasm');
|
||||
_currentCodec = codec;
|
||||
break;
|
||||
case CODEC.VP8:
|
||||
_decoders[codec] = createOgvVideoDecoder('ogv-decoder-video-vp8-wasm');
|
||||
_currentCodec = codec;
|
||||
break;
|
||||
case CODEC.AV1:
|
||||
_decoders[codec] = createOgvVideoDecoder('ogv-decoder-video-av1-wasm');
|
||||
_currentCodec = codec;
|
||||
break;
|
||||
default:
|
||||
console.warn('[RDVideo] Unsupported codec:', codec);
|
||||
return null;
|
||||
}
|
||||
return _decoders[codec];
|
||||
} catch (e) {
|
||||
console.error('[RDVideo] Failed to init decoder for', codec, ':', e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an ogvjs video decoder
|
||||
*/
|
||||
function createOgvVideoDecoder(moduleName) {
|
||||
// ogvjs uses a specific API for creating decoders
|
||||
// We need to use the OGVDecoderVideoVPx or similar classes
|
||||
if (typeof OGVDecoderVideoVP9 !== 'undefined') {
|
||||
const decoderClass = {
|
||||
'ogv-decoder-video-vp9-wasm': OGVDecoderVideoVP9,
|
||||
'ogv-decoder-video-vp8-wasm': OGVDecoderVideoVP8,
|
||||
'ogv-decoder-video-av1-wasm': OGVDecoderVideoAV1,
|
||||
}[moduleName];
|
||||
|
||||
if (decoderClass) {
|
||||
const decoder = new decoderClass({
|
||||
type: moduleName,
|
||||
});
|
||||
// Process any loaded frames
|
||||
decoder.onvideo = function(frame) {
|
||||
processDecodedFrame(frame);
|
||||
};
|
||||
return decoder;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: create a frame processor that processes raw video data
|
||||
console.warn('[RDVideo] ogvjs decoder classes not available, using fallback');
|
||||
return {
|
||||
codec: moduleName,
|
||||
processFrame: processFallbackFrame
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a decoded video frame and render it
|
||||
*/
|
||||
function processDecodedFrame(frame) {
|
||||
if (!frame || !frame.format) return;
|
||||
|
||||
const width = frame.format.width;
|
||||
const height = frame.format.height;
|
||||
|
||||
if (width !== _displayWidth || height !== _displayHeight) {
|
||||
_displayWidth = width;
|
||||
_displayHeight = height;
|
||||
_canvas.width = width;
|
||||
_canvas.height = height;
|
||||
console.log('[RDVideo] Display size changed:', width, 'x', height);
|
||||
}
|
||||
|
||||
// ogvjs provides frames in YUV420 format
|
||||
// YUV data: frame.buf (planar Y, U, V)
|
||||
if (frame.pixels) {
|
||||
// RGBA data available directly
|
||||
const imageData = new ImageData(
|
||||
new Uint8ClampedArray(frame.pixels),
|
||||
width,
|
||||
height
|
||||
);
|
||||
_ctx.putImageData(imageData, 0, 0);
|
||||
} else if (frame.frames && frame.frames.length > 0 && frame.frames[0].buf) {
|
||||
// YUV data - use yuv-canvas for WebGL rendering
|
||||
const yuvFrame = frame.frames[0];
|
||||
renderYUV(yuvFrame.buf, width, height);
|
||||
}
|
||||
|
||||
updateFps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a fallback frame (raw RGB/YUV data)
|
||||
*/
|
||||
function processFallbackFrame(data, width, height) {
|
||||
if (!data || !data.byteLength) return;
|
||||
|
||||
// Try to render as RGBA
|
||||
if (_canvas.width !== width || _canvas.height !== height) {
|
||||
_displayWidth = width;
|
||||
_displayHeight = height;
|
||||
_canvas.width = width;
|
||||
_canvas.height = height;
|
||||
}
|
||||
|
||||
const imageData = new ImageData(
|
||||
new Uint8ClampedArray(data.buffer || data),
|
||||
width,
|
||||
height
|
||||
);
|
||||
_ctx.putImageData(imageData, 0, 0);
|
||||
updateFps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render YUV data to canvas using WebGL
|
||||
*/
|
||||
function renderYUV(yuvData, width, height) {
|
||||
if (!_yuvCanvas) return;
|
||||
|
||||
try {
|
||||
// YUV420 layout: Y plane (width*height), U plane (width*height/4), V plane (width*height/4)
|
||||
const ySize = width * height;
|
||||
const uvSize = ySize / 4;
|
||||
|
||||
const yPlane = new Uint8Array(yuvData.buffer || yuvData, 0, ySize);
|
||||
const uPlane = new Uint8Array(yuvData.buffer || yuvData, ySize, uvSize);
|
||||
const vPlane = new Uint8Array(yuvData.buffer || yuvData, ySize + uvSize, uvSize);
|
||||
|
||||
_yuvCanvas.drawFrame({
|
||||
format: {
|
||||
width: width,
|
||||
height: height,
|
||||
chromaWidth: width / 2,
|
||||
chromaHeight: height / 2,
|
||||
chromaPitch: width / 2,
|
||||
lumaPitch: width,
|
||||
cropLeft: 0,
|
||||
cropTop: 0,
|
||||
cropWidth: width,
|
||||
cropHeight: height,
|
||||
bitDepth: 8
|
||||
},
|
||||
planes: [
|
||||
{ data: yPlane, stride: width },
|
||||
{ data: uPlane, stride: width / 2 },
|
||||
{ data: vPlane, stride: width / 2 }
|
||||
],
|
||||
time: { low: Date.now() % 0x100000000, high: 0 }
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('[RDVideo] YUV render failed:', e);
|
||||
// Fallback to 2D canvas
|
||||
const ySize = width * height;
|
||||
const yPlane = new Uint8Array(yuvData.buffer || yuvData, 0, ySize);
|
||||
renderYUVToRGBA(yPlane, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fallback YUV to RGBA conversion using 2D canvas
|
||||
*/
|
||||
function renderYUVToRGBA(yPlane, width, height) {
|
||||
const imageData = _ctx.createImageData(width, height);
|
||||
const data = imageData.data;
|
||||
|
||||
for (let i = 0; i < width * height; i++) {
|
||||
const y = yPlane[i];
|
||||
const idx = i * 4;
|
||||
// Simple grayscale (no U/V in this fallback)
|
||||
data[idx] = y;
|
||||
data[idx + 1] = y;
|
||||
data[idx + 2] = y;
|
||||
data[idx + 3] = 255;
|
||||
}
|
||||
|
||||
_ctx.putImageData(imageData, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle incoming VideoFrame from the session
|
||||
* @param {Object} videoFrame - Decoded protobuf VideoFrame
|
||||
*/
|
||||
function handleVideoFrame(videoFrame) {
|
||||
if (!videoFrame) return;
|
||||
|
||||
const display = videoFrame.display || 0;
|
||||
|
||||
// Check for VP9 frames
|
||||
if (videoFrame.vp9s && videoFrame.vp9s.frames && videoFrame.vp9s.frames.length > 0) {
|
||||
const codec = CODEC.VP9;
|
||||
if (_currentCodec !== codec) initDecoder(codec);
|
||||
processEncodedFrames(videoFrame.vp9s.frames, codec);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for VP8 frames
|
||||
if (videoFrame.vp8s && videoFrame.vp8s.frames && videoFrame.vp8s.frames.length > 0) {
|
||||
const codec = CODEC.VP8;
|
||||
if (_currentCodec !== codec) initDecoder(codec);
|
||||
processEncodedFrames(videoFrame.vp8s.frames, codec);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for AV1 frames
|
||||
if (videoFrame.av1s && videoFrame.av1s.frames && videoFrame.av1s.frames.length > 0) {
|
||||
const codec = CODEC.AV1;
|
||||
if (_currentCodec !== codec) initDecoder(codec);
|
||||
processEncodedFrames(videoFrame.av1s.frames, codec);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for raw RGB
|
||||
if (videoFrame.rgb) {
|
||||
// RGB data comes as the raw protobuf payload after the RGB message
|
||||
// In practice, the raw data is appended after the VideoFrame message
|
||||
console.log('[RDVideo] RGB frame received (not fully supported)');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for raw YUV
|
||||
if (videoFrame.yuv) {
|
||||
// Similar to RGB, YUV data is appended
|
||||
console.log('[RDVideo] YUV frame received (not fully supported)');
|
||||
return;
|
||||
}
|
||||
|
||||
// H264/H265 not supported in browser without WASM decoders
|
||||
if (videoFrame.h264s) {
|
||||
console.log('[RDVideo] H.264 frame received (not supported in browser)');
|
||||
}
|
||||
if (videoFrame.h265s) {
|
||||
console.log('[RDVideo] H.265 frame received (not supported in browser)');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process encoded video frames through the decoder
|
||||
*/
|
||||
function processEncodedFrames(frames, codec) {
|
||||
const decoder = _decoders[codec];
|
||||
if (!decoder) {
|
||||
console.warn('[RDVideo] No decoder for codec:', codec);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const frame of frames) {
|
||||
if (!frame.data || frame.data.byteLength === 0) continue;
|
||||
|
||||
try {
|
||||
if (decoder.processFrame) {
|
||||
// Custom fallback decoder
|
||||
// Try to determine frame dimensions from data
|
||||
// VP9 bitstream: first bytes contain frame header
|
||||
// For now, just log
|
||||
_frameCount++;
|
||||
} else if (decoder instanceof OGVDecoderVideoVP9 ||
|
||||
decoder instanceof OGVDecoderVideoVP8 ||
|
||||
decoder instanceof OGVDecoderVideoAV1) {
|
||||
// ogvjs native decoder
|
||||
decoder.processHeader(frame.data);
|
||||
// Check if decoder has loaded header info for dimensions
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[RDVideo] Frame decode error:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process raw RGBA data (from fallback/secondary path)
|
||||
* @param {Uint8Array} rgba - RGBA pixel data
|
||||
* @param {number} width - Frame width
|
||||
* @param {number} height - Frame height
|
||||
*/
|
||||
function processRGBA(rgba, width, height) {
|
||||
if (_canvas.width !== width || _canvas.height !== height) {
|
||||
_canvas.width = width;
|
||||
_canvas.height = height;
|
||||
_displayWidth = width;
|
||||
_displayHeight = height;
|
||||
}
|
||||
|
||||
const imageData = new ImageData(
|
||||
new Uint8ClampedArray(rgba.buffer || rgba),
|
||||
width,
|
||||
height
|
||||
);
|
||||
_ctx.putImageData(imageData, 0, 0);
|
||||
updateFps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update FPS counter
|
||||
*/
|
||||
function updateFps() {
|
||||
_frameCount++;
|
||||
_fpsCounter++;
|
||||
const now = performance.now();
|
||||
if (now - _fpsTime >= 1000) {
|
||||
_currentFps = _fpsCounter;
|
||||
_fpsCounter = 0;
|
||||
_fpsTime = now;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current FPS
|
||||
*/
|
||||
function getFps() {
|
||||
return _currentFps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resize the canvas
|
||||
*/
|
||||
function resize(width, height) {
|
||||
if (_canvas) {
|
||||
_canvas.width = width;
|
||||
_canvas.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current display dimensions
|
||||
*/
|
||||
function getDisplaySize() {
|
||||
return { width: _displayWidth, height: _displayHeight };
|
||||
}
|
||||
|
||||
/**
|
||||
* Take a screenshot of the current canvas
|
||||
*/
|
||||
function screenshot() {
|
||||
if (!_canvas) return null;
|
||||
return _canvas.toDataURL('image/png');
|
||||
}
|
||||
|
||||
return {
|
||||
CODEC,
|
||||
init,
|
||||
handleVideoFrame,
|
||||
processRGBA,
|
||||
resize,
|
||||
getDisplaySize,
|
||||
getFps,
|
||||
screenshot,
|
||||
get canvas() { return _canvas; }
|
||||
};
|
||||
})();
|
||||
5555
shelled/rustdesk-web-client/lib/libopus.js
Normal file
5555
shelled/rustdesk-web-client/lib/libopus.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
shelled/rustdesk-web-client/lib/libopus.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/libopus.wasm
Executable file
Binary file not shown.
21
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/COPYING
Normal file
21
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/COPYING
Normal file
@ -0,0 +1,21 @@
|
||||
ogv.js wrapper and player code
|
||||
|
||||
Copyright (c) 2013-2019 Brion Vibber and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@ -0,0 +1,23 @@
|
||||
Copyright © 2018-2019, VideoLAN and dav1d authors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
28
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/COPYING-ogg.txt
Normal file
28
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/COPYING-ogg.txt
Normal file
@ -0,0 +1,28 @@
|
||||
Copyright (c) 2002, Xiph.org Foundation
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
44
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/COPYING-opus.txt
Normal file
44
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/COPYING-opus.txt
Normal file
@ -0,0 +1,44 @@
|
||||
Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
|
||||
Jean-Marc Valin, Timothy B. Terriberry,
|
||||
CSIRO, Gregory Maxwell, Mark Borgerding,
|
||||
Erik de Castro Lopo
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Internet Society, IETF or IETF Trust, nor the
|
||||
names of specific contributors, may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Opus is subject to the royalty-free patent licenses which are
|
||||
specified at:
|
||||
|
||||
Xiph.Org Foundation:
|
||||
https://datatracker.ietf.org/ipr/1524/
|
||||
|
||||
Microsoft Corporation:
|
||||
https://datatracker.ietf.org/ipr/1914/
|
||||
|
||||
Broadcom Corporation:
|
||||
https://datatracker.ietf.org/ipr/1526/
|
||||
@ -0,0 +1,28 @@
|
||||
Copyright (C) 2002-2009 Xiph.org Foundation
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@ -0,0 +1,28 @@
|
||||
Copyright (c) 2002-2018 Xiph.org Foundation
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@ -0,0 +1,13 @@
|
||||
Copyright © 2010 Mozilla Foundation
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
31
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/LICENSE-vpx.txt
Normal file
31
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/LICENSE-vpx.txt
Normal file
@ -0,0 +1,31 @@
|
||||
Copyright (c) 2010, The WebM Project authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the name of Google, nor the WebM Project, nor the names
|
||||
of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
23
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/PATENTS-vpx.txt
Normal file
23
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/PATENTS-vpx.txt
Normal file
@ -0,0 +1,23 @@
|
||||
Additional IP Rights Grant (Patents)
|
||||
------------------------------------
|
||||
|
||||
"These implementations" means the copyrightable works that implement the WebM
|
||||
codecs distributed by Google as part of the WebM Project.
|
||||
|
||||
Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
|
||||
royalty-free, irrevocable (except as stated in this section) patent license to
|
||||
make, have made, use, offer to sell, sell, import, transfer, and otherwise
|
||||
run, modify and propagate the contents of these implementations of WebM, where
|
||||
such license applies only to those patent claims, both currently owned by
|
||||
Google and acquired in the future, licensable by Google that are necessarily
|
||||
infringed by these implementations of WebM. This grant does not include claims
|
||||
that would be infringed only as a consequence of further modification of these
|
||||
implementations. If you or your agent or exclusive licensee institute or order
|
||||
or agree to the institution of patent litigation or any other patent
|
||||
enforcement activity against any entity (including a cross-claim or
|
||||
counterclaim in a lawsuit) alleging that any of these implementations of WebM
|
||||
or any code incorporated within any of these implementations of WebM
|
||||
constitute direct or contributory patent infringement, or inducement of
|
||||
patent infringement, then any patent rights granted to you under this License
|
||||
for these implementations of WebM shall terminate as of the date such
|
||||
litigation is filed.
|
||||
391
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/README.md
Normal file
391
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/README.md
Normal file
@ -0,0 +1,391 @@
|
||||
ogv.js
|
||||
======
|
||||
|
||||
Media decoder and player for Ogg Vorbis/Opus/Theora and WebM VP8/VP9/AV1 video.
|
||||
|
||||
Based around libogg, libvorbis, libtheora, libopus, libvpx, libnestegg and dav1d compiled to JavaScript and WebAssembly with Emscripten.
|
||||
|
||||
## Updates
|
||||
|
||||
1.8.6 - 2022-01-12
|
||||
* Bump to yuv-canvas
|
||||
* Fix demo for removal of video-canvas mode
|
||||
|
||||
1.8.5 - 2022-01-11
|
||||
* Remove unnecessary user-agent checks
|
||||
* Remove flaky, obsolete support for faking CSS `object-fit`
|
||||
* Remove experimental support for streaming `<canvas>` into `<video>`
|
||||
|
||||
1.8.4 - 2021-07-02
|
||||
* Fix for fix for OGVLoader.base fix
|
||||
|
||||
1.8.3 - 2021-07-02
|
||||
* Fixes for build with emscripten 2.0.25
|
||||
* Fix for nextTick/setImmediate-style polyfill in front-end
|
||||
* Provisional fix for OGVLoader.base not working with CDNs
|
||||
* the fallback code for loading a non-local worker had been broken with WebAssembly for some time, sorry!
|
||||
|
||||
1.8.2 - errored out
|
||||
|
||||
1.8.1 - 2021-02-18
|
||||
* Fixed OGVCompat APIs to correctly return false without WebAssembly and Web Audio
|
||||
|
||||
1.8.0 - 2021-02-09
|
||||
* Dropping IE support and Flash audio backend
|
||||
* Updated to stream-file 0.3.0
|
||||
* Updated to audio-feeder 0.5.0
|
||||
* The old IE 10/11 support _no longer works_ due to the Flash plugin being disabled, and so is being removed
|
||||
* Drop es6-promise shim
|
||||
* Now requires WebAssembly, which requires native Promise support
|
||||
* Build & fixes
|
||||
* Demo fixed (removed test files that are now offline)
|
||||
* Builds with emscripten 2.0.13
|
||||
* Requires latest meson from git pending a fix hitting release
|
||||
|
||||
1.7.0 - 2020-09-28
|
||||
* Builds with emscripten's LLVM upstream backend
|
||||
* Updated to build with emscripten 2.0.4
|
||||
* Reduced amount of memory used between GC runs by reusing frame buffers
|
||||
* Removed `memoryLimit` option
|
||||
* JS, Wasm, and threaded Wasm builds now all use dynamic memory growth
|
||||
* Updated dav1d
|
||||
* Updated libvpx to 1.8.1
|
||||
* Experimental SIMD builds of AV1 decoder optional, with `make SIMD=1`
|
||||
* These work in Chrome with the "WebAssembly SIMD" flag enabled in chrome://flags/
|
||||
* Significant speed boost when available.
|
||||
* Available with and without multithreading.
|
||||
* Must enable explicitly with `simd: true` in `options`.
|
||||
* Experimental SIMD work for VP9 as well, incomplete.
|
||||
|
||||
1.6.1 - 2019-06-18
|
||||
* playbackSpeed attribute now supported
|
||||
* updated audio-feeder to 0.4.21;
|
||||
* mono audio is now less loud, matching native playback better
|
||||
* audio resampling now uses linear interpolation for upscaling
|
||||
* fix for IE in bundling scenarios that use strict mode
|
||||
* tempo change support thanks to a great patch from velochy!
|
||||
* updated yuv-canvas to 1.2.6;
|
||||
* fixes for capturing WebGL canvas as MediaStream
|
||||
* fixes for seeks on low frame rate video
|
||||
* updated emscripten toolchain to 1.38.36
|
||||
* drop OUTLINING_LIMIT from AV1 JS build; doesn't work in newer emscripten and not really needed
|
||||
|
||||
1.6.0 - 2019-02-26
|
||||
* experimental support for AV1 video in WebM
|
||||
* update buildchain to emscripten 1.38.28
|
||||
* fix a stray global
|
||||
* starting to move to ES6 classes and modules
|
||||
* building with babel for ES5/IE11 compat
|
||||
* updated eslint
|
||||
* updated yuv-canvas to 1.2.4; fixes for software GL rendering
|
||||
* updated audio-feeder to 0.4.15; fixes for resampling and Flash perf
|
||||
* retooled buffer copies
|
||||
* sync fix for audio packets with discard padding
|
||||
* clients can pass a custom `StreamFile` instance as `{stream:foo}` in options. This can be useful for custom streaming until MSE interfaces are ready.
|
||||
* refactored WebM keyframe detection
|
||||
* prefill the frame pipeline as well as the audio pipeline before starting audio
|
||||
* removed BINARYEN_IGNORE_IMPLICIT_TRAPS=1 option which can cause intermittent breakages
|
||||
* changed download streaming method to avoid data corruption problem on certain files
|
||||
* fix for seek on very short WebM files
|
||||
* fix for replay-after-end-of-playback in WebM
|
||||
|
||||
See more details and history in [CHANGES.md](https://github.com/brion/ogv.js/blob/master/CHANGES.md)
|
||||
|
||||
## Current status
|
||||
|
||||
Note that as of 2021 ogv.js works pretty nicely but may still have some packagine oddities with tools like webpack. It should work via CDNs again as of 1.8.2 if you can't or don't want to package locally, but this is not documented well yet. Improved documentation will come with the next major update & code cleanup!
|
||||
|
||||
Since August 2015, ogv.js can be seen in action [on Wikipedia and Wikimedia Commons](https://commons.wikimedia.org/wiki/Commons:Video) in Safari and IE/Edge where native Ogg and WebM playback is not available. (See [technical details on MediaWiki integration](https://www.mediawiki.org/wiki/Extension:TimedMediaHandler/ogv.js).)
|
||||
|
||||
See also a standalone demo with performance metrics at https://brionv.com/misc/ogv.js/demo/
|
||||
|
||||
* streaming: yes (with Range header)
|
||||
* seeking: yes for Ogg and WebM (with Range header)
|
||||
* color: yes
|
||||
* audio: yes, with a/v sync (requires Web Audio or Flash)
|
||||
* background threading: yes (video, audio decoders in Workers)
|
||||
* [GPU accelerated drawing: yes (WebGL)](https://github.com/brion/ogv.js/wiki/GPU-acceleration)
|
||||
* GPU accelerated decoding: no
|
||||
* SIMD acceleration: no
|
||||
* Web Assembly: yes (with asm.js fallback)
|
||||
* multithreaded VP8, VP9, AV1: in development (set `options.threading` to `true`; requires flags to be enabled in Firefox 65 and Chrome 72, no support yet in Safari)
|
||||
* controls: no (currently provided by demo or other UI harness)
|
||||
|
||||
Ogg and WebM files are fairly well supported.
|
||||
|
||||
|
||||
## Goals
|
||||
|
||||
Long-form goal is to create a drop-in replacement for the HTML5 video and audio tags which can be used for basic playback of Ogg Theora and Vorbis or WebM media on browsers that don't support Ogg or WebM natively.
|
||||
|
||||
The API isn't quite complete, but works pretty well.
|
||||
|
||||
|
||||
## Compatibility
|
||||
|
||||
ogv.js requires a fast JS engine with typed arrays, and Web Audio for audio playback.
|
||||
|
||||
The primary target browsers are (testing 360p/30fps and up):
|
||||
* Safari 6.1-12 on Mac OS X 10.7-10.14
|
||||
* Safari on iOS 10-11 64-bit
|
||||
|
||||
Older versions of Safari have flaky JIT compilers. IE 9 and below lack typed arrays, and IE 10/11 no longer support an audio channel since the Flash plugin was sunset.
|
||||
|
||||
(Note that Windows and Mac OS X can support Ogg and WebM by installing codecs or alternate browsers with built-in support, but this is not possible on iOS where all browsers are really Safari.)
|
||||
|
||||
Testing browsers (these support .ogv and .webm natively):
|
||||
* Firefox 65
|
||||
* Chrome 73
|
||||
|
||||
|
||||
## Package installation
|
||||
|
||||
Pre-built releases of ogv.js are available as [.zip downloads from the GitHub releases page](https://github.com/brion/ogv.js/releases) and through the npm package manager.
|
||||
|
||||
You can load the `ogv.js` main entry point directly in a script tag, or bundle it through whatever build process you like. The other .js files must be made available for runtime loading, together in the same directory.
|
||||
|
||||
ogv.js will try to auto-detect the path to its resources based on the script element that loads ogv.js or ogv-support.js. If you load ogv.js through another bundler (such as browserify or MediaWiki's ResourceLoader) you may need to override this manually before instantiating players:
|
||||
|
||||
```
|
||||
// Path to ogv-demuxer-ogg.js, ogv-worker-audio.js, etc
|
||||
OGVLoader.base = '/path/to/resources';
|
||||
```
|
||||
|
||||
To fetch from npm:
|
||||
|
||||
```
|
||||
npm install ogv
|
||||
```
|
||||
|
||||
The distribution-ready files will appear in 'node_modules/ogv/dist'.
|
||||
|
||||
To load the player library into your browserify or webpack project:
|
||||
|
||||
```
|
||||
var ogv = require('ogv');
|
||||
|
||||
// Access public classes either as ogv.OGVPlayer or just OGVPlayer.
|
||||
// Your build/lint tools may be happier with ogv.OGVPlayer!
|
||||
ogv.OGVLoader.base = '/path/to/resources';
|
||||
var player = new ogv.OGVPlayer();
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The `OGVPlayer` class implements a player, and supports a subset of the events, properties and methods from [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) and [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement).
|
||||
|
||||
```
|
||||
// Create a new player with the constructor
|
||||
var player = new OGVPlayer();
|
||||
|
||||
// Or with options
|
||||
var player = new OGVPlayer({
|
||||
debug: true,
|
||||
debugFilter: /demuxer/
|
||||
});
|
||||
|
||||
// Now treat it just like a video or audio element
|
||||
containerElement.appendChild(player);
|
||||
player.src = 'path/to/media.ogv';
|
||||
player.play();
|
||||
player.addEventListener('ended', function() {
|
||||
// ta-da!
|
||||
});
|
||||
```
|
||||
|
||||
To check for compatibility before creating a player, include `ogv-support.js` and use the `OGVCompat` API:
|
||||
|
||||
```
|
||||
if (OGVCompat.supported('OGVPlayer')) {
|
||||
// go load the full player from ogv.js and instantiate stuff
|
||||
}
|
||||
```
|
||||
|
||||
This will check for typed arrays, web audio, blacklisted iOS versions, and super-slow/broken JIT compilers.
|
||||
|
||||
If you need a URL versioning/cache-buster parameter for dynamic loading of `ogv.js`, you can use the `OGVVersion` symbol provided by `ogv-support.js` or the even tinier `ogv-version.js`:
|
||||
|
||||
```
|
||||
var script = document.createElement('script');
|
||||
script.src = 'ogv.js?version=' + encodeURIComponent(OGVVersion);
|
||||
document.querySelector('head').appendChild(script);
|
||||
```
|
||||
|
||||
## Distribution notes
|
||||
|
||||
Entry points:
|
||||
* `ogv.js` contains the main runtime classes, including OGVPlayer, OGVLoader, and OGVCompat.
|
||||
* `ogv-support.js` contains the OGVCompat class and OGVVersion symbol, useful for checking for runtime support before loading the main `ogv.js`.
|
||||
* `ogv-version.js` contains only the OGVVersion symbol.
|
||||
|
||||
These entry points may be loaded directly from a script element, or concatenated into a larger project, or otherwise loaded as you like.
|
||||
|
||||
Further code modules are loaded at runtime, which must be available with their defined names together in a directory. If the files are not hosted same-origin to the web page that includes them, you will need to set up appropriate CORS headers to allow loading of the worker JS modules.
|
||||
|
||||
Dynamically loaded assets:
|
||||
* `ogv-worker-audio.js`, `ogv-worker-video.js`, and `*.worker.js` are Worker entry points, used to run video and audio decoders in the background.
|
||||
* `ogv-demuxer-ogg-wasm.js/.wasm` are used in playing .ogg, .oga, and .ogv files.
|
||||
* `ogv-demuxer-webm-wasm.js/.wasm` are used in playing .webm files.
|
||||
* `ogv-decoder-audio-vorbis-wasm.js/.wasm` and `ogv-decoder-audio-opus-wasm.js/.wasm` are used in playing both Ogg and WebM files containing audio.
|
||||
* `ogv-decoder-video-theora-wasm.js/.wasm` are used in playing .ogg and .ogv video files.
|
||||
* `ogv-decoder-video-vp8-wasm.js/.wasm` and `ogv-decoder-video-vp9-wasm.js/.wasm` are used in playing .webm video files.
|
||||
* `*-mt.js/.wasm` are the multithreaded versions of some of the above modules. They have additional support files.
|
||||
|
||||
If you know you will never use particular formats or codecs you can skip bundling them; for instance if you only need to play Ogg files you don't need `ogv-demuxer-webm-wasm.js` or `ogv-decoder-video-vp8-wasm.js` which are only used for WebM.
|
||||
|
||||
|
||||
## Performance
|
||||
|
||||
(This section is somewhat out of date.)
|
||||
|
||||
As of 2015, for SD-or-less resolution basic Ogg Theora decoding speed is reliable on desktop and newer high-end mobile devices; current high-end desktops and laptops can even reach HD resolutions. Older and low-end mobile devices may have difficulty on any but audio and the lowest-resolution video files.
|
||||
|
||||
WebM VP8/VP9 is slower, but works pretty well at a resolution step below Theora.
|
||||
|
||||
AV1 is slower still, and tops out around 360p for single-threaded decoding on a fast desktop or iOS device.
|
||||
|
||||
*Low-res targets*
|
||||
|
||||
I've gotten acceptable performance for Vorbis audio and 160p/15fps Theora files on 32-bit iOS devices: iPhone 4s, iPod Touch 5th-gen and iPad 3. These have difficulty at 240p and above, and just won't keep up with higher resolutions.
|
||||
|
||||
Meanwhile, newer 64-bit iPhones and iPads are comparable to low-end laptops, and videos at 360p and often 480p play acceptably. Since 32-bit and 64-bit iOS devices have the same user-agent, a benchmark must be used to approximately test minimum CPU speed.
|
||||
|
||||
(On iOS, Safari performs significantly better than some alternative browsers that are unable to enable the JIT due to use of the old UIWebView API. Chrome 49 and Firefox for iOS are known to work using the newer WKWebView API internally. Again, a benchmark must be used to detect slow performance, as the browser remains otherwise compatible.)
|
||||
|
||||
|
||||
Windows on 32-bit ARM platforms is similar... IE 11 on Windows RT 8.1 on a Surface tablet (NVidia Tegra 3) does not work (crashes IE), while Edge on Windows 10 Mobile works ok at low resolutions, having trouble starting around 240p.
|
||||
|
||||
|
||||
In both cases, a native application looms as a possibly better alternative. See [OGVKit](https://github.com/brion/OGVKit) and [OgvRt](https://github.com/brion/OgvRT) projects for experiments in those directions.
|
||||
|
||||
|
||||
Note that at these lower resolutions, Vorbis audio and Theora video decoding are about equally expensive operations -- dual-core phones and tablets should be able to eke out a little parallelism here thanks to audio and video being in separate Worker threads.
|
||||
|
||||
|
||||
*WebGL drawing acceleration*
|
||||
|
||||
Accelerated YCbCr->RGB conversion and drawing is done using WebGL on supporting browsers, or through software CPU conversion if not. This is abstracted in the [yuv-canvas](https://github.com/brion/yuv-canvas) package, now separately installable.
|
||||
|
||||
It may be possible to do further acceleration of actual decoding operations using WebGL shaders, but this could be ... tricky. WebGL is also only available on the main thread, and there are no compute shaders yet so would have to use fragment shaders.
|
||||
|
||||
|
||||
## Difficulties
|
||||
|
||||
*Threading*
|
||||
|
||||
Currently the video and audio codecs run in worker threads by default, while the demuxer and player logic run on the UI thread. This seems to work pretty well.
|
||||
|
||||
There is some overhead in extracting data out of each emscripten module's heap and in the thread-to-thread communications, but the parallelism and smoother main thread makes up for it.
|
||||
|
||||
*Streaming download*
|
||||
|
||||
Streaming buffering is done by chunking the requests at up to a megabyte each, using the HTTP Range header. For cross-site playback, this requires CORS setup to whitelist the Range header! Chunks are downloaded as ArrayBuffers, so a chunk must be loaded in full before demuxing or playback can start.
|
||||
|
||||
Old versions of [Safari have a bug with Range headers](https://bugs.webkit.org/show_bug.cgi?id=82672) which is worked around as necessary with a 'cache-busting' URL string parameter.
|
||||
|
||||
|
||||
*Seeking*
|
||||
|
||||
Seeking is implemented via the HTTP Range: header.
|
||||
|
||||
For Ogg files with keyframe indices in a skeleton index, seeking is very fast. Otherwise, a bisection search is used to locate the target frame or audio position, which is very slow over the internet as it creates a lot of short-lived HTTP requests.
|
||||
|
||||
For WebM files with cues, efficient seeking is supported as well as of 1.1.2. WebM files without cues can be seeked in 1.5.5, but inefficiently via linear seek from the beginning. This is fine for small audio-only files, but might be improved for large files with a bisection in future.
|
||||
|
||||
As with chunked streaming, cross-site playback requires CORS support for the Range header.
|
||||
|
||||
|
||||
*Audio output*
|
||||
|
||||
Audio output is handled through the [AudioFeeder](https://github.com/brion/audio-feeder) library, which encapsulates use of Web Audio API:
|
||||
|
||||
Firefox, Safari, Chrome, and Edge support the W3C Web Audio API.
|
||||
|
||||
IE is no longer supported; the workaround using Flash no longer works due to sunsetting of the Flash plugin.
|
||||
|
||||
A/V synchronization is performed on files with both audio and video, and seems to actually work. Yay!
|
||||
|
||||
Note that autoplay with audio doesn't work on iOS Safari due to limitations with starting audio playback from event handlers; if playback is started outside an event handler, the player will hang due to broken audio.
|
||||
|
||||
As of 1.1.1, muting before script-triggered playback allows things to work:
|
||||
|
||||
```
|
||||
player = new OGVPlayer();
|
||||
player.muted = true;
|
||||
player.src = 'path/to/file-with-audio.ogv';
|
||||
player.play();
|
||||
```
|
||||
|
||||
You can then unmute the video in response to a touch or click handler. Alternately if audio is not required, do not include an audio track in the file.
|
||||
|
||||
|
||||
*WebM*
|
||||
|
||||
WebM support was added in June 2015, with some major issues finally worked out in May 2016. Initial VP9 support was added in February 2017. It's pretty stable in production use at Wikipedia and is enabled by default as of October 2015.
|
||||
|
||||
Beware that performance of WebM VP8 is much slower than Ogg Theora, and VP9 is slightly slower still.
|
||||
|
||||
For best WebM decode speed, consider encoding VP8 with "profile 1" (simple deblocking filter) which will sacrifice quality modestly, mainly in high-motion scenes. When encoding with ffmpeg, this is the `-profile:v 1` option to the `libvpx` codec.
|
||||
|
||||
It is also recommended to use the `-slices` option for VP8, or `-tile-columns` for VP9, to maximize ability to use multithreaded decoding when available in the future.
|
||||
|
||||
*AV1*
|
||||
|
||||
WebM files containing the AV1 codec are supported as of 1.6.0 (February 2019) using the [dav1d](https://code.videolan.org/videolan/dav1d) decoder.
|
||||
|
||||
Currently this is experimental, and does not advertise support via `canPlayType`.
|
||||
|
||||
Performance is about 2-3x slower than VP8 or VP9, and may require bumping down a resolution step or two to maintain frame rate. There may be further optimizations that can be done to improve this a bit, but the best improvements will come from future improvements to WebAssembly multithreading and SIMD.
|
||||
|
||||
Currently AV1 in MP4 container is not supported.
|
||||
|
||||
## Upstream library notes
|
||||
|
||||
We've experimented with tremor (libivorbis), an integer-only variant of libvorbis. This actually does *not* decode faster, but does save about 200kb off our generated JavaScript, presumably thanks to not including an encoder in the library. However on slow devices like iPod Touch 5th-generation, it makes a significant negative impact on the decode time so we've gone back to libvorbis.
|
||||
|
||||
The Ogg Skeleton library (libskeleton) is a bit ... unfinished and is slightly modified here.
|
||||
|
||||
libvpx is slightly modified to work around emscripten threading limitations in the VP8 decoder.
|
||||
|
||||
|
||||
## WebAssembly
|
||||
|
||||
WebAssembly (Wasm) builds are used exclusively as of 1.8.0, as Safari's Wasm support is pretty well established now and IE no longer works due to the Flash plugin deprecation.
|
||||
|
||||
|
||||
## Multithreading
|
||||
|
||||
Experimental multithreaded VP8, VP9, and AV1 decoding up to 4 cores is in development, requiring emscripten 1.38.27 to build.
|
||||
|
||||
Multithreading is used only if `options.threading` is true. This requires browser support for the new `SharedArrayBuffer` and `Atomics` APIs, currently available in Firefox and Chrome with experimental flags enabled.
|
||||
|
||||
Threading currently requires WebAssembly; JavaScript builds are possible but perform poorly.
|
||||
|
||||
Speedups will only be noticeable when using the "slices" or "token partitions" option for VP8 encoding, or the "tile columns" option for VP9 encoding.
|
||||
|
||||
If you are making a slim build and will not use the `threading` option, you can leave out the `*-mt.*` files.
|
||||
|
||||
|
||||
## Building JS components
|
||||
|
||||
Building ogv.js is known to work on Mac OS X and Linux (tested Fedora 29 and Ubuntu 18.10 with Meson manually updated).
|
||||
|
||||
1. You will need autoconf, automake, libtool, pkg-config, meson, ninja, and node (nodejs). These can be installed through Homebrew on Mac OS X, or through distribution-specific methods on Linux. For meson, you may need a newer version than your distro packages -- install it manually with `pip3` or from source.
|
||||
2. Install [Emscripten](http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html); currently building with 2.0.13.
|
||||
3. `git submodule update --init`
|
||||
4. Run `npm install` to install build utilities
|
||||
5. Run `make js` to configure and build the libraries and the C wrapper
|
||||
|
||||
|
||||
## Building the demo
|
||||
|
||||
If you did all the setup above, just run `make demo` or `make`. Look in build/demo/ and enjoy!
|
||||
|
||||
|
||||
## License
|
||||
|
||||
libogg, libvorbis, libtheora, libopus, nestegg, libvpx, and dav1d are available under their respective licenses, and the JavaScript and C wrapper code in this repo is licensed under MIT.
|
||||
|
||||
Based on build scripts from https://github.com/devongovett/ogg.js
|
||||
|
||||
See [AUTHORS.md](https://github.com/brion/ogv.js/blob/master/AUTHORS.md) and/or the git history for a list of contributors.
|
||||
@ -0,0 +1,39 @@
|
||||
|
||||
var OGVDecoderAudioOpusW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderAudioOpusW) {
|
||||
OGVDecoderAudioOpusW = OGVDecoderAudioOpusW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderAudioOpusW !== 'undefined' ? OGVDecoderAudioOpusW : {});var g=Object.assign,h,m;a.ready=new Promise(function(b,c){h=b;m=c});var n=a,p=g({},a),q="object"===typeof window,r="function"===typeof importScripts,t="",u,v,w,fs,x,y;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)t=r?require("path").dirname(t)+"/":__dirname+"/",y=function(){x||(fs=require("fs"),x=require("path"))},u=function(b,c){y();b=x.normalize(b);return fs.readFileSync(b,c?null:"utf8")},w=function(b){b=u(b,!0);b.buffer||(b=new Uint8Array(b));return b},v=function(b,c,e){y();b=x.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(q||r)r?t=self.location.href:"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",u=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(w=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),v=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var z=a.printErr||console.warn.bind(console);g(a,p);p=null;var A;a.wasmBinary&&(A=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&B("no native wasm support detected");
|
||||
var C,D=!1,E,F;function G(){var b=C.buffer;E=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=F=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var H,I=[],J=[],K=[];function aa(){var b=a.preRun.shift();I.unshift(b)}var L=0,M=null,N=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function B(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";z(b);D=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");m(b);throw b;}function O(){return P.startsWith("data:application/octet-stream;base64,")}var P;P="ogv-decoder-audio-opus-wasm.wasm";if(!O()){var Q=P;P=a.locateFile?a.locateFile(Q,t):t+Q}function R(){var b=P;try{if(b==P&&A)return new Uint8Array(A);if(w)return w(b);throw"both async and sync fetching of the wasm failed";}catch(c){B(c)}}
|
||||
function ba(){if(!A&&(q||r)){if("function"===typeof fetch&&!P.startsWith("file://"))return fetch(P,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+P+"'";return b.arrayBuffer()}).catch(function(){return R()});if(v)return new Promise(function(b,c){v(P,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return R()})}
|
||||
function S(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.s;"number"===typeof e?void 0===c.o?ca(e)():ca(e)(c.o):e(void 0===c.o?null:c.o)}}}var T=[];function ca(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=H.get(b));return c}
|
||||
var da={a:function(b,c,e){F.copyWithin(b,c,c+e)},b:function(b){var c=F.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{C.grow(Math.min(2147483648,d)-E.byteLength+65535>>>16);G();var f=1;break a}catch(k){}f=void 0}if(f)return!0}return!1},c:function(b,c,e){var d=C.buffer,f=new Uint32Array(d,b,c),k=[];if(0!==b)for(b=0;b<c;b++){var l=f[b];d.slice?(l=d.slice(l,l+4*e),l=new Float32Array(l)):(l=
|
||||
new Float32Array(d,l,e),l=new Float32Array(l));k.push(l)}a.audioBuffer=k},d:function(b,c){a.audioFormat={channels:b,rate:c};a.loadedMetadata=!0}};
|
||||
(function(){function b(f){a.asm=f.exports;C=a.asm.e;G();H=a.asm.m;J.unshift(a.asm.f);L--;a.monitorRunDependencies&&a.monitorRunDependencies(L);0==L&&(null!==M&&(clearInterval(M),M=null),N&&(f=N,N=null,f()))}function c(f){b(f.instance)}function e(f){return ba().then(function(k){return WebAssembly.instantiate(k,d)}).then(function(k){return k}).then(f,function(k){z("failed to asynchronously prepare wasm: "+k);B(k)})}var d={a:da};L++;a.monitorRunDependencies&&a.monitorRunDependencies(L);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return z("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return A||"function"!==typeof WebAssembly.instantiateStreaming||O()||P.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(P,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(k){z("wasm streaming compile failed: "+k);z("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(m);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.f).apply(null,arguments)};a._ogv_audio_decoder_init=function(){return(a._ogv_audio_decoder_init=a.asm.g).apply(null,arguments)};a._ogv_audio_decoder_process_header=function(){return(a._ogv_audio_decoder_process_header=a.asm.h).apply(null,arguments)};a._ogv_audio_decoder_process_audio=function(){return(a._ogv_audio_decoder_process_audio=a.asm.i).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.j).apply(null,arguments)};
|
||||
a._free=function(){return(a._free=a.asm.k).apply(null,arguments)};a._ogv_audio_decoder_destroy=function(){return(a._ogv_audio_decoder_destroy=a.asm.l).apply(null,arguments)};var U;N=function ea(){U||V();U||(N=ea)};
|
||||
function V(){function b(){if(!U&&(U=!0,a.calledRun=!0,!D)){S(J);h(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();K.unshift(c)}S(K)}}if(!(0<L)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)aa();S(I);0<L||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=V;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();V();var W,X;function fa(b){if(W&&X>=b)return W;W&&a._free(W);X=b;return W=a._malloc(X)}var Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!n.audioFormat;a.audioFormat=n.audioFormat||null;a.audioBuffer=null;a.cpuTime=0;
|
||||
Object.defineProperty(a,"processing",{get:function(){return!1}});a.init=function(b){Z(function(){a._ogv_audio_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength,f=fa(d);(new Uint8Array(C.buffer,f,d)).set(new Uint8Array(b));return a._ogv_audio_decoder_process_header(f,d)});c(e)};a.processAudio=function(b,c){var e=Z(function(){var d=b.byteLength,f=fa(d);(new Uint8Array(C.buffer,f,d)).set(new Uint8Array(b));return a._ogv_audio_decoder_process_audio(f,d)});c(e)};
|
||||
a.close=function(){};
|
||||
|
||||
|
||||
return OGVDecoderAudioOpusW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderAudioOpusW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderAudioOpusW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderAudioOpusW"] = OGVDecoderAudioOpusW;
|
||||
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-audio-opus-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-audio-opus-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1,40 @@
|
||||
|
||||
var OGVDecoderAudioVorbisW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderAudioVorbisW) {
|
||||
OGVDecoderAudioVorbisW = OGVDecoderAudioVorbisW || {};
|
||||
|
||||
|
||||
var b;b||(b=typeof OGVDecoderAudioVorbisW !== 'undefined' ? OGVDecoderAudioVorbisW : {});var g=Object.assign,h,m;b.ready=new Promise(function(a,c){h=a;m=c});var n=b,p=g({},b),q=(a,c)=>{throw c;},r="object"===typeof window,t="function"===typeof importScripts,u="",v,w,x,fs,y,z;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)u=t?require("path").dirname(u)+"/":__dirname+"/",z=function(){y||(fs=require("fs"),y=require("path"))},v=function(a,c){z();a=y.normalize(a);return fs.readFileSync(a,c?null:"utf8")},x=function(a){a=v(a,!0);a.buffer||(a=new Uint8Array(a));return a},w=function(a,c,e){z();a=y.normalize(a);fs.readFile(a,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(a){throw a;}),q=(a,c)=>{if(noExitRuntime||0<A)throw process.exitCode=a,c;c instanceof B||C("exiting due to exception: "+c);process.exit(a)},b.inspect=function(){return"[Emscripten Module object]"};else if(r||t)t?u=self.location.href:"undefined"!==typeof document&&document.currentScript&&(u=document.currentScript.src),_scriptDir&&(u=_scriptDir),0!==u.indexOf("blob:")?u=u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):u="",v=function(a){var c=new XMLHttpRequest;
|
||||
c.open("GET",a,!1);c.send(null);return c.responseText},t&&(x=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),w=function(a,c,e){var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};b.print||console.log.bind(console);var C=b.printErr||console.warn.bind(console);g(b,p);p=null;b.quit&&(q=b.quit);
|
||||
var D;b.wasmBinary&&(D=b.wasmBinary);var noExitRuntime=b.noExitRuntime||!0;"object"!==typeof WebAssembly&&E("no native wasm support detected");var F,G=!1,H,I;function J(){var a=F.buffer;H=a;b.HEAP8=new Int8Array(a);b.HEAP16=new Int16Array(a);b.HEAP32=new Int32Array(a);b.HEAPU8=I=new Uint8Array(a);b.HEAPU16=new Uint16Array(a);b.HEAPU32=new Uint32Array(a);b.HEAPF32=new Float32Array(a);b.HEAPF64=new Float64Array(a)}var K,L=[],M=[],N=[],A=0;function aa(){var a=b.preRun.shift();L.unshift(a)}
|
||||
var O=0,P=null,Q=null;b.preloadedImages={};b.preloadedAudios={};function E(a){if(b.onAbort)b.onAbort(a);a="Aborted("+a+")";C(a);G=!0;a=new WebAssembly.RuntimeError(a+". Build with -s ASSERTIONS=1 for more info.");m(a);throw a;}function ba(){return R.startsWith("data:application/octet-stream;base64,")}var R;R="ogv-decoder-audio-vorbis-wasm.wasm";if(!ba()){var ca=R;R=b.locateFile?b.locateFile(ca,u):u+ca}
|
||||
function da(){var a=R;try{if(a==R&&D)return new Uint8Array(D);if(x)return x(a);throw"both async and sync fetching of the wasm failed";}catch(c){E(c)}}
|
||||
function ea(){if(!D&&(r||t)){if("function"===typeof fetch&&!R.startsWith("file://"))return fetch(R,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+R+"'";return a.arrayBuffer()}).catch(function(){return da()});if(w)return new Promise(function(a,c){w(R,function(e){a(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return da()})}
|
||||
function S(a){for(;0<a.length;){var c=a.shift();if("function"==typeof c)c(b);else{var e=c.s;"number"===typeof e?void 0===c.o?fa(e)():fa(e)(c.o):e(void 0===c.o?null:c.o)}}}var T=[];function fa(a){var c=T[a];c||(a>=T.length&&(T.length=a+1),T[a]=c=K.get(a));return c}
|
||||
var ha={a:function(a,c,e){I.copyWithin(a,c,c+e)},b:function(a){var c=I.length;a>>>=0;if(2147483648<a)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,a+100663296);d=Math.max(a,d);0<d%65536&&(d+=65536-d%65536);a:{try{F.grow(Math.min(2147483648,d)-H.byteLength+65535>>>16);J();var f=1;break a}catch(k){}f=void 0}if(f)return!0}return!1},c:function(a){if(!(noExitRuntime||0<A)){if(b.onExit)b.onExit(a);G=!0}q(a,new B(a))},d:function(a,c,e){var d=F.buffer,f=new Uint32Array(d,a,c),k=[];if(0!==
|
||||
a)for(a=0;a<c;a++){var l=f[a];d.slice?(l=d.slice(l,l+4*e),l=new Float32Array(l)):(l=new Float32Array(d,l,e),l=new Float32Array(l));k.push(l)}b.audioBuffer=k},e:function(a,c){b.audioFormat={channels:a,rate:c};b.loadedMetadata=!0}};
|
||||
(function(){function a(f){b.asm=f.exports;F=b.asm.f;J();K=b.asm.n;M.unshift(b.asm.g);O--;b.monitorRunDependencies&&b.monitorRunDependencies(O);0==O&&(null!==P&&(clearInterval(P),P=null),Q&&(f=Q,Q=null,f()))}function c(f){a(f.instance)}function e(f){return ea().then(function(k){return WebAssembly.instantiate(k,d)}).then(function(k){return k}).then(f,function(k){C("failed to asynchronously prepare wasm: "+k);E(k)})}var d={a:ha};O++;b.monitorRunDependencies&&b.monitorRunDependencies(O);if(b.instantiateWasm)try{return b.instantiateWasm(d,
|
||||
a)}catch(f){return C("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return D||"function"!==typeof WebAssembly.instantiateStreaming||ba()||R.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(R,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(k){C("wasm streaming compile failed: "+k);C("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(m);return{}})();
|
||||
b.___wasm_call_ctors=function(){return(b.___wasm_call_ctors=b.asm.g).apply(null,arguments)};b._ogv_audio_decoder_init=function(){return(b._ogv_audio_decoder_init=b.asm.h).apply(null,arguments)};b._ogv_audio_decoder_process_header=function(){return(b._ogv_audio_decoder_process_header=b.asm.i).apply(null,arguments)};b._ogv_audio_decoder_process_audio=function(){return(b._ogv_audio_decoder_process_audio=b.asm.j).apply(null,arguments)};
|
||||
b._ogv_audio_decoder_destroy=function(){return(b._ogv_audio_decoder_destroy=b.asm.k).apply(null,arguments)};b._malloc=function(){return(b._malloc=b.asm.l).apply(null,arguments)};b._free=function(){return(b._free=b.asm.m).apply(null,arguments)};var U;function B(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}Q=function ia(){U||V();U||(Q=ia)};
|
||||
function V(){function a(){if(!U&&(U=!0,b.calledRun=!0,!G)){S(M);h(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();N.unshift(c)}S(N)}}if(!(0<O)){if(b.preRun)for("function"==typeof b.preRun&&(b.preRun=[b.preRun]);b.preRun.length;)aa();S(L);0<O||(b.setStatus?(b.setStatus("Running..."),setTimeout(function(){setTimeout(function(){b.setStatus("")},1);a()},1)):a())}}b.run=V;
|
||||
if(b.preInit)for("function"==typeof b.preInit&&(b.preInit=[b.preInit]);0<b.preInit.length;)b.preInit.pop()();V();var W,X;function ja(a){if(W&&X>=a)return W;W&&b._free(W);X=a;return W=b._malloc(X)}var Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(a){var c=Y();a=a();b.cpuTime+=Y()-c;return a}b.loadedMetadata=!!n.audioFormat;b.audioFormat=n.audioFormat||null;b.audioBuffer=null;b.cpuTime=0;
|
||||
Object.defineProperty(b,"processing",{get:function(){return!1}});b.init=function(a){Z(function(){b._ogv_audio_decoder_init()});a()};b.processHeader=function(a,c){var e=Z(function(){var d=a.byteLength,f=ja(d);(new Uint8Array(F.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_header(f,d)});c(e)};b.processAudio=function(a,c){var e=Z(function(){var d=a.byteLength,f=ja(d);(new Uint8Array(F.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_audio(f,d)});c(e)};
|
||||
b.close=function(){};
|
||||
|
||||
|
||||
return OGVDecoderAudioVorbisW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderAudioVorbisW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderAudioVorbisW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderAudioVorbisW"] = OGVDecoderAudioVorbisW;
|
||||
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-audio-vorbis-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-audio-vorbis-wasm.wasm
Executable file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-av1-mt-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-av1-mt-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoAV1MTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoAV1SIMDMTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
@ -0,0 +1,43 @@
|
||||
|
||||
var OGVDecoderVideoAV1SIMDW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoAV1SIMDW) {
|
||||
OGVDecoderVideoAV1SIMDW = OGVDecoderVideoAV1SIMDW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoAV1SIMDW !== 'undefined' ? OGVDecoderVideoAV1SIMDW : {});var aa=Object.assign,ba,q;a.ready=new Promise(function(b,c){ba=b;q=c});var ca=a,da=aa({},a),ea="object"===typeof window,r="function"===typeof importScripts,A="",fa,F,G,fs,I,ha;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)A=r?require("path").dirname(A)+"/":__dirname+"/",ha=function(){I||(fs=require("fs"),I=require("path"))},fa=function(b,c){ha();b=I.normalize(b);return fs.readFileSync(b,c?null:"utf8")},G=function(b){b=fa(b,!0);b.buffer||(b=new Uint8Array(b));return b},F=function(b,c,e){ha();b=I.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),
|
||||
process.argv.slice(2),process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ea||r)r?A=self.location.href:"undefined"!==typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),0!==A.indexOf("blob:")?A=A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):A="",fa=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(G=function(b){var c=new XMLHttpRequest;
|
||||
c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),F=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};var ia=a.print||console.log.bind(console),J=a.printErr||console.warn.bind(console);aa(a,da);da=null;var K;a.wasmBinary&&(K=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&M("no native wasm support detected");
|
||||
var N,ja=!1,ka="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0,la,O,P;function ma(){var b=N.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=P=new Int32Array(b);a.HEAPU8=O=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var na,oa=[],pa=[],qa=[];function ra(){var b=a.preRun.shift();oa.unshift(b)}var Q=0,sa=null,R=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function M(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";J(b);ja=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");q(b);throw b;}function ta(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-av1-simd-wasm.wasm";if(!ta()){var ua=S;S=a.locateFile?a.locateFile(ua,A):A+ua}function va(){var b=S;try{if(b==S&&K)return new Uint8Array(K);if(G)return G(b);throw"both async and sync fetching of the wasm failed";}catch(c){M(c)}}
|
||||
function wa(){if(!K&&(ea||r)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return va()});if(F)return new Promise(function(b,c){F(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return va()})}
|
||||
function xa(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.B;"number"===typeof e?void 0===c.s?Ja(e)():Ja(e)(c.s):e(void 0===c.s?null:c.s)}}}var T=[];function Ja(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=na.get(b));return c}
|
||||
var Ka=[null,[],[]],La={b:function(){M("")},d:function(b,c,e){O.copyWithin(b,c,c+e)},e:function(b){var c=O.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{N.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);ma();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},f:function(){return 0},c:function(){},a:function(b,c,e,d){for(var f=0,g=0;g<e;g++){var x=P[c>>2],u=P[c+4>>2];c+=8;for(var y=
|
||||
0;y<u;y++){var n=O[x+y],w=Ka[b];if(0===n||10===n){n=1===b?ia:J;var l=w;for(var p=0,t=p+NaN,v=p;l[v]&&!(v>=t);)++v;if(16<v-p&&l.subarray&&ka)l=ka.decode(l.subarray(p,v));else{for(t="";p<v;){var h=l[p++];if(h&128){var B=l[p++]&63;if(192==(h&224))t+=String.fromCharCode((h&31)<<6|B);else{var U=l[p++]&63;h=224==(h&240)?(h&15)<<12|B<<6|U:(h&7)<<18|B<<12|U<<6|l[p++]&63;65536>h?t+=String.fromCharCode(h):(h-=65536,t+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else t+=String.fromCharCode(h)}l=t}n(l);w.length=
|
||||
0}else w.push(n)}f+=u}P[d>>2]=f;return 0},g:function(b,c,e,d,f,g,x,u,y,n,w,l,p,t,v,h){function B(H,k,C,ya,za,Aa,Na,Oa,V){H.set(new Uint8Array(U,k,C*ya));var D,z;for(D=z=0;D<Aa;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;for(;D<Aa+Oa;D++,z+=C){for(k=0;k<za;k++)H[z+k]=V;for(k=za+Na;k<C;k++)H[z+k]=V}for(;D<ya;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;return H}var U=N.buffer,m=a.videoFormat,Ba=(p&-2)*y/x,Ca=(t&-2)*n/u,Da=w*y/x,Ea=l*n/u;w===m.cropWidth&&l===m.cropHeight&&(v=m.displayWidth,h=m.displayHeight);for(var Fa=
|
||||
a.recycledFrames,E,Ga=u*c,Ha=n*d,Ia=n*g;0<Fa.length;){var L=Fa.shift();m=L.format;if(m.width===x&&m.height===u&&m.chromaWidth===y&&m.chromaHeight===n&&m.cropLeft===p&&m.cropTop===t&&m.cropWidth===w&&m.cropHeight===l&&m.displayWidth===v&&m.displayHeight===h&&L.y.bytes.length===Ga&&L.u.bytes.length===Ha&&L.v.bytes.length===Ia){E=L;break}}E||(E={format:{width:x,height:u,chromaWidth:y,chromaHeight:n,cropLeft:p,cropTop:t,cropWidth:w,cropHeight:l,displayWidth:v,displayHeight:h},y:{bytes:new Uint8Array(Ga),
|
||||
stride:c},u:{bytes:new Uint8Array(Ha),stride:d},v:{bytes:new Uint8Array(Ia),stride:g}});B(E.y.bytes,b,c,u,p,t,w,l,0);B(E.u.bytes,e,d,n,Ba,Ca,Da,Ea,128);B(E.v.bytes,f,g,n,Ba,Ca,Da,Ea,128);a.frameBuffer=E}};
|
||||
(function(){function b(f){a.asm=f.exports;N=a.asm.h;ma();na=a.asm.p;pa.unshift(a.asm.i);Q--;a.monitorRunDependencies&&a.monitorRunDependencies(Q);0==Q&&(null!==sa&&(clearInterval(sa),sa=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return wa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){J("failed to asynchronously prepare wasm: "+g);M(g)})}var d={a:La};Q++;a.monitorRunDependencies&&a.monitorRunDependencies(Q);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return J("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return K||"function"!==typeof WebAssembly.instantiateStreaming||ta()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){J("wasm streaming compile failed: "+g);J("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(q);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.i).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.k).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.l).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.m).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.n).apply(null,arguments)};a._free=function(){return(a._free=a.asm.o).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.q).apply(null,arguments)};var W;R=function Ma(){W||Pa();W||(R=Ma)};
|
||||
function Pa(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ja)){xa(pa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();qa.unshift(c)}xa(qa)}}if(!(0<Q)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)ra();xa(oa);0<Q||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Pa;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Pa();var X,Qa,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Qa>=d||(X&&a._free(X),Qa=d,X=a._malloc(Qa));var f=X;(new Uint8Array(N.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.A=[];
|
||||
a.processFrame=function(b,c){function e(u){a._free(g);c(u)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.A.push(e);var x=Z(function(){(new Uint8Array(N.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(x)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.A.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoAV1SIMDW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoAV1SIMDW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoAV1SIMDW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoAV1SIMDW"] = OGVDecoderVideoAV1SIMDW;
|
||||
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-av1-simd-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-av1-simd-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1,43 @@
|
||||
|
||||
var OGVDecoderVideoAV1W = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoAV1W) {
|
||||
OGVDecoderVideoAV1W = OGVDecoderVideoAV1W || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoAV1W !== 'undefined' ? OGVDecoderVideoAV1W : {});var aa=Object.assign,ba,q;a.ready=new Promise(function(b,c){ba=b;q=c});var ca=a,da=aa({},a),ea="object"===typeof window,r="function"===typeof importScripts,A="",fa,F,G,fs,I,ha;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)A=r?require("path").dirname(A)+"/":__dirname+"/",ha=function(){I||(fs=require("fs"),I=require("path"))},fa=function(b,c){ha();b=I.normalize(b);return fs.readFileSync(b,c?null:"utf8")},G=function(b){b=fa(b,!0);b.buffer||(b=new Uint8Array(b));return b},F=function(b,c,e){ha();b=I.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),
|
||||
process.argv.slice(2),process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ea||r)r?A=self.location.href:"undefined"!==typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),0!==A.indexOf("blob:")?A=A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):A="",fa=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(G=function(b){var c=new XMLHttpRequest;
|
||||
c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),F=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};var ia=a.print||console.log.bind(console),J=a.printErr||console.warn.bind(console);aa(a,da);da=null;var K;a.wasmBinary&&(K=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&M("no native wasm support detected");
|
||||
var N,ja=!1,ka="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0,la,O,P;function ma(){var b=N.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=P=new Int32Array(b);a.HEAPU8=O=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var na,oa=[],pa=[],qa=[];function ra(){var b=a.preRun.shift();oa.unshift(b)}var Q=0,sa=null,R=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function M(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";J(b);ja=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");q(b);throw b;}function ta(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-av1-wasm.wasm";if(!ta()){var ua=S;S=a.locateFile?a.locateFile(ua,A):A+ua}function va(){var b=S;try{if(b==S&&K)return new Uint8Array(K);if(G)return G(b);throw"both async and sync fetching of the wasm failed";}catch(c){M(c)}}
|
||||
function wa(){if(!K&&(ea||r)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return va()});if(F)return new Promise(function(b,c){F(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return va()})}
|
||||
function xa(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.B;"number"===typeof e?void 0===c.s?Ja(e)():Ja(e)(c.s):e(void 0===c.s?null:c.s)}}}var T=[];function Ja(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=na.get(b));return c}
|
||||
var Ka=[null,[],[]],La={f:function(){M("")},c:function(b,c,e){O.copyWithin(b,c,c+e)},d:function(b){var c=O.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{N.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);ma();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},e:function(){return 0},b:function(){},a:function(b,c,e,d){for(var f=0,g=0;g<e;g++){var x=P[c>>2],u=P[c+4>>2];c+=8;for(var y=
|
||||
0;y<u;y++){var n=O[x+y],w=Ka[b];if(0===n||10===n){n=1===b?ia:J;var l=w;for(var p=0,t=p+NaN,v=p;l[v]&&!(v>=t);)++v;if(16<v-p&&l.subarray&&ka)l=ka.decode(l.subarray(p,v));else{for(t="";p<v;){var h=l[p++];if(h&128){var B=l[p++]&63;if(192==(h&224))t+=String.fromCharCode((h&31)<<6|B);else{var U=l[p++]&63;h=224==(h&240)?(h&15)<<12|B<<6|U:(h&7)<<18|B<<12|U<<6|l[p++]&63;65536>h?t+=String.fromCharCode(h):(h-=65536,t+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else t+=String.fromCharCode(h)}l=t}n(l);w.length=
|
||||
0}else w.push(n)}f+=u}P[d>>2]=f;return 0},g:function(b,c,e,d,f,g,x,u,y,n,w,l,p,t,v,h){function B(H,k,C,ya,za,Aa,Na,Oa,V){H.set(new Uint8Array(U,k,C*ya));var D,z;for(D=z=0;D<Aa;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;for(;D<Aa+Oa;D++,z+=C){for(k=0;k<za;k++)H[z+k]=V;for(k=za+Na;k<C;k++)H[z+k]=V}for(;D<ya;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;return H}var U=N.buffer,m=a.videoFormat,Ba=(p&-2)*y/x,Ca=(t&-2)*n/u,Da=w*y/x,Ea=l*n/u;w===m.cropWidth&&l===m.cropHeight&&(v=m.displayWidth,h=m.displayHeight);for(var Fa=
|
||||
a.recycledFrames,E,Ga=u*c,Ha=n*d,Ia=n*g;0<Fa.length;){var L=Fa.shift();m=L.format;if(m.width===x&&m.height===u&&m.chromaWidth===y&&m.chromaHeight===n&&m.cropLeft===p&&m.cropTop===t&&m.cropWidth===w&&m.cropHeight===l&&m.displayWidth===v&&m.displayHeight===h&&L.y.bytes.length===Ga&&L.u.bytes.length===Ha&&L.v.bytes.length===Ia){E=L;break}}E||(E={format:{width:x,height:u,chromaWidth:y,chromaHeight:n,cropLeft:p,cropTop:t,cropWidth:w,cropHeight:l,displayWidth:v,displayHeight:h},y:{bytes:new Uint8Array(Ga),
|
||||
stride:c},u:{bytes:new Uint8Array(Ha),stride:d},v:{bytes:new Uint8Array(Ia),stride:g}});B(E.y.bytes,b,c,u,p,t,w,l,0);B(E.u.bytes,e,d,n,Ba,Ca,Da,Ea,128);B(E.v.bytes,f,g,n,Ba,Ca,Da,Ea,128);a.frameBuffer=E}};
|
||||
(function(){function b(f){a.asm=f.exports;N=a.asm.h;ma();na=a.asm.p;pa.unshift(a.asm.i);Q--;a.monitorRunDependencies&&a.monitorRunDependencies(Q);0==Q&&(null!==sa&&(clearInterval(sa),sa=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return wa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){J("failed to asynchronously prepare wasm: "+g);M(g)})}var d={a:La};Q++;a.monitorRunDependencies&&a.monitorRunDependencies(Q);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return J("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return K||"function"!==typeof WebAssembly.instantiateStreaming||ta()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){J("wasm streaming compile failed: "+g);J("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(q);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.i).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.k).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.l).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.m).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.n).apply(null,arguments)};a._free=function(){return(a._free=a.asm.o).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.q).apply(null,arguments)};var W;R=function Ma(){W||Pa();W||(R=Ma)};
|
||||
function Pa(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ja)){xa(pa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();qa.unshift(c)}xa(qa)}}if(!(0<Q)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)ra();xa(oa);0<Q||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Pa;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Pa();var X,Qa,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Qa>=d||(X&&a._free(X),Qa=d,X=a._malloc(Qa));var f=X;(new Uint8Array(N.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.A=[];
|
||||
a.processFrame=function(b,c){function e(u){a._free(g);c(u)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.A.push(e);var x=Z(function(){(new Uint8Array(N.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(x)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.A.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoAV1W.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoAV1W;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoAV1W; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoAV1W"] = OGVDecoderVideoAV1W;
|
||||
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-av1-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-av1-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1,42 @@
|
||||
|
||||
var OGVDecoderVideoTheoraW = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoTheoraW) {
|
||||
OGVDecoderVideoTheoraW = OGVDecoderVideoTheoraW || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoTheoraW !== 'undefined' ? OGVDecoderVideoTheoraW : {});var ca=Object.assign,da,l;a.ready=new Promise(function(b,c){da=b;l=c});var ea=a,fa=ca({},a),ha="object"===typeof window,m="function"===typeof importScripts,t="",y,B,C,fs,D,E;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)t=m?require("path").dirname(t)+"/":__dirname+"/",E=function(){D||(fs=require("fs"),D=require("path"))},y=function(b,c){E();b=D.normalize(b);return fs.readFileSync(b,c?null:"utf8")},C=function(b){b=y(b,!0);b.buffer||(b=new Uint8Array(b));return b},B=function(b,c,e){E();b=D.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ha||m)m?t=self.location.href:"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",y=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},m&&(C=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),B=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var H=a.printErr||console.warn.bind(console);ca(a,fa);fa=null;var I;a.wasmBinary&&(I=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&J("no native wasm support detected");
|
||||
var K,ia=!1,ja,L;function ka(){var b=K.buffer;ja=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=L=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var la,ma=[],na=[],oa=[];function pa(){var b=a.preRun.shift();ma.unshift(b)}var P=0,Q=null,R=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function J(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";H(b);ia=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");l(b);throw b;}function qa(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-theora-wasm.wasm";if(!qa()){var ra=S;S=a.locateFile?a.locateFile(ra,t):t+ra}function sa(){var b=S;try{if(b==S&&I)return new Uint8Array(I);if(C)return C(b);throw"both async and sync fetching of the wasm failed";}catch(c){J(c)}}
|
||||
function ta(){if(!I&&(ha||m)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return sa()});if(B)return new Promise(function(b,c){B(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return sa()})}
|
||||
function T(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.A;"number"===typeof e?void 0===c.o?ua(e)():ua(e)(c.o):e(void 0===c.o?null:c.o)}}}var U=[];function ua(b){var c=U[b];c||(b>=U.length&&(U.length=b+1),U[b]=c=la.get(b));return c}
|
||||
var Ga={a:function(b,c,e){L.copyWithin(b,c,c+e)},b:function(b){var c=L.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{K.grow(Math.min(2147483648,d)-ja.byteLength+65535>>>16);ka();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},c:function(b,c,e,d,f,g,q,n,z,p,u,F,M,N,Z,aa){function ba(A,h,v,va,wa,xa,Ia,Ja,O){A.set(new Uint8Array(Ka,h,v*va));var w,r;for(w=r=0;w<xa;w++,r+=v)for(h=
|
||||
0;h<v;h++)A[r+h]=O;for(;w<xa+Ja;w++,r+=v){for(h=0;h<wa;h++)A[r+h]=O;for(h=wa+Ia;h<v;h++)A[r+h]=O}for(;w<va;w++,r+=v)for(h=0;h<v;h++)A[r+h]=O;return A}var Ka=K.buffer,k=a.videoFormat,ya=(M&-2)*z/q,za=(N&-2)*p/n,Aa=u*z/q,Ba=F*p/n;u===k.cropWidth&&F===k.cropHeight&&(Z=k.displayWidth,aa=k.displayHeight);for(var Ca=a.recycledFrames,x,Da=n*c,Ea=p*d,Fa=p*g;0<Ca.length;){var G=Ca.shift();k=G.format;if(k.width===q&&k.height===n&&k.chromaWidth===z&&k.chromaHeight===p&&k.cropLeft===M&&k.cropTop===N&&k.cropWidth===
|
||||
u&&k.cropHeight===F&&k.displayWidth===Z&&k.displayHeight===aa&&G.y.bytes.length===Da&&G.u.bytes.length===Ea&&G.v.bytes.length===Fa){x=G;break}}x||(x={format:{width:q,height:n,chromaWidth:z,chromaHeight:p,cropLeft:M,cropTop:N,cropWidth:u,cropHeight:F,displayWidth:Z,displayHeight:aa},y:{bytes:new Uint8Array(Da),stride:c},u:{bytes:new Uint8Array(Ea),stride:d},v:{bytes:new Uint8Array(Fa),stride:g}});ba(x.y.bytes,b,c,n,M,N,u,F,0);ba(x.u.bytes,e,d,p,ya,za,Aa,Ba,128);ba(x.v.bytes,f,g,p,ya,za,Aa,Ba,128);
|
||||
a.frameBuffer=x},d:function(b,c,e,d,f,g,q,n,z,p,u){a.videoFormat={width:b,height:c,chromaWidth:e,chromaHeight:d,cropLeft:n,cropTop:z,cropWidth:g,cropHeight:q,displayWidth:p,displayHeight:u,fps:f};a.loadedMetadata=!0}};
|
||||
(function(){function b(f){a.asm=f.exports;K=a.asm.e;ka();la=a.asm.n;na.unshift(a.asm.f);P--;a.monitorRunDependencies&&a.monitorRunDependencies(P);0==P&&(null!==Q&&(clearInterval(Q),Q=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return ta().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){H("failed to asynchronously prepare wasm: "+g);J(g)})}var d={a:Ga};P++;a.monitorRunDependencies&&a.monitorRunDependencies(P);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return H("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return I||"function"!==typeof WebAssembly.instantiateStreaming||qa()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){H("wasm streaming compile failed: "+g);H("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(l);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.f).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.g).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.h).apply(null,arguments)};a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.i).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.k).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.l).apply(null,arguments)};a._free=function(){return(a._free=a.asm.m).apply(null,arguments)};var V;R=function Ha(){V||La();V||(R=Ha)};
|
||||
function La(){function b(){if(!V&&(V=!0,a.calledRun=!0,!ia)){T(na);da(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();oa.unshift(c)}T(oa)}}if(!(0<P)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)pa();T(ma);0<P||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=La;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();La();var W,Ma,X;"undefined"===typeof performance||"undefined"===typeof performance.now?X=Date.now:X=performance.now.bind(performance);function Y(b){var c=X();b=b();a.cpuTime+=X()-c;return b}a.loadedMetadata=!!ea.videoFormat;a.videoFormat=ea.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Y(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Y(function(){var d=b.byteLength;W&&Ma>=d||(W&&a._free(W),Ma=d,W=a._malloc(Ma));var f=W;(new Uint8Array(K.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.s=[];
|
||||
a.processFrame=function(b,c){function e(n){a._free(g);c(n)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.s.push(e);var q=Y(function(){(new Uint8Array(K.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(q)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.s.push(function(){}),Y(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoTheoraW.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoTheoraW;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoTheoraW; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoTheoraW"] = OGVDecoderVideoTheoraW;
|
||||
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-theora-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-theora-wasm.wasm
Executable file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-vp8-mt-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-vp8-mt-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoVP8MTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
@ -0,0 +1,44 @@
|
||||
|
||||
var OGVDecoderVideoVP8W = (() => {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
||||
return (
|
||||
function(OGVDecoderVideoVP8W) {
|
||||
OGVDecoderVideoVP8W = OGVDecoderVideoVP8W || {};
|
||||
|
||||
|
||||
var a;a||(a=typeof OGVDecoderVideoVP8W !== 'undefined' ? OGVDecoderVideoVP8W : {});var aa=Object.assign,ba,n;a.ready=new Promise(function(b,c){ba=b;n=c});var ca=a,ha=aa({},a),ia="object"===typeof window,p="function"===typeof importScripts,t="",x,y,A,fs,B,C;
|
||||
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)t=p?require("path").dirname(t)+"/":__dirname+"/",C=function(){B||(fs=require("fs"),B=require("path"))},x=function(b,c){C();b=B.normalize(b);return fs.readFileSync(b,c?null:"utf8")},A=function(b){b=x(b,!0);b.buffer||(b=new Uint8Array(b));return b},y=function(b,c,e){C();b=B.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
|
||||
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ia||p)p?t=self.location.href:"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",x=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},p&&(A=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
|
||||
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),y=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var D=a.printErr||console.warn.bind(console);aa(a,ha);ha=null;var ja=0,E;a.wasmBinary&&(E=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&F("no native wasm support detected");
|
||||
var G,ka=!1,la,ma;function na(){var b=G.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=ma=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var oa,pa=[],qa=[],ra=[];function sa(){var b=a.preRun.shift();pa.unshift(b)}var K=0,ta=null,L=null;a.preloadedImages={};a.preloadedAudios={};
|
||||
function F(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";D(b);ka=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");n(b);throw b;}function ua(){return M.startsWith("data:application/octet-stream;base64,")}var M;M="ogv-decoder-video-vp8-wasm.wasm";if(!ua()){var va=M;M=a.locateFile?a.locateFile(va,t):t+va}function wa(){var b=M;try{if(b==M&&E)return new Uint8Array(E);if(A)return A(b);throw"both async and sync fetching of the wasm failed";}catch(c){F(c)}}
|
||||
function xa(){if(!E&&(ia||p)){if("function"===typeof fetch&&!M.startsWith("file://"))return fetch(M,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+M+"'";return b.arrayBuffer()}).catch(function(){return wa()});if(y)return new Promise(function(b,c){y(M,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return wa()})}
|
||||
function ya(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.C;"number"===typeof e?void 0===c.A?N(e)():N(e)(c.A):e(void 0===c.A?null:c.A)}}}var O=[];function N(b){var c=O[b];c||(b>=O.length&&(O.length=b+1),O[b]=c=oa.get(b));return c}
|
||||
var Pa={g:function(){throw"longjmp";},e:function(b,c,e){ma.copyWithin(b,c,c+e)},f:function(b){var c=ma.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{G.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);na();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},a:function(){return ja},d:Ka,i:La,j:Ma,h:Na,c:Oa,k:function(b,c,e,d,f,g,l,m,P,q,H,I,Q,R,da,ea){function fa(z,h,u,za,Aa,Ba,
|
||||
Sa,Ta,S){z.set(new Uint8Array(Ua,h,u*za));var v,r;for(v=r=0;v<Ba;v++,r+=u)for(h=0;h<u;h++)z[r+h]=S;for(;v<Ba+Ta;v++,r+=u){for(h=0;h<Aa;h++)z[r+h]=S;for(h=Aa+Sa;h<u;h++)z[r+h]=S}for(;v<za;v++,r+=u)for(h=0;h<u;h++)z[r+h]=S;return z}var Ua=G.buffer,k=a.videoFormat,Ca=(Q&-2)*P/l,Da=(R&-2)*q/m,Ea=H*P/l,Fa=I*q/m;H===k.cropWidth&&I===k.cropHeight&&(da=k.displayWidth,ea=k.displayHeight);for(var Ga=a.recycledFrames,w,Ha=m*c,Ia=q*d,Ja=q*g;0<Ga.length;){var J=Ga.shift();k=J.format;if(k.width===l&&k.height===
|
||||
m&&k.chromaWidth===P&&k.chromaHeight===q&&k.cropLeft===Q&&k.cropTop===R&&k.cropWidth===H&&k.cropHeight===I&&k.displayWidth===da&&k.displayHeight===ea&&J.y.bytes.length===Ha&&J.u.bytes.length===Ia&&J.v.bytes.length===Ja){w=J;break}}w||(w={format:{width:l,height:m,chromaWidth:P,chromaHeight:q,cropLeft:Q,cropTop:R,cropWidth:H,cropHeight:I,displayWidth:da,displayHeight:ea},y:{bytes:new Uint8Array(Ha),stride:c},u:{bytes:new Uint8Array(Ia),stride:d},v:{bytes:new Uint8Array(Ja),stride:g}});fa(w.y.bytes,
|
||||
b,c,m,Q,R,H,I,0);fa(w.u.bytes,e,d,q,Ca,Da,Ea,Fa,128);fa(w.v.bytes,f,g,q,Ca,Da,Ea,Fa,128);a.frameBuffer=w},b:function(b){ja=b}};
|
||||
(function(){function b(f){a.asm=f.exports;G=a.asm.l;na();oa=a.asm.s;qa.unshift(a.asm.m);K--;a.monitorRunDependencies&&a.monitorRunDependencies(K);0==K&&(null!==ta&&(clearInterval(ta),ta=null),L&&(f=L,L=null,f()))}function c(f){b(f.instance)}function e(f){return xa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){D("failed to asynchronously prepare wasm: "+g);F(g)})}var d={a:Pa};K++;a.monitorRunDependencies&&a.monitorRunDependencies(K);if(a.instantiateWasm)try{return a.instantiateWasm(d,
|
||||
b)}catch(f){return D("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return E||"function"!==typeof WebAssembly.instantiateStreaming||ua()||M.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(M,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){D("wasm streaming compile failed: "+g);D("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(n);return{}})();
|
||||
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.m).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.n).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.o).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.p).apply(null,arguments)};
|
||||
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.q).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.r).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.t).apply(null,arguments)};a._free=function(){return(a._free=a.asm.u).apply(null,arguments)};
|
||||
var T=a._setThrew=function(){return(T=a._setThrew=a.asm.v).apply(null,arguments)},U=a.stackSave=function(){return(U=a.stackSave=a.asm.w).apply(null,arguments)},V=a.stackRestore=function(){return(V=a.stackRestore=a.asm.x).apply(null,arguments)},Qa=a.dynCall_iiiij=function(){return(Qa=a.dynCall_iiiij=a.asm.y).apply(null,arguments)};function Oa(b,c,e,d,f){var g=U();try{N(b)(c,e,d,f)}catch(l){V(g);if(l!==l+0&&"longjmp"!==l)throw l;T(1,0)}}
|
||||
function Ka(b,c,e){var d=U();try{return N(b)(c,e)}catch(f){V(d);if(f!==f+0&&"longjmp"!==f)throw f;T(1,0)}}function La(b,c,e,d){var f=U();try{return N(b)(c,e,d)}catch(g){V(f);if(g!==g+0&&"longjmp"!==g)throw g;T(1,0)}}function Na(b,c){var e=U();try{N(b)(c)}catch(d){V(e);if(d!==d+0&&"longjmp"!==d)throw d;T(1,0)}}function Ma(b,c,e,d,f,g){var l=U();try{return Qa(b,c,e,d,f,g)}catch(m){V(l);if(m!==m+0&&"longjmp"!==m)throw m;T(1,0)}}var W;L=function Ra(){W||Va();W||(L=Ra)};
|
||||
function Va(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ka)){ya(qa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();ra.unshift(c)}ya(ra)}}if(!(0<K)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)sa();ya(pa);0<K||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Va;
|
||||
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Va();var X,Wa,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
|
||||
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Wa>=d||(X&&a._free(X),Wa=d,X=a._malloc(Wa));var f=X;(new Uint8Array(G.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.B=[];
|
||||
a.processFrame=function(b,c){function e(m){a._free(g);c(m)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.B.push(e);var l=Z(function(){(new Uint8Array(G.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(l)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.B.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
|
||||
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
|
||||
|
||||
|
||||
return OGVDecoderVideoVP8W.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = OGVDecoderVideoVP8W;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return OGVDecoderVideoVP8W; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["OGVDecoderVideoVP8W"] = OGVDecoderVideoVP8W;
|
||||
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-vp8-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-vp8-wasm.wasm
Executable file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-vp9-mt-wasm.wasm
Executable file
BIN
shelled/rustdesk-web-client/lib/ogvjs-1.8.6/ogv-decoder-video-vp9-mt-wasm.wasm
Executable file
Binary file not shown.
@ -0,0 +1 @@
|
||||
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoVP9MTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user