Victor Porof | 6e09692 | 2022-06-10 13:01:05 +0000 | [diff] [blame^] | 1 | // GENERATED CONTENT - DO NOT EDIT |
| 2 | // Content was automatically extracted by Reffy into webref |
| 3 | // (https://github.com/w3c/webref) |
| 4 | // Source: WebRTC Encoded Transform (https://w3c.github.io/webrtc-encoded-transform/) |
| 5 | |
| 6 | // New dictionary |
| 7 | dictionary RTCInsertableStreams { |
| 8 | ReadableStream readable; |
| 9 | WritableStream writable; |
| 10 | }; |
| 11 | |
| 12 | typedef (SFrameTransform or RTCRtpScriptTransform) RTCRtpTransform; |
| 13 | |
| 14 | // New methods for RTCRtpSender and RTCRtpReceiver |
| 15 | partial interface RTCRtpSender { |
| 16 | attribute RTCRtpTransform? transform; |
| 17 | }; |
| 18 | |
| 19 | partial interface RTCRtpReceiver { |
| 20 | attribute RTCRtpTransform? transform; |
| 21 | }; |
| 22 | |
| 23 | enum SFrameTransformRole { |
| 24 | "encrypt", |
| 25 | "decrypt" |
| 26 | }; |
| 27 | |
| 28 | dictionary SFrameTransformOptions { |
| 29 | SFrameTransformRole role = "encrypt"; |
| 30 | }; |
| 31 | |
| 32 | typedef [EnforceRange] unsigned long long SmallCryptoKeyID; |
| 33 | typedef (SmallCryptoKeyID or bigint) CryptoKeyID; |
| 34 | |
| 35 | [Exposed=(Window,DedicatedWorker)] |
| 36 | interface SFrameTransform { |
| 37 | constructor(optional SFrameTransformOptions options = {}); |
| 38 | Promise<undefined> setEncryptionKey(CryptoKey key, optional CryptoKeyID keyID); |
| 39 | attribute EventHandler onerror; |
| 40 | }; |
| 41 | SFrameTransform includes GenericTransformStream; |
| 42 | |
| 43 | enum SFrameTransformErrorEventType { |
| 44 | "authentication", |
| 45 | "keyID", |
| 46 | "syntax" |
| 47 | }; |
| 48 | |
| 49 | [Exposed=(Window,DedicatedWorker)] |
| 50 | interface SFrameTransformErrorEvent : Event { |
| 51 | constructor(DOMString type, SFrameTransformErrorEventInit eventInitDict); |
| 52 | |
| 53 | readonly attribute SFrameTransformErrorEventType errorType; |
| 54 | readonly attribute CryptoKeyID? keyID; |
| 55 | readonly attribute any frame; |
| 56 | }; |
| 57 | |
| 58 | dictionary SFrameTransformErrorEventInit : EventInit { |
| 59 | required SFrameTransformErrorEventType errorType; |
| 60 | required any frame; |
| 61 | CryptoKeyID? keyID; |
| 62 | }; |
| 63 | |
| 64 | // New enum for video frame types. Will eventually re-use the equivalent defined |
| 65 | // by WebCodecs. |
| 66 | enum RTCEncodedVideoFrameType { |
| 67 | "empty", |
| 68 | "key", |
| 69 | "delta", |
| 70 | }; |
| 71 | |
| 72 | dictionary RTCEncodedVideoFrameMetadata { |
| 73 | long long frameId; |
| 74 | sequence<long long> dependencies; |
| 75 | unsigned short width; |
| 76 | unsigned short height; |
| 77 | long spatialIndex; |
| 78 | long temporalIndex; |
| 79 | long synchronizationSource; |
| 80 | octet payloadType; |
| 81 | sequence<long> contributingSources; |
| 82 | }; |
| 83 | |
| 84 | // New interfaces to define encoded video and audio frames. Will eventually |
| 85 | // re-use or extend the equivalent defined in WebCodecs. |
| 86 | [Exposed=(Window,DedicatedWorker)] |
| 87 | interface RTCEncodedVideoFrame { |
| 88 | readonly attribute RTCEncodedVideoFrameType type; |
| 89 | readonly attribute unsigned long long timestamp; |
| 90 | attribute ArrayBuffer data; |
| 91 | RTCEncodedVideoFrameMetadata getMetadata(); |
| 92 | }; |
| 93 | |
| 94 | dictionary RTCEncodedAudioFrameMetadata { |
| 95 | long synchronizationSource; |
| 96 | octet payloadType; |
| 97 | sequence<long> contributingSources; |
| 98 | }; |
| 99 | |
| 100 | [Exposed=(Window,DedicatedWorker)] |
| 101 | interface RTCEncodedAudioFrame { |
| 102 | readonly attribute unsigned long long timestamp; |
| 103 | attribute ArrayBuffer data; |
| 104 | RTCEncodedAudioFrameMetadata getMetadata(); |
| 105 | }; |
| 106 | |
| 107 | // New interfaces to expose JavaScript-based transforms. |
| 108 | |
| 109 | [Exposed=DedicatedWorker] |
| 110 | interface RTCTransformEvent : Event { |
| 111 | readonly attribute RTCRtpScriptTransformer transformer; |
| 112 | }; |
| 113 | |
| 114 | partial interface DedicatedWorkerGlobalScope { |
| 115 | attribute EventHandler onrtctransform; |
| 116 | }; |
| 117 | |
| 118 | [Exposed=DedicatedWorker] |
| 119 | interface RTCRtpScriptTransformer { |
| 120 | readonly attribute ReadableStream readable; |
| 121 | readonly attribute WritableStream writable; |
| 122 | readonly attribute any options; |
| 123 | Promise<unsigned long long> generateKeyFrame(optional DOMString rid); |
| 124 | Promise<undefined> sendKeyFrameRequest(); |
| 125 | }; |
| 126 | |
| 127 | [Exposed=Window] |
| 128 | interface RTCRtpScriptTransform { |
| 129 | constructor(Worker worker, optional any options, optional sequence<object> transfer); |
| 130 | }; |
| 131 | |
| 132 | partial interface RTCRtpSender { |
| 133 | Promise<undefined> generateKeyFrame(optional sequence <DOMString> rids); |
| 134 | }; |