Optimize screen streaming performance and clean up debug logs
- Reduced image processing time from 7-8 seconds to 340-420ms (15-20x improvement) - Optimized BGRA->RGBA conversion with unsafe pointer operations and batch processing - Changed image resize filter from Lanczos3 to Nearest for maximum speed - Reduced target resolution from 400x225 to 320x180 for better performance - Reduced JPEG quality from 75 to 50 for faster compression - Fixed force-send mechanism timing from 500ms to 200ms intervals - Improved frame rate from 0 FPS to ~2.5 FPS - Cleaned up extensive debug logging and performance instrumentation - Removed unused imports and variables to reduce compiler warnings
This commit is contained in:
@@ -7,13 +7,22 @@ import {
|
||||
onMount,
|
||||
splitProps,
|
||||
} from 'solid-js';
|
||||
import { ScreenViewWebSocket } from './screen-view-websocket';
|
||||
|
||||
type ScreenViewProps = {
|
||||
displayId: number;
|
||||
useWebSocket?: boolean;
|
||||
} & JSX.HTMLAttributes<HTMLDivElement>;
|
||||
|
||||
export const ScreenView: Component<ScreenViewProps> = (props) => {
|
||||
const [localProps, rootProps] = splitProps(props, ['displayId']);
|
||||
const [localProps, rootProps] = splitProps(props, ['displayId', 'useWebSocket']);
|
||||
|
||||
// Use WebSocket by default for better performance
|
||||
if (localProps.useWebSocket !== false) {
|
||||
return <ScreenViewWebSocket displayId={localProps.displayId} {...rootProps} />;
|
||||
}
|
||||
|
||||
// Fallback to HTTP polling (legacy mode)
|
||||
let canvas: HTMLCanvasElement;
|
||||
let root: HTMLDivElement;
|
||||
const [ctx, setCtx] = createSignal<CanvasRenderingContext2D | null>(null);
|
||||
|
Reference in New Issue
Block a user