Bug 1363667 - P1 - Add RTP Sources WebIDL draft
authorNico Grunbaum
Tue, 14 Nov 2017 09:20:29 -0800
changeset 706486 724dff65f4b61fa7c498748a3dc7e7e2866d19ca
parent 706205 781485c695e1f07b8782427d556f6570e4a8072f
child 706487 65f3b9cb441e962084f1de05ec1e124a19d01dc9
push id91808
push userna-g@nostrum.com
push dateSat, 02 Dec 2017 00:48:28 +0000
bugs1363667
milestone59.0a1
Bug 1363667 - P1 - Add RTP Sources WebIDL MozReview-Commit-ID: 61RqPKfbrDw
dom/webidl/RTCRtpReceiver.webidl
dom/webidl/RTCRtpSources.webidl
dom/webidl/moz.build
--- a/dom/webidl/RTCRtpReceiver.webidl
+++ b/dom/webidl/RTCRtpReceiver.webidl
@@ -5,11 +5,13 @@
  *
  * The origin of this IDL file is
  * http://lists.w3.org/Archives/Public/public-webrtc/2014May/0067.html
  */
 
 [Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/rtpreceiver;1"]
 interface RTCRtpReceiver {
-  readonly attribute MediaStreamTrack track;
-  Promise<RTCStatsReport> getStats();
+  readonly attribute MediaStreamTrack   track;
+  Promise<RTCStatsReport>               getStats();
+  sequence<RTCRtpContributingSource>    getContributingSources();
+  sequence<RTCRtpSynchronizationSource> getSynchronizationSources();
 };
new file mode 100644
--- /dev/null
+++ b/dom/webidl/RTCRtpSources.webidl
@@ -0,0 +1,39 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://www.w3.org/TR/2017/CR-webrtc-20171102/
+ */
+
+// WebIDL note: RTCRtpContrinbutingSource and RTCRtpSynchronizationSource
+// are specified currently as interfaces in the spec, however there is an
+// open issue which has yet to land changing them to dictionaries.
+// See: https://github.com/w3c/webrtc-pc/issues/1533
+// and https://bugzilla.mozilla.org/show_bug.cgi?id=1419093
+
+dictionary RTCRtpContributingSource {
+    DOMHighResTimeStamp  timestamp;
+    unsigned long        source;
+    byte?                audioLevel;
+};
+
+dictionary RTCRtpSynchronizationSource {
+    DOMHighResTimeStamp  timestamp;
+    unsigned long        source;
+    byte                 audioLevel;
+};
+
+/* Hidden shared representation of Contributing and Synchronization sources */
+enum RTCRtpSourceEntryType {
+    "contributing",
+    "synchronization",
+};
+
+dictionary RTCRtpSourceEntry {
+    DOMHighResTimeStamp    timestamp;
+    unsigned long          source;
+    byte?                  audioLevel;
+    RTCRtpSourceEntryType  sourceType;
+};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -990,16 +990,17 @@ if CONFIG['MOZ_WEBRTC']:
         'RTCDTMFSender.webidl',
         'RTCIceCandidate.webidl',
         'RTCIdentityAssertion.webidl',
         'RTCIdentityProvider.webidl',
         'RTCPeerConnection.webidl',
         'RTCPeerConnectionStatic.webidl',
         'RTCRtpReceiver.webidl',
         'RTCRtpSender.webidl',
+        'RTCRtpSources.webidl',
         'RTCRtpTransceiver.webidl',
         'RTCSessionDescription.webidl',
         'TransceiverImpl.webidl',
         'WebrtcDeprecated.webidl',
         'WebrtcGlobalInformation.webidl',
     ]
 
 if CONFIG['MOZ_WEBSPEECH']: