libbitsub 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/LICENSE +674 -0
- package/README.md +355 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/ts/parsers.d.ts +156 -0
- package/dist/ts/parsers.d.ts.map +1 -0
- package/dist/ts/parsers.js +366 -0
- package/dist/ts/parsers.js.map +1 -0
- package/dist/ts/renderers.d.ts +155 -0
- package/dist/ts/renderers.d.ts.map +1 -0
- package/dist/ts/renderers.js +640 -0
- package/dist/ts/renderers.js.map +1 -0
- package/dist/ts/types.d.ts +146 -0
- package/dist/ts/types.d.ts.map +1 -0
- package/dist/ts/types.js +5 -0
- package/dist/ts/types.js.map +1 -0
- package/dist/ts/utils.d.ts +11 -0
- package/dist/ts/utils.d.ts.map +1 -0
- package/dist/ts/utils.js +47 -0
- package/dist/ts/utils.js.map +1 -0
- package/dist/ts/wasm.d.ts +15 -0
- package/dist/ts/wasm.d.ts.map +1 -0
- package/dist/ts/wasm.js +54 -0
- package/dist/ts/wasm.js.map +1 -0
- package/dist/ts/worker.d.ts +12 -0
- package/dist/ts/worker.d.ts.map +1 -0
- package/dist/ts/worker.js +342 -0
- package/dist/ts/worker.js.map +1 -0
- package/dist/wrapper.d.ts +17 -0
- package/dist/wrapper.d.ts.map +1 -0
- package/dist/wrapper.js +22 -0
- package/dist/wrapper.js.map +1 -0
- package/package.json +54 -0
- package/pkg/LICENSE +674 -0
- package/pkg/README.md +355 -0
- package/pkg/libbitsub.d.ts +323 -0
- package/pkg/libbitsub.js +880 -0
- package/pkg/libbitsub_bg.wasm +0 -0
- package/pkg/libbitsub_bg.wasm.d.ts +68 -0
- package/pkg/package.json +31 -0
- package/src/wrapper.ts +41 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Low-level subtitle parsers for libbitsub.
|
|
3
|
+
* Use these for programmatic access to subtitle data without video integration.
|
|
4
|
+
*/
|
|
5
|
+
import { getWasm } from './wasm';
|
|
6
|
+
/**
|
|
7
|
+
* Low-level PGS subtitle parser using WASM.
|
|
8
|
+
* Use this for programmatic access to PGS data without video integration.
|
|
9
|
+
*/
|
|
10
|
+
export class PgsParser {
|
|
11
|
+
parser = null;
|
|
12
|
+
timestamps = new Float64Array(0);
|
|
13
|
+
constructor() {
|
|
14
|
+
const wasm = getWasm();
|
|
15
|
+
this.parser = new wasm.PgsParser();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Load PGS subtitle data from a Uint8Array.
|
|
19
|
+
*/
|
|
20
|
+
load(data) {
|
|
21
|
+
if (!this.parser)
|
|
22
|
+
throw new Error('Parser not initialized');
|
|
23
|
+
const count = this.parser.parse(data);
|
|
24
|
+
this.timestamps = this.parser.getTimestamps();
|
|
25
|
+
return count;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get all timestamps in milliseconds.
|
|
29
|
+
*/
|
|
30
|
+
getTimestamps() {
|
|
31
|
+
return this.timestamps;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the number of display sets.
|
|
35
|
+
*/
|
|
36
|
+
get count() {
|
|
37
|
+
return this.parser?.count ?? 0;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Find the display set index for a given timestamp in seconds.
|
|
41
|
+
*/
|
|
42
|
+
findIndexAtTimestamp(timeSeconds) {
|
|
43
|
+
if (!this.parser)
|
|
44
|
+
return -1;
|
|
45
|
+
return this.parser.findIndexAtTimestamp(timeSeconds * 1000);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Render subtitle at the given index.
|
|
49
|
+
*/
|
|
50
|
+
renderAtIndex(index) {
|
|
51
|
+
if (!this.parser)
|
|
52
|
+
return undefined;
|
|
53
|
+
const frame = this.parser.renderAtIndex(index);
|
|
54
|
+
if (!frame)
|
|
55
|
+
return undefined;
|
|
56
|
+
return this.convertFrame(frame);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Render subtitle at the given timestamp in seconds.
|
|
60
|
+
*/
|
|
61
|
+
renderAtTimestamp(timeSeconds) {
|
|
62
|
+
const index = this.findIndexAtTimestamp(timeSeconds);
|
|
63
|
+
if (index < 0)
|
|
64
|
+
return undefined;
|
|
65
|
+
return this.renderAtIndex(index);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Convert WASM frame to SubtitleData.
|
|
69
|
+
*/
|
|
70
|
+
convertFrame(frame) {
|
|
71
|
+
const compositionData = [];
|
|
72
|
+
for (let i = 0; i < frame.compositionCount; i++) {
|
|
73
|
+
const comp = frame.getComposition(i);
|
|
74
|
+
if (!comp)
|
|
75
|
+
continue;
|
|
76
|
+
const rgba = comp.getRgba();
|
|
77
|
+
const expectedLength = comp.width * comp.height * 4;
|
|
78
|
+
// Validate buffer size
|
|
79
|
+
if (rgba.length !== expectedLength || comp.width === 0 || comp.height === 0) {
|
|
80
|
+
console.warn(`Invalid composition data: expected ${expectedLength} bytes, got ${rgba.length}, size=${comp.width}x${comp.height}`);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
// Copy to new Uint8ClampedArray to ensure proper buffer ownership
|
|
84
|
+
const clampedData = new Uint8ClampedArray(rgba.length);
|
|
85
|
+
clampedData.set(rgba);
|
|
86
|
+
const imageData = new ImageData(clampedData, comp.width, comp.height);
|
|
87
|
+
compositionData.push({
|
|
88
|
+
pixelData: imageData,
|
|
89
|
+
x: comp.x,
|
|
90
|
+
y: comp.y
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
width: frame.width,
|
|
95
|
+
height: frame.height,
|
|
96
|
+
compositionData
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Clear internal caches.
|
|
101
|
+
*/
|
|
102
|
+
clearCache() {
|
|
103
|
+
this.parser?.clearCache();
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Dispose of resources.
|
|
107
|
+
*/
|
|
108
|
+
dispose() {
|
|
109
|
+
this.parser?.free();
|
|
110
|
+
this.parser = null;
|
|
111
|
+
this.timestamps = new Float64Array(0);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Low-level VobSub subtitle parser using WASM.
|
|
116
|
+
* Use this for programmatic access to VobSub data without video integration.
|
|
117
|
+
*/
|
|
118
|
+
export class VobSubParserLowLevel {
|
|
119
|
+
parser = null;
|
|
120
|
+
timestamps = new Float64Array(0);
|
|
121
|
+
constructor() {
|
|
122
|
+
const wasm = getWasm();
|
|
123
|
+
this.parser = new wasm.VobSubParser();
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Load VobSub from IDX and SUB data.
|
|
127
|
+
*/
|
|
128
|
+
loadFromData(idxContent, subData) {
|
|
129
|
+
if (!this.parser)
|
|
130
|
+
throw new Error('Parser not initialized');
|
|
131
|
+
this.parser.loadFromData(idxContent, subData);
|
|
132
|
+
this.timestamps = this.parser.getTimestamps();
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Load VobSub from SUB file only.
|
|
136
|
+
*/
|
|
137
|
+
loadFromSubOnly(subData) {
|
|
138
|
+
if (!this.parser)
|
|
139
|
+
throw new Error('Parser not initialized');
|
|
140
|
+
this.parser.loadFromSubOnly(subData);
|
|
141
|
+
this.timestamps = this.parser.getTimestamps();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get all timestamps in milliseconds.
|
|
145
|
+
*/
|
|
146
|
+
getTimestamps() {
|
|
147
|
+
return this.timestamps;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Get the number of subtitle entries.
|
|
151
|
+
*/
|
|
152
|
+
get count() {
|
|
153
|
+
return this.parser?.count ?? 0;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Find the subtitle index for a given timestamp in seconds.
|
|
157
|
+
*/
|
|
158
|
+
findIndexAtTimestamp(timeSeconds) {
|
|
159
|
+
if (!this.parser)
|
|
160
|
+
return -1;
|
|
161
|
+
return this.parser.findIndexAtTimestamp(timeSeconds * 1000);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Render subtitle at the given index.
|
|
165
|
+
*/
|
|
166
|
+
renderAtIndex(index) {
|
|
167
|
+
if (!this.parser)
|
|
168
|
+
return undefined;
|
|
169
|
+
const frame = this.parser.renderAtIndex(index);
|
|
170
|
+
if (!frame)
|
|
171
|
+
return undefined;
|
|
172
|
+
return this.convertFrame(frame);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Render subtitle at the given timestamp in seconds.
|
|
176
|
+
*/
|
|
177
|
+
renderAtTimestamp(timeSeconds) {
|
|
178
|
+
const index = this.findIndexAtTimestamp(timeSeconds);
|
|
179
|
+
if (index < 0)
|
|
180
|
+
return undefined;
|
|
181
|
+
return this.renderAtIndex(index);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Convert WASM frame to SubtitleData.
|
|
185
|
+
*/
|
|
186
|
+
convertFrame(frame) {
|
|
187
|
+
const rgba = frame.getRgba();
|
|
188
|
+
const expectedLength = frame.width * frame.height * 4;
|
|
189
|
+
// Validate buffer size
|
|
190
|
+
if (rgba.length !== expectedLength || frame.width === 0 || frame.height === 0) {
|
|
191
|
+
console.warn(`Invalid VobSub frame: expected ${expectedLength} bytes, got ${rgba.length}, size=${frame.width}x${frame.height}`);
|
|
192
|
+
return {
|
|
193
|
+
width: frame.screenWidth,
|
|
194
|
+
height: frame.screenHeight,
|
|
195
|
+
compositionData: []
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
// Copy to new Uint8ClampedArray to ensure proper buffer ownership
|
|
199
|
+
const clampedData = new Uint8ClampedArray(rgba.length);
|
|
200
|
+
clampedData.set(rgba);
|
|
201
|
+
const imageData = new ImageData(clampedData, frame.width, frame.height);
|
|
202
|
+
return {
|
|
203
|
+
width: frame.screenWidth,
|
|
204
|
+
height: frame.screenHeight,
|
|
205
|
+
compositionData: [
|
|
206
|
+
{
|
|
207
|
+
pixelData: imageData,
|
|
208
|
+
x: frame.x,
|
|
209
|
+
y: frame.y
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Clear internal caches.
|
|
216
|
+
*/
|
|
217
|
+
clearCache() {
|
|
218
|
+
this.parser?.clearCache();
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Dispose of resources.
|
|
222
|
+
*/
|
|
223
|
+
dispose() {
|
|
224
|
+
this.parser?.free();
|
|
225
|
+
this.parser = null;
|
|
226
|
+
this.timestamps = new Float64Array(0);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Unified subtitle parser that handles both PGS and VobSub formats.
|
|
231
|
+
*/
|
|
232
|
+
export class UnifiedSubtitleParser {
|
|
233
|
+
renderer = null;
|
|
234
|
+
timestamps = new Float64Array(0);
|
|
235
|
+
constructor() {
|
|
236
|
+
const wasm = getWasm();
|
|
237
|
+
this.renderer = new wasm.SubtitleRenderer();
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Load PGS subtitle data.
|
|
241
|
+
*/
|
|
242
|
+
loadPgs(data) {
|
|
243
|
+
if (!this.renderer)
|
|
244
|
+
throw new Error('Renderer not initialized');
|
|
245
|
+
const count = this.renderer.loadPgs(data);
|
|
246
|
+
this.timestamps = this.renderer.getTimestamps();
|
|
247
|
+
return count;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Load VobSub from IDX and SUB data.
|
|
251
|
+
*/
|
|
252
|
+
loadVobSub(idxContent, subData) {
|
|
253
|
+
if (!this.renderer)
|
|
254
|
+
throw new Error('Renderer not initialized');
|
|
255
|
+
this.renderer.loadVobSub(idxContent, subData);
|
|
256
|
+
this.timestamps = this.renderer.getTimestamps();
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Load VobSub from SUB file only.
|
|
260
|
+
*/
|
|
261
|
+
loadVobSubOnly(subData) {
|
|
262
|
+
if (!this.renderer)
|
|
263
|
+
throw new Error('Renderer not initialized');
|
|
264
|
+
this.renderer.loadVobSubOnly(subData);
|
|
265
|
+
this.timestamps = this.renderer.getTimestamps();
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Get the current subtitle format.
|
|
269
|
+
*/
|
|
270
|
+
get format() {
|
|
271
|
+
const fmt = this.renderer?.format;
|
|
272
|
+
if (fmt === 0)
|
|
273
|
+
return 'pgs';
|
|
274
|
+
if (fmt === 1)
|
|
275
|
+
return 'vobsub';
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get all timestamps in milliseconds.
|
|
280
|
+
*/
|
|
281
|
+
getTimestamps() {
|
|
282
|
+
return this.timestamps;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Get the number of subtitle entries.
|
|
286
|
+
*/
|
|
287
|
+
get count() {
|
|
288
|
+
return this.renderer?.count ?? 0;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Find the subtitle index for a given timestamp in seconds.
|
|
292
|
+
*/
|
|
293
|
+
findIndexAtTimestamp(timeSeconds) {
|
|
294
|
+
if (!this.renderer)
|
|
295
|
+
return -1;
|
|
296
|
+
return this.renderer.findIndexAtTimestamp(timeSeconds * 1000);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Render subtitle at the given index.
|
|
300
|
+
*/
|
|
301
|
+
renderAtIndex(index) {
|
|
302
|
+
if (!this.renderer)
|
|
303
|
+
return undefined;
|
|
304
|
+
const result = this.renderer.renderAtIndex(index);
|
|
305
|
+
if (!result)
|
|
306
|
+
return undefined;
|
|
307
|
+
return this.convertResult(result);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Render subtitle at the given timestamp in seconds.
|
|
311
|
+
*/
|
|
312
|
+
renderAtTimestamp(timeSeconds) {
|
|
313
|
+
if (!this.renderer)
|
|
314
|
+
return undefined;
|
|
315
|
+
const result = this.renderer.renderAtTimestamp(timeSeconds);
|
|
316
|
+
if (!result)
|
|
317
|
+
return undefined;
|
|
318
|
+
return this.convertResult(result);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Convert WASM result to SubtitleData.
|
|
322
|
+
*/
|
|
323
|
+
convertResult(result) {
|
|
324
|
+
const compositionData = [];
|
|
325
|
+
for (let i = 0; i < result.compositionCount; i++) {
|
|
326
|
+
const rgba = result.getCompositionRgba(i);
|
|
327
|
+
const width = result.getCompositionWidth(i);
|
|
328
|
+
const height = result.getCompositionHeight(i);
|
|
329
|
+
const expectedLength = width * height * 4;
|
|
330
|
+
if (width > 0 && height > 0 && rgba.length === expectedLength) {
|
|
331
|
+
const clampedData = new Uint8ClampedArray(rgba.length);
|
|
332
|
+
clampedData.set(rgba);
|
|
333
|
+
const imageData = new ImageData(clampedData, width, height);
|
|
334
|
+
compositionData.push({
|
|
335
|
+
pixelData: imageData,
|
|
336
|
+
x: result.getCompositionX(i),
|
|
337
|
+
y: result.getCompositionY(i)
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
else if (width > 0 && height > 0) {
|
|
341
|
+
console.warn(`Invalid unified result: expected ${expectedLength} bytes, got ${rgba.length}, size=${width}x${height}`);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return {
|
|
345
|
+
width: result.screenWidth,
|
|
346
|
+
height: result.screenHeight,
|
|
347
|
+
compositionData
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Clear internal caches.
|
|
352
|
+
*/
|
|
353
|
+
clearCache() {
|
|
354
|
+
this.renderer?.clearCache();
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Dispose of resources.
|
|
358
|
+
*/
|
|
359
|
+
dispose() {
|
|
360
|
+
this.renderer?.dispose();
|
|
361
|
+
this.renderer?.free();
|
|
362
|
+
this.renderer = null;
|
|
363
|
+
this.timestamps = new Float64Array(0);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=parsers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/ts/parsers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC;;;GAGG;AACH,MAAM,OAAO,SAAS;IACZ,MAAM,GAAyB,IAAI,CAAA;IACnC,UAAU,GAAiB,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;IAEtD;QACE,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,CAAC,SAAS,EAAE,CAAA;IACpC,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,IAAgB;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACrC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAA;QAC7C,OAAO,KAAK,CAAA;IACd,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAA;IACxB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,WAAmB;QACtC,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO,CAAC,CAAC,CAAA;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,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CAAC;QACH,CAAC;QAED,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,WAAW;YACzB,MAAM,EAAE,MAAM,CAAC,YAAY;YAC3B,eAAe;SAChB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;IAC7B,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;QACxB,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAA;QACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level video-integrated subtitle renderers for libbitsub.
|
|
3
|
+
* Handles canvas overlay, video sync, and subtitle fetching.
|
|
4
|
+
*/
|
|
5
|
+
import type { SubtitleData, SubtitleDisplaySettings, VideoSubtitleOptions, VideoVobSubOptions } from './types';
|
|
6
|
+
/** Performance statistics for subtitle renderer */
|
|
7
|
+
export interface SubtitleRendererStats {
|
|
8
|
+
/** Total frames rendered since initialization */
|
|
9
|
+
framesRendered: number;
|
|
10
|
+
/** Frames dropped due to slow rendering */
|
|
11
|
+
framesDropped: number;
|
|
12
|
+
/** Average render time in milliseconds */
|
|
13
|
+
avgRenderTime: number;
|
|
14
|
+
/** Maximum render time in milliseconds */
|
|
15
|
+
maxRenderTime: number;
|
|
16
|
+
/** Minimum render time in milliseconds */
|
|
17
|
+
minRenderTime: number;
|
|
18
|
+
/** Last render time in milliseconds */
|
|
19
|
+
lastRenderTime: number;
|
|
20
|
+
/** Current FPS (renders per second) */
|
|
21
|
+
renderFps: number;
|
|
22
|
+
/** Whether rendering is using web worker */
|
|
23
|
+
usingWorker: boolean;
|
|
24
|
+
/** Number of cached frames */
|
|
25
|
+
cachedFrames: number;
|
|
26
|
+
/** Number of pending renders */
|
|
27
|
+
pendingRenders: number;
|
|
28
|
+
/** Total subtitle entries/display sets */
|
|
29
|
+
totalEntries: number;
|
|
30
|
+
/** Current subtitle index being displayed */
|
|
31
|
+
currentIndex: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Base class for video-integrated subtitle renderers.
|
|
35
|
+
* Handles canvas overlay, video sync, and subtitle fetching.
|
|
36
|
+
*/
|
|
37
|
+
declare abstract class BaseVideoSubtitleRenderer {
|
|
38
|
+
protected video: HTMLVideoElement;
|
|
39
|
+
protected subUrl: string;
|
|
40
|
+
protected canvas: HTMLCanvasElement | null;
|
|
41
|
+
protected ctx: CanvasRenderingContext2D | null;
|
|
42
|
+
protected animationFrameId: number | null;
|
|
43
|
+
protected isLoaded: boolean;
|
|
44
|
+
protected lastRenderedIndex: number;
|
|
45
|
+
protected lastRenderedTime: number;
|
|
46
|
+
protected disposed: boolean;
|
|
47
|
+
protected resizeObserver: ResizeObserver | null;
|
|
48
|
+
protected tempCanvas: HTMLCanvasElement | null;
|
|
49
|
+
protected tempCtx: CanvasRenderingContext2D | null;
|
|
50
|
+
protected lastRenderedData: SubtitleData | null;
|
|
51
|
+
/** Display settings for subtitle rendering */
|
|
52
|
+
protected displaySettings: SubtitleDisplaySettings;
|
|
53
|
+
protected perfStats: {
|
|
54
|
+
framesRendered: number;
|
|
55
|
+
framesDropped: number;
|
|
56
|
+
renderTimes: number[];
|
|
57
|
+
lastRenderTime: number;
|
|
58
|
+
fpsTimestamps: number[];
|
|
59
|
+
lastFrameTime: number;
|
|
60
|
+
};
|
|
61
|
+
constructor(options: VideoSubtitleOptions);
|
|
62
|
+
/** Get current display settings */
|
|
63
|
+
getDisplaySettings(): SubtitleDisplaySettings;
|
|
64
|
+
/** Get performance statistics */
|
|
65
|
+
abstract getStats(): SubtitleRendererStats;
|
|
66
|
+
/** Get base stats common to all renderers */
|
|
67
|
+
protected getBaseStats(): Omit<SubtitleRendererStats, 'usingWorker' | 'cachedFrames' | 'pendingRenders' | 'totalEntries'>;
|
|
68
|
+
/** Set display settings and force re-render */
|
|
69
|
+
setDisplaySettings(settings: Partial<SubtitleDisplaySettings>): void;
|
|
70
|
+
/** Reset display settings to defaults */
|
|
71
|
+
resetDisplaySettings(): void;
|
|
72
|
+
/** Start initialization. */
|
|
73
|
+
protected startInit(): void;
|
|
74
|
+
/** Initialize the renderer. */
|
|
75
|
+
protected init(): Promise<void>;
|
|
76
|
+
/** Create the canvas overlay positioned over the video. */
|
|
77
|
+
protected createCanvas(): void;
|
|
78
|
+
/** Called when video seeks. */
|
|
79
|
+
protected onSeek(): void;
|
|
80
|
+
/** Calculate the actual video content bounds, accounting for letterboxing/pillarboxing */
|
|
81
|
+
protected getVideoContentBounds(): {
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
};
|
|
87
|
+
/** Update canvas size to match video content area. */
|
|
88
|
+
protected updateCanvasSize(): void;
|
|
89
|
+
protected abstract loadSubtitles(): Promise<void>;
|
|
90
|
+
protected abstract renderAtTime(time: number): SubtitleData | undefined;
|
|
91
|
+
protected abstract findCurrentIndex(time: number): number;
|
|
92
|
+
protected abstract renderAtIndex(index: number): SubtitleData | undefined;
|
|
93
|
+
/** Check if a render is pending for the given index (async loading in progress) */
|
|
94
|
+
protected abstract isPendingRender(index: number): boolean;
|
|
95
|
+
/** Start the render loop. */
|
|
96
|
+
protected startRenderLoop(): void;
|
|
97
|
+
/** Render a subtitle frame to the canvas. */
|
|
98
|
+
protected renderFrame(time: number, index: number): void;
|
|
99
|
+
/** Dispose of all resources. */
|
|
100
|
+
dispose(): void;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* High-level PGS subtitle renderer with Web Worker support.
|
|
104
|
+
* Compatible with the old libpgs-js API.
|
|
105
|
+
*/
|
|
106
|
+
export declare class PgsRenderer extends BaseVideoSubtitleRenderer {
|
|
107
|
+
private pgsParser;
|
|
108
|
+
private state;
|
|
109
|
+
private onLoading?;
|
|
110
|
+
private onLoaded?;
|
|
111
|
+
private onError?;
|
|
112
|
+
constructor(options: VideoSubtitleOptions);
|
|
113
|
+
protected loadSubtitles(): Promise<void>;
|
|
114
|
+
private loadOnMainThread;
|
|
115
|
+
/** Yield to main thread to prevent UI blocking */
|
|
116
|
+
private yieldToMain;
|
|
117
|
+
protected renderAtTime(time: number): SubtitleData | undefined;
|
|
118
|
+
protected findCurrentIndex(time: number): number;
|
|
119
|
+
protected renderAtIndex(index: number): SubtitleData | undefined;
|
|
120
|
+
protected isPendingRender(index: number): boolean;
|
|
121
|
+
protected onSeek(): void;
|
|
122
|
+
/** Get performance statistics for PGS renderer */
|
|
123
|
+
getStats(): SubtitleRendererStats;
|
|
124
|
+
dispose(): void;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* High-level VobSub subtitle renderer with Web Worker support.
|
|
128
|
+
* Compatible with the old libpgs-js API.
|
|
129
|
+
*/
|
|
130
|
+
export declare class VobSubRenderer extends BaseVideoSubtitleRenderer {
|
|
131
|
+
private vobsubParser;
|
|
132
|
+
private idxUrl;
|
|
133
|
+
private state;
|
|
134
|
+
private onLoading?;
|
|
135
|
+
private onLoaded?;
|
|
136
|
+
private onError?;
|
|
137
|
+
private cachedIndex;
|
|
138
|
+
private cachedIndexTime;
|
|
139
|
+
private pendingIndexLookup;
|
|
140
|
+
constructor(options: VideoVobSubOptions);
|
|
141
|
+
protected loadSubtitles(): Promise<void>;
|
|
142
|
+
private loadOnMainThread;
|
|
143
|
+
/** Yield to main thread to prevent UI blocking */
|
|
144
|
+
private yieldToMain;
|
|
145
|
+
protected renderAtTime(time: number): SubtitleData | undefined;
|
|
146
|
+
protected findCurrentIndex(time: number): number;
|
|
147
|
+
protected renderAtIndex(index: number): SubtitleData | undefined;
|
|
148
|
+
protected isPendingRender(index: number): boolean;
|
|
149
|
+
protected onSeek(): void;
|
|
150
|
+
/** Get performance statistics for VobSub renderer */
|
|
151
|
+
getStats(): SubtitleRendererStats;
|
|
152
|
+
dispose(): void;
|
|
153
|
+
}
|
|
154
|
+
export {};
|
|
155
|
+
//# sourceMappingURL=renderers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderers.d.ts","sourceRoot":"","sources":["../../src/ts/renderers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAY9G,mDAAmD;AACnD,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAA;IACtB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAA;IACrB,uCAAuC;IACvC,cAAc,EAAE,MAAM,CAAA;IACtB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,WAAW,EAAE,OAAO,CAAA;IACpB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,gCAAgC;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,uBAAe,yBAAyB;IACtC,SAAS,CAAC,KAAK,EAAE,gBAAgB,CAAA;IACjC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAO;IACjD,SAAS,CAAC,GAAG,EAAE,wBAAwB,GAAG,IAAI,CAAO;IACrD,SAAS,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAO;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