Skip to content

Commit 6419c74

Browse files
committed
Remove unnecessary muxer and make pipeline list update based on cloud mode
1 parent 8c5d3ff commit 6419c74

File tree

9 files changed

+47
-1198
lines changed

9 files changed

+47
-1198
lines changed

frontend/src/App.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { StreamPage } from "./pages/StreamPage";
22
import { Toaster } from "./components/ui/sonner";
33
import "./index.css";
4-
import { MuxerProvider } from "@/muxer";
54

65
function App() {
76
return (
8-
<MuxerProvider width={512} height={512} fps={30} sendFps={30}>
9-
<>
10-
<StreamPage />
11-
<Toaster />
12-
</>
13-
</MuxerProvider>
7+
<>
8+
<StreamPage />
9+
<Toaster />
10+
</>
1411
);
1512
}
1613

frontend/src/components/SettingsPanel.tsx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from "react";
1+
import { useState, useEffect, useMemo } from "react";
22
import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";
33
import {
44
Select,
@@ -100,6 +100,27 @@ export function SettingsPanel({
100100
const [widthError, setWidthError] = useState<string | null>(null);
101101
const [seedError, setSeedError] = useState<string | null>(null);
102102

103+
// Get filtered pipeline IDs based on cloudMode
104+
const filteredPipelineIds = useMemo(() => {
105+
return Object.keys(PIPELINES).filter(id => {
106+
const pipeline = PIPELINES[id];
107+
const compatibility = pipeline.pipelineCompatibility || "local";
108+
109+
if (cloudMode) {
110+
return compatibility === "cloud" || compatibility === "both";
111+
} else {
112+
return compatibility === "local" || compatibility === "both";
113+
}
114+
});
115+
}, [cloudMode]);
116+
117+
// Auto-select first available pipeline if current selection is no longer available
118+
useEffect(() => {
119+
if (filteredPipelineIds.length > 0 && !filteredPipelineIds.includes(pipelineId)) {
120+
onPipelineIdChange?.(filteredPipelineIds[0] as PipelineId);
121+
}
122+
}, [cloudMode, filteredPipelineIds, pipelineId, onPipelineIdChange]);
123+
103124
const handlePipelineIdChange = (value: string) => {
104125
if (value in PIPELINES) {
105126
onPipelineIdChange?.(value as PipelineId);
@@ -229,7 +250,7 @@ export function SettingsPanel({
229250
<SelectValue placeholder="Select a pipeline" />
230251
</SelectTrigger>
231252
<SelectContent>
232-
{Object.keys(PIPELINES).map(id => (
253+
{filteredPipelineIds.map(id => (
233254
<SelectItem key={id} value={id}>
234255
{id}
235256
</SelectItem>

frontend/src/components/WhipConnection.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import { usePlaybackUrl } from "@/hooks/usePlaybackUrl";
4-
import { useMuxer } from "@/muxer";
54
import { memo, useEffect, useRef } from "react";
65
import { WhipClient } from "@/lib/WhipClient";
76

@@ -32,7 +31,6 @@ export const WhipConnection = memo(
3231
debugStats,
3332
}: WhipConnectionProps) => {
3433
const { setPlaybackUrl, setLoading } = usePlaybackUrl();
35-
const muxer = useMuxer();
3634
const clientRef = useRef<WhipClient | null>(null);
3735
const streamRef = useRef<MediaStream | null>(stream);
3836

@@ -89,12 +87,6 @@ export const WhipConnection = memo(
8987
setLoading,
9088
]);
9189

92-
useEffect(() => {
93-
const client = clientRef.current;
94-
if (!client) return;
95-
client.setMaxFramerate(muxer.sendFps);
96-
}, [muxer.sendFps]);
97-
9890
return null;
9991
},
10092
);

frontend/src/data/pipelines.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export type PipelineCategory = "video-input" | "no-video-input";
2+
export type PipelineCompatibility = "local" | "cloud" | "both";
23

34
export interface PipelineInfo {
45
name: string;
@@ -11,6 +12,7 @@ export interface PipelineInfo {
1112
requiresModels?: boolean; // Whether this pipeline requires models to be downloaded
1213
defaultTemporalInterpolationMethod?: "linear" | "slerp"; // Default method for temporal interpolation
1314
defaultTemporalInterpolationSteps?: number; // Default number of steps for temporal interpolation
15+
pipelineCompatibility?: PipelineCompatibility;
1416
}
1517

1618
export const PIPELINES: Record<string, PipelineInfo> = {
@@ -58,6 +60,22 @@ export const PIPELINES: Record<string, PipelineInfo> = {
5860
defaultTemporalInterpolationMethod: "linear",
5961
defaultTemporalInterpolationSteps: 4,
6062
},
63+
"sd-turbo": {
64+
name: "SD-turbo",
65+
docsUrl:
66+
"",
67+
about:
68+
"",
69+
modified: true,
70+
category: "video-input",
71+
defaultPrompt:
72+
"",
73+
estimatedVram: 32,
74+
requiresModels: true,
75+
defaultTemporalInterpolationMethod: "linear",
76+
defaultTemporalInterpolationSteps: 4,
77+
pipelineCompatibility: "cloud",
78+
},
6179
passthrough: {
6280
name: "Passthrough",
6381
about:

frontend/src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "./index.css";
44
import App from "./App.tsx";
55

66
createRoot(document.getElementById("root")!).render(
7-
// <StrictMode>
7+
<StrictMode>
88
<App />
9-
// </StrictMode>
9+
</StrictMode>
1010
);

frontend/src/muxer/README.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)