W3C
WebRTC/MediaCapture
WG Meeting
January 11, 2018
8 AM PDT
1
Chairs: Stefan Hakansson
Bernard Aboba
Harald Alvestrand
W3C WG IPR Policy
2
Welcome!
3
Current Status of WebRTC-PC
4
About this Virtual Meeting
Information on the meeting:
February Virtual Interim: Focus on Screen Capture
5
Links to the latest drafts
New documents:
6
Agenda for Today
7
For Discussion Today
8
For Discussion Today (cont’d)
(Jan-Ivar)
9
WebRTC-PC Issues
10
11
Issue 1689: Why is RTCRtpSynchronizationSource.voiceActivityFlag required-but-nullable? (Jan-Ivar)
12
Issue 1497: Not possible to tell how old `RTCRtpContributingSource.timestamp` is (Jan-Ivar)
Issue 1690: RTCRtpContributingSource.timestamp needs a clearer definition (Taylor)
13
[1] https://www.w3.org/2017/11/06-webrtc-minutes.html#item19
14
For Discussion Today (cont’d)
(Jan-Ivar)
15
Media Capture
16
Peter's {resizeMode: “crop-and-scale”} constraint from TPAC, modulo "box-and-scale" *
��� enum VideoResizeModeEnum {� "none",� "crop-and-scale"� };
“The UA SHOULD use the one with the smallest fitness distance, as calculated in step 3, but MAY prefer ones with resizeMode set to "none" over "crop-and-scale".”��*) "box-and-scale" adds pixels and is incompatible with the constraints algorithm (these fitness distances would compete with "crop-and-scale" and "none" modes, with unpredictable and undesirable results).
17
resizeMode | ConstrainDOMString | This string (or each string, when a list) should be a member of VideoResizeModeEnum. The members describe the means by which the resolution can be derived by the UA. In other words, whether the UA is allowed to use cropping and downscaling on the camera output. The UA may disguise concurrent use of the camera, by cropping and/or downscaling to mimic native resolutions when "none" is used, but only when the camera is in use in another browsing context. |
none | This resolution is offered by the camera, its driver, or the OS.� Note: The UA may report this value to disguise concurrent use, but only when the camera is in use in another browsing context. |
crop-and-scale | This resolution is downscaled and/or cropped from a higher camera resolution by the user agent. |
Statistics
18
Issue 235: Is keeping stats around a speed problem? (jib)
19
Issue 235: Is keeping stats around a speed problem? (jib)
Proposal to fix this:
Omit objectDeleted stats from getStats, and add new methods to get them instead:
partial interface RTCRtpSender { partial interface RTCRtpReceiver {� RTCStatsReport getCompletedStats(); RTCStatsReport getCompletedStats();�}; };��partial interface RTCPeerConnection {� RTCStatsReport getCompletedStats(optional MediaStreamTrack? selector = null);�};
These return deleted stats (tracks + “stopped” senders/receivers) synchronously from a cache.
Benefits: Simpler parsing (no filtering on booleans). Isolates overhead (out of live-update hot path).
Trivial to combine results in JS:�[...(await sender.getStats()).values(), ...sender.getCompletedStats().values()] // All tracks
20
Issue 235: Is keeping stats around a speed problem? (jib)
If previous proposal is well received, a question: Do we need “track” stats in getStats()?
Users can compute live “track” stats from “sender” stats using JS:
let senderStat = [...(await sender.getStats()).values()].find(s => s.type == “sender”);�let oldTracks = [...sender.getCompletedStats().values()].filter(s => s.type == “track”);
let trackFramesSent = oldTracks.reduce((n, old) => n - old.framesSent, senderStat.framesSent);
21
WebRTC-QUIC Status
At TPAC, we decided to start an extension spec�(to decide if we like it).
Now, here it is:
�https://w3c.github.io/webrtc-quic/
https://github.com/w3c/webrtc-quic/issues
22
WebRTC-QUIC Approach
23
WebRTC-QUIC Stream states (summarized)
As "receiver"
.onstream: -> open
FIN/RST received -> closing
finish or reset() -> closed
��Write when open/closing
Read when open
As "sender"
createStream: -> opening
stream frame acked -> open
finish() or reset() -> closing
FIN/RST received -> closed�
Write when opening/open
Read when open/closing
24
WebRTC-QUIC Issues Raised
25
"QUIC" in the charter
Instead of mentioning "QUIC" in the charter, should we explain what we want to accomplish?
We should discuss in the charter discussion. But if it's not QUIC, what is it?
26
QUIC vs SCTP
A desire for "good reasons" for QUIC vs SCTP.�
Some of my reasons:
27
WHATWG streams
Basically choose between these two things.�Proposal: Keep the left w/o dependencies
readInto(Uint8Array); write(Uint8Array);�waitForReadable(amount); waitForWritable(amount);
(And implement WHATWG streams on top, if you want them)
attribute ReadableStream readableStream;
attribute WritableStream writableStream;
(With a big dependency on WHATWG ReadableStream and WritableStream)
28
"unadorned" QUIC
To do multiple protocols on top of QUIC streams over the same 5-tuple at the same time, need either a new mechanism for segregating the QUIC streams, or multiple QUIC connections. This is an issue with QUIC in general.
�Proposal: If a solution comes up for QUIC in general, use it. Maybe propose one in QUIC WG.
29
ALPN
You're supposed to put a value in the ALPN field in the client hello. It's supposed to identify the "application protocol". Who decides what that is?
Proposal: let the JS decide.
30
Unidirectional/bidrectional streams
The API is bidirectional because unidirectional streams didn't exist in QUIC until very recently. But it does make sense to support both.��Proposal: Update createStream/onstream to support both.
31
0-RTT
We don't have anything in the API for 0-RTT, which QUIC is capable of. Should we add support for it?
Proposal: Finish everything else we want and then come back to this later.
32
WebRTC-ICE Status
At TPAC, we decided to start an extension spec�(to decide if we like it).
Now, here it is:
�https://w3c.github.io/webrtc-ice/
https://github.com/w3c/webrtc-ice/issues
33
WebRTC-ICE Approach
34
Tricky Parts: What if you don't call gather()?
If you don't call gather(), you won't get local candidates.
So you have to call both gather() and start().
Is that too big of a foot gun?
The alternative is to make start() semi-magic. But then ICE restarts become less clear.
Proposal: Require calling both. You need to, anyway, for good use of trickle ICE on the caller side. So it encourages good use.
35
Tricky Parts: ICE Restarts
To initiate a full ICE restart, two things must happen:
Proposal:�- New gathering done via call to gather(), which changes local parameters�- New remote parameters via restart(), which changes remote parameters
Like when you first start, you must call both. Again, on the restarter side, this is good trickle practice.�
36
Tricky Parts: Changing gathering policy
If you want to add TURN servers without an ICE restart, like with PeerConnection.setConfiguration, what do you do?
Proposal: Have a variant of gather() which doesn't change the local ufrag/pwd, but just gathers new candidates.
�
37
Tricky Parts: Gathering done
Like with PeerConnection, it might be useful to signal "end of candidates" easily out of the box.
Proposal: Make it just like WebRTC: candidate.candidate == "" means "end of candidates". It's ugly but it works and we don't have to specify anything new.
38
Open Question: stats
Option A: iceTransport.getStats()
Option B: statCollector.getStats(iceTransport)
Which one?
39
An alternative to IceTransport: SliceTransport
SLICE: Simple, Low-level ICE
Basically, Cullen's idea from TPAC of a low-level ICE where the JS gets to control (almost) everything.
40
Today
41
Application
JS
IceTransport in Browser
IP Network Enumeration
STUN
TURN
ICE checks
ICE agent (gathering, pairing, timing, ...)
UDP ports
TCP ports
Cullen's idea
42
IP Network Enumeration
STUN
TURN
ICE checks
ICE agent (gathering, pairing, timing, ...)
UDP ports
TCP ports
Application
JS
Low-level components in Browser
New APIs
43
NetworkManager
StunClient
TurnClient
SliceTransport
UdpPort
TcpPort
Application
JS
Low-level components in Browser
How to use them
44
SliceTransport: checking and selection
45
interface IceTransport {
// Can receive any network route and send on selected one
IceNetworkRoute addNetworkRoute(PacketTransport transport);
void selectNetworkRoute(IceNetworkRoute networkRoute);
void removeNetworkRoute(IceNetworkRoute networkRoute);
}
interface IceNetworkRoute {
// Sends an ICE check. Resolves when the response is received
Promise sendCheck(...);
// Checks responses automatically sent.
eventhandler oncheckreceived;
}
UDP PacketTransports
46
interface UdpPort {
readonly attribute IpPort localAddress;
UdpTransport connect(IpPort remoteAddress);
void close();
// Fired once for each new remote address
eventhandler onnewremoteaddress;
}
// Only usable within SliceTransport, not by itself.
interface UdpTransport : PacketTransport {
readonly attribute IpPort localAddress;
readonly attribute IpPort remoteAddress;
void close();
}
TCP PacketTransports
47
interface ClientTcpPort {
readonly attribute IpPort localAddress;
Promise<TcpTransport> connect(IpPort remoteAddress,
TlsMode tlsMode);
void close();
}
// Only usable within SliceTransport, not by itself.
interface TcpTransport : PacketTransport {
readonly attribute IpPort localAddress;
readonly attribute IpPort remoteAddress;
void close();
}
How to get IP, UDP, TCP (with permission)
48
interface NetworkManager {
Promise<sequence<NetworkInfo>> EnumerateNetworks();
Promise<UdpPort> OpenUdpPort(IPAddress localIp);
Promise<ClientTcpPort> OpenClientTcpPort(
IPAddress localIp, bool tls);
attribute eventhandler onnetworkschanged;
}
interface NetworkInfo {
readonly attribute sequence<IPAddress> ips;
readonly attribute NetworkAdapterType type;
}
Getting STUN addresses
49
interface StunClient {
// Resolves when response is received
Promise<IpPort> sendBindingRequest(
PacketTransport transport, ...);
}
Getting TURN addresses
50
interface TurnClient {
Promise<TurnAllocation> sendAllocationRequest(PacketTransport transport, ...);
}
interface TurnAllocation {
// TODO: Are refreshes automatic or controlled by JS?
readonly attribute IpPort serverAddress;
Promise sendCreatePermissionRequest(IpPort remoteAddress);
TurnTransport connect(IpPort remoteAddress);
void close();
eventhandler onnewremoteaddress; // IpPort
}
interface TurnTransport : PacketTransport {
// TODO: Are channels automatic or controlled by JS?
readonly attribute IpPort serverAddress;
readonly attribute IpPort remoteAddress;
void close();
}
Advantages
51
...
WebRTC WG Charter (Bernard)
52
WebRTC WG Charter Discussion (cont’d)
53
For extra credit
54
Name that bird!
Thank you
Special thanks to:
W3C/MIT for WebEx
WG Participants, Editors & Chairs
The bird
55