import { Version, CurrentLoad } from "@norskvideo/norsk-api/lib/shared/common_pb"; import { AmdMA35DLoad, LicenseEvent } from "@norskvideo/norsk-api/lib/media_pb"; import { PinToKey } from "./media_nodes/common"; import { NorskInput } from "./media_nodes/input"; import { Gain, NorskProcessor, NorskDuplex } from "./media_nodes/processor"; import { NorskOutput } from "./media_nodes/output"; import { EncryptionSettings, StreamKey, StreamMetadata, Context, Wave } from "./media_nodes/types"; import { NorskSystem } from "./system"; import { NorskInspect } from "./media_nodes/inspect"; import { NorskMediaStore } from "./media_nodes/mediaStore"; export * from "./types"; export * from "./system"; export * from "./media_nodes/types"; export * from "./media_nodes/input"; export * from "./media_nodes/output"; export * from "./media_nodes/inspect"; export * from "./media_nodes/processor"; export * from "./media_nodes/common"; export * from "./media_nodes/mediaStore"; export { CurrentLoad, } from "@norskvideo/norsk-api/lib/shared/common_pb"; export { AmdMA35DLoad } from "@norskvideo/norsk-api/lib/media_pb"; export { AudioCodec } from "@norskvideo/norsk-api/lib/media_pb"; export * from "./system"; export { Version } from "@norskvideo/norsk-api/lib/shared/common_pb"; /** @public */ export type Log = { level: "emergency" | "alert" | "critical" | "error" | "warning" | "notice" | "info" | "debug"; timestamp: Date; message: string; metadata: string; }; /** * @public * Top level Norsk configuration */ export interface NorskSettings { /** * Callback URL to listen on for gRPC session with Norsk Media * Defaults to $NORSK_HOST:$NORSK_PORT if the environment variables are set * where NORSK_HOST defaults to "127.0.0.1" and NORSK_PORT to "6790" * (so "127.0.0.1:6790" if neither variable is set) */ url?: string; onAttemptingToConnect?: () => void; onConnecting?: () => void; onReady?: () => void; onFailedToConnect?: () => void; /** Code to execute if the Norsk node is shutdown - by default it logs and nothing else */ onShutdown?: () => void; onCurrentLoad?: (load: CurrentLoad) => void; onAmdMA35DLoad?: (load: AmdMA35DLoad) => void; onHello?: (version: Version) => void; onLogEvent?: (log: Log) => void; /** * Manually handle license events, such as missing/invalid licenses and * sandbox timeout. (Logs messages to console by default.) */ onLicenseEvent?: (message: string, running: boolean, fullEvent: LicenseEvent) => void; } /** * @public * The entrypoint for all Norsk Media applications * * @example * ```ts * const norsk = new Norsk(); * ``` */ export declare class Norsk { /** * Implements the {@link NorskInput} interface */ input: NorskInput; /** * Implements the {@link NorskOutput} interface */ output: NorskOutput; /** * Implements the {@link NorskDuplex} interface */ duplex: NorskDuplex; /** * Implements the {@link NorskProcessor} interface */ processor: NorskProcessor; /** * Implements the {@link NorskMediaStore} interface */ mediaStore: NorskMediaStore; /** * Implements the {@link NorskInspect} interface */ inspect: NorskInspect; /** * Implements the {@link NorskSystem} interface */ system: NorskSystem; /** /* The settings used to create this Norsk instance */ settings: NorskSettings; /** * Norsk Runtime version information */ version: Version; /** * Norsk SDK version information */ sdkVersion: string; /** * Norsk license information */ license: { activeFeaturePacks: string[]; expiredFeaturePacks: string[]; }; close(): Promise; /** @public */ static connect(settings?: NorskSettings): Promise; private onConnectionTimeout; } /** * @public * Filters a context to only the audio streams within it * @param streams - The media context from which to return the streams * @returns The audio streams in the media context */ export declare function audioStreams(streams: readonly StreamMetadata[]): StreamMetadata[]; /** * @public * Filters a context to only the video streams within it * @param streams - The media context from which to return the streams * @returns The video streams in the media context */ export declare function videoStreams(streams: readonly StreamMetadata[]): StreamMetadata[]; /** * @public * Filters a context to only the subtitle streams within it * @param streams - The media context from which to return the streams * @returns The subtitle streams in the media context */ export declare function subtitleStreams(streams: readonly StreamMetadata[]): StreamMetadata[]; /** * @public * Filters a context to only the playlist streams within it * @param streams - The media context from which to return the streams * @returns The playlist streams in the media context */ export declare function playlistStreams(streams: readonly StreamMetadata[]): StreamMetadata[]; /** * @public * Filters a context to only the ancillary streams within it * @param streams - The media context from which to return the streams * @returns The ancillary streams in the media context */ export declare function ancillaryStreams(streams: readonly StreamMetadata[]): StreamMetadata[]; /** * @public * Returns the stream keys for audio streams in a media context * @param streams - The media context from which to return the stream keys * @returns The audio stream keys in the media context */ export declare function audioStreamKeys(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Returns the stream keys for video streams in a media context * @param streams - The media context from which to return the stream keys * @returns The video stream keys in the media context */ export declare function videoStreamKeys(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Returns the stream keys for subtitle streams in a media context * @param streams - The media context from which to return the stream keys * @returns The subtitle stream keys in the media context */ export declare function subtitleStreamKeys(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Returns the stream keys for playlist streams in a media context * @param streams - The media context from which to return the stream keys * @returns The playlist stream keys in the media context */ export declare function playlistStreamKeys(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Returns the stream keys for ancillary streams in a media context * @param streams - The media context from which to return the stream keys * @returns The ancillary stream keys in the media context */ export declare function ancillaryStreamKeys(streams: readonly StreamMetadata[]): StreamKey[]; /** @public */ export declare function newSilentMatrix(rows: number, cols: number): Gain[][]; /** * @public * * Provided for compatibilty, this is just e.g. `{ type: "sine", freq: 444 }` */ export declare function mkSine(freq: number): Wave; /** * @public * Select all the streams from the input * @param streams - The streams from the inbound Context * @returns Array of selected StreamKeys */ export declare function selectAll(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Select all the audio and video streams from the input * @param streams - The streams from the inbound Context * @returns Array of selected StreamKeys */ export declare function selectAV(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Select all the subtitle streams from the input * @param streams - The streams from the inbound Context * @returns Array of selected StreamKeys */ export declare function selectSubtitles(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Select all the audio streams from the input * @param streams - The streams from the inbound Context * @returns Array of selected StreamKeys */ export declare function selectAudio(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Select all the video streams from the input * @param streams - The streams from the inbound Context * @returns Array of selected StreamKeys */ export declare function selectVideo(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Select all the ancillary data streams from the input * @param streams - The streams from the inbound Context * @returns Array of selected StreamKeys */ export declare function selectAncillary(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Create a selector selecting all the video streams from the input with the specified rendition name * @param renditionName - The streams from the inbound Context * @returns Array of selected StreamKeys */ export declare function selectVideoRendition(renditionName: string): (streams: readonly StreamMetadata[]) => StreamKey[]; /** @public */ export declare function selectExactKey(key: StreamKey): (streams: readonly StreamMetadata[]) => StreamKey[]; /** @public */ export declare function selectPlaylist(streams: readonly StreamMetadata[]): StreamKey[]; /** * @public * Generate encryption parameters from from an encryption KeyID and Key, * in the form KEYID:KEY, both 16byte hexadecimal */ export declare function mkEncryption(encryption: string | undefined, pssh?: string | undefined): EncryptionSettings | undefined; /** @public */ export declare function videoToPin(pin: Pins): (streams: StreamMetadata[]) => PinToKey; /** @public */ export declare function audioToPin(pin: Pins): (streams: StreamMetadata[]) => PinToKey; /** @public */ export declare function avToPin(pin: Pins): (streams: StreamMetadata[]) => PinToKey; /** @public */ export declare function sourceToPin(source: string, pin: Pins): (streams: StreamMetadata[]) => PinToKey; /** @public */ export declare function subtitlesToPin(pin: Pins): (streams: StreamMetadata[]) => PinToKey; /** * @public * Validation function to require at least one audio and at least one video stream. Often the default validation * will happen to ensure this, as audio and video are subscribed from separate media nodes, but when one media node * will produce both audio and video, default validation cannot know that both are required. */ export declare function requireAV(ctx: Context): boolean; /** * @public * Validation function to require exactly N audio and exactly M video streams. Often the default validation * will happen to ensure this, as audio and video are subscribed from separate media nodes, but when one media node * will produce both audio and video, default validation cannot know that both are required. */ export declare function requireExactAV({ audio, video }: { audio: number; video: number; }): (ctx: Context) => boolean; /** * @public * Compares two stream keys by value, returning true if the stream keys refer to the same stream */ export declare function streamKeysAreEqual(l: StreamKey, r: StreamKey): unknown; //# sourceMappingURL=sdk.d.ts.map