RTCEncodedVideoFrame.webidl (1755B)
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 * You can obtain one at http://mozilla.org/MPL/2.0/. 5 * 6 * The origin of this IDL file is 7 * https://www.w3.org/TR/webrtc-encoded-transform 8 */ 9 10 // New enum for video frame types. Will eventually re-use the equivalent defined 11 // by WebCodecs. 12 enum RTCEncodedVideoFrameType { 13 "empty", 14 "key", 15 "delta", 16 }; 17 18 dictionary RTCEncodedVideoFrameMetadata { 19 unsigned long long frameId; 20 sequence<unsigned long long> dependencies; 21 unsigned short width; 22 unsigned short height; 23 unsigned long spatialIndex; 24 unsigned long temporalIndex; 25 unsigned long synchronizationSource; 26 octet payloadType; 27 sequence<unsigned long> contributingSources; 28 long long timestamp; // microseconds 29 }; 30 31 dictionary RTCEncodedVideoFrameOptions { 32 RTCEncodedVideoFrameMetadata metadata; 33 }; 34 35 // New interfaces to define encoded video and audio frames. Will eventually 36 // re-use or extend the equivalent defined in WebCodecs. 37 // 38 // [Serializable] is implemented without adding attribute here, 39 // because we don't implement "full serialization" to disk. 40 [Pref="media.peerconnection.enabled", 41 Pref="media.peerconnection.scripttransform.enabled", 42 Exposed=(Window,DedicatedWorker)] 43 interface RTCEncodedVideoFrame { 44 [Throws] 45 constructor(RTCEncodedVideoFrame originalFrame, optional RTCEncodedVideoFrameOptions options = {}); 46 readonly attribute RTCEncodedVideoFrameType type; 47 readonly attribute unsigned long timestamp; 48 attribute ArrayBuffer data; 49 RTCEncodedVideoFrameMetadata getMetadata(); 50 };