Re: [rtcweb] JSEP: When the "current direction" changes

Taylor Brandstetter <deadbeef@google.com> Sat, 12 November 2016 00:55 UTC

Return-Path: <deadbeef@google.com>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 88F20129CDF for <rtcweb@ietfa.amsl.com>; Fri, 11 Nov 2016 16:55:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.216
X-Spam-Level:
X-Spam-Status: No, score=-3.216 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_FONT_FACE_BAD=0.981, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-1.497, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.com
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 rJwx2MMkcIay for <rtcweb@ietfa.amsl.com>; Fri, 11 Nov 2016 16:55:45 -0800 (PST)
Received: from mail-qt0-x22b.google.com (mail-qt0-x22b.google.com [IPv6:2607:f8b0:400d:c0d::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 380961297F7 for <rtcweb@ietf.org>; Fri, 11 Nov 2016 16:55:45 -0800 (PST)
Received: by mail-qt0-x22b.google.com with SMTP id c47so19371030qtc.2 for <rtcweb@ietf.org>; Fri, 11 Nov 2016 16:55:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7DakAV75zE5rJ/MhBG3u306XCv4V7jUQSFSjoF1d8+E=; b=kRX3tsnKcZUu28jeNcMhywwz/aZH+CMr+4CqxVxszFFqIavPYtSnyt9ESH+x2G4Dyt AnSzpVes1AGwaCcBLt0MvhvM5Ihw9N/BlrWZnna5E6HHljCiF1vnSbm+8slzO6oZfH7U i9gWPyJ5GOjmszhNSjf5XibMRfoRE+vGp5Hf5exvF2fUeTd3vFrrqtll8Z3/Zh/wW9U9 yuNttjTLfW0O1p9r76wrVqUCj99OnwPjBDgkjdfD+SJRWys+A83AfyxR2KU7ET4Oo7vK T4sm+9RMrpi/LmhQ6jw1Z1ycE9l9CwMBVmnq+gnFzMgNeeBA7e04NZj11lzvvy2C81S8 /rOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7DakAV75zE5rJ/MhBG3u306XCv4V7jUQSFSjoF1d8+E=; b=mtLw0uZZhvojh5tQpRklHCdnXSOKWrm36gf0yy2IIZPgMeFdiBDGh4PilhtcpvNmg8 a70BYeu9oQPV0SwIdCEEIkgHQ4wic2YyyyjlljQwXngp1FDMFlaODGzHCR4VfbG9Oo4q R5NnR+7csqBBvdd5orq5d2Wm6FyCiPhAnqcMk3veg9Pl0CHt9jWwa4NRMYDD+NNiJS4g ufAtkLciZWDJ+xxsqjN6CxcYUzfQwyABKI7S5aNGYjZ2eMOpnAEOUtsrDPQP3mbpsh72 ggcns8i0usK35bHM8+gxRPHk7W3UabmQd8L0/4g/fY2Kgz9mXxz0FzjjG6azNJvrK09+ b9Sg==
X-Gm-Message-State: ABUngveZTOs5ra9AOjK3uw+ZdRJkZqV8iF9FSpDFmINkl+Fk6pd9x40bM/x0zAxVp+5ulQx9URJ7raHYPIpdiIx4
X-Received: by 10.237.35.60 with SMTP id h57mr1535665qtc.245.1478912144130; Fri, 11 Nov 2016 16:55:44 -0800 (PST)
MIME-Version: 1.0
Received: by 10.200.41.134 with HTTP; Fri, 11 Nov 2016 16:55:43 -0800 (PST)
In-Reply-To: <CAOW+2ds9VP0FhKMY5cmdg7MXGnCN70HDpUvAr1BijEWz8o0d0g@mail.gmail.com>
References: <CAOW+2ds9VP0FhKMY5cmdg7MXGnCN70HDpUvAr1BijEWz8o0d0g@mail.gmail.com>
From: Taylor Brandstetter <deadbeef@google.com>
Date: Fri, 11 Nov 2016 16:55:43 -0800
Message-ID: <CAK35n0Yzse44c5tC5DipT2-OPLEmwfGdPNo=d=6n+zUG9Ysmfw@mail.gmail.com>
To: Bernard Aboba <bernard.aboba@gmail.com>
Content-Type: multipart/alternative; boundary="001a113e5ef401a39b0541101178"
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/7D4ARr2-TqApLPbZS5QftemKHPw>
Cc: "rtcweb@ietf.org" <rtcweb@ietf.org>
Subject: Re: [rtcweb] JSEP: When the "current direction" changes
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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: Sat, 12 Nov 2016 00:55:48 -0000

I'd expect the new "currentDirection" attribute to represent the direction
in the last applied answer. So it would only change in the last step of the
two examples.

However, I don't think there's a 1:1 mapping between currentDirection and
"is sender sending/is receiver receiving". After a sendrecv or recvonly
offer is applied, we MUST be prepared to receive media, before an answer is
received. And I'd somewhat expect that after a recvonly or inactive offer
is applied, we should stop sending media (step 3 of example 1; Chrome
currently works this way). Though I can't find anything explicitly stating
this in RFC3264.

On Fri, Nov 11, 2016 at 3:13 PM, Bernard Aboba <bernard.aboba@gmail.com>
wrote:

> According to WebRTC 1.0 Section 5.4 (and JSEP Section 4.2.3)
> setDirection() does not take effect immediately:
>
> "The setDirection method sets the direction of the RTCRtpTransceiver.
> Calls to setDirection() do not take effect immediately. Instead, future
> calls to createOffer and createAnswer mark the corresponding media
> description as sendrecv, sendonly, recvonly or inactive as defined in
> [JSEP] (section 5.2.2. and section 5.3.2.). Calling setDirection() sets the
> negotiation-needed flag."
>
> My understanding is that setDirection immediately sets the
> transceiver.direction attribute, but that the "current direction" (distinct
> from the direction attribute) is only changed by calls to
> setLocal/setRemoteDescription.
>
> The question is when the "current direction" changes, and how this relates
> to the direction expressed in the currentLocalDescription and
> currentRemoteDescription.  Some concrete examples:
>
> Example 1
>
>    1. The direction provided in the currentLocalDescription (e.g. the
>    "current direction") is "sendrecv" and setDirection("recvonly") is called.
>    Since setDirection does not change currentLocalDescription, the RtpSender
>    does not stop sending, correct?
>    2. createOffer() is called. A "recvonly" offer is generated.
>    3. setLocalDescription(RecvOnlyOffer) is called. Now the direction in
>    pendingLocalDescription changes to "recvonly", but the direction in
>    currentLocalDescription is still "sendrecv".  The RtpSender still does not
>    stop sending, correct?
>    4. setRemoteDescription(SendOnlyAnswer) is called. Now the direction
>    in currentLocalDescription is "recvonly".  So, the RtpSender will now stop
>    sending, right?
>
>
> Example 2
>
>
>    1. The value of transceiver.direction is "sendrecv" and a "sendonly"
>    offer is received so that setRemoteDescription(SendOnlyOffer) is
>    called. Since this does not change currentLocalDescription (still
>    "sendrecv"), the RtpSender does not stop sending, correct?
>    2. createAnswer() is called.  A "recvonly" answer is generated.
>    RtpSender is still sending.
>    3. setLocalDescription(RecvOnlyAnswer) is called. Now the direction in
>    currentLocalDescription changes to "recvonly", so the RtpSender stops
>    sending, right?
>
>
> _______________________________________________
> rtcweb mailing list
> rtcweb@ietf.org
> https://www.ietf.org/mailman/listinfo/rtcweb
>
>