From 543b5bf25c88df4df341fb4aa0441f00a6cf97f1 Mon Sep 17 00:00:00 2001 From: ldm0 Date: Thu, 1 Oct 2026 18:29:02 +0800 Subject: [PATCH] feat(webrtc): expose transport and RTP interface shells --- .../exposed_interfaces/metadata.rs | 4 ++ .../src/context_bootstrap/specs/registry.rs | 64 +++++++++++++++++++ moli-webapi/src/interfaces.rs | 36 +++++++---- 3 files changed, 93 insertions(+), 11 deletions(-) diff --git a/moli-renderer-v8/src/context_bootstrap/exposed_interfaces/metadata.rs b/moli-renderer-v8/src/context_bootstrap/exposed_interfaces/metadata.rs index ef24144094c..c4588e2e56c 100644 --- a/moli-renderer-v8/src/context_bootstrap/exposed_interfaces/metadata.rs +++ b/moli-renderer-v8/src/context_bootstrap/exposed_interfaces/metadata.rs @@ -52,6 +52,8 @@ pub(in crate::context_bootstrap) const WORKER_SHARED_INTERFACE_NAMES: &[&str] = "SourceBufferList", "VideoColorSpace", "VideoFrame", + "RTCEncodedAudioFrame", + "RTCEncodedVideoFrame", "EventTarget", "Event", "CustomEvent", @@ -285,6 +287,8 @@ const WINDOW_AND_DEDICATED_WORKER_INTERFACE_NAMES: &[&str] = &[ "SourceBufferList", "VideoColorSpace", "VideoFrame", + "RTCEncodedAudioFrame", + "RTCEncodedVideoFrame", ]; pub(in crate::context_bootstrap) const INDEXED_DB_INTERFACE_NAMES: &[&str] = &[ diff --git a/moli-renderer-v8/src/context_bootstrap/specs/registry.rs b/moli-renderer-v8/src/context_bootstrap/specs/registry.rs index 27a20ed3fac..0e93db554ee 100644 --- a/moli-renderer-v8/src/context_bootstrap/specs/registry.rs +++ b/moli-renderer-v8/src/context_bootstrap/specs/registry.rs @@ -288,6 +288,70 @@ const CONSTRUCTOR_SPECS_BEFORE_STREAMS: &[ConstructorSpec] = &[ interface: web_api_interfaces::ScriptProcessorNode::DESCRIPTOR, kind: ConstructorKind::Illegal, }, + ConstructorSpec { + interface: web_api_interfaces::RTCCertificate::DESCRIPTOR, + kind: ConstructorKind::Illegal, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCDTMFSender::DESCRIPTOR, + kind: ConstructorKind::Illegal, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCDTMFToneChangeEvent::DESCRIPTOR, + kind: ConstructorKind::Shell { length: 1 }, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCDtlsTransport::DESCRIPTOR, + kind: ConstructorKind::Illegal, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCEncodedAudioFrame::DESCRIPTOR, + kind: ConstructorKind::Shell { length: 1 }, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCEncodedVideoFrame::DESCRIPTOR, + kind: ConstructorKind::Shell { length: 1 }, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCError::DESCRIPTOR, + kind: ConstructorKind::Shell { length: 1 }, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCErrorEvent::DESCRIPTOR, + kind: ConstructorKind::Shell { length: 2 }, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCIceTransport::DESCRIPTOR, + kind: ConstructorKind::Illegal, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCPeerConnectionIceErrorEvent::DESCRIPTOR, + kind: ConstructorKind::Shell { length: 2 }, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCRtpScriptTransform::DESCRIPTOR, + kind: ConstructorKind::Shell { length: 1 }, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCRtpSender::DESCRIPTOR, + kind: ConstructorKind::Illegal, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCRtpTransceiver::DESCRIPTOR, + kind: ConstructorKind::Illegal, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCSctpTransport::DESCRIPTOR, + kind: ConstructorKind::Illegal, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCStatsReport::DESCRIPTOR, + kind: ConstructorKind::Illegal, + }, + ConstructorSpec { + interface: web_api_interfaces::RTCTrackEvent::DESCRIPTOR, + kind: ConstructorKind::Shell { length: 2 }, + }, ConstructorSpec { interface: web_api_interfaces::External::DESCRIPTOR, kind: ConstructorKind::Illegal, diff --git a/moli-webapi/src/interfaces.rs b/moli-webapi/src/interfaces.rs index 692d3e3ebd6..4a0e3d3e6fe 100644 --- a/moli-webapi/src/interfaces.rs +++ b/moli-webapi/src/interfaces.rs @@ -78,6 +78,20 @@ interfaces! { MediaStreamAudioSourceNode: AudioNode; PannerNode: AudioNode; ScriptProcessorNode: AudioNode; + RTCCertificate; + RTCDTMFSender: EventTarget; + RTCDTMFToneChangeEvent: Event; + RTCDtlsTransport: EventTarget; + RTCError: DOMException; + RTCErrorEvent: Event; + RTCIceTransport: EventTarget; + RTCPeerConnectionIceErrorEvent: Event; + RTCRtpScriptTransform; + RTCRtpSender; + RTCRtpTransceiver; + RTCSctpTransport: EventTarget; + RTCStatsReport; + RTCTrackEvent: Event; AbortController; AbortSignal: EventTarget; AbstractRange; @@ -508,26 +522,26 @@ interfaces! { PushSubscription; PushSubscriptionOptions; QuotaExceededError: DOMException; - RTCCertificate; + RTCDataChannel: EventTarget; - RTCDTMFSender: EventTarget; - RTCDtlsTransport: EventTarget; - RTCError: DOMException; - RTCErrorEvent: Event; + + + + RTCIceCandidate; - RTCIceTransport: EventTarget; + RTCEncodedAudioFrame; RTCEncodedVideoFrame; RTCPeerConnection: EventTarget; RTCPeerConnectionIceEvent: Event; RTCDataChannelEvent: Event; - RTCPeerConnectionIceErrorEvent: Event; + RTCRtpReceiver; - RTCRtpSender; - RTCRtpTransceiver; - RTCSctpTransport: EventTarget; + + + RTCSessionDescription; - RTCStatsReport; + RadioNodeList: NodeList; Range: AbstractRange; ReadableByteStreamController;