[rtcweb] Rejecting MediaStreamTracks in JSEP

Justin Uberti <juberti@google.com> Mon, 03 February 2014 19:27 UTC

Return-Path: <juberti@google.com>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 060F01A01D0 for <rtcweb@ietfa.amsl.com>; Mon, 3 Feb 2014 11:27:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.887
X-Spam-Level: *
X-Spam-Status: No, score=1.887 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, J_CHICKENPOX_14=0.6, J_CHICKENPOX_15=0.6, J_CHICKENPOX_18=0.6, J_CHICKENPOX_36=0.6, RP_MATCHES_RCVD=-0.535, SPF_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rcf-oSM6M2n6 for <rtcweb@ietfa.amsl.com>; Mon, 3 Feb 2014 11:27:28 -0800 (PST)
Received: from mail-vc0-x22b.google.com (mail-vc0-x22b.google.com [IPv6:2607:f8b0:400c:c03::22b]) by ietfa.amsl.com (Postfix) with ESMTP id EDC971A010F for <rtcweb@ietf.org>; Mon, 3 Feb 2014 11:27:27 -0800 (PST)
Received: by mail-vc0-f171.google.com with SMTP id le5so5190429vcb.30 for <rtcweb@ietf.org>; Mon, 03 Feb 2014 11:27:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=bBKhRE/5uzBgp6DDpWIg4it2axc04Cv5eMdPvx92i2c=; b=eWcWiGCy7fyH5dfL6gp2+gEBeCguTWqhpWjYtsLFKmwFZVhNtTm+Qhsozczi/M6VQX mI3Tp0B267ZtItZXlzUfohBmgdc2eH3QX5jMLFRPZ04dcu/Qgt3JxObCPRV11tIEgXhE T3xMGNfKIznmj8cCc5RqDCjQtVMKG/yoGyX/aX7dTUjb/KO67VsWApAOqeWbBaquACGI AGSO1xll2OYi7CplPZaSVVctE+SKFrX4ZUsqZJ60y9nTLaGOCuKAYxcZvltd5x1PhbDz 8g+x6ga5XrCHIAsFpGIcXPnKvPIh4/EGFWcvw+O5WA3u8mcdtzlbW44qYYdDEGrl/e6q uuRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=bBKhRE/5uzBgp6DDpWIg4it2axc04Cv5eMdPvx92i2c=; b=FfjVXd3PQNY9PT92XGyM+g5MXxnvNAClcFG7UvS9T+GJKMLkQWFzypplYOgZz5qnd4 wmbWD3SlhBZkQ/1HQYASoYU9+cTaPyqa1CnoZr9FASf9rLxsPbLLaor3Dgkvty7pR1p7 wTlDPy10Yo12WVHm2cZxFMr6XAWsQ/6j6nMy/7HFcqmHceII9YWi3992wMUjYzbgjdOg Fb0ILvSxidYlmM1d4EP10Un7LehzmL0lPNtx2WfxgDF2w1xtyPmEhhTofXMh7wwobZxZ TaKJ3U72FF5wlEnZ+UOF/C2fzqW2njphbfoF44CB7DtA1F5A0mLOW2OfNQjrL5PWB3Wl ZnyA==
X-Gm-Message-State: ALoCoQmxs9tspXgcDWE2s7xetRctMMScQi+VLdMi4tYxP7sbkCbEZCd9fmtp06vKoDz9kLPAQ4Po73h0Pvu6kfS+gC3UGpanzxDoMEUAZa/rm5LUN+NIC2Wvnk6yAKjNnEAYWF1X81hov6jYPRFBSYFZ4527q88ntF0Xgs49lopKAU8QOZ0cl9Nu8OvzpyRPBeDXtPHuG2JE
X-Received: by 10.221.30.14 with SMTP id sa14mr36451vcb.44.1391455647020; Mon, 03 Feb 2014 11:27:27 -0800 (PST)
MIME-Version: 1.0
Received: by 10.52.89.170 with HTTP; Mon, 3 Feb 2014 11:27:06 -0800 (PST)
From: Justin Uberti <juberti@google.com>
Date: Mon, 03 Feb 2014 11:27:06 -0800
Message-ID: <CAOJ7v-22T7hLMdC2je0nLk34MXQ8L+JFWLtAz--6Ryt+DMaMvQ@mail.gmail.com>
To: "rtcweb@ietf.org" <rtcweb@ietf.org>, Cullen Jennings <fluffy@cisco.com>
Content-Type: multipart/alternative; boundary="001a11336a2e90057e04f1858368"
Subject: [rtcweb] Rejecting MediaStreamTracks in JSEP
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtcweb/>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 03 Feb 2014 19:27:30 -0000

While working on the latest JSEP update, I came across the following
problem:

When a answerer wants to reject a "media stream" in 3264, it sets the m=
line port in the answer to zero. However, when an endpoint wants to reject
a remote MediaStreamTrack without rejecting the m= line entirely, because
it is using the m= line for its own MediaStreamTrack, we don't have a clear
way to express that. While setting a=sendonly in the answer will tell the
other side to stop sending data, this won't kill the remote track. As far
as the remote side is concerned, its track is just 'paused'/'held', and is
still associated with the m= line.

Note that there is no such problem if an endpoint decides to kill its own
local MediaStreamTrack; in the offer it sends to indicate this, in addition
to setting the m= line to a=recvonly, it can also remove the MSID of the
track from the m= line, indicating the track is gone. In other words, the
a=msid attribute serves as the binding of MST to m= line, and its absence
indicates the track is gone.

Therefore, I think we need some similar way for a receiver to do the same
for a remote track. And fortunately, I think we have a surface that can be
used for this, namely the "recv-appId" attribute that has been discussed in
the context of unified-plan and explained in
http://tools.ietf.org/id/draft-even-mmusic-application-token-02.txt and
unified-plan. If an endpoint doesn't want to receive a particular track on
a m= line, it sets the m= line to a=sendonly and also removes any
a=recv-appId.

Below is an example of an audio call between A and B, with
MediaStreamTracks MSTA and MSTB. A initially generates an offer, and then I
show 4 different answer scenarios for various cases.

1) A generates offer with MSTA
m=audio X
a=msid:MSTA
a=recv-appId:1 # use 1 in the header extension when sending MSTA

2a) Normal answer: B adds its own track MSTB, generates answer:
m=audio Y
a=msid:MSTB
a=recv-appId:1

2b) Add+reject answer: B adds its own track MSTB, stops MSTA, generates
answer:
m=audio Y
a=msid:MSB
a=sendonly
# no appid; A can realize that MSA has been rejected

2c) Reject-only answer: B stops MSTA without adding a stream, generates
answer:
m=audio 0
# entire m-line has been rejected

2d) Do-nothing answer: B does nothing, generates answer:
m=audio Y
a=recv-appId:1
a=recvonly

If this seems reasonable, I plan to use this mechanism for handling m= line
allocation in JSEP.

Also, this essentially makes recv-appId the converse of MSID; for
simplicity, I think we should consider unifying these concepts into a
single document.