Skip to content

Commit

Permalink
sdk, rebroadcast: don't automatically prebuffer synthetic streams (#1534
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bjia56 committed Jul 21, 2024
1 parent c1f4ae9 commit aa9903b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions plugins/prebuffer-mixin/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,13 @@ class PrebufferMixin extends SettingsMixinDeviceBase<VideoCamera> implements Vid
log.a(`${this.name} is a cloud camera. Prebuffering maintains a persistent stream and will not be enabled by default. You must enable the Prebuffer stream manually.`)
}
}
if (this.storage.getItem('warnedSynthetic') !== 'true') {
const synthetic = msos?.find(mso => mso.source === 'synthetic');
if (synthetic) {
this.storage.setItem('warnedSynthetic', 'true');
log.a(`${this.name} is a synthetic stream requiring substantial transcoding overhead. Prebuffering maintains a persistent stream and will not be enabled by default. You must enable the Prebuffer stream manually.`)
}
}

if (!enabledIds.length)
this.online = true;
Expand Down
2 changes: 1 addition & 1 deletion plugins/prebuffer-mixin/src/stream-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function createStreamSettings(device: MixinDeviceBase<VideoCamera>) {
const local = getMediaStream(storageSettings.keys.defaultStream, msos);
const remoteRecording = getMediaStream(storageSettings.keys.remoteRecordingStream, msos);

if (!local?.stream || local.stream.source === 'cloud')
if (!local?.stream || local.stream.source === 'cloud' || local.stream.source === 'synthetic')
return [];

if (local.stream.id === remoteRecording.stream.id)
Expand Down
2 changes: 1 addition & 1 deletion sdk/types/src/types.input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export interface AudioStreamOptions {
sampleRate?: number;
}

export type MediaStreamSource = "local" | "cloud";
export type MediaStreamSource = "local" | "cloud" | "synthetic";
export type MediaStreamTool = 'ffmpeg' | 'scrypted' | 'gstreamer';

/**
Expand Down

0 comments on commit aa9903b

Please sign in to comment.