@bun-win32/avifil32 1.0.0
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.
- package/AI.md +71 -0
- package/README.md +78 -0
- package/index.ts +4 -0
- package/package.json +58 -0
- package/structs/Avifil32.ts +490 -0
- package/types/Avifil32.ts +96 -0
package/AI.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# AI Guide for @bun-win32/avifil32
|
|
2
|
+
|
|
3
|
+
How to use this package, not what the Win32 API does.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import Avifil32, { SomeFlag } from '@bun-win32/avifil32';
|
|
9
|
+
|
|
10
|
+
// Methods bind lazily on first call
|
|
11
|
+
const result = Avifil32.SomeFunctionW(arg1, arg2);
|
|
12
|
+
|
|
13
|
+
// Preload: array, single string, or no args (all symbols)
|
|
14
|
+
Avifil32.Preload(['SomeFunctionW', 'AnotherFunction']);
|
|
15
|
+
Avifil32.Preload('SomeFunctionW');
|
|
16
|
+
Avifil32.Preload();
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Where To Look
|
|
20
|
+
|
|
21
|
+
| Need | Read |
|
|
22
|
+
| --------------------------------- | -------------------- |
|
|
23
|
+
| Find a method or its MS Docs link | `structs/Avifil32.ts` |
|
|
24
|
+
| Find types, enums, constants | `types/Avifil32.ts` |
|
|
25
|
+
| Quick examples | `README.md` |
|
|
26
|
+
|
|
27
|
+
`index.ts` re-exports the class and all types — import from `@bun-win32/avifil32` directly.
|
|
28
|
+
|
|
29
|
+
## Calling Convention
|
|
30
|
+
|
|
31
|
+
All documented `avifil32.dll` exports are bound. Each method maps 1:1 to its DLL export. Names, parameter names, and order match Microsoft Docs.
|
|
32
|
+
|
|
33
|
+
### Strings
|
|
34
|
+
|
|
35
|
+
`W` methods take UTF-16LE NUL-terminated buffers. `A` methods take ANSI strings.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const wide = Buffer.from('Hello\0', 'utf16le'); // LPCWSTR
|
|
39
|
+
Avifil32.SomeFunctionW(wide.ptr);
|
|
40
|
+
|
|
41
|
+
// Reading a wide string back from a buffer:
|
|
42
|
+
const text = new TextDecoder('utf-16').decode(buf).replace(/\0.*$/, '');
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Return types
|
|
46
|
+
|
|
47
|
+
- `HANDLE`, `HWND`, etc. → `bigint`
|
|
48
|
+
- `DWORD`, `UINT`, `BOOL`, `INT`, `LONG` → `number`
|
|
49
|
+
- `LPVOID`, `LPWSTR`, etc. → `Pointer`
|
|
50
|
+
- Win32 `BOOL` is `number` (0 or non-zero), **not** JS `boolean`. Do not compare with `=== true`.
|
|
51
|
+
|
|
52
|
+
### Pointers, handles, out-parameters
|
|
53
|
+
|
|
54
|
+
- **Pointer** params (`LP*`, `P*`, `Pointer`): pass `buffer.ptr` from a caller-allocated `Buffer`.
|
|
55
|
+
- **Handle** params (`HANDLE`, `HWND`, etc.): pass a `bigint` value.
|
|
56
|
+
- **Out-parameters**: allocate a `Buffer`, pass `.ptr`, read the result after the call.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
const out = Buffer.alloc(4);
|
|
60
|
+
Avifil32.SomeFunction(out.ptr);
|
|
61
|
+
const value = out.readUInt32LE(0);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Nullability
|
|
65
|
+
|
|
66
|
+
- `| NULL` in a signature → pass `null` (optional pointer).
|
|
67
|
+
- `| 0n` in a signature → pass `0n` (optional handle).
|
|
68
|
+
|
|
69
|
+
## Errors and Cleanup
|
|
70
|
+
|
|
71
|
+
Return values are raw. If the Win32 function uses last-error semantics, read via `GetLastError()`. Resource cleanup is your responsibility — same as raw Win32.
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @bun-win32/avifil32
|
|
2
|
+
|
|
3
|
+
Zero-dependency, zero-overhead Win32 Avifil32 bindings for [Bun](https://bun.sh) on Windows.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`@bun-win32/avifil32` exposes the `avifil32.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Avifil32`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.
|
|
8
|
+
|
|
9
|
+
The bindings are strongly typed for a smooth DX in TypeScript.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.
|
|
14
|
+
- Direct FFI to `avifil32.dll` (Video for Windows AVIFile API: open/create `.avi` files, enumerate and read/write video, audio, MIDI, and text streams, decode frames to DIBs, mux files from streams, and edit streams).
|
|
15
|
+
- In-source docs in `structs/Avifil32.ts` with links to Microsoft Docs.
|
|
16
|
+
- Lazy binding on first call; optional eager preload (`Avifil32.Preload()`).
|
|
17
|
+
- No wrapper overhead; calls map 1:1 to native APIs.
|
|
18
|
+
- Strongly-typed Win32 aliases (see `types/Avifil32.ts`).
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- [Bun](https://bun.sh) runtime
|
|
23
|
+
- Windows 10 or later
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
bun add @bun-win32/avifil32
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import Avifil32, { OpenFileFlags, StreamType } from '@bun-win32/avifil32';
|
|
35
|
+
|
|
36
|
+
// Optionally bind a subset up-front
|
|
37
|
+
Avifil32.Preload(['AVIFileInit', 'AVIFileOpenW', 'AVIFileInfoW', 'AVIFileRelease', 'AVIFileExit']);
|
|
38
|
+
|
|
39
|
+
Avifil32.AVIFileInit();
|
|
40
|
+
|
|
41
|
+
// AVIFileOpenW writes the IAVIFile pointer into a caller-allocated buffer
|
|
42
|
+
const ppfile = Buffer.alloc(8);
|
|
43
|
+
const path = Buffer.from('C:\\\\sample.avi\0', 'utf16le');
|
|
44
|
+
const hr = Avifil32.AVIFileOpenW(ppfile.ptr, path.ptr, OpenFileFlags.OF_READ | OpenFileFlags.OF_SHARE_DENY_NONE, null);
|
|
45
|
+
|
|
46
|
+
if (hr === 0) {
|
|
47
|
+
const pfile = ppfile.readBigUInt64LE(0);
|
|
48
|
+
|
|
49
|
+
// AVIFILEINFOW is 172 bytes on x64; dwStreams is at offset 12
|
|
50
|
+
const info = Buffer.alloc(172);
|
|
51
|
+
Avifil32.AVIFileInfoW(pfile, info.ptr, info.byteLength);
|
|
52
|
+
console.log('Streams: %d', info.readUInt32LE(12));
|
|
53
|
+
|
|
54
|
+
Avifil32.AVIFileRelease(pfile);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Avifil32.AVIFileExit();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> [!NOTE]
|
|
61
|
+
> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.
|
|
62
|
+
|
|
63
|
+
## Examples
|
|
64
|
+
|
|
65
|
+
Run the included examples:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
# Decode a synthesized .avi and play it back in the terminal with 24-bit ANSI
|
|
69
|
+
bun run example/terminal-cinema.ts
|
|
70
|
+
|
|
71
|
+
# Thorough AVI container diagnostic (pass a path, or a sample is synthesized)
|
|
72
|
+
bun run example/avi-inspector.ts [path-to.avi]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Notes
|
|
76
|
+
|
|
77
|
+
- Either rely on lazy binding or call `Avifil32.Preload()`.
|
|
78
|
+
- Windows only. Bun runtime required.
|
package/index.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Stev Peifer <stev@bell.net>",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/ObscuritySRL/bun-win32/issues"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@bun-win32/core": "1.1.2"
|
|
8
|
+
},
|
|
9
|
+
"description": "Zero-dependency, zero-overhead Win32 AVIFIL32 bindings for Bun (FFI) on Windows.",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@bun-win32/kernel32": "1.0.21",
|
|
12
|
+
"@types/bun": "latest"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./index.ts"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"module": "index.ts",
|
|
19
|
+
"name": "@bun-win32/avifil32",
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"typescript": "^5"
|
|
22
|
+
},
|
|
23
|
+
"private": false,
|
|
24
|
+
"homepage": "https://github.com/ObscuritySRL/bun-win32#readme",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git://github.com/ObscuritySRL/bun-win32.git",
|
|
28
|
+
"directory": "packages/avifil32"
|
|
29
|
+
},
|
|
30
|
+
"type": "module",
|
|
31
|
+
"version": "1.0.0",
|
|
32
|
+
"main": "./index.ts",
|
|
33
|
+
"keywords": [
|
|
34
|
+
"bun",
|
|
35
|
+
"ffi",
|
|
36
|
+
"win32",
|
|
37
|
+
"windows",
|
|
38
|
+
"avifil32",
|
|
39
|
+
"bindings",
|
|
40
|
+
"typescript",
|
|
41
|
+
"dll"
|
|
42
|
+
],
|
|
43
|
+
"files": [
|
|
44
|
+
"AI.md",
|
|
45
|
+
"README.md",
|
|
46
|
+
"index.ts",
|
|
47
|
+
"structs/*.ts",
|
|
48
|
+
"types/*.ts"
|
|
49
|
+
],
|
|
50
|
+
"sideEffects": false,
|
|
51
|
+
"engines": {
|
|
52
|
+
"bun": ">=1.1.0"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"example:avi-inspector": "bun ./example/avi-inspector.ts",
|
|
56
|
+
"example:terminal-cinema": "bun ./example/terminal-cinema.ts"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { type FFIFunction, FFIType, type Pointer } from 'bun:ffi';
|
|
2
|
+
|
|
3
|
+
import { Win32 } from '@bun-win32/core';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
AVISAVECALLBACK,
|
|
7
|
+
BOOL,
|
|
8
|
+
DWORD,
|
|
9
|
+
HANDLE,
|
|
10
|
+
HRESULT,
|
|
11
|
+
HWND,
|
|
12
|
+
INT,
|
|
13
|
+
INT_PTR,
|
|
14
|
+
LONG,
|
|
15
|
+
LPAVICOMPRESSOPTIONS,
|
|
16
|
+
LPAVIFILEINFO,
|
|
17
|
+
LPAVIFILEINFOA,
|
|
18
|
+
LPAVIFILEINFOW,
|
|
19
|
+
LPAVISTREAMINFO,
|
|
20
|
+
LPAVISTREAMINFOA,
|
|
21
|
+
LPAVISTREAMINFOW,
|
|
22
|
+
LPBITMAPINFOHEADER,
|
|
23
|
+
LPCLSID,
|
|
24
|
+
LPCSTR,
|
|
25
|
+
LPCTSTR,
|
|
26
|
+
LPCWSTR,
|
|
27
|
+
LPLONG,
|
|
28
|
+
LPSTR,
|
|
29
|
+
LPTSTR,
|
|
30
|
+
LPVOID,
|
|
31
|
+
LPWSTR,
|
|
32
|
+
NULL,
|
|
33
|
+
PAVIFILE,
|
|
34
|
+
PAVISTREAM,
|
|
35
|
+
PGETFRAME,
|
|
36
|
+
UINT,
|
|
37
|
+
ULONG,
|
|
38
|
+
} from '../types/Avifil32';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Thin, lazy-loaded FFI bindings for `avifil32.dll`.
|
|
42
|
+
*
|
|
43
|
+
* Each static method corresponds one-to-one with a Win32 export declared in `Symbols`.
|
|
44
|
+
* The first call to a method binds the underlying native symbol via `bun:ffi` and
|
|
45
|
+
* memoizes it on the class for subsequent calls. For bulk, up-front binding, use `Preload`.
|
|
46
|
+
*
|
|
47
|
+
* Symbols are defined with explicit `FFIType` signatures and kept alphabetized.
|
|
48
|
+
* You normally do not access `Symbols` directly; call the static methods or preload
|
|
49
|
+
* a subset for hot paths.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import Avifil32 from './structs/Avifil32';
|
|
54
|
+
*
|
|
55
|
+
* // Lazy: bind on first call
|
|
56
|
+
* const result = Avifil32.AVIFileOpenW(ppfile.ptr, szFile.ptr, OF_READ, null);
|
|
57
|
+
*
|
|
58
|
+
* // Or preload a subset to avoid per-symbol lazy binding cost
|
|
59
|
+
* Avifil32.Preload(['AVIFileInit', 'AVIFileOpenW', 'AVIFileGetStream']);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
class Avifil32 extends Win32 {
|
|
63
|
+
protected static override name = 'avifil32.dll';
|
|
64
|
+
|
|
65
|
+
/** @inheritdoc */
|
|
66
|
+
protected static override readonly Symbols = {
|
|
67
|
+
AVIBuildFilter: { args: [FFIType.ptr, FFIType.i32, FFIType.i32], returns: FFIType.i32 },
|
|
68
|
+
AVIBuildFilterA: { args: [FFIType.ptr, FFIType.i32, FFIType.i32], returns: FFIType.i32 },
|
|
69
|
+
AVIBuildFilterW: { args: [FFIType.ptr, FFIType.i32, FFIType.i32], returns: FFIType.i32 },
|
|
70
|
+
AVIClearClipboard: { args: [], returns: FFIType.i32 },
|
|
71
|
+
AVIFileAddRef: { args: [FFIType.u64], returns: FFIType.u32 },
|
|
72
|
+
AVIFileCreateStream: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
73
|
+
AVIFileCreateStreamA: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
74
|
+
AVIFileCreateStreamW: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
75
|
+
AVIFileEndRecord: { args: [FFIType.u64], returns: FFIType.i32 },
|
|
76
|
+
AVIFileExit: { args: [], returns: FFIType.void },
|
|
77
|
+
AVIFileGetStream: { args: [FFIType.u64, FFIType.ptr, FFIType.u32, FFIType.i32], returns: FFIType.i32 },
|
|
78
|
+
AVIFileInfo: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
79
|
+
AVIFileInfoA: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
80
|
+
AVIFileInfoW: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
81
|
+
AVIFileInit: { args: [], returns: FFIType.void },
|
|
82
|
+
AVIFileOpen: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
83
|
+
AVIFileOpenA: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
84
|
+
AVIFileOpenW: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
85
|
+
AVIFileReadData: { args: [FFIType.u64, FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
86
|
+
AVIFileRelease: { args: [FFIType.u64], returns: FFIType.u32 },
|
|
87
|
+
AVIFileWriteData: { args: [FFIType.u64, FFIType.u32, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
88
|
+
AVIGetFromClipboard: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
89
|
+
AVIMakeCompressedStream: { args: [FFIType.ptr, FFIType.u64, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
90
|
+
AVIMakeFileFromStreams: { args: [FFIType.ptr, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
|
|
91
|
+
AVIMakeStreamFromClipboard: { args: [FFIType.u32, FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
92
|
+
AVIPutFileOnClipboard: { args: [FFIType.u64], returns: FFIType.i32 },
|
|
93
|
+
AVISave: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32, FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
94
|
+
AVISaveA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32, FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
95
|
+
AVISaveOptions: { args: [FFIType.u64, FFIType.u32, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i64 },
|
|
96
|
+
AVISaveOptionsFree: { args: [FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
|
|
97
|
+
AVISaveV: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
98
|
+
AVISaveVA: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
99
|
+
AVISaveVW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
100
|
+
AVISaveW: { args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.i32, FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
101
|
+
AVIStreamAddRef: { args: [FFIType.u64], returns: FFIType.u32 },
|
|
102
|
+
AVIStreamBeginStreaming: { args: [FFIType.u64, FFIType.i32, FFIType.i32, FFIType.i32], returns: FFIType.i32 },
|
|
103
|
+
AVIStreamCreate: { args: [FFIType.ptr, FFIType.i32, FFIType.i32, FFIType.ptr], returns: FFIType.i32 },
|
|
104
|
+
AVIStreamEndStreaming: { args: [FFIType.u64], returns: FFIType.i32 },
|
|
105
|
+
AVIStreamFindSample: { args: [FFIType.u64, FFIType.i32, FFIType.i32], returns: FFIType.i32 },
|
|
106
|
+
AVIStreamGetFrame: { args: [FFIType.u64, FFIType.i32], returns: FFIType.ptr },
|
|
107
|
+
AVIStreamGetFrameClose: { args: [FFIType.u64], returns: FFIType.i32 },
|
|
108
|
+
AVIStreamGetFrameOpen: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.u64 },
|
|
109
|
+
AVIStreamInfo: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
110
|
+
AVIStreamInfoA: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
111
|
+
AVIStreamInfoW: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
112
|
+
AVIStreamLength: { args: [FFIType.u64], returns: FFIType.i32 },
|
|
113
|
+
AVIStreamOpenFromFile: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.i32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
114
|
+
AVIStreamOpenFromFileA: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.i32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
115
|
+
AVIStreamOpenFromFileW: { args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.i32, FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
116
|
+
AVIStreamRead: { args: [FFIType.u64, FFIType.i32, FFIType.i32, FFIType.ptr, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
117
|
+
AVIStreamReadData: { args: [FFIType.u64, FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
118
|
+
AVIStreamReadFormat: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
119
|
+
AVIStreamRelease: { args: [FFIType.u64], returns: FFIType.u32 },
|
|
120
|
+
AVIStreamSampleToTime: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
|
|
121
|
+
AVIStreamSetFormat: { args: [FFIType.u64, FFIType.i32, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
122
|
+
AVIStreamStart: { args: [FFIType.u64], returns: FFIType.i32 },
|
|
123
|
+
AVIStreamTimeToSample: { args: [FFIType.u64, FFIType.i32], returns: FFIType.i32 },
|
|
124
|
+
AVIStreamWrite: { args: [FFIType.u64, FFIType.i32, FFIType.i32, FFIType.ptr, FFIType.i32, FFIType.u32, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
125
|
+
AVIStreamWriteData: { args: [FFIType.u64, FFIType.u32, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
126
|
+
CreateEditableStream: { args: [FFIType.ptr, FFIType.u64], returns: FFIType.i32 },
|
|
127
|
+
EditStreamClone: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
128
|
+
EditStreamCopy: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
129
|
+
EditStreamCut: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
|
130
|
+
EditStreamPaste: { args: [FFIType.u64, FFIType.ptr, FFIType.ptr, FFIType.u64, FFIType.i32, FFIType.i32], returns: FFIType.i32 },
|
|
131
|
+
EditStreamSetInfo: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
132
|
+
EditStreamSetInfoA: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
133
|
+
EditStreamSetInfoW: { args: [FFIType.u64, FFIType.ptr, FFIType.i32], returns: FFIType.i32 },
|
|
134
|
+
EditStreamSetName: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
135
|
+
EditStreamSetNameA: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
136
|
+
EditStreamSetNameW: { args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 },
|
|
137
|
+
} as const satisfies Record<string, FFIFunction>;
|
|
138
|
+
|
|
139
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avibuildfilter
|
|
140
|
+
public static AVIBuildFilter(lpszFilter: LPTSTR, cbFilter: LONG, fSaving: BOOL): HRESULT {
|
|
141
|
+
return Avifil32.Load('AVIBuildFilter')(lpszFilter, cbFilter, fSaving);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avibuildfiltera
|
|
145
|
+
public static AVIBuildFilterA(lpszFilter: LPSTR, cbFilter: LONG, fSaving: BOOL): HRESULT {
|
|
146
|
+
return Avifil32.Load('AVIBuildFilterA')(lpszFilter, cbFilter, fSaving);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avibuildfilterw
|
|
150
|
+
public static AVIBuildFilterW(lpszFilter: LPWSTR, cbFilter: LONG, fSaving: BOOL): HRESULT {
|
|
151
|
+
return Avifil32.Load('AVIBuildFilterW')(lpszFilter, cbFilter, fSaving);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-aviclearclipboard
|
|
155
|
+
public static AVIClearClipboard(): HRESULT {
|
|
156
|
+
return Avifil32.Load('AVIClearClipboard')();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileaddref
|
|
160
|
+
public static AVIFileAddRef(pfile: PAVIFILE): ULONG {
|
|
161
|
+
return Avifil32.Load('AVIFileAddRef')(pfile);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifilecreatestream
|
|
165
|
+
public static AVIFileCreateStream(pfile: PAVIFILE, ppavi: Pointer, psi: LPAVISTREAMINFO): HRESULT {
|
|
166
|
+
return Avifil32.Load('AVIFileCreateStream')(pfile, ppavi, psi);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifilecreatestreama
|
|
170
|
+
public static AVIFileCreateStreamA(pfile: PAVIFILE, ppavi: Pointer, psi: LPAVISTREAMINFOA): HRESULT {
|
|
171
|
+
return Avifil32.Load('AVIFileCreateStreamA')(pfile, ppavi, psi);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifilecreatestreamw
|
|
175
|
+
public static AVIFileCreateStreamW(pfile: PAVIFILE, ppavi: Pointer, psi: LPAVISTREAMINFOW): HRESULT {
|
|
176
|
+
return Avifil32.Load('AVIFileCreateStreamW')(pfile, ppavi, psi);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileendrecord
|
|
180
|
+
public static AVIFileEndRecord(pfile: PAVIFILE): HRESULT {
|
|
181
|
+
return Avifil32.Load('AVIFileEndRecord')(pfile);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileexit
|
|
185
|
+
public static AVIFileExit(): void {
|
|
186
|
+
return Avifil32.Load('AVIFileExit')();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifilegetstream
|
|
190
|
+
public static AVIFileGetStream(pfile: PAVIFILE, ppavi: Pointer, fccType: DWORD, lParam: LONG): HRESULT {
|
|
191
|
+
return Avifil32.Load('AVIFileGetStream')(pfile, ppavi, fccType, lParam);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileinfo
|
|
195
|
+
public static AVIFileInfo(pfile: PAVIFILE, pfi: LPAVIFILEINFO, lSize: LONG): HRESULT {
|
|
196
|
+
return Avifil32.Load('AVIFileInfo')(pfile, pfi, lSize);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileinfoa
|
|
200
|
+
public static AVIFileInfoA(pfile: PAVIFILE, pfi: LPAVIFILEINFOA, lSize: LONG): HRESULT {
|
|
201
|
+
return Avifil32.Load('AVIFileInfoA')(pfile, pfi, lSize);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileinfow
|
|
205
|
+
public static AVIFileInfoW(pfile: PAVIFILE, pfi: LPAVIFILEINFOW, lSize: LONG): HRESULT {
|
|
206
|
+
return Avifil32.Load('AVIFileInfoW')(pfile, pfi, lSize);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileinit
|
|
210
|
+
public static AVIFileInit(): void {
|
|
211
|
+
return Avifil32.Load('AVIFileInit')();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileopen
|
|
215
|
+
public static AVIFileOpen(ppfile: Pointer, szFile: LPCTSTR, uMode: UINT, lpHandler: LPCLSID | NULL): HRESULT {
|
|
216
|
+
return Avifil32.Load('AVIFileOpen')(ppfile, szFile, uMode, lpHandler);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileopena
|
|
220
|
+
public static AVIFileOpenA(ppfile: Pointer, szFile: LPCSTR, uMode: UINT, lpHandler: LPCLSID | NULL): HRESULT {
|
|
221
|
+
return Avifil32.Load('AVIFileOpenA')(ppfile, szFile, uMode, lpHandler);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifileopenw
|
|
225
|
+
public static AVIFileOpenW(ppfile: Pointer, szFile: LPCWSTR, uMode: UINT, lpHandler: LPCLSID | NULL): HRESULT {
|
|
226
|
+
return Avifil32.Load('AVIFileOpenW')(ppfile, szFile, uMode, lpHandler);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifilereaddata
|
|
230
|
+
public static AVIFileReadData(pfile: PAVIFILE, ckid: DWORD, lpData: LPVOID, lpcbData: LPLONG): HRESULT {
|
|
231
|
+
return Avifil32.Load('AVIFileReadData')(pfile, ckid, lpData, lpcbData);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifilerelease
|
|
235
|
+
public static AVIFileRelease(pfile: PAVIFILE): ULONG {
|
|
236
|
+
return Avifil32.Load('AVIFileRelease')(pfile);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avifilewritedata
|
|
240
|
+
public static AVIFileWriteData(pfile: PAVIFILE, ckid: DWORD, lpData: LPVOID, cbData: LONG): HRESULT {
|
|
241
|
+
return Avifil32.Load('AVIFileWriteData')(pfile, ckid, lpData, cbData);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avigetfromclipboard
|
|
245
|
+
public static AVIGetFromClipboard(lppf: Pointer): HRESULT {
|
|
246
|
+
return Avifil32.Load('AVIGetFromClipboard')(lppf);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avimakecompressedstream
|
|
250
|
+
public static AVIMakeCompressedStream(ppsCompressed: Pointer, ppsSource: PAVISTREAM, lpOptions: LPAVICOMPRESSOPTIONS, pclsidHandler: LPCLSID | NULL): HRESULT {
|
|
251
|
+
return Avifil32.Load('AVIMakeCompressedStream')(ppsCompressed, ppsSource, lpOptions, pclsidHandler);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avimakefilefromstreams
|
|
255
|
+
public static AVIMakeFileFromStreams(ppfile: Pointer, nStreams: INT, papStreams: Pointer): HRESULT {
|
|
256
|
+
return Avifil32.Load('AVIMakeFileFromStreams')(ppfile, nStreams, papStreams);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avimakestreamfromclipboard
|
|
260
|
+
public static AVIMakeStreamFromClipboard(cfFormat: UINT, hGlobal: HANDLE, ppstream: Pointer): HRESULT {
|
|
261
|
+
return Avifil32.Load('AVIMakeStreamFromClipboard')(cfFormat, hGlobal, ppstream);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-aviputfileonclipboard
|
|
265
|
+
public static AVIPutFileOnClipboard(pf: PAVIFILE): HRESULT {
|
|
266
|
+
return Avifil32.Load('AVIPutFileOnClipboard')(pf);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avisave
|
|
270
|
+
public static AVISave(szFile: LPCTSTR, pclsidHandler: LPCLSID | NULL, lpfnCallback: AVISAVECALLBACK | NULL, nStreams: INT, pfile: PAVISTREAM, lpOptions: LPAVICOMPRESSOPTIONS | NULL): HRESULT {
|
|
271
|
+
return Avifil32.Load('AVISave')(szFile, pclsidHandler, lpfnCallback, nStreams, pfile, lpOptions);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avisavea
|
|
275
|
+
public static AVISaveA(szFile: LPCSTR, pclsidHandler: LPCLSID | NULL, lpfnCallback: AVISAVECALLBACK | NULL, nStreams: INT, pfile: PAVISTREAM, lpOptions: LPAVICOMPRESSOPTIONS | NULL): HRESULT {
|
|
276
|
+
return Avifil32.Load('AVISaveA')(szFile, pclsidHandler, lpfnCallback, nStreams, pfile, lpOptions);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avisaveoptions
|
|
280
|
+
public static AVISaveOptions(hwnd: HWND, uiFlags: UINT, nStreams: INT, ppavi: Pointer, plpOptions: Pointer): INT_PTR {
|
|
281
|
+
return Avifil32.Load('AVISaveOptions')(hwnd, uiFlags, nStreams, ppavi, plpOptions);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avisaveoptionsfree
|
|
285
|
+
public static AVISaveOptionsFree(nStreams: INT, plpOptions: Pointer): HRESULT {
|
|
286
|
+
return Avifil32.Load('AVISaveOptionsFree')(nStreams, plpOptions);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avisavev
|
|
290
|
+
public static AVISaveV(szFile: LPCTSTR, pclsidHandler: LPCLSID | NULL, lpfnCallback: AVISAVECALLBACK | NULL, nStreams: INT, ppavi: Pointer, plpOptions: Pointer): HRESULT {
|
|
291
|
+
return Avifil32.Load('AVISaveV')(szFile, pclsidHandler, lpfnCallback, nStreams, ppavi, plpOptions);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avisaveva
|
|
295
|
+
public static AVISaveVA(szFile: LPCSTR, pclsidHandler: LPCLSID | NULL, lpfnCallback: AVISAVECALLBACK | NULL, nStreams: INT, ppavi: Pointer, plpOptions: Pointer): HRESULT {
|
|
296
|
+
return Avifil32.Load('AVISaveVA')(szFile, pclsidHandler, lpfnCallback, nStreams, ppavi, plpOptions);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avisavevw
|
|
300
|
+
public static AVISaveVW(szFile: LPCWSTR, pclsidHandler: LPCLSID | NULL, lpfnCallback: AVISAVECALLBACK | NULL, nStreams: INT, ppavi: Pointer, plpOptions: Pointer): HRESULT {
|
|
301
|
+
return Avifil32.Load('AVISaveVW')(szFile, pclsidHandler, lpfnCallback, nStreams, ppavi, plpOptions);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avisavew
|
|
305
|
+
public static AVISaveW(szFile: LPCWSTR, pclsidHandler: LPCLSID | NULL, lpfnCallback: AVISAVECALLBACK | NULL, nStreams: INT, pfile: PAVISTREAM, lpOptions: LPAVICOMPRESSOPTIONS | NULL): HRESULT {
|
|
306
|
+
return Avifil32.Load('AVISaveW')(szFile, pclsidHandler, lpfnCallback, nStreams, pfile, lpOptions);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamaddref
|
|
310
|
+
public static AVIStreamAddRef(pavi: PAVISTREAM): ULONG {
|
|
311
|
+
return Avifil32.Load('AVIStreamAddRef')(pavi);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreambeginstreaming
|
|
315
|
+
public static AVIStreamBeginStreaming(pavi: PAVISTREAM, lStart: LONG, lEnd: LONG, lRate: LONG): HRESULT {
|
|
316
|
+
return Avifil32.Load('AVIStreamBeginStreaming')(pavi, lStart, lEnd, lRate);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamcreate
|
|
320
|
+
public static AVIStreamCreate(ppavi: Pointer, lParam1: LONG, lParam2: LONG, pclsidHandler: LPCLSID | NULL): HRESULT {
|
|
321
|
+
return Avifil32.Load('AVIStreamCreate')(ppavi, lParam1, lParam2, pclsidHandler);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamendstreaming
|
|
325
|
+
public static AVIStreamEndStreaming(pavi: PAVISTREAM): HRESULT {
|
|
326
|
+
return Avifil32.Load('AVIStreamEndStreaming')(pavi);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamfindsample
|
|
330
|
+
public static AVIStreamFindSample(pavi: PAVISTREAM, lPos: LONG, lFlags: LONG): LONG {
|
|
331
|
+
return Avifil32.Load('AVIStreamFindSample')(pavi, lPos, lFlags);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamgetframe
|
|
335
|
+
public static AVIStreamGetFrame(pg: PGETFRAME, lPos: LONG): LPVOID {
|
|
336
|
+
return Avifil32.Load('AVIStreamGetFrame')(pg, lPos);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamgetframeclose
|
|
340
|
+
public static AVIStreamGetFrameClose(pg: PGETFRAME): HRESULT {
|
|
341
|
+
return Avifil32.Load('AVIStreamGetFrameClose')(pg);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamgetframeopen
|
|
345
|
+
public static AVIStreamGetFrameOpen(pavi: PAVISTREAM, lpbiWanted: LPBITMAPINFOHEADER | NULL): PGETFRAME {
|
|
346
|
+
return Avifil32.Load('AVIStreamGetFrameOpen')(pavi, lpbiWanted);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreaminfo
|
|
350
|
+
public static AVIStreamInfo(pavi: PAVISTREAM, psi: LPAVISTREAMINFO, lSize: LONG): HRESULT {
|
|
351
|
+
return Avifil32.Load('AVIStreamInfo')(pavi, psi, lSize);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreaminfoa
|
|
355
|
+
public static AVIStreamInfoA(pavi: PAVISTREAM, psi: LPAVISTREAMINFOA, lSize: LONG): HRESULT {
|
|
356
|
+
return Avifil32.Load('AVIStreamInfoA')(pavi, psi, lSize);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreaminfow
|
|
360
|
+
public static AVIStreamInfoW(pavi: PAVISTREAM, psi: LPAVISTREAMINFOW, lSize: LONG): HRESULT {
|
|
361
|
+
return Avifil32.Load('AVIStreamInfoW')(pavi, psi, lSize);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamlength
|
|
365
|
+
public static AVIStreamLength(pavi: PAVISTREAM): LONG {
|
|
366
|
+
return Avifil32.Load('AVIStreamLength')(pavi);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamopenfromfile
|
|
370
|
+
public static AVIStreamOpenFromFile(ppavi: Pointer, szFile: LPCTSTR, fccType: DWORD, lParam: LONG, mode: UINT, pclsidHandler: LPCLSID | NULL): HRESULT {
|
|
371
|
+
return Avifil32.Load('AVIStreamOpenFromFile')(ppavi, szFile, fccType, lParam, mode, pclsidHandler);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamopenfromfilea
|
|
375
|
+
public static AVIStreamOpenFromFileA(ppavi: Pointer, szFile: LPCSTR, fccType: DWORD, lParam: LONG, mode: UINT, pclsidHandler: LPCLSID | NULL): HRESULT {
|
|
376
|
+
return Avifil32.Load('AVIStreamOpenFromFileA')(ppavi, szFile, fccType, lParam, mode, pclsidHandler);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamopenfromfilew
|
|
380
|
+
public static AVIStreamOpenFromFileW(ppavi: Pointer, szFile: LPCWSTR, fccType: DWORD, lParam: LONG, mode: UINT, pclsidHandler: LPCLSID | NULL): HRESULT {
|
|
381
|
+
return Avifil32.Load('AVIStreamOpenFromFileW')(ppavi, szFile, fccType, lParam, mode, pclsidHandler);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamread
|
|
385
|
+
public static AVIStreamRead(pavi: PAVISTREAM, lStart: LONG, lSamples: LONG, lpBuffer: LPVOID | NULL, cbBuffer: LONG, plBytes: LPLONG | NULL, plSamples: LPLONG | NULL): HRESULT {
|
|
386
|
+
return Avifil32.Load('AVIStreamRead')(pavi, lStart, lSamples, lpBuffer, cbBuffer, plBytes, plSamples);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamreaddata
|
|
390
|
+
public static AVIStreamReadData(pavi: PAVISTREAM, fcc: DWORD, lp: LPVOID | NULL, lpcb: LPLONG): HRESULT {
|
|
391
|
+
return Avifil32.Load('AVIStreamReadData')(pavi, fcc, lp, lpcb);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamreadformat
|
|
395
|
+
public static AVIStreamReadFormat(pavi: PAVISTREAM, lPos: LONG, lpFormat: LPVOID | NULL, lpcbFormat: LPLONG): HRESULT {
|
|
396
|
+
return Avifil32.Load('AVIStreamReadFormat')(pavi, lPos, lpFormat, lpcbFormat);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamrelease
|
|
400
|
+
public static AVIStreamRelease(pavi: PAVISTREAM): ULONG {
|
|
401
|
+
return Avifil32.Load('AVIStreamRelease')(pavi);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamsampletotime
|
|
405
|
+
public static AVIStreamSampleToTime(pavi: PAVISTREAM, lSample: LONG): LONG {
|
|
406
|
+
return Avifil32.Load('AVIStreamSampleToTime')(pavi, lSample);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamsetformat
|
|
410
|
+
public static AVIStreamSetFormat(pavi: PAVISTREAM, lPos: LONG, lpFormat: LPVOID, cbFormat: LONG): HRESULT {
|
|
411
|
+
return Avifil32.Load('AVIStreamSetFormat')(pavi, lPos, lpFormat, cbFormat);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamstart
|
|
415
|
+
public static AVIStreamStart(pavi: PAVISTREAM): LONG {
|
|
416
|
+
return Avifil32.Load('AVIStreamStart')(pavi);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamtimetosample
|
|
420
|
+
public static AVIStreamTimeToSample(pavi: PAVISTREAM, lTime: LONG): LONG {
|
|
421
|
+
return Avifil32.Load('AVIStreamTimeToSample')(pavi, lTime);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamwrite
|
|
425
|
+
public static AVIStreamWrite(pavi: PAVISTREAM, lStart: LONG, lSamples: LONG, lpBuffer: LPVOID, cbBuffer: LONG, dwFlags: DWORD, plSampWritten: LPLONG | NULL, plBytesWritten: LPLONG | NULL): HRESULT {
|
|
426
|
+
return Avifil32.Load('AVIStreamWrite')(pavi, lStart, lSamples, lpBuffer, cbBuffer, dwFlags, plSampWritten, plBytesWritten);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-avistreamwritedata
|
|
430
|
+
public static AVIStreamWriteData(pavi: PAVISTREAM, fcc: DWORD, lp: LPVOID, cb: LONG): HRESULT {
|
|
431
|
+
return Avifil32.Load('AVIStreamWriteData')(pavi, fcc, lp, cb);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-createeditablestream
|
|
435
|
+
public static CreateEditableStream(ppsEditable: Pointer, psSource: PAVISTREAM | 0n): HRESULT {
|
|
436
|
+
return Avifil32.Load('CreateEditableStream')(ppsEditable, psSource);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamclone
|
|
440
|
+
public static EditStreamClone(pavi: PAVISTREAM, ppResult: Pointer): HRESULT {
|
|
441
|
+
return Avifil32.Load('EditStreamClone')(pavi, ppResult);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamcopy
|
|
445
|
+
public static EditStreamCopy(pavi: PAVISTREAM, plStart: LPLONG, plLength: LPLONG, ppResult: Pointer): HRESULT {
|
|
446
|
+
return Avifil32.Load('EditStreamCopy')(pavi, plStart, plLength, ppResult);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamcut
|
|
450
|
+
public static EditStreamCut(pavi: PAVISTREAM, plStart: LPLONG, plLength: LPLONG, ppResult: Pointer): HRESULT {
|
|
451
|
+
return Avifil32.Load('EditStreamCut')(pavi, plStart, plLength, ppResult);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreampaste
|
|
455
|
+
public static EditStreamPaste(pavi: PAVISTREAM, plPos: LPLONG, plLength: LPLONG, pstream: PAVISTREAM, lStart: LONG, lEnd: LONG): HRESULT {
|
|
456
|
+
return Avifil32.Load('EditStreamPaste')(pavi, plPos, plLength, pstream, lStart, lEnd);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamsetinfo
|
|
460
|
+
public static EditStreamSetInfo(pavi: PAVISTREAM, lpInfo: LPAVISTREAMINFO, cbInfo: LONG): HRESULT {
|
|
461
|
+
return Avifil32.Load('EditStreamSetInfo')(pavi, lpInfo, cbInfo);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamsetinfoa
|
|
465
|
+
public static EditStreamSetInfoA(pavi: PAVISTREAM, lpInfo: LPAVISTREAMINFOA, cbInfo: LONG): HRESULT {
|
|
466
|
+
return Avifil32.Load('EditStreamSetInfoA')(pavi, lpInfo, cbInfo);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamsetinfow
|
|
470
|
+
public static EditStreamSetInfoW(pavi: PAVISTREAM, lpInfo: LPAVISTREAMINFOW, cbInfo: LONG): HRESULT {
|
|
471
|
+
return Avifil32.Load('EditStreamSetInfoW')(pavi, lpInfo, cbInfo);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamsetname
|
|
475
|
+
public static EditStreamSetName(pavi: PAVISTREAM, lpszName: LPCTSTR): HRESULT {
|
|
476
|
+
return Avifil32.Load('EditStreamSetName')(pavi, lpszName);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamsetnamea
|
|
480
|
+
public static EditStreamSetNameA(pavi: PAVISTREAM, lpszName: LPCSTR): HRESULT {
|
|
481
|
+
return Avifil32.Load('EditStreamSetNameA')(pavi, lpszName);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// https://learn.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-editstreamsetnamew
|
|
485
|
+
public static EditStreamSetNameW(pavi: PAVISTREAM, lpszName: LPCWSTR): HRESULT {
|
|
486
|
+
return Avifil32.Load('EditStreamSetNameW')(pavi, lpszName);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export default Avifil32;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Pointer } from 'bun:ffi';
|
|
2
|
+
|
|
3
|
+
export type { BOOL, DWORD, HANDLE, HRESULT, HWND, INT, INT_PTR, LONG, LPCSTR, LPCWSTR, LPSTR, LPVOID, LPWSTR, NULL, UINT, ULONG } from '@bun-win32/core';
|
|
4
|
+
|
|
5
|
+
export const AVISTREAMREAD_CONVENIENT = -1;
|
|
6
|
+
|
|
7
|
+
export enum AviCompressFlags {
|
|
8
|
+
AVICOMPRESSF_DATARATE = 0x0000_0002,
|
|
9
|
+
AVICOMPRESSF_INTERLEAVE = 0x0000_0001,
|
|
10
|
+
AVICOMPRESSF_KEYFRAMES = 0x0000_0004,
|
|
11
|
+
AVICOMPRESSF_VALID = 0x0000_0008,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum AviFileCaps {
|
|
15
|
+
AVIFILECAPS_ALLKEYFRAMES = 0x0000_0010,
|
|
16
|
+
AVIFILECAPS_CANREAD = 0x0000_0001,
|
|
17
|
+
AVIFILECAPS_CANWRITE = 0x0000_0002,
|
|
18
|
+
AVIFILECAPS_NOCOMPRESSION = 0x0000_0020,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum AviFileInfoFlags {
|
|
22
|
+
AVIFILEINFO_COPYRIGHTED = 0x0002_0000,
|
|
23
|
+
AVIFILEINFO_HASINDEX = 0x0000_0010,
|
|
24
|
+
AVIFILEINFO_ISINTERLEAVED = 0x0000_0100,
|
|
25
|
+
AVIFILEINFO_MUSTUSEINDEX = 0x0000_0020,
|
|
26
|
+
AVIFILEINFO_WASCAPTUREFILE = 0x0001_0000,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum AviGetFrameFlags {
|
|
30
|
+
AVIGETFRAMEF_BESTDISPLAYFMT = 0x0000_0001,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export enum AviIndexFlags {
|
|
34
|
+
AVIIF_COMPUSE = 0x0fff_0000,
|
|
35
|
+
AVIIF_FIRSTPART = 0x0000_0020,
|
|
36
|
+
AVIIF_KEYFRAME = 0x0000_0010,
|
|
37
|
+
AVIIF_LASTPART = 0x0000_0040,
|
|
38
|
+
AVIIF_LIST = 0x0000_0001,
|
|
39
|
+
AVIIF_MIDPART = 0x0000_0060,
|
|
40
|
+
AVIIF_NOTIME = 0x0000_0100,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export enum AviStreamInfoFlags {
|
|
44
|
+
AVISTREAMINFO_DISABLED = 0x0000_0001,
|
|
45
|
+
AVISTREAMINFO_FORMATCHANGES = 0x0001_0000,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export enum FindSampleFlags {
|
|
49
|
+
FIND_ANY = 0x0000_0020,
|
|
50
|
+
FIND_DIR = 0x0000_000f,
|
|
51
|
+
FIND_FORMAT = 0x0000_0040,
|
|
52
|
+
FIND_FROM_START = 0x0000_0008,
|
|
53
|
+
FIND_INDEX = 0x0000_4000,
|
|
54
|
+
FIND_KEY = 0x0000_0010,
|
|
55
|
+
FIND_LENGTH = 0x0000_1000,
|
|
56
|
+
FIND_NEXT = 0x0000_0001,
|
|
57
|
+
FIND_OFFSET = 0x0000_2000,
|
|
58
|
+
FIND_POS = 0x0000_0000,
|
|
59
|
+
FIND_PREV = 0x0000_0004,
|
|
60
|
+
FIND_RET = 0x0000_f000,
|
|
61
|
+
FIND_SIZE = 0x0000_3000,
|
|
62
|
+
FIND_TYPE = 0x0000_00f0,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export enum OpenFileFlags {
|
|
66
|
+
OF_CREATE = 0x0000_1000,
|
|
67
|
+
OF_READ = 0x0000_0000,
|
|
68
|
+
OF_READWRITE = 0x0000_0002,
|
|
69
|
+
OF_SHARE_DENY_NONE = 0x0000_0040,
|
|
70
|
+
OF_SHARE_EXCLUSIVE = 0x0000_0010,
|
|
71
|
+
OF_WRITE = 0x0000_0001,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export enum StreamType {
|
|
75
|
+
streamtypeAUDIO = 0x7364_7561,
|
|
76
|
+
streamtypeMIDI = 0x7364_696d,
|
|
77
|
+
streamtypeTEXT = 0x7374_7874,
|
|
78
|
+
streamtypeVIDEO = 0x7364_6976,
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type AVISAVECALLBACK = Pointer;
|
|
82
|
+
export type LPAVICOMPRESSOPTIONS = Pointer;
|
|
83
|
+
export type LPAVIFILEINFO = Pointer;
|
|
84
|
+
export type LPAVIFILEINFOA = Pointer;
|
|
85
|
+
export type LPAVIFILEINFOW = Pointer;
|
|
86
|
+
export type LPAVISTREAMINFO = Pointer;
|
|
87
|
+
export type LPAVISTREAMINFOA = Pointer;
|
|
88
|
+
export type LPAVISTREAMINFOW = Pointer;
|
|
89
|
+
export type LPBITMAPINFOHEADER = Pointer;
|
|
90
|
+
export type LPCLSID = Pointer;
|
|
91
|
+
export type LPCTSTR = Pointer;
|
|
92
|
+
export type LPLONG = Pointer;
|
|
93
|
+
export type LPTSTR = Pointer;
|
|
94
|
+
export type PAVIFILE = bigint;
|
|
95
|
+
export type PAVISTREAM = bigint;
|
|
96
|
+
export type PGETFRAME = bigint;
|