@matjash/pixi-native-win32-x64 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/LICENSE +21 -0
  2. package/THIRD_PARTY_NOTICES.md +83 -0
  3. package/index.cjs +25 -0
  4. package/index.d.ts +11 -0
  5. package/native/audio/binding-path.js +16 -0
  6. package/native/audio/dist/win32-x64/native_audio.node +0 -0
  7. package/native/audio/package.json +7 -0
  8. package/native/audio/src/index.d.ts +63 -0
  9. package/native/audio/src/index.js +5 -0
  10. package/native/audio/src/lib.rs +1520 -0
  11. package/native/gpu/dist/win32-x64/d3dcompiler_47.dll +0 -0
  12. package/native/gpu/dist/win32-x64/pixi_native_gpu.node +0 -0
  13. package/native/gpu/package.json +24 -0
  14. package/native/gpu/src/binding-path.js +16 -0
  15. package/native/gpu/src/index.d.ts +2847 -0
  16. package/native/gpu/src/index.js +48 -0
  17. package/native/video/dist/win32-x64/FFMPEG_BUILD_INFO.txt +46 -0
  18. package/native/video/dist/win32-x64/FFMPEG_LICENSE.txt +502 -0
  19. package/native/video/dist/win32-x64/FFMPEG_SHA256SUMS +4 -0
  20. package/native/video/dist/win32-x64/ffmpeg.exe +0 -0
  21. package/native/video/dist/win32-x64/ffprobe.exe +0 -0
  22. package/native/video/dist/win32-x64/native_video.node +0 -0
  23. package/native/video/package.json +7 -0
  24. package/native/video/src/binding-path.js +26 -0
  25. package/native/video/src/index.d.ts +36 -0
  26. package/native/video/src/index.js +61 -0
  27. package/native/video/src/lib.rs +994 -0
  28. package/native/window/binding-path.js +11 -0
  29. package/native/window/dist/win32-x64/native_window.node +0 -0
  30. package/native/window/package.json +7 -0
  31. package/native/window/src/index.d.ts +17 -0
  32. package/native/window/src/index.js +32 -0
  33. package/native/window/src/lib.rs +308 -0
  34. package/package.json +41 -0
  35. package/third_party/ffmpeg-source-8.0-140fd653ae.tar.gz +0 -0
  36. package/third_party/ffmpeg-source-8.0-140fd653ae.tar.gz.sha256 +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matjaz Prijatelj
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,83 @@
1
+ # Third-party notices
2
+
3
+ Pixi Native uses the MIT License. The third-party components listed below keep
4
+ their own license terms.
5
+
6
+ ## JavaScript and native runtime projects
7
+
8
+ Pixi Native uses these projects through direct packages or native integration:
9
+
10
+ - [PixiJS](https://pixijs.com/) for the rendering API and scene graph
11
+ - [@node-3d](https://github.com/node-3d) and
12
+ [GLFW](https://www.glfw.org/) for native WebGL windows
13
+ - [SDL](https://www.libsdl.org/) through `@kmamal/sdl` for input, display
14
+ information, and Linux audio output
15
+ - [@napi-rs/canvas](https://github.com/Brooooooklyn/canvas) for Canvas2D, text,
16
+ and image decoding
17
+ - [napi-rs](https://napi.rs/) for the Rust native addons
18
+ - [CPAL](https://github.com/RustAudio/cpal) and crossbeam for Windows audio
19
+ - [FFmpeg](https://ffmpeg.org/) for video probing, decoding, and streamed audio
20
+
21
+ The installed packages and their upstream repositories contain their copyright
22
+ and license terms. Those terms continue to apply to each dependency.
23
+
24
+ ## Dawn and Tint
25
+
26
+ The packaged `pixi_native_gpu.node` binaries contain Dawn and Tint code.
27
+
28
+ Copyright 2017-2026 The Dawn & Tint Authors
29
+
30
+ Redistribution and use in source and binary forms, with or without
31
+ modification, are permitted provided that the following conditions are met:
32
+
33
+ 1. Redistributions of source code must retain the above copyright notice,
34
+ this list of conditions and the following disclaimer.
35
+ 2. Redistributions in binary form must reproduce the above copyright notice,
36
+ this list of conditions and the following disclaimer in the documentation
37
+ and/or other materials provided with the distribution.
38
+ 3. Neither the name of the copyright holder nor the names of its contributors
39
+ may be used to endorse or promote products derived from this software
40
+ without specific prior written permission.
41
+
42
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
43
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
45
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
46
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
48
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
49
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
50
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
51
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
52
+
53
+ The pinned Dawn source contains more third-party notices in its upstream
54
+ [LICENSE file](https://dawn.googlesource.com/dawn/+/HEAD/LICENSE).
55
+
56
+ ## Rust native-addon dependencies
57
+
58
+ The native window, audio, and video binaries include napi-rs and, where used,
59
+ CPAL, crossbeam, and windows-rs. The checked-in Cargo lockfiles record their
60
+ exact versions. Each crate remains subject to its upstream license.
61
+
62
+ ## Microsoft D3DCompiler
63
+
64
+ The Windows package contains `d3dcompiler_47.dll` from the Windows SDK.
65
+ Microsoft Software License Terms for the Windows SDK used to build the binary
66
+ govern its redistribution.
67
+
68
+ ## FFmpeg
69
+
70
+ The Windows x64 and Linux x64 native packages contain project-built, statically
71
+ linked FFmpeg and FFprobe programs. Pixi Native invokes them through subprocess
72
+ pipes.
73
+
74
+ - Source: <https://github.com/FFmpeg/FFmpeg/commit/140fd653aed8cad774f991ba083e2d01e86420c7>
75
+ - Release: FFmpeg 8.0
76
+ - License profile: GNU Lesser General Public License version 2.1 or later
77
+ - Configuration: decode-focused x64 builds without GPL or nonfree components
78
+
79
+ Each native package includes `FFMPEG_LICENSE.txt`, `FFMPEG_BUILD_INFO.txt`,
80
+ and `FFMPEG_SHA256SUMS` beside its FFmpeg programs. Each release places the
81
+ complete pinned corresponding-source archive and its SHA-256 file under
82
+ `third_party/`. The LGPL terms apply to the bundled FFmpeg programs. H.264 and H.265
83
+ may require separate patent licenses that the LGPL does not grant.
package/index.cjs ADDED
@@ -0,0 +1,25 @@
1
+ const Fs = require("node:fs");
2
+ const Path = require("node:path");
3
+
4
+ const packagedNativeRoot = Path.join(__dirname, "native");
5
+ const workspaceNativeRoot = Path.resolve(__dirname, "..", "..", "native");
6
+ const nativeRoot = Fs.existsSync(packagedNativeRoot)
7
+ ? packagedNativeRoot
8
+ : workspaceNativeRoot;
9
+ const target = "win32-x64";
10
+
11
+ module.exports = {
12
+ target,
13
+ gpuModule: Path.join(nativeRoot, "gpu"),
14
+ windowModule: Path.join(nativeRoot, "window"),
15
+ videoModule: Path.join(nativeRoot, "video", "src", "index.js"),
16
+ audioBinding: Path.join(
17
+ nativeRoot,
18
+ "audio",
19
+ "dist",
20
+ target,
21
+ "native_audio.node",
22
+ ),
23
+ ffmpeg: Path.join(nativeRoot, "video", "dist", target, "ffmpeg.exe"),
24
+ ffprobe: Path.join(nativeRoot, "video", "dist", target, "ffprobe.exe"),
25
+ };
package/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export interface NativePlatformModules {
2
+ readonly target: "win32-x64";
3
+ readonly gpuModule: string;
4
+ readonly windowModule: string;
5
+ readonly videoModule: string;
6
+ readonly audioBinding: string;
7
+ readonly ffmpeg: string;
8
+ readonly ffprobe: string;
9
+ }
10
+ declare const modules: NativePlatformModules;
11
+ export = modules;
@@ -0,0 +1,16 @@
1
+ const { existsSync } = require("node:fs");
2
+ const { resolve } = require("node:path");
3
+
4
+ function getBindingPath() {
5
+ const platform = `${process.platform}-${process.arch}`;
6
+ const binding = resolve(__dirname, "dist", platform, "native_audio.node");
7
+ if (!existsSync(binding)) {
8
+ throw new Error(
9
+ `Missing native audio addon for ${platform}: ${binding}. ` +
10
+ "Build it with pnpm native:audio:build on Windows x64.",
11
+ );
12
+ }
13
+ return binding;
14
+ }
15
+
16
+ module.exports = { getBindingPath };
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@pixi-native/native-audio",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts"
7
+ }
@@ -0,0 +1,63 @@
1
+ export interface NativeVoiceOptions {
2
+ ownerId: number;
3
+ id: number;
4
+ source: string;
5
+ ffmpegPath: string;
6
+ offsetSeconds: number;
7
+ durationSeconds?: number;
8
+ volume: number;
9
+ muted: boolean;
10
+ loop: boolean;
11
+ streaming: boolean;
12
+ playbackRate: number;
13
+ inputArgs: string[];
14
+ outputArgs: string[];
15
+ }
16
+
17
+ export interface NativeCommandOptions {
18
+ ownerId: number;
19
+ command: string;
20
+ id?: number;
21
+ value?: number;
22
+ boolValue?: boolean;
23
+ from?: number;
24
+ to?: number;
25
+ durationMs?: number;
26
+ fadeVersion?: number;
27
+ }
28
+
29
+ export interface NativeAudioEvent {
30
+ ownerId: number;
31
+ event: string;
32
+ id?: number;
33
+ message?: string;
34
+ }
35
+
36
+ export interface NativeAudioDiagnostics {
37
+ activeVoices: number;
38
+ queuedMs: number;
39
+ underruns: number;
40
+ }
41
+
42
+ export class NativeAudioEngine {
43
+ public constructor(eventNotifier: () => void);
44
+ public createVoice(options: NativeVoiceOptions): void;
45
+ public preload(
46
+ ownerId: number,
47
+ requestId: number,
48
+ source: string,
49
+ ffmpegPath: string,
50
+ offsetSeconds: number,
51
+ durationSeconds?: number,
52
+ ): void;
53
+ public command(options: NativeCommandOptions): void;
54
+ public unloadOwner(ownerId: number): void;
55
+ public currentTime(id: number): number | null;
56
+ public currentVolume(id: number): number | null;
57
+ public setGlobalVolume(value: number): void;
58
+ public setGlobalMuted(value: boolean): void;
59
+ public drainEvents(): NativeAudioEvent[];
60
+ public diagnostics(): NativeAudioDiagnostics;
61
+ public stopAll(): void;
62
+ public shutdown(): void;
63
+ }
@@ -0,0 +1,5 @@
1
+ const { createRequire } = require("node:module");
2
+ const { getBindingPath } = require("../binding-path.js");
3
+
4
+ const requireNative = createRequire(__filename);
5
+ module.exports = requireNative(getBindingPath());