mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
✨ feat: Add streaming support (#125)
This adds: - [x] Keyboard and mouse handling on the frontend - [x] Video and audio streaming from the backend to the frontend - [x] Input server that works with Websockets Update - 17/11 - [ ] Master docker container to run this - [ ] Steam runtime - [ ] Entrypoint.sh --------- Co-authored-by: Kristian Ollikainen <14197772+DatCaptainHorse@users.noreply.github.com> Co-authored-by: Kristian Ollikainen <DatCaptainHorse@users.noreply.github.com>
This commit is contained in:
29
packages/moq/karp/catalog/video.ts
Normal file
29
packages/moq/karp/catalog/video.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as Hex from "../../common/hex"
|
||||
import { type Track, decodeTrack } from "./track"
|
||||
|
||||
export interface Video {
|
||||
track: Track
|
||||
codec: string
|
||||
description?: Uint8Array
|
||||
bitrate?: number
|
||||
frame_rate?: number
|
||||
resolution: Dimensions
|
||||
}
|
||||
|
||||
export interface Dimensions {
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
export function decodeVideo(o: unknown): o is Video {
|
||||
if (typeof o !== "object" || o === null) return false
|
||||
|
||||
const obj = o as Partial<Video>
|
||||
if (!decodeTrack(obj.track)) return false
|
||||
if (typeof obj.codec !== "string") return false
|
||||
if (typeof obj.description !== "string") return false
|
||||
|
||||
obj.description = Hex.decode(obj.description)
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user