@expo/serve-sim 0.1.42 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/middleware.js +3 -3
- package/dist/native/serve-sim-native.node +0 -0
- package/dist/serve-sim.js +73 -73
- package/package.json +1 -1
- package/src/stream-settings.ts +5 -2
package/package.json
CHANGED
package/src/stream-settings.ts
CHANGED
|
@@ -2,6 +2,9 @@ export type HttpStreamCodec = "auto" | "mjpeg" | "h264";
|
|
|
2
2
|
export type WebRtcStreamCodec = "vp8" | "vp9" | "h264";
|
|
3
3
|
export type WebRtcIceServer = { urls: string[]; username?: string; credential?: string };
|
|
4
4
|
|
|
5
|
+
export const MAX_MJPEG_STREAM_FPS = 120;
|
|
6
|
+
export const MAX_VIDEO_STREAM_FPS = 140;
|
|
7
|
+
|
|
5
8
|
export type StreamSettings = (
|
|
6
9
|
| { transport: "http"; codec?: HttpStreamCodec }
|
|
7
10
|
| { transport: "webrtc"; codec: WebRtcStreamCodec; iceServers?: WebRtcIceServer[] }
|
|
@@ -142,11 +145,11 @@ export function normalizeStreamEncoderSettings(
|
|
|
142
145
|
fallback: StreamEncoderSettings = DEFAULT_STREAM_ENCODER_SETTINGS,
|
|
143
146
|
): StreamEncoderSettings {
|
|
144
147
|
return {
|
|
145
|
-
mjpegFps: integerInRange(input.mjpegFps, fallback.mjpegFps, 1,
|
|
148
|
+
mjpegFps: integerInRange(input.mjpegFps, fallback.mjpegFps, 1, MAX_MJPEG_STREAM_FPS),
|
|
146
149
|
mjpegQuality: numberInRange(input.mjpegQuality, fallback.mjpegQuality, 0.05, 1),
|
|
147
150
|
maxDimension: integerInRange(input.maxDimension, fallback.maxDimension, 0, 4096),
|
|
148
151
|
h264Bitrate: integerInRange(input.h264Bitrate, fallback.h264Bitrate, 100_000, 50_000_000),
|
|
149
|
-
h264Fps: integerInRange(input.h264Fps, fallback.h264Fps, 1,
|
|
152
|
+
h264Fps: integerInRange(input.h264Fps, fallback.h264Fps, 1, MAX_VIDEO_STREAM_FPS),
|
|
150
153
|
};
|
|
151
154
|
}
|
|
152
155
|
|