@norskvideo/norsk-sdk 1.0.373 → 1.0.375

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.
@@ -3611,7 +3611,7 @@ declare type Pattern = "black" | "smpte75" | "smpte100";
3611
3611
  export declare type PinToKey<Pins extends string> = Nullable<Partial<Record<Pins, StreamKey[]>>>;
3612
3612
 
3613
3613
  /** @public */
3614
- export declare type PixelFormat = "bgra" | "rgba" | "yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuva422p" | "yuva444p";
3614
+ export declare type PixelFormat = "bgra" | "rgba" | "yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuva422p" | "yuva444p" | "uyvy";
3615
3615
 
3616
3616
  /** @public */
3617
3617
  export declare type PlaylistOnChangeFn<ClientMessage> = {
@@ -5590,6 +5590,8 @@ export declare interface VideoTestcardGeneratorSettings extends SourceNodeSettin
5590
5590
  };
5591
5591
  /** The pattern to use on the test card (if any) */
5592
5592
  pattern: Pattern;
5593
+ /** Optional pixel format of the raw stream **/
5594
+ pixelFormat?: PixelFormat;
5593
5595
  }
5594
5596
 
5595
5597
  /** @public */
package/lib/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "license": "MIT",
3
3
  "name": "@norskvideo/norsk-sdk",
4
- "version": "1.0.373",
4
+ "version": "1.0.375",
5
5
  "dependencies": {
6
6
  "@bufbuild/protobuf": "^0.3.0",
7
7
  "@grpc/grpc-js": "^1.2.2",
8
- "@norskvideo/norsk-api": "1.0.373",
8
+ "@norskvideo/norsk-api": "1.0.375",
9
9
  "lodash": "^4.17.21",
10
10
  "typescript-nullable": "^0.6.0"
11
11
  },
@@ -50,6 +50,7 @@ class MediaNodeState {
50
50
  this.events = new events_1.default();
51
51
  this.client = client;
52
52
  this.id = undefined;
53
+ this.events.setMaxListeners(0);
53
54
  }
54
55
  emit(name, arg) {
55
56
  this.events.emit(name, arg);
@@ -1,6 +1,6 @@
1
1
  import * as grpc from "@grpc/grpc-js";
2
2
  import { TsInputEvent, StreamKey as StreamKeyPB, Wave, FileTsInputMessage, UdpTsInputMessage, M3u8MediaInputMessage, TimestampProgramNudge, RtmpError_UnsupportedVideo, RtmpError_UnsupportedAudio } from "@norskvideo/norsk-api/lib/media_pb";
3
- import { BrowserEvent, ChannelLayout, RtmpServerInputStatus, RtpLinearPcmBitDepth, SampleFormat, SampleRate, SrtMode, SrtInputStatus, ImageFormat, IceServerSettings } from "./types";
3
+ import { BrowserEvent, ChannelLayout, RtmpServerInputStatus, RtpLinearPcmBitDepth, SampleFormat, SampleRate, SrtMode, SrtInputStatus, ImageFormat, IceServerSettings, PixelFormat } from "./types";
4
4
  import { FrameRate } from "../types";
5
5
  import { DeckLinkPixelFormat, DeckLinkVideoConnection, DeckLinkDisplayModeId } from "../types";
6
6
  import { MediaNodeState, MediaClient, SourceMediaNode, SourceNodeSettings, StreamStatisticsMixin } from "./common";
@@ -645,6 +645,8 @@ export interface VideoTestcardGeneratorSettings extends SourceNodeSettings<Video
645
645
  };
646
646
  /** The pattern to use on the test card (if any) */
647
647
  pattern: Pattern;
648
+ /** Optional pixel format of the raw stream **/
649
+ pixelFormat?: PixelFormat;
648
650
  }
649
651
  declare type Pattern = "black" | "smpte75" | "smpte100";
650
652
  /**
@@ -448,7 +448,7 @@ class DeckLinkInputNode extends common_1.SourceMediaNode {
448
448
  : media_pb_1.DeckLinkDisplayModeId.AUTO,
449
449
  pixelFormat: settings.pixelFormat
450
450
  ? (0, types_3.toDeckLinkPixelFormat)(settings.pixelFormat)
451
- : media_pb_1.DeckLinkPixelFormat.UYVY,
451
+ : media_pb_1.DeckLinkPixelFormat.DECKLINK_UYVY,
452
452
  channelLayout: (0, types_1.toChannelLayout)(settings.channelLayout),
453
453
  videoConnection: (0, types_3.toVideoConnection)(settings.videoConnection),
454
454
  statsSampling: settings.statsSampling
@@ -1174,6 +1174,7 @@ class VideoTestcardGeneratorNode extends common_1.SourceMediaNode {
1174
1174
  sourceName: settings.sourceName,
1175
1175
  frameRate: (0, utils_1.provideFull)(media_pb_1.FrameRate, settings.frameRate),
1176
1176
  resolution: (0, utils_1.provideFull)(media_pb_1.Resolution, settings.resolution),
1177
+ pixelFormat: settings.pixelFormat ? (0, types_1.toPixelFormat)(settings.pixelFormat) : (0, types_1.toPixelFormat)("yuv420p"),
1177
1178
  pattern: toPattern(settings.pattern)
1178
1179
  });
1179
1180
  this.grpcStream = this.client.media.createInputVideoTestCardGenerator();
@@ -481,13 +481,18 @@ class MediaStoreSnapshot {
481
481
  exports.MediaStoreSnapshot = MediaStoreSnapshot;
482
482
  /** @internal */
483
483
  function fromMediaStoreStreamVersion(version) {
484
- return {
485
- versionNum: version.versionNum,
486
- startDateTime: version.startDateTime,
487
- durationMs: version.durationMs,
488
- metadata: (0, types_1.fromStreamMetadata)((0, common_1.mandatory)(version.metadata)),
489
- active: version.active
490
- };
484
+ if (version.startDateTime) {
485
+ return {
486
+ versionNum: version.versionNum,
487
+ startDateTime: new Date(Number(version.startDateTime.seconds) * 1000 + version.startDateTime.nanos / 1000000),
488
+ durationMs: Number(version.durationMs),
489
+ metadata: (0, types_1.fromStreamMetadata)((0, common_1.mandatory)(version.metadata)),
490
+ active: version.active
491
+ };
492
+ }
493
+ else {
494
+ throw new Error();
495
+ }
491
496
  }
492
497
  /** @internal */
493
498
  function fromMediaStoreStream(stream) {
@@ -1189,7 +1189,7 @@ class VideoComposeNode extends ProcessorMediaNode {
1189
1189
  outputResolution: (0, utils_1.provideFull)(media_pb_1.Resolution, settings.outputResolution),
1190
1190
  outputPixelFormat: settings.outputPixelFormat !== undefined
1191
1191
  ? (0, types_2.toPixelFormat)(settings.outputPixelFormat)
1192
- : media_pb_1.VideoComposeConfiguration_PixelFormat.UNSPECIFIED,
1192
+ : media_pb_1.PixelFormat.UNSPECIFIED,
1193
1193
  missingStreamBehaviour: settings.missingStreamBehaviour !== undefined
1194
1194
  ? (0, types_2.toComposeMissingStreamBehaviour)(settings.missingStreamBehaviour)
1195
1195
  : media_pb_1.VideoComposeConfiguration_MissingStreamBehaviour.UNSPECIFIED_BEHAVIOUR,
@@ -856,7 +856,7 @@ export declare type AacProfile = "lc" | "main" | "high";
856
856
  /** @public */
857
857
  export declare type SimpleEasing = "linear" | "ease_in" | "ease_in_out" | "ease_out";
858
858
  /** @public */
859
- export declare type PixelFormat = "bgra" | "rgba" | "yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuva422p" | "yuva444p";
859
+ export declare type PixelFormat = "bgra" | "rgba" | "yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuva422p" | "yuva444p" | "uyvy";
860
860
  /** @public */
861
861
  export declare type ComposeMissingStreamBehaviour =
862
862
  /**
@@ -1363,21 +1363,23 @@ exports.toSimpleEasing = toSimpleEasing;
1363
1363
  function toPixelFormat(format) {
1364
1364
  switch (format) {
1365
1365
  case "bgra":
1366
- return media_pb_1.VideoComposeConfiguration_PixelFormat.BGRA;
1366
+ return media_pb_1.PixelFormat.BGRA;
1367
1367
  case "rgba":
1368
- return media_pb_1.VideoComposeConfiguration_PixelFormat.RGBA;
1368
+ return media_pb_1.PixelFormat.RGBA;
1369
1369
  case "yuv420p":
1370
- return media_pb_1.VideoComposeConfiguration_PixelFormat.YUV420P;
1370
+ return media_pb_1.PixelFormat.YUV420P;
1371
1371
  case "yuv422p":
1372
- return media_pb_1.VideoComposeConfiguration_PixelFormat.YUV422P;
1372
+ return media_pb_1.PixelFormat.YUV422P;
1373
1373
  case "yuv444p":
1374
- return media_pb_1.VideoComposeConfiguration_PixelFormat.YUV444P;
1374
+ return media_pb_1.PixelFormat.YUV444P;
1375
1375
  case "yuva420p":
1376
- return media_pb_1.VideoComposeConfiguration_PixelFormat.YUVA420P;
1376
+ return media_pb_1.PixelFormat.YUVA420P;
1377
1377
  case "yuva422p":
1378
- return media_pb_1.VideoComposeConfiguration_PixelFormat.YUVA422P;
1378
+ return media_pb_1.PixelFormat.YUVA422P;
1379
1379
  case "yuva444p":
1380
- return media_pb_1.VideoComposeConfiguration_PixelFormat.YUVA444P;
1380
+ return media_pb_1.PixelFormat.YUVA444P;
1381
+ case "uyvy":
1382
+ return media_pb_1.PixelFormat.UYVY;
1381
1383
  default:
1382
1384
  (0, utils_1.exhaustiveCheck)(format);
1383
1385
  }
package/lib/src/types.js CHANGED
@@ -94,9 +94,9 @@ exports.fromVideoIOSupport = fromVideoIOSupport;
94
94
  function toDeckLinkPixelFormat(format) {
95
95
  switch (format) {
96
96
  case "uyvy":
97
- return media_pb_1.DeckLinkPixelFormat.UYVY;
97
+ return media_pb_1.DeckLinkPixelFormat.DECKLINK_UYVY;
98
98
  case "argb":
99
- return media_pb_1.DeckLinkPixelFormat.ARGB;
99
+ return media_pb_1.DeckLinkPixelFormat.DECKLINK_ARGB;
100
100
  default:
101
101
  (0, utils_1.exhaustiveCheck)(format);
102
102
  }
@@ -105,9 +105,9 @@ exports.toDeckLinkPixelFormat = toDeckLinkPixelFormat;
105
105
  /** @internal */
106
106
  function fromDeckLinkPixelFormat(format) {
107
107
  switch (format) {
108
- case media_pb_1.DeckLinkPixelFormat.UYVY:
108
+ case media_pb_1.DeckLinkPixelFormat.DECKLINK_UYVY:
109
109
  return "uyvy";
110
- case media_pb_1.DeckLinkPixelFormat.ARGB:
110
+ case media_pb_1.DeckLinkPixelFormat.DECKLINK_ARGB:
111
111
  return "argb";
112
112
  default:
113
113
  (0, utils_1.exhaustiveCheck)(format);
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "license": "MIT",
3
3
  "name": "@norskvideo/norsk-sdk",
4
- "version": "1.0.373",
4
+ "version": "1.0.375",
5
5
  "dependencies": {
6
6
  "@bufbuild/protobuf": "^0.3.0",
7
7
  "@grpc/grpc-js": "^1.2.2",
8
- "@norskvideo/norsk-api": "1.0.373",
8
+ "@norskvideo/norsk-api": "1.0.375",
9
9
  "lodash": "^4.17.21",
10
10
  "typescript-nullable": "^0.6.0"
11
11
  },
package/src/types.ts CHANGED
@@ -158,9 +158,9 @@ export function toDeckLinkPixelFormat(
158
158
  ): DeckLinkPixelFormatPB {
159
159
  switch (format) {
160
160
  case "uyvy":
161
- return DeckLinkPixelFormatPB.UYVY;
161
+ return DeckLinkPixelFormatPB.DECKLINK_UYVY;
162
162
  case "argb":
163
- return DeckLinkPixelFormatPB.ARGB;
163
+ return DeckLinkPixelFormatPB.DECKLINK_ARGB;
164
164
  default:
165
165
  exhaustiveCheck(format);
166
166
  }
@@ -171,9 +171,9 @@ export function fromDeckLinkPixelFormat(
171
171
  format: DeckLinkPixelFormatPB
172
172
  ): DeckLinkPixelFormat {
173
173
  switch (format) {
174
- case DeckLinkPixelFormatPB.UYVY:
174
+ case DeckLinkPixelFormatPB.DECKLINK_UYVY:
175
175
  return "uyvy";
176
- case DeckLinkPixelFormatPB.ARGB:
176
+ case DeckLinkPixelFormatPB.DECKLINK_ARGB:
177
177
  return "argb";
178
178
  default:
179
179
  exhaustiveCheck(format);