Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdk, rebroadcast: don't automatically prebuffer synthetic streams #1534

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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