ebml.js 4.0.1

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.
@@ -0,0 +1,30 @@
1
+ /* @flow */
2
+ /* eslint-disable flowtype/space-after-type-colon */
3
+ /**
4
+ * @typedef {{
5
+ * name: string,
6
+ * type: 'm' | 'u' | 'i' | 'f' | 's' | '8' | 'd' | 'b' | null,
7
+ * description: string,
8
+ * level: number,
9
+ * mandatory: boolean,
10
+ * minver: number,
11
+ * multiple: boolean,
12
+ * webm: boolean,
13
+ * br?:
14
+ * | string
15
+ * | [string, string]
16
+ * | [string, string, string]
17
+ * | [string, string, string, string],
18
+ * bytesize?: number,
19
+ * cppname?: string,
20
+ * default?: number | string,
21
+ * del?: ['1 - bzlib,', '2 - lzo1x'] | '1 - bzlib,' | '2 - lzo1x',
22
+ * divx?: boolean,
23
+ * i?: string,
24
+ * maxver?: number,
25
+ * recursive?: boolean,
26
+ * strong?: 'informational' | 'Informational',
27
+ * }} EBMLSchema
28
+ */
29
+
30
+ module.exports = {}
@@ -0,0 +1,25 @@
1
+ // @flow
2
+
3
+
4
+ /**
5
+ * @typedef {{
6
+ * data: Buffer,
7
+ * dataSize: number,
8
+ * discardable: boolean,
9
+ * end: number,
10
+ * id: number,
11
+ * keyframe: boolean,
12
+ * payload: Buffer,
13
+ * start: number,
14
+ * tagStr: string,
15
+ * track: number,
16
+ * value: number | string,
17
+ * }} TagMeta
18
+ */
19
+
20
+ /** @typedef {import('./schema.types').EBMLSchema & TagMeta} Tag */
21
+
22
+ /** @typedef {Tag & { children: TagStackItem[] }} TagStackItem */
23
+ /** @typedef {TagStackItem[]} TagStack */
24
+
25
+ module.exports = {}
@@ -0,0 +1,17 @@
1
+ /* eslint no-console:off */
2
+ const { Decoder } = require('./lib/ebml.js');
3
+
4
+ const ebmlDecoder = new Decoder();
5
+ const counts = {};
6
+
7
+ require('fs')
8
+ .createReadStream('media/test.webm')
9
+ .pipe(ebmlDecoder)
10
+ .on('data', chunk => {
11
+ const { name } = chunk[1];
12
+ if (!counts[name]) {
13
+ counts[name] = 0;
14
+ }
15
+ counts[name] += 1;
16
+ })
17
+ .on('finish', () => console.log(counts));