PSA: Unified Plan Transition Guide for Mobile/Native

1,992 views
Skip to first unread message

Steve Anton

unread,
Oct 18, 2018, 7:22:48 PM10/18/18
to discuss...@googlegroups.com
Now that Chrome has announced Unified Plan experimentation with a migration guide for Web applications, we would also like to share a migration guide for native users of the WebRTC API who wish to use the standards-compliant SDP format "Unified Plan".


A few things to note:
- Most native PeerConnection APIs that are no longer in the standard (e.g., AddStream, CreateSender, etc.) will no longer work with Unified Plan mode enabled. We're being more aggressive deprecating these APIs in the native PeerConnections since users have more control over deployment.
- We're deprecating Plan B SDP and encourage switching to Unified Plan -- but we won't remove the Plan B code until Chrome removes support for it.
- We will now start sending discuss-webrtc PSAs for changes affected only the Unified Plan mode (no longer considered experimental).
- Most example applications in the WebRTC repository have been updated to utilize Unified Plan.

Feel free to reply to this thread with any questions about the native API changes for Unified Plan.

篠原俊一

unread,
Oct 21, 2018, 3:28:47 AM10/21/18
to discuss...@googlegroups.com
Hi Steve and the List,

First of all, thank you very much for the great effort from WebRTC team
and contributors.

After reading the "Migrating ..." doc, I have two questions.

1. OnRemoveTrack (or its equivalent) in Java API

I could not find OnRemoveTrack (or its equivalent) API exposed to Java
world as of commit f05cae3268 in master branch.

On the other hand, ios SDK has the exposed API implemented in
RTCPeerConnection.mm:

void PeerConnectionDelegateAdapter::OnRemoveTrack(
rtc::scoped_refptr<RtpReceiverInterface> receiver) {
RTCPeerConnection *peer_connection = peer_connection_;
if ([peer_connection.delegate
respondsToSelector:@selector(peerConnection:didRemoveReceiver:)]) {

2. OnTrack or OnAddTrack

The migration document mentions onTrack as "which is intended to
replace OnAddTrack."
Current implementation of OnAddTrack supplies media streams along with
the track itself,
but OnTrack does not. Can it be possible to group tracks from OnTrack
calls by MSID?

Thanks,
Shino
2018年10月19日(金) 8:22 Steve Anton <steve...@webrtc.org>:
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAKopfD_1TZKCN0PZWFKdjQ_B7S56%3DMdXUQV7zePZ2fyZJ_2LNA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

sham...@webrtc.org

unread,
Oct 26, 2018, 12:20:10 PM10/26/18
to discuss-webrtc
Hi Shino,

You're correct it looks like the Java PeerConnection API does not currently have OnRemoveTrack. We will add support for this soon and update this PSA when it has been added to the API.

For the native API you can get streams by using "transceiver->receiver()->streams()" with the transceiver from OnTrack. For the Java API unfortunately the receiver does not have a reference to the streams. You should be able to group the streams by MSID line, but note that the track ID will be removed from this SDP line as the track ID was broken due to various reasons (see issue here). You can use the mid (RtpTransceiver.getMid()) instead to map the track to the MSID line. I don't know why the RtpReceiver.java does not have streams. Maybe we can update this as well.

-Seth

篠原俊一

unread,
Oct 29, 2018, 1:47:39 AM10/29/18
to discuss...@googlegroups.com
Hi Seth,

Thank you very much for reply and clarification/workaround.
I hope OnRevemoTrack will be implemented in Java world soon :)

For the means to get streams, after reading the issue about track ID and
others referenced by it, I found the issue [1] that might be related.
Its description says:
1. Add RtpReceiverInterface::stream_ids().
2. Remove RtpReceiverInterface::streams().

Just out of curiosity, would you suggest which is the preferred way?

[1] https://bugs.chromium.org/p/webrtc/issues/detail?id=9480

Thanks,
Shino
2018年10月27日(土) 1:20 <sham...@webrtc.org>:
> To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/0d8cbaa3-151e-42ce-b729-c4e3043d99b2%40googlegroups.com.

hb...@webrtc.org

unread,
Oct 30, 2018, 6:50:26 AM10/30/18
to discuss-webrtc
I'm not sure we should implement OnRemoveTrack(), maybe OnTrackMuted() or rely on MediaStreamTrackInterface's ObserverInterface::OnChanged(). The spec way of doing things is listen on RTCPeerConnection.ontrack for tracks being added, and MediaStreamTrack.onmute for tracks being "removed". In Unified Plan remote tracks are never removed though, only muted. Subsequent "ontrack" could unmute it again; transceivers are reusable.

pps

unread,
May 25, 2019, 4:19:57 PM5/25/19
to discuss-webrtc
That doc is readonly and we cannot leave comment there.
Firs of all, it must be dated, otherwise I'm not even sure if it's 10 years old or 1 month old.
In c++ part I see that it has RTTConfiguration which seems like a typo, should have been RTCConfiguration

Ostap Maliuvanchyk

unread,
Oct 3, 2019, 8:30:11 AM10/3/19
to discuss-webrtc
What would happen if I use an older version native/mobile SDK with Plan B to have PeerConnection with Chrome that has Plan B removed?

Currently, I am using Plan B on mobile and Unifiedl Plan on Chrome and everything still works. I am using stream API in both cases.

Harald Alvestrand

unread,
Oct 3, 2019, 8:50:51 AM10/3/19
to discuss...@googlegroups.com
If Chrome were to disable Plan B, exactly the same thing would happen as if you currently try to connect with Firefox; it would work fine as long as you were only using one audio and one video track, and not work at all well otherwise.

We are watching the usage of Plan B, and won't remove it until usage has fallen enough that it's no longer considered significant.

(We still have > 2% of PeerConnections requesting Plan B semantics. That's far too much for removal.)



--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

emanuele bizzarri

unread,
Oct 3, 2019, 10:34:54 AM10/3/19
to discuss...@googlegroups.com
From where do you get these stats?
Thank you

PhistucK

unread,
Oct 3, 2019, 2:22:55 PM10/3/19
to WebRTC-discuss
Probably from the Chrome anonymous usage statistics (so probably no enterprises), not from the native API usage.

PhistucK


Reply all
Reply to author
Forward
0 new messages