New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 619289 link

Starred by 7 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

[WebRTC] Promise-based createOffer() ignores "offerToReceiveAudio", "offerToReceiveVideo" options

Reported by georass...@gmail.com, Jun 11 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2764.0 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. var pc = new webkitRTCPeerConnection(null);
2. pc.createOffer({offerToReceiveAudio: 1, offerToReceiveVideo: 1}).then(offer =>  console.log(offer.sdp));
3. Examine the produced SDP offer.

What is the expected behavior?
The offer should contain m-lines. In the specific case, two: one for audio and one for video.

What went wrong?
The offer does not contain any m-lines.

Did this work before? N/A 

Chrome version: 53.0.2764.0  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 22.0 r0

This issue only appears when the new Promise-based createOffer() is used. The underline implementation seems to ignore both "offerToReceiveAudio" and "offerToReceiveVideo" options. The legacy createOffer() implementation instead, which uses success/error callbacks, works as expected.
 
Components: Blink>WebRTC
Labels: Te-NeedsFurtherTriage

Comment 3 by hta@chromium.org, Jun 13 2016

Yup, the old Dictionary-parsed-in-C++ calls supported these nonstandard (no-longer-standard) features, while the new IDL-based dictionary parser doesn't.

The fix is fairly trivial (mangle in https://codesearch.chromium.org/chromium/src/third_party/WebKit/Source/modules/mediastream/RTCOfferAnswerOptions.idl?dr=C&q=RTCOfferAnswerOptions.idl&sq=package:chromium&l=1) , the only question is how much pushback we get on adding non-standard options to the Web-exposed API.



Comment 4 by hta@chromium.org, Jun 13 2016

Cc: guidou@chromium.org
I know that these two options got deprecated in latest draft versions in favor of using addTransceiver(), but since it seems that the new API is not yet implemented in Chrome, doesn't it make sense to continue supporting them? At least, until the transition could be made without breaking any clients or losing functionality.

Comment 6 by guidou@chromium.org, Jun 13 2016

Cc: -guidou@chromium.org
Owner: guidou@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 8 by guidou@chromium.org, Jun 21 2016

Labels: Merge-Request-52
Labels: Needs-Feedback
guidou@, can this be tested manually so that we can verify it on Canary before the CL gets merged in to M52 branch ?

Comment 10 by fi...@appear.in, Jun 21 2016

#9: if this works then the output of 
  var pc = new webkitRTCPeerConnection(null);
  pc.createOffer({offerToReceiveAudio: 1})
  .then(function(offer) { console.log(offer.sdp); })
should be roughly identical to te output of
  var pc = new webkitRTCPeerConnection(null);
  pc.createOffer(function(offer) { console.log(offer.sdp); }, console.error, 
    {offerToReceiveAudio: 1});
in terms of length and presence of a line that starts with m=audio.

Comment 11 by tin...@google.com, Jun 22 2016

Labels: -Merge-Request-52 Merge-Approved-52 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M52 (branch: 2743)

Comment 12 by phistuck@gmail.com, Jun 22 2016

Perhaps the Promise based overloads should just be unshipped instead, until the rest of the API (only the parts that replace the offerToReceiveAudio and friends) is ready?

What does Firefox do?

Comment 13 by hta@chromium.org, Jun 22 2016

Firefox supports offerToReceive*.

Comment 14 by phistuck@gmail.com, Jun 22 2016

Sounds like the new old standard.
WebKit also supports offerToReceive* on the promise-based overloads.
https://trac.webkit.org/browser/trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.cpp?rev=202109

Comment 16 by phistuck@gmail.com, Jun 22 2016

Yes, I was just about to check WebKit. You saved me some time. :)
It also seems to support addTrasceiver.

I hardly believe offerToReceive* will ever go away, then.

Comment 17 by hta@chromium.org, Jun 22 2016

The spec issue about restoring these fields is here:

https://github.com/w3c/webrtc-pc/issues/709

Labels: -Needs-Feedback
#9: A sample page that runs fippo's proposed test is available at
https://guidou.github.io/createoffer1.html
Cc: ranjitkan@chromium.org
Labels: -Te-NeedsFurtherTriage TE-Verified-53.0.2777.0 TE-Verified-M53
Rechecked this on chrome canary version 53.0.2777.0 on Windows, MAC and Ubuntu 14.04. as per the comment#10, when executed both the scrips in dev console gave the same output as

m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126

Also executed the same test case as in comment#19, both promise based and call back based createoffer() method returned the same output:

m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126

Fix is working as intended. Adding TE-Verified labels.

Thanks.!
Project Member

Comment 21 by bugdroid1@chromium.org, Jun 24 2016

Labels: -merge-approved-52 merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e4c3ebd35922fee6573e921e629cb7faa251b91

commit 9e4c3ebd35922fee6573e921e629cb7faa251b91
Author: Guido Urdaneta <guidou@chromium.org>
Date: Fri Jun 24 11:14:58 2016

Support legacy offerToReceiveAudio/offerToReceiveVideo fields in RTCOfferOptions.

BUG= 619289 

Review-Url: https://codereview.chromium.org/2077323003
Cr-Commit-Position: refs/heads/master@{#400927}
(cherry picked from commit b0e609db70af6bab30628e7bf14ad6a8add1a40e)

Review URL: https://codereview.chromium.org/2097683003 .

Cr-Commit-Position: refs/branch-heads/2743@{#464}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/9e4c3ebd35922fee6573e921e629cb7faa251b91/components/test_runner/mock_webrtc_peer_connection_handler.cc
[modify] https://crrev.com/9e4c3ebd35922fee6573e921e629cb7faa251b91/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-expected.txt
[modify] https://crrev.com/9e4c3ebd35922fee6573e921e629cb7faa251b91/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer-promise.html
[modify] https://crrev.com/9e4c3ebd35922fee6573e921e629cb7faa251b91/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createOffer.html
[modify] https://crrev.com/9e4c3ebd35922fee6573e921e629cb7faa251b91/third_party/WebKit/Source/modules/mediastream/RTCOfferOptions.idl
[modify] https://crrev.com/9e4c3ebd35922fee6573e921e629cb7faa251b91/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment