@norskvideo/norsk-sdk 1.0.344 → 1.0.345
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/dist/norsk-sdk.d.ts +38 -0
- package/lib/src/media_nodes/debug.d.ts +28 -0
- package/lib/src/media_nodes/debug.js +81 -0
- package/lib/src/media_nodes/types.d.ts +5 -0
- package/lib/src/sdk.d.ts +6 -0
- package/lib/src/sdk.js +5 -0
- package/package.json +2 -2
- package/src/sdk.ts +12 -2
package/dist/norsk-sdk.d.ts
CHANGED
|
@@ -1577,6 +1577,12 @@ export declare interface Interval {
|
|
|
1577
1577
|
d: number;
|
|
1578
1578
|
}
|
|
1579
1579
|
|
|
1580
|
+
/** @public */
|
|
1581
|
+
export declare interface IntervalTimestamp {
|
|
1582
|
+
n: number;
|
|
1583
|
+
d: number;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1580
1586
|
/**
|
|
1581
1587
|
* @public
|
|
1582
1588
|
* see: {@link NorskTransform.jitterBuffer}
|
|
@@ -1825,6 +1831,10 @@ export declare class Norsk {
|
|
|
1825
1831
|
* Implements the {@link NorskProcessor} interface
|
|
1826
1832
|
*/
|
|
1827
1833
|
processor: NorskProcessor;
|
|
1834
|
+
/**
|
|
1835
|
+
* Implements the {@link NorskDebug} interface
|
|
1836
|
+
*/
|
|
1837
|
+
debug: NorskDebug;
|
|
1828
1838
|
/**
|
|
1829
1839
|
* Implements the {@link NorskSystem} interface
|
|
1830
1840
|
*/
|
|
@@ -1870,6 +1880,17 @@ export declare interface NorskControl {
|
|
|
1870
1880
|
audioMeasureLevels(settings: AudioMeasureLevelsSettings): Promise<AudioMeasureLevelsNode>;
|
|
1871
1881
|
}
|
|
1872
1882
|
|
|
1883
|
+
/**
|
|
1884
|
+
* @public
|
|
1885
|
+
* Methods that allow you to inspect a system (typically during development)
|
|
1886
|
+
*/
|
|
1887
|
+
export declare interface NorskDebug {
|
|
1888
|
+
/** Creates a node to intercept all the timestamps of any subscribed stream
|
|
1889
|
+
* @param settings - Configuration for the report node
|
|
1890
|
+
*/
|
|
1891
|
+
streamTimestampReport(settings: StreamTimestampReportSettings): Promise<StreamTimestampReportNode>;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1873
1894
|
/**
|
|
1874
1895
|
* @public
|
|
1875
1896
|
* Methods that allow you to both ingest and egest media from your application
|
|
@@ -3563,6 +3584,23 @@ export declare interface StreamTimestampNudgeSettings extends ProcessorNodeSetti
|
|
|
3563
3584
|
nudge?: number;
|
|
3564
3585
|
}
|
|
3565
3586
|
|
|
3587
|
+
/**
|
|
3588
|
+
* @public
|
|
3589
|
+
* see: {@link NorskDebug.streamTimestampReport}
|
|
3590
|
+
*/
|
|
3591
|
+
export declare class StreamTimestampReportNode extends AutoSinkMediaNode<string> {
|
|
3592
|
+
close(): void;
|
|
3593
|
+
}
|
|
3594
|
+
|
|
3595
|
+
/**
|
|
3596
|
+
* @public
|
|
3597
|
+
* Settings to control MP4 file output
|
|
3598
|
+
* see {@link NorskOutput.fileMp4}
|
|
3599
|
+
*/
|
|
3600
|
+
export declare interface StreamTimestampReportSettings extends SinkNodeSettings<StreamTimestampReportNode> {
|
|
3601
|
+
onTimestamp?: (streamKey: StreamKey, timestamp: IntervalTimestamp) => Promise<void>;
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3566
3604
|
export declare interface SubscribeDestination {
|
|
3567
3605
|
id?: string;
|
|
3568
3606
|
sourceContextChange(responseCallback: (error?: SubscriptionError) => void): Promise<boolean>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AutoSinkMediaNode, SinkNodeSettings } from "./common";
|
|
2
|
+
import { IntervalTimestamp, StreamKey } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
* Settings to control MP4 file output
|
|
6
|
+
* see {@link NorskOutput.fileMp4}
|
|
7
|
+
*/
|
|
8
|
+
export interface StreamTimestampReportSettings extends SinkNodeSettings<StreamTimestampReportNode> {
|
|
9
|
+
onTimestamp?: (streamKey: StreamKey, timestamp: IntervalTimestamp) => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
* see: {@link NorskDebug.streamTimestampReport}
|
|
14
|
+
*/
|
|
15
|
+
export declare class StreamTimestampReportNode extends AutoSinkMediaNode<string> {
|
|
16
|
+
close(): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
* Methods that allow you to inspect a system (typically during development)
|
|
21
|
+
*/
|
|
22
|
+
export interface NorskDebug {
|
|
23
|
+
/** Creates a node to intercept all the timestamps of any subscribed stream
|
|
24
|
+
* @param settings - Configuration for the report node
|
|
25
|
+
*/
|
|
26
|
+
streamTimestampReport(settings: StreamTimestampReportSettings): Promise<StreamTimestampReportNode>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StreamTimestampReportNode = void 0;
|
|
13
|
+
const media_pb_1 = require("@norskvideo/norsk-api/lib/media_pb");
|
|
14
|
+
const common_1 = require("./common");
|
|
15
|
+
const media_pb_2 = require("@norskvideo/norsk-api/lib/media_pb");
|
|
16
|
+
const types_1 = require("./types");
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
* see: {@link NorskDebug.streamTimestampReport}
|
|
20
|
+
*/
|
|
21
|
+
class StreamTimestampReportNode extends common_1.AutoSinkMediaNode {
|
|
22
|
+
/** @internal */
|
|
23
|
+
constructor(settings, client, unregisterNode) {
|
|
24
|
+
super(client, () => this.grpcStream, (subscription) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
return this.grpcStream.write((0, common_1.provideFull)(media_pb_1.StreamTimestampReportMessage, (0, common_1.mkMessageCase)({ subscription })));
|
|
26
|
+
}), settings.onSubscriptionError);
|
|
27
|
+
const config = (0, common_1.provideFull)(media_pb_1.StreamTimestampReportConfiguration, {
|
|
28
|
+
id: settings.id ? (0, common_1.provideFull)(media_pb_2.MediaNodeId, {
|
|
29
|
+
id: settings.id
|
|
30
|
+
}) : undefined
|
|
31
|
+
});
|
|
32
|
+
this.grpcStream = this.client.createDebugStreamTimestampReport();
|
|
33
|
+
this.grpcStream.write((0, common_1.provideFull)(media_pb_1.StreamTimestampReportMessage, (0, common_1.mkMessageCase)({ configuration: config })));
|
|
34
|
+
this.initialised = new Promise((resolve, reject) => {
|
|
35
|
+
this.grpcStream.on("data", (data) => {
|
|
36
|
+
const messageCase = data.message.case;
|
|
37
|
+
switch (messageCase) {
|
|
38
|
+
case undefined:
|
|
39
|
+
break;
|
|
40
|
+
case "subscriptionResponse":
|
|
41
|
+
super.subscriptionResponse(data.message.value);
|
|
42
|
+
break;
|
|
43
|
+
case "nodeId": {
|
|
44
|
+
this.id = data.message.value.id;
|
|
45
|
+
settings.onCreate && settings.onCreate(this);
|
|
46
|
+
resolve();
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case "inboundContext": {
|
|
50
|
+
const context = data.message.value;
|
|
51
|
+
super.handleInboundContext(context);
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case "report": {
|
|
55
|
+
if (settings.onTimestamp) {
|
|
56
|
+
if (data.message.value.pts && data.message.value.stream)
|
|
57
|
+
settings.onTimestamp((0, types_1.fromStreamKey)(data.message.value.stream), data.message.value.pts);
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
default:
|
|
62
|
+
(0, common_1.exhaustiveCheck)(messageCase);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
(0, common_1.registerStreamHandlers)(this.grpcStream, () => unregisterNode(this), "debugStreamTimestampReport", reject, settings);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** @internal */
|
|
69
|
+
static create(settings, client, unregisterNode) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const node = new StreamTimestampReportNode(settings, client, unregisterNode);
|
|
72
|
+
yield node.initialised;
|
|
73
|
+
return node;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
close() {
|
|
77
|
+
this.grpcStream.cancel();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.StreamTimestampReportNode = StreamTimestampReportNode;
|
|
81
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -2,6 +2,11 @@ import { ExplicitChannel, AudioCodec, FrameRate } from "@norskvideo/norsk-api/li
|
|
|
2
2
|
/** @public */
|
|
3
3
|
export declare type MediaNodeId = string;
|
|
4
4
|
/** @public */
|
|
5
|
+
export interface IntervalTimestamp {
|
|
6
|
+
n: number;
|
|
7
|
+
d: number;
|
|
8
|
+
}
|
|
9
|
+
/** @public */
|
|
5
10
|
export interface StreamKey {
|
|
6
11
|
streamId: number;
|
|
7
12
|
programNumber: number;
|
package/lib/src/sdk.d.ts
CHANGED
|
@@ -6,11 +6,13 @@ import { Gain, NorskProcessor, NorskDuplex } from "./media_nodes/processor";
|
|
|
6
6
|
import { NorskOutput } from "./media_nodes/output";
|
|
7
7
|
import { EncryptionSettings, StreamKey, StreamMetadata, Context } from "./media_nodes/types";
|
|
8
8
|
import { NorskSystem } from "./system";
|
|
9
|
+
import { NorskDebug } from "./media_nodes/debug";
|
|
9
10
|
export * from "./types";
|
|
10
11
|
export * from "./system";
|
|
11
12
|
export * from "./media_nodes/types";
|
|
12
13
|
export * from "./media_nodes/input";
|
|
13
14
|
export * from "./media_nodes/output";
|
|
15
|
+
export * from "./media_nodes/debug";
|
|
14
16
|
export * from "./media_nodes/processor";
|
|
15
17
|
export * from "./media_nodes/common";
|
|
16
18
|
export { AudioCodec } from "@norskvideo/norsk-api/lib/media_pb";
|
|
@@ -76,6 +78,10 @@ export declare class Norsk {
|
|
|
76
78
|
* Implements the {@link NorskProcessor} interface
|
|
77
79
|
*/
|
|
78
80
|
processor: NorskProcessor;
|
|
81
|
+
/**
|
|
82
|
+
* Implements the {@link NorskDebug} interface
|
|
83
|
+
*/
|
|
84
|
+
debug: NorskDebug;
|
|
79
85
|
/**
|
|
80
86
|
* Implements the {@link NorskSystem} interface
|
|
81
87
|
*/
|
package/lib/src/sdk.js
CHANGED
|
@@ -46,11 +46,13 @@ const input_1 = require("./media_nodes/input");
|
|
|
46
46
|
const processor_1 = require("./media_nodes/processor");
|
|
47
47
|
const output_1 = require("./media_nodes/output");
|
|
48
48
|
const system_1 = require("./system");
|
|
49
|
+
const debug_1 = require("./media_nodes/debug");
|
|
49
50
|
__exportStar(require("./types"), exports);
|
|
50
51
|
__exportStar(require("./system"), exports);
|
|
51
52
|
__exportStar(require("./media_nodes/types"), exports);
|
|
52
53
|
__exportStar(require("./media_nodes/input"), exports);
|
|
53
54
|
__exportStar(require("./media_nodes/output"), exports);
|
|
55
|
+
__exportStar(require("./media_nodes/debug"), exports);
|
|
54
56
|
__exportStar(require("./media_nodes/processor"), exports);
|
|
55
57
|
__exportStar(require("./media_nodes/common"), exports);
|
|
56
58
|
var media_pb_2 = require("@norskvideo/norsk-api/lib/media_pb");
|
|
@@ -113,6 +115,9 @@ class Norsk {
|
|
|
113
115
|
fileTs: (settings) => __awaiter(this, void 0, void 0, function* () { return output_1.FileTsOutputNode.create(settings, this.client, unregisterNode).then(registerNode); }),
|
|
114
116
|
fileMp4: (settings) => __awaiter(this, void 0, void 0, function* () { return output_1.FileMp4OutputNode.create(settings, this.client, unregisterNode).then(registerNode); }),
|
|
115
117
|
};
|
|
118
|
+
this.debug = {
|
|
119
|
+
streamTimestampReport: (settings) => __awaiter(this, void 0, void 0, function* () { return debug_1.StreamTimestampReportNode.create(settings, this.client, unregisterNode).then(registerNode); }),
|
|
120
|
+
};
|
|
116
121
|
this.processor = new processor_1.NorskProcessor(this.client);
|
|
117
122
|
this.system = {
|
|
118
123
|
hardwareInfo: () => __awaiter(this, void 0, void 0, function* () { return (0, system_1.hardwareInfo)(this.client); }), // does not produce a node...
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"license": "MIT",
|
|
3
3
|
"name": "@norskvideo/norsk-sdk",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.345",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@bufbuild/protobuf": "^0.3.0",
|
|
7
7
|
"@grpc/grpc-js": "^1.2.2",
|
|
8
|
-
"@norskvideo/norsk-api": "1.0.
|
|
8
|
+
"@norskvideo/norsk-api": "1.0.345",
|
|
9
9
|
"typescript-nullable": "^0.6.0"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
package/src/sdk.ts
CHANGED
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
Wave,
|
|
10
10
|
NorskStatusEvent,
|
|
11
|
-
SineWave
|
|
12
|
-
Context as ContextPB,
|
|
11
|
+
SineWave
|
|
13
12
|
} from "@norskvideo/norsk-api/lib/media_pb";
|
|
14
13
|
import { Empty } from "@bufbuild/protobuf";
|
|
15
14
|
import { debuglog, exhaustiveCheck, norskHost, norskPort } from "./shared/utils";
|
|
@@ -86,12 +85,14 @@ import {
|
|
|
86
85
|
} from "./media_nodes/output";
|
|
87
86
|
import { EncryptionSettings, StreamKey, StreamMetadata, Context } from "./media_nodes/types";
|
|
88
87
|
import { hardwareInfo, NorskSystem } from "./system";
|
|
88
|
+
import { NorskDebug, StreamTimestampReportNode, StreamTimestampReportSettings } from "./media_nodes/debug";
|
|
89
89
|
|
|
90
90
|
export * from "./types";
|
|
91
91
|
export * from "./system";
|
|
92
92
|
export * from "./media_nodes/types";
|
|
93
93
|
export * from "./media_nodes/input";
|
|
94
94
|
export * from "./media_nodes/output";
|
|
95
|
+
export * from "./media_nodes/debug";
|
|
95
96
|
export * from "./media_nodes/processor";
|
|
96
97
|
export * from "./media_nodes/common";
|
|
97
98
|
export { AudioCodec } from "@norskvideo/norsk-api/lib/media_pb";
|
|
@@ -181,6 +182,11 @@ export class Norsk {
|
|
|
181
182
|
* Implements the {@link NorskProcessor} interface
|
|
182
183
|
*/
|
|
183
184
|
public processor: NorskProcessor;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Implements the {@link NorskDebug} interface
|
|
188
|
+
*/
|
|
189
|
+
public debug: NorskDebug;
|
|
184
190
|
/**
|
|
185
191
|
* Implements the {@link NorskSystem} interface
|
|
186
192
|
*/
|
|
@@ -456,6 +462,10 @@ export class Norsk {
|
|
|
456
462
|
fileMp4: async (settings: FileMp4OutputSettings) =>
|
|
457
463
|
FileMp4OutputNode.create(settings, this.client, unregisterNode).then(registerNode),
|
|
458
464
|
};
|
|
465
|
+
this.debug = {
|
|
466
|
+
streamTimestampReport: async (settings: StreamTimestampReportSettings) =>
|
|
467
|
+
StreamTimestampReportNode.create(settings, this.client, unregisterNode).then(registerNode),
|
|
468
|
+
};
|
|
459
469
|
this.processor = new NorskProcessor(this.client);
|
|
460
470
|
this.system = {
|
|
461
471
|
hardwareInfo: async () => hardwareInfo(this.client), // does not produce a node...
|