| // GENERATED CONTENT - DO NOT EDIT |
| // Content was automatically extracted by Reffy into webref |
| // (https://github.com/w3c/webref) |
| // Source: WebRTC Encoded Transform (https://w3c.github.io/webrtc-encoded-transform/) |
| |
| typedef (SFrameTransform or RTCRtpScriptTransform) RTCRtpTransform; |
| |
| // New methods for RTCRtpSender and RTCRtpReceiver |
| partial interface RTCRtpSender { |
| attribute RTCRtpTransform? transform; |
| }; |
| |
| partial interface RTCRtpReceiver { |
| attribute RTCRtpTransform? transform; |
| }; |
| |
| // List of supported cipher suites, as defined in [[RFC9605]] section 4.5. |
| enum SFrameCipherSuite { |
| "AES_128_CTR_HMAC_SHA256_80", |
| "AES_128_CTR_HMAC_SHA256_64", |
| "AES_128_CTR_HMAC_SHA256_32", |
| "AES_128_GCM_SHA256_128", |
| "AES_256_GCM_SHA512_128" |
| }; |
| |
| dictionary SFrameTransformOptions { |
| required SFrameCipherSuite cipherSuite; |
| }; |
| |
| typedef [EnforceRange] unsigned long long SmallCryptoKeyID; |
| typedef (SmallCryptoKeyID or bigint) CryptoKeyID; |
| |
| interface mixin SFrameKeyManagement { |
| Promise<undefined> setEncryptionKey(CryptoKey key, optional CryptoKeyID keyID); |
| attribute EventHandler onerror; |
| }; |
| |
| [Exposed=Window] |
| interface SFrameTransform : EventTarget { |
| constructor(optional SFrameTransformOptions options = {}); |
| }; |
| SFrameTransform includes SFrameKeyManagement; |
| |
| [Exposed=(Window,DedicatedWorker)] |
| interface SFrameEncrypterStream : EventTarget { |
| constructor(optional SFrameTransformOptions options = {}); |
| }; |
| SFrameEncrypterStream includes GenericTransformStream; |
| SFrameEncrypterStream includes SFrameKeyManagement; |
| |
| [Exposed=(Window,DedicatedWorker)] |
| interface SFrameDecrypterStream : EventTarget { |
| constructor(optional SFrameTransformOptions options = {}); |
| }; |
| SFrameDecrypterStream includes GenericTransformStream; |
| SFrameDecrypterStream includes SFrameKeyManagement; |
| |
| enum SFrameTransformErrorEventType { |
| "authentication", |
| "keyID", |
| "syntax" |
| }; |
| |
| [Exposed=(Window,DedicatedWorker)] |
| interface SFrameTransformErrorEvent : Event { |
| constructor(DOMString type, SFrameTransformErrorEventInit eventInitDict); |
| |
| readonly attribute SFrameTransformErrorEventType errorType; |
| readonly attribute CryptoKeyID? keyID; |
| readonly attribute any frame; |
| }; |
| |
| dictionary SFrameTransformErrorEventInit : EventInit { |
| required SFrameTransformErrorEventType errorType; |
| required any frame; |
| CryptoKeyID? keyID; |
| }; |
| |
| dictionary RTCEncodedFrameMetadata { |
| unsigned long synchronizationSource; |
| octet payloadType; |
| sequence<unsigned long> contributingSources; |
| unsigned long rtpTimestamp; |
| DOMHighResTimeStamp receiveTime; |
| DOMHighResTimeStamp captureTime; |
| DOMHighResTimeStamp senderCaptureTimeOffset; |
| DOMString mimeType; |
| }; |
| |
| // New enum for video frame types. Will eventually re-use the equivalent defined |
| // by WebCodecs. |
| enum RTCEncodedVideoFrameType { |
| "empty", |
| "key", |
| "delta", |
| }; |
| |
| dictionary RTCEncodedVideoFrameMetadata : RTCEncodedFrameMetadata { |
| unsigned long long frameId; |
| sequence<unsigned long long> dependencies; |
| unsigned short width; |
| unsigned short height; |
| unsigned long spatialIndex; |
| unsigned long temporalIndex; |
| long long timestamp; // microseconds |
| }; |
| |
| dictionary RTCEncodedVideoFrameOptions { |
| RTCEncodedVideoFrameMetadata metadata; |
| }; |
| |
| // New interfaces to define encoded video and audio frames. Will eventually |
| // re-use or extend the equivalent defined in WebCodecs. |
| [Exposed=(Window,DedicatedWorker), Serializable] |
| interface RTCEncodedVideoFrame { |
| constructor(RTCEncodedVideoFrame originalFrame, optional RTCEncodedVideoFrameOptions options = {}); |
| readonly attribute RTCEncodedVideoFrameType type; |
| attribute ArrayBuffer data; |
| RTCEncodedVideoFrameMetadata getMetadata(); |
| }; |
| |
| dictionary RTCEncodedAudioFrameMetadata : RTCEncodedFrameMetadata { |
| short sequenceNumber; |
| double audioLevel; |
| }; |
| |
| dictionary RTCEncodedAudioFrameOptions { |
| RTCEncodedAudioFrameMetadata metadata; |
| }; |
| |
| [Exposed=(Window,DedicatedWorker), Serializable] |
| interface RTCEncodedAudioFrame { |
| constructor(RTCEncodedAudioFrame originalFrame, optional RTCEncodedAudioFrameOptions options = {}); |
| attribute ArrayBuffer data; |
| RTCEncodedAudioFrameMetadata getMetadata(); |
| }; |
| |
| [Exposed=DedicatedWorker] |
| interface RTCTransformEvent : Event { |
| readonly attribute RTCRtpScriptTransformer transformer; |
| }; |
| |
| partial interface DedicatedWorkerGlobalScope { |
| attribute EventHandler onrtctransform; |
| }; |
| |
| [Exposed=DedicatedWorker] |
| interface RTCRtpScriptTransformer : EventTarget { |
| // Attributes and methods related to the transformer source |
| readonly attribute ReadableStream readable; |
| Promise<undefined> generateKeyFrame(optional DOMString rid); |
| Promise<undefined> sendKeyFrameRequest(); |
| // Attributes and methods related to the transformer sink |
| readonly attribute WritableStream writable; |
| attribute EventHandler onkeyframerequest; |
| // Attributes for configuring the Javascript code |
| readonly attribute any options; |
| }; |
| |
| [Exposed=Window] |
| interface RTCRtpScriptTransform { |
| constructor(Worker worker, optional any options, optional sequence<object> transfer); |
| }; |
| |
| [Exposed=DedicatedWorker] |
| interface KeyFrameRequestEvent : Event { |
| constructor(DOMString type, optional DOMString rid); |
| readonly attribute DOMString? rid; |
| }; |