Commit graph

76 commits

Author SHA1 Message Date
Steve Anton
3172c035d5 Implement OnRemoveTrack and OnRemoveStream for Unified Plan
Also parameterizes the PeerConnection RTP unit tests to test
Unified Plan also.

Bug: webrtc:8587
Change-Id: I7661d9f2ec4b3bce0d2e2979035fa02225e3f118
Reviewed-on: https://webrtc-review.googlesource.com/73284
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23157}
2018-05-07 20:51:28 +00:00
Niels Möller
0c4f7beb25 New api struct BitrateSettings.
Replaces both BitrateConstraintsMask and
PeerConnectionInterface::BitrateParameters. The latter is kept
temporarily for backwards compatibility.

Bug: None
Change-Id: Ibe1d043f2a76e56ff67809774e9c0f5e0ec9e00f
Reviewed-on: https://webrtc-review.googlesource.com/74020
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23148}
2018-05-07 15:01:28 +00:00
Benjamin Wright
6f7e6d6ff3 Created PeerConnectionDependencies to avoid creating new CreatePeerConnection overloads.
Currently CreatePeerConnection takes 3 parameters. This is going to expand to four with a new change. Every time a new parameter is added, we need to deprecate the old method, switch clients to the new one, update fake/mock classes and tests, and so on, which is a cumbersome process.

To address this, this CL introduces a PeerConnectionDependencies structure to encapsulate all mandatory and optional dependencies (where a dependency is defined as non trivial
executable code that an API user may want to provide to the native API). This allows adding a new injectable dependency by simply adding a new field to the struct, avoiding the hassle described above.

You may think we could use RTCConfiguration for this. But since RTCConfiguration is both passed in and out of the PeerConnection (using GetConfiguration/SetConfiguration), it can't carry unique_ptrs. And we don't want to inject dependencies via raw pointers, since this could lead to lifetime management bugs, where the dependency is deleted before the PeerConnection is done using it.

Bug: webrtc:7913
Change-Id: I38c3f4ce4f26b37e6fe219d1eeca271294b40db8
Reviewed-on: https://webrtc-review.googlesource.com/73663
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23084}
2018-05-02 21:43:47 +00:00
Steve Anton
97a58969ed Remove PeerConnectionInterface::UpdateIce
It is unused.

Bug: None
Change-Id: I368923299b28d7ec2f54ddd2b4ee5f69cb285b21
Reviewed-on: https://webrtc-review.googlesource.com/71963
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23006}
2018-04-24 16:15:51 +00:00
Steve Anton
3acffc3b16 Remove SdpSemantics::kDefault
This adds confusion to the native API and is only needed for
Chromium UMA metrics, so the appropriate metrics have been moved
upstream and kDefault option removed.

Bug: chromium:811683
Change-Id: I666d7f7793765b8d6edcd99416c8b6c957766f00
Reviewed-on: https://webrtc-review.googlesource.com/59261
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22864}
2018-04-13 17:03:08 +00:00
Seth Hampson
5b4f075f9c Reland "Reland "Adds support for multiple or no media stream ids.""
This is a reland of f351c3408a

Reland history:
The original CL broke tests in chromium which were manually tested in
the first reland. Another small fix was added to the reland to fix a
downstream bug, which caused separate tests to fail in chromium.
These were not caught because the chromium trybot was down. These
are temporarily disabled in chrome to allow this change to roll in.

Original change's description:
> Reland "Adds support for multiple or no media stream ids."
>
> This is a reland of 1550292efe
>
> Original change's description:
> > Adds support for multiple or no media stream ids.
> >
> > With Unified Plan SDP semantics, this adds support for specifying
> > either no media stream ids or multiple media stream ids for a
> > transceiver/sender/receiver. This includes serializing/deserializing
> > SDPs with multiple a=msid lines in a m section, or an "a=msid:-
> > <appdata>" line to indicate the no stream case. Note that this does
> > not synchronize between multiple streams, this is still just supported
> > based upon the first media stream id.
> >
> > Bug: webrtc:7932, webrtc:7933
> > Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
> > Reviewed-on: https://webrtc-review.googlesource.com/61341
> > Commit-Queue: Seth Hampson <shampson@webrtc.org>
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22611}
>
> Bug: webrtc:7932, webrtc:7933
> Change-Id: Ica272ac18088103e65cccf6b96a6d3ecccb178ed
> Reviewed-on: https://webrtc-review.googlesource.com/65560
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22687}

TBR=deadbeef@webrtc.org

Bug: webrtc:7932, webrtc:7933
Change-Id: Ideb30219b2f952dd51428cd4e8bd43ef49df5b17
Reviewed-on: https://webrtc-review.googlesource.com/66280
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22699}
2018-04-03 01:10:07 +00:00
Tomas Gunnarsson
191bf5c653 Revert "Reland "Adds support for multiple or no media stream ids.""
This reverts commit f351c3408a.

Reason for revert: Breaks chromium import

https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/58012

Failin tests:
WebRtcRtpBrowserTest.TrackAddedToSecondStream
WebRtcRtpBrowserTest.TrackSwitchingStream

Original change's description:
> Reland "Adds support for multiple or no media stream ids."
> 
> This is a reland of 1550292efe
> 
> Original change's description:
> > Adds support for multiple or no media stream ids.
> > 
> > With Unified Plan SDP semantics, this adds support for specifying
> > either no media stream ids or multiple media stream ids for a
> > transceiver/sender/receiver. This includes serializing/deserializing
> > SDPs with multiple a=msid lines in a m section, or an "a=msid:-
> > <appdata>" line to indicate the no stream case. Note that this does
> > not synchronize between multiple streams, this is still just supported
> > based upon the first media stream id.
> > 
> > Bug: webrtc:7932, webrtc:7933
> > Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
> > Reviewed-on: https://webrtc-review.googlesource.com/61341
> > Commit-Queue: Seth Hampson <shampson@webrtc.org>
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22611}
> 
> Bug: webrtc:7932, webrtc:7933
> Change-Id: Ica272ac18088103e65cccf6b96a6d3ecccb178ed
> Reviewed-on: https://webrtc-review.googlesource.com/65560
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22687}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,shampson@webrtc.org

Change-Id: I1835419f963762bc308a91d81c423d8e7bf65026
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7932, webrtc:7933
Reviewed-on: https://webrtc-review.googlesource.com/65700
Reviewed-by: Tomas Gunnarsson <tommi@chromium.org>
Commit-Queue: Tomas Gunnarsson <tommi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#22690}
2018-03-30 10:44:53 +00:00
Seth Hampson
f351c3408a Reland "Adds support for multiple or no media stream ids."
This is a reland of 1550292efe

Original change's description:
> Adds support for multiple or no media stream ids.
> 
> With Unified Plan SDP semantics, this adds support for specifying
> either no media stream ids or multiple media stream ids for a
> transceiver/sender/receiver. This includes serializing/deserializing
> SDPs with multiple a=msid lines in a m section, or an "a=msid:-
> <appdata>" line to indicate the no stream case. Note that this does
> not synchronize between multiple streams, this is still just supported
> based upon the first media stream id.
> 
> Bug: webrtc:7932, webrtc:7933
> Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
> Reviewed-on: https://webrtc-review.googlesource.com/61341
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22611}

Bug: webrtc:7932, webrtc:7933
Change-Id: Ica272ac18088103e65cccf6b96a6d3ecccb178ed
Reviewed-on: https://webrtc-review.googlesource.com/65560
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22687}
2018-03-30 01:33:48 +00:00
Emircan Uysaler
bc609eaab1 Revert "Adds support for multiple or no media stream ids."
This reverts commit 1550292efe.

Reason for revert: 

webkit_layout_tests:fast/peerconnection/RTCPeerConnection-sdpSemantics.html is broken, see below. WebRTC roll isn't going through because of it. This CL looks the most suspicious within the 5 in the range. 

https://chromium-review.googlesource.com/c/chromium/src/+/981899
https://webrtc.googlesource.com/src.git/+log/bb50ce5bb6d5..27f3bf512827
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/54616

Original change's description:
> Adds support for multiple or no media stream ids.
> 
> With Unified Plan SDP semantics, this adds support for specifying
> either no media stream ids or multiple media stream ids for a
> transceiver/sender/receiver. This includes serializing/deserializing
> SDPs with multiple a=msid lines in a m section, or an "a=msid:-
> <appdata>" line to indicate the no stream case. Note that this does
> not synchronize between multiple streams, this is still just supported
> based upon the first media stream id.
> 
> Bug: webrtc:7932, webrtc:7933
> Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
> Reviewed-on: https://webrtc-review.googlesource.com/61341
> Commit-Queue: Seth Hampson <shampson@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22611}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,shampson@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:7932, webrtc:7933
Change-Id: I1d4e4332b518ec32b305c8af07679650059d02bb
Reviewed-on: https://webrtc-review.googlesource.com/65000
Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22634}
2018-03-27 23:01:55 +00:00
Seth Hampson
1550292efe Adds support for multiple or no media stream ids.
With Unified Plan SDP semantics, this adds support for specifying
either no media stream ids or multiple media stream ids for a
transceiver/sender/receiver. This includes serializing/deserializing
SDPs with multiple a=msid lines in a m section, or an "a=msid:-
<appdata>" line to indicate the no stream case. Note that this does
not synchronize between multiple streams, this is still just supported
based upon the first media stream id.

Bug: webrtc:7932, webrtc:7933
Change-Id: Ib7433929af7b2925abe2824b485b360cec12f275
Reviewed-on: https://webrtc-review.googlesource.com/61341
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22611}
2018-03-26 21:21:50 +00:00
Henrik Boström
1df1bf8551 PeerConnectionInterface::GetStats() with selector argument added.
This exposes the stats selection algorithm[1] on the PeerConnection.

Per-spec, there are four flavors of getStats():
1. RTCPeerConnection.getStats().
2. RTCPeerConnection.getStats(MediaStreamTrack selector).
3. RTCRtpSender.getStats().
4. RTCRtpReceiver.getStats().

1) is the parameterless getStats() which is already shipped.
2) is the same as 3) and 4) except the track is used to look up the
corresponding sender/receiver to use as the selector.
3) and 4) perform stats collection with a filter, which is implemented
in RTCStatsCollector.GetStatsReport(selector).

For technical reasons, it is easier to place GetStats() on the
PeerConnection where the RTCStatsCollector lives than to place it on the
sender/receiver. Passing the selector as an argument or as a "this"
makes little difference other than style. Wiring Chrome up such that the
JavaScript APIs is like the spec is trivial after GetStats() is added to
PeerConnectionInterface.

This CL also adds comments documenting our intent to deprecate and
remove the legacy GetStats() APIs some time in the future.

[1] https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm

Bug: chromium:680172
Change-Id: I09316ba6f20b25d4f9c11785d0a1a1262d6062a1
Reviewed-on: https://webrtc-review.googlesource.com/62900
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22602}
2018-03-26 12:08:20 +00:00
Sami Kalliomäki
96114428bd Remove unneeded migration helper.
The migration has completed and this is no longer needed.

Bug: None
Change-Id: I2ef262e78cad618e9bb664baa239d446fe8bd69d
Reviewed-on: https://webrtc-review.googlesource.com/63320
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22524}
2018-03-21 08:20:08 +00:00
Qingsi Wang
22e623ad68 Add configurable threshold for writability state update.
Add configurable parameters in RTCConfiguration with the default value
given by the constants CONNECTION_WRITE_CONNECT_TIME and
CONNECTION_WRITE_CONNECT_FAILURES in the ICE implementation. These two
parameters define the time period for which a candidate pair must wait
for ping response and the minimum number of connectivity checks that
the pair must send without response before its state becomes unreliable
from writable as defined in the current ICE implementation.

Bug: webrtc:8988
Change-Id: I484599b7d776489a87741ffea8926df766095da9
Reviewed-on: https://webrtc-review.googlesource.com/60704
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22411}
2018-03-13 18:54:03 +00:00
Qingsi Wang
e6826d2461 Add configurable connectivity check intervals.
The connectivity check intervals for candidate pairs with strong and
weak connectivity are currently constants in the ICE implementation. A
set of suboptimal value of these constants for a given application may
result in undesirable behavior including excessive network switching
latency. This CL adds these intervals to RTCConfiguration that is
available to applications to configure, while maintaining the original
constants as their default value for compatibility with existing
applications.

Bug: webrtc:8988
Change-Id: I804b0f4cf7881be7d3c8aec2776bc9596de72482
Reviewed-on: https://webrtc-review.googlesource.com/60585
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22351}
2018-03-09 08:09:43 +00:00
Seth Hampson
845e87877e Name change from stream label to stream id for spec compliance.
Bug: webrtc:7932
Change-Id: I66f33597342394083256f050cac2a00a68042302
Reviewed-on: https://webrtc-review.googlesource.com/59280
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22276}
2018-03-02 20:44:48 +00:00
Steve Anton
ab6ea6b7b1 Miscellaneous updates to PeerConnectionInterface comments
NoTry: true
Bug: None
Change-Id: I9cf4f77e4775ff9b97c71f6a9bdb2d7f159e7048
Reviewed-on: https://webrtc-review.googlesource.com/57240
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22192}
2018-02-26 22:27:52 +00:00
Qingsi Wang
db53f8e604 Add configurable STUN binding request interval.
STUN candidates use STUN binding requests to keep NAT bindings open. The
interval at which the STUN keepalive pings are sent is configurable now
via RTCConfiguration.

TBR=sakal@webrtc.org

Bug: None
Change-Id: I5f99ea3fe1e9042fa2bf7dcab0aace78f57739e6
Reviewed-on: https://webrtc-review.googlesource.com/54180
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22109}
2018-02-20 23:32:46 +00:00
Ying Wang
0dd1b0a4b2 Revert "Revert "Enables PeerConnectionFactory using external fec controller""
This reverts commit 00733015fa.

Reason for revert: The reason for a downstream test failure on the original commit and a workaround has been found. Solution is to keep a PeerConnectionFactory constructor implementation as the same as before.

Original change's description:
> Revert "Enables PeerConnectionFactory using external fec controller"
>
> This reverts commit 4f07bdb255.
>
> Reason for revert: Speculatively reverting, because downstream test is now hitting "PeerConnectionFactory.initialize was not called before creating a PeerConnectionFactory" error, even though it did call initialize. I don't see how any change in this CL could cause that, but it's the only CL on the blamelist, and it does modify PeerConnectionFactory.java
>
> Original change's description:
> > Enables PeerConnectionFactory using external fec controller
> >
> > Bug: webrtc:8799
> > Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
> > Reviewed-on: https://webrtc-review.googlesource.com/43961
> > Commit-Queue: Ying Wang <yinwa@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22038}
>
> TBR=sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org
>
> Change-Id: I95868c35d6f9973e0ebf563814cd71d0fcbd433d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8799
> Reviewed-on: https://webrtc-review.googlesource.com/54080
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22040}

TBR=deadbeef@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org

Bug: webrtc:8799
Change-Id: If9f3292bfcc739782967530c49f006d0abbc38a8
Reviewed-on: https://webrtc-review.googlesource.com/55400
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22100}
2018-02-20 12:41:55 +00:00
Steve Anton
8b815cddca Add OnTrack PeerConnection callback for Unified Plan
This adds a callback corresponding to the ontrack event as defined
in the WebRTC specification.

Bug: webrtc:7600
Change-Id: Ied8c55e11dcea864428fb194623c1595c21657c7
Reviewed-on: https://webrtc-review.googlesource.com/52660
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22066}
2018-02-17 01:03:59 +00:00
Steve Anton
c49bcd9911 Fire OnAddStream with Unified Plan
Bug: webrtc:7600
Change-Id: Ic4e5560fdeb9848c65c59e0f45ca3a2a4a22a2ad
Reviewed-on: https://webrtc-review.googlesource.com/53401
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22042}
2018-02-16 01:19:15 +00:00
Taylor Brandstetter
00733015fa Revert "Enables PeerConnectionFactory using external fec controller"
This reverts commit 4f07bdb255.

Reason for revert: Speculatively reverting, because downstream test is now hitting "PeerConnectionFactory.initialize was not called before creating a PeerConnectionFactory" error, even though it did call initialize. I don't see how any change in this CL could cause that, but it's the only CL on the blamelist, and it does modify PeerConnectionFactory.java

Original change's description:
> Enables PeerConnectionFactory using external fec controller
> 
> Bug: webrtc:8799
> Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
> Reviewed-on: https://webrtc-review.googlesource.com/43961
> Commit-Queue: Ying Wang <yinwa@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22038}

TBR=sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,yinwa@webrtc.org

Change-Id: I95868c35d6f9973e0ebf563814cd71d0fcbd433d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8799
Reviewed-on: https://webrtc-review.googlesource.com/54080
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22040}
2018-02-15 20:07:24 +00:00
Ying Wang
4f07bdb255 Enables PeerConnectionFactory using external fec controller
Bug: webrtc:8799
Change-Id: Ieb2cf6163b9a83844ab9ed4822b4a7f1db4c24b8
Reviewed-on: https://webrtc-review.googlesource.com/43961
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22038}
2018-02-15 16:58:26 +00:00
Niels Möller
8366e177e7 Rename Call::Config to CallConfig, keep old name as alias.
We want api/peerconnectioninterface.h (and corresponding build target)
to not depend on call.h, and generally we treat Call as an internal,
non-api, class. But we need CallFactoryInterface in the api in order to
enable use of PeerConnection with or without support for media.

Making CallConfig a top-level class makes it possible to forward declare
it, together with Call, for use in callfactoryinterface.h and
peerconnectioninterface.h.

Delete the peerconnection_and_implicit_call_api target, replaced by
new target callfactory_api, to link between Call and Peerconnection.

Bug: webrtc:7504
Change-Id: I5e3978ef89bcd6705e94536f8676bcf89fc82fe1
Reviewed-on: https://webrtc-review.googlesource.com/46201
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22020}
2018-02-14 15:14:39 +00:00
Niels Möller
d377f04194 Move AudioFrame to its own header file and target in api/.
This breaks the dependency api:audio_mixer_api --> modules:module_api,
and allows peerconnectioninterface.h to include audio_mixer.h, without
introducing a dependency cycle.

In addition, un-inline all AudioFrame methods, moving implementations
to audio_frame.cc, and replace assert by RTC_CHECK_*.

Bug: webrtc:7504
Change-Id: I11e3d3d22716e9b98976bf830103fbb06e7bbb77
Reviewed-on: https://webrtc-review.googlesource.com/51860
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22016}
2018-02-14 11:01:53 +00:00
Daniel Lazarenko
2870b0a57e Expose a link-local network interfaces enumeration option
The bug 8432 is caused by trying to connect through a
"link-local" interface (IP address 169.254.0.x/16),
which is listed among the iPhone network interfaces.
The bug is not happening if the link-local network interfaces
are skipped in the ICE candidate gethering process.

To control this behaviour an option - disable_link_local_networks -
is added inside the RTCConfiguration.
It is used to set the new BasicPortAllocatorSession flag -
PORTALLOCATOR_DISABLE_LINK_LOCAL_NETWORKS.
The port allocator flag is added if the configuration option is set.

IPIsLinkLocal IPAddress function and its friends (IPIsLoopback, IPIsPrivate)
are refactored to work on both IPv4 and IPv6.
Unit test IPIsLinkLocal.

Bonus: fix a bug in IPIsLinkLocalV6:
take into account just 10 network mask bits instead of 16.

Bug: webrtc:8432
Change-Id: Ibe8f677a36098057b7fcad5c798380727b23359b
Reviewed-on: https://webrtc-review.googlesource.com/36380
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21922}
2018-02-06 19:12:04 +00:00
Qingsi Wang
9a5c6f8f3f Add the network preference to RTCConfiguration.
The network preference is added to RTCConfiguration and passed to ICE.
ICE considers now the preference set by applications over network
interface types when making decisions in candidate pair switching.

Bug: webrtc:8816
Change-Id: I40d2612705b54c83dd45772ac855808e0a76b1e1
Reviewed-on: https://webrtc-review.googlesource.com/44020
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21855}
2018-02-01 19:32:21 +00:00
Niels Möller
6daa278156 Move MediaConfig to its own header file and target.
To eliminate circular dependencies, we need to eliminate the include
of media/base/mediachannel.h from api/peerconnectioninterface.h.

MediaConfig is one of the types the PeerConnection api depends on,
since it's part of PeerConnectionInterface::RTCConfiguration. It's
formally a public member, but the intention is that applications should use
accessor mehtods on RTCConfiguration and never access the contents of
MediaConfig directly.

Bug: webrtc:7504
Change-Id: Idfab6f69132d6b90d1628fa4543a393e22db79ac
Reviewed-on: https://webrtc-review.googlesource.com/41260
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21731}
2018-01-23 11:02:16 +00:00
Niels Möller
1d7ecd29c7 Rename a few MediaConfig::Video flags for consistency.
enable_cpu_overuse_detection --> enable_cpu_adaptation
  disable_prerenderer_smoothing --> enable_prerenderer_smoothing

where the latter also gets opposite meaning.

Bug: none
Change-Id: Ic10de0871a87e86a899aefa72ecb7e46fcdeaa65
Reviewed-on: https://webrtc-review.googlesource.com/40280
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21726}
2018-01-22 17:32:58 +00:00
Niels Möller
a6fe261b97 Move AudioOptions to its own header file and target.
It is part of our api.

With the intention to later delete the inclusion of mediachannel.h from
api/peerconnectioninterface.h, and eliminate circular dependencies.

Bug: webrtc:7504
Change-Id: If44efd14d85675530e457760a1c4a1d338f931b7
Reviewed-on: https://webrtc-review.googlesource.com/41281
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21694}
2018-01-19 13:00:32 +00:00
Taylor Brandstetter
215fda713e Make PeerConnection take reference to UMA observer.
It's reference counted, yet we aren't taking a reference to it for some
reason. This could be causing it to be dereferenced after deletion in
some cases in chromium.

Bug: chromium:798251
Change-Id: I0b91451e38ed611d2ea8a477f1e7db482a790f79
Reviewed-on: https://webrtc-review.googlesource.com/37283
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21684}
2018-01-18 20:07:58 +00:00
Niels Möller
6539f69746 Add VideoSendStream::Config::EncoderSettings::experiment_cpu_load_estimator.
And wire it up to methods on RTCConfiguration, via MediaConfig::Video.

Bug: webrtc:8504
Change-Id: I30805ee20c11d1d2fe552eb81f16d514db0ba4a8
Reviewed-on: https://webrtc-review.googlesource.com/39786
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21670}
2018-01-18 10:42:07 +00:00
Steve Anton
772eb2115a Make OnAddStream and OnRemoveStream not required
This changes PeerConnectionObserver to not default the stream
events as pure virtual. Applications which have switched to using
OnAddTrack and OnRemoveTrack will no longer need to implement
these callbacks.

Bug: webrtc:8587
Change-Id: I659ce7b5a208ebfcb29e899dd17916ae0072d3cc
Reviewed-on: https://webrtc-review.googlesource.com/39384
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21665}
2018-01-18 01:31:37 +00:00
Sami Kalliomäki
02879f9990 Reland "Make freeNativePeerConnectionObserver generic."
This is a reland of 046f78cae6
Original change's description:
> Make freeNativePeerConnectionObserver generic.
> 
> Previously, it was only possible to free PeerConnectionObserverJni
> objects using this method. Now it is generic and can free any
> PeerConnectionObserver.
> 
> Bug: webrtc:8662
> Change-Id: I619ca5ed88a0c2553fa6d19ce41e510947d5bd44
> Reviewed-on: https://webrtc-review.googlesource.com/35222
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21411}

Bug: webrtc:8662
Change-Id: Iba64d613f7b434260a0d7b762ca67d49b295a84f
Reviewed-on: https://webrtc-review.googlesource.com/38901
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21587}
2018-01-11 15:26:11 +00:00
Steve Anton
2d6c76aa39 Switch to using AddTrack with stream labels
Bug: webrtc:8587
Change-Id: I8d4a3a225e6f6a6ae59def972ecae3255c0f2bda
Reviewed-on: https://webrtc-review.googlesource.com/37547
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21509}
2018-01-06 02:01:39 +00:00
Harald Alvestrand
8906187c86 Pivot generation of stats to iterate senders/receivers
This will allow stats to be generated when AddTrack() is used.
It also exposes a ClearStatsCache() call on the PC to allow enforcement
of cache lifetime restrictions.

Bug: webrtc:8616
Change-Id: If47b967ce9e40fa768303e6f5f54fe74db2cc7a4
Reviewed-on: https://webrtc-review.googlesource.com/34360
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21468}
2018-01-02 13:36:01 +00:00
Sami Kalliomäki
b96d62dbf2 Revert "Make freeNativePeerConnectionObserver generic."
This reverts commit 046f78cae6.

Reason for revert: Breaks chromium.webrtc.fyi tree

Original change's description:
> Make freeNativePeerConnectionObserver generic.
> 
> Previously, it was only possible to free PeerConnectionObserverJni
> objects using this method. Now it is generic and can free any
> PeerConnectionObserver.
> 
> Bug: webrtc:8662
> Change-Id: I619ca5ed88a0c2553fa6d19ce41e510947d5bd44
> Reviewed-on: https://webrtc-review.googlesource.com/35222
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21411}

TBR=magjed@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org

Change-Id: I4490945ca3d9a25d5ed5795bc7954dc1044bdd22
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8662
Reviewed-on: https://webrtc-review.googlesource.com/35781
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21413}
2017-12-21 13:09:01 +00:00
Sami Kalliomäki
046f78cae6 Make freeNativePeerConnectionObserver generic.
Previously, it was only possible to free PeerConnectionObserverJni
objects using this method. Now it is generic and can free any
PeerConnectionObserver.

Bug: webrtc:8662
Change-Id: I619ca5ed88a0c2553fa6d19ce41e510947d5bd44
Reviewed-on: https://webrtc-review.googlesource.com/35222
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21411}
2017-12-21 12:36:20 +00:00
Steve Anton
f9381f0e73 Implement PeerConnection::AddTrack/RemoveTrack for Unified Plan
Bug: webrtc:7600
Change-Id: I2a48426a29ac67b6bdbd7817fe07273cdd5fd980
Reviewed-on: https://webrtc-review.googlesource.com/31647
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21305}
2017-12-15 18:54:37 +00:00
Steve Anton
9158ef6575 Reland "Add AddTransceiver and GetTransceivers to PeerConnection"
This reverts commit 8b13f96e2d.

Original change's description:
> Revert "Add AddTransceiver and GetTransceivers to PeerConnection"
> 
> This reverts commit f93d2800d9.
> 
> Reason for revert: https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.webrtc.fyi%2Fios-device%2F5804%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout
> 
> Original change's description:
> > Add AddTransceiver and GetTransceivers to PeerConnection
> > 
> > WebRTC 1.0 has added the transceiver API to PeerConnection. This
> > is the first step towards exposing this to WebRTC consumers. For
> > now, transceivers can be added and fetched but there is not yet
> > support for creating offers/answers or setting local/remote
> > descriptions. That support ("Unified Plan") will be added in
> > follow-up CLs.
> > 
> > The transceiver API is currently only available if the application
> > opts in by specifying the kUnifiedPlan SDP semantics when creating
> > the PeerConnection.
> > 
> > Bug: webrtc:7600
> > Change-Id: I0b8ee24b489b45bb4c5f60b699bd20c61af01d8e
> > Reviewed-on: https://webrtc-review.googlesource.com/23880
> > Commit-Queue: Steve Anton <steveanton@webrtc.org>
> > Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#20896}
> 
> TBR=steveanton@webrtc.org,zhihuang@webrtc.org,hbos@webrtc.org,pthatcher@webrtc.org
> 
> Change-Id: Ie91ea4988dba25c20e2532114d3a9d859a932d4c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:7600
> Reviewed-on: https://webrtc-review.googlesource.com/26400
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20897}

TBR=steveanton@webrtc.org,zhihuang@webrtc.org,hbos@webrtc.org,pthatcher@webrtc.org

Change-Id: I19fdf08c54f09302794e998a0ffddb82ae0d7b41
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7600
Reviewed-on: https://webrtc-review.googlesource.com/26401
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20898}
2017-11-27 22:27:49 +00:00
Steve Anton
8b13f96e2d Revert "Add AddTransceiver and GetTransceivers to PeerConnection"
This reverts commit f93d2800d9.

Reason for revert: https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.webrtc.fyi%2Fios-device%2F5804%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout

Original change's description:
> Add AddTransceiver and GetTransceivers to PeerConnection
> 
> WebRTC 1.0 has added the transceiver API to PeerConnection. This
> is the first step towards exposing this to WebRTC consumers. For
> now, transceivers can be added and fetched but there is not yet
> support for creating offers/answers or setting local/remote
> descriptions. That support ("Unified Plan") will be added in
> follow-up CLs.
> 
> The transceiver API is currently only available if the application
> opts in by specifying the kUnifiedPlan SDP semantics when creating
> the PeerConnection.
> 
> Bug: webrtc:7600
> Change-Id: I0b8ee24b489b45bb4c5f60b699bd20c61af01d8e
> Reviewed-on: https://webrtc-review.googlesource.com/23880
> Commit-Queue: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20896}

TBR=steveanton@webrtc.org,zhihuang@webrtc.org,hbos@webrtc.org,pthatcher@webrtc.org

Change-Id: Ie91ea4988dba25c20e2532114d3a9d859a932d4c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7600
Reviewed-on: https://webrtc-review.googlesource.com/26400
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20897}
2017-11-27 20:56:00 +00:00
Steve Anton
f93d2800d9 Add AddTransceiver and GetTransceivers to PeerConnection
WebRTC 1.0 has added the transceiver API to PeerConnection. This
is the first step towards exposing this to WebRTC consumers. For
now, transceivers can be added and fetched but there is not yet
support for creating offers/answers or setting local/remote
descriptions. That support ("Unified Plan") will be added in
follow-up CLs.

The transceiver API is currently only available if the application
opts in by specifying the kUnifiedPlan SDP semantics when creating
the PeerConnection.

Bug: webrtc:7600
Change-Id: I0b8ee24b489b45bb4c5f60b699bd20c61af01d8e
Reviewed-on: https://webrtc-review.googlesource.com/23880
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20896}
2017-11-27 20:35:35 +00:00
Henrik Boström
07109657a5 Old SetRemoteDescription signature default implementation.
So that third party projects don't still have to implement it when they
switch over to the new signature.

Bug: webrtc:8473
Change-Id: I329814ad6e899def7bad97939e8643380a268f91
Reviewed-on: https://webrtc-review.googlesource.com/26022
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20885}
2017-11-27 10:25:42 +00:00
Henrik Boström
316386747a Reland "SetRemoteDescriptionObserverInterface added."
Description for changes from the original CL:

Calling legacy SRD, implemented using
SetRemoteDescriptionObserverAdapter wrapping the old observer, was
meant to have the exact same behavior as the legacy SRD implementation
which invokes the callbacks in a Post.

However, in the CL that landed and got reverted (PS1), the Adapter had
its own message handler, and callbacks would be invoked even if the PC
was destroyed.

In PS2 I've changed the Adapter to use the PeerConnection's message
handler. If the PC is destroyed, the callback will not be invoked.
This gives identical behavior to before this CL, and the legacy
behavior is covered by a new unittest.

I changed the adapter to be an implementation detail of
peerconnection.cc, therefor some stuff was moved, and the only tests
covering this is now in peerconnection_rtp_unittest.cc.

This is a reland of 6c7ec32bd6
Original change's description:
> SetRemoteDescriptionObserverInterface added.
>
> The new observer replaced SetSessionDescriptionObserver for
> SetRemoteDescription. Unlike SetSessionDescriptionObserver,
> SetRemoteDescriptionObserverInterface is invoked synchronously so
> that the you can rely on the state of the PeerConnection to represent
> the result of the SetRemoteDescription call in the callback.
>
> The new observer succeeds or fails with an RTCError.
>
> This deprecates the need for PeerConnectionObserver::OnAdd/RemoveTrack
> and SetSessionDescriptionObserver, with the benefit that all media
> object changes can be processed in a single callback by the application
> in a synchronous callback. This will help Chromium keep objects in-sync
> across layers and threads in a non-racy and straight-forward way, see
> design doc (Proposal 2):
> https://docs.google.com/a/google.com/document/d/1-cDDC82mgU5zrHacfFz720p3xwRtuBkOPSRchh07Ho0/edit?usp=sharing
>
> An adapter for SetSessionDescriptionObserver is added to allow calling
> the old SetRemoteDescription signature and get the old behavior
> (OnSuccess/OnFailure callback in a Post) until third parties switch.
>
> Bug: webrtc:8473
> Change-Id: I3d4eb60da6dd34615f2c9f384aeaf4634e648c99
> Reviewed-on: https://webrtc-review.googlesource.com/17523
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20841}

TBR=pthatcher@webrtc.org

Bug: webrtc:8473
Change-Id: If2b1a1929663b0e77fcc9c2ebeef043e6f73adf5
Reviewed-on: https://webrtc-review.googlesource.com/25640
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20854}
2017-11-23 19:59:48 +00:00
Henrik Boström
a4ecf5571e Revert "SetRemoteDescriptionObserverInterface added."
This reverts commit 6c7ec32bd6.

Reason for revert: Third party project breaks due to use-after-free
in the callback. I suspect this is because the adapter is processing
the async callback instead of the pc, i.e. callback is called from
SetRemoteDescriptionObserverAdapter::OnMessage instead of from
PeerConnection::OnMessage. This makes it possible for the callback to
be invoked after the PC is destroyed.

I argue this is how it should be done, and that if you're using a raw
pointer in an async callback you're doing it wrong, but I will reland
this CL with the callback processed in PeerConnection::OnMessage
instead as to not change the behavior of the old SRD signature.

Original change's description:
> SetRemoteDescriptionObserverInterface added.
> 
> The new observer replaced SetSessionDescriptionObserver for
> SetRemoteDescription. Unlike SetSessionDescriptionObserver,
> SetRemoteDescriptionObserverInterface is invoked synchronously so
> that the you can rely on the state of the PeerConnection to represent
> the result of the SetRemoteDescription call in the callback.
> 
> The new observer succeeds or fails with an RTCError.
> 
> This deprecates the need for PeerConnectionObserver::OnAdd/RemoveTrack
> and SetSessionDescriptionObserver, with the benefit that all media
> object changes can be processed in a single callback by the application
> in a synchronous callback. This will help Chromium keep objects in-sync
> across layers and threads in a non-racy and straight-forward way, see
> design doc (Proposal 2):
> https://docs.google.com/a/google.com/document/d/1-cDDC82mgU5zrHacfFz720p3xwRtuBkOPSRchh07Ho0/edit?usp=sharing
> 
> An adapter for SetSessionDescriptionObserver is added to allow calling
> the old SetRemoteDescription signature and get the old behavior
> (OnSuccess/OnFailure callback in a Post) until third parties switch.
> 
> Bug: webrtc:8473
> Change-Id: I3d4eb60da6dd34615f2c9f384aeaf4634e648c99
> Reviewed-on: https://webrtc-review.googlesource.com/17523
> Commit-Queue: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20841}

TBR=hbos@webrtc.org,hta@webrtc.org,pthatcher@webrtc.org,guidou@webrtc.org

Change-Id: I715555e084d9aae49ee2a8831c70dc006dbdb74c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8473
Reviewed-on: https://webrtc-review.googlesource.com/25580
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20850}
2017-11-23 14:17:19 +00:00
Henrik Boström
6c7ec32bd6 SetRemoteDescriptionObserverInterface added.
The new observer replaced SetSessionDescriptionObserver for
SetRemoteDescription. Unlike SetSessionDescriptionObserver,
SetRemoteDescriptionObserverInterface is invoked synchronously so
that the you can rely on the state of the PeerConnection to represent
the result of the SetRemoteDescription call in the callback.

The new observer succeeds or fails with an RTCError.

This deprecates the need for PeerConnectionObserver::OnAdd/RemoveTrack
and SetSessionDescriptionObserver, with the benefit that all media
object changes can be processed in a single callback by the application
in a synchronous callback. This will help Chromium keep objects in-sync
across layers and threads in a non-racy and straight-forward way, see
design doc (Proposal 2):
https://docs.google.com/a/google.com/document/d/1-cDDC82mgU5zrHacfFz720p3xwRtuBkOPSRchh07Ho0/edit?usp=sharing

An adapter for SetSessionDescriptionObserver is added to allow calling
the old SetRemoteDescription signature and get the old behavior
(OnSuccess/OnFailure callback in a Post) until third parties switch.

Bug: webrtc:8473
Change-Id: I3d4eb60da6dd34615f2c9f384aeaf4634e648c99
Reviewed-on: https://webrtc-review.googlesource.com/17523
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20841}
2017-11-22 19:30:34 +00:00
Bjorn Terelius
de939432dc Revert "Revert "Encode log events periodically instead of for every event.""
This reverts commit 33c5c7f5e4.

Reason for revert: Fix broken API change.

TBR=sprang@webrtc.org,solenberg@webrtc.org
TBRing because only pc/ and api/ have changed since last LGTMed version.

Original change's description:
> Revert "Encode log events periodically instead of for every event."
>
> This reverts commit b154c27e72.
>
> Reason for revert: Broke the internal project.
>
> Original change's description:
> > Encode log events periodically instead of for every event.
> >
> > Updated unit test to take output_period and random seed as parameters.
> > Updated the peerconnection interface to allow passing in an output_period.
> >
> > This is in preparation of some upcoming CLs that will change the format
> > to store batches of delta-encoded values.
> >
> >
> > Bug: webrtc:8111
> > Change-Id: Id5d9844dfad8d8edad346cd7cbebc7eadaaa5416
> > Reviewed-on: https://webrtc-review.googlesource.com/22600
> > Commit-Queue: Björn Terelius <terelius@webrtc.org>
> > Reviewed-by: Elad Alon <eladalon@webrtc.org>
> > Reviewed-by: Tommi <tommi@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#20736}
>
> Change-Id: I2257c46c014adb8c7c4fb28538635cabed1f2229
> Bug: webrtc:8111
> Reviewed-on: https://webrtc-review.googlesource.com/24160
> Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20738}

Bug: webrtc:8111
Change-Id: Ie69862cd52d11c1e15adeb6e2caacafe16863c80
Reviewed-on: https://webrtc-review.googlesource.com/24620
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20811}
2017-11-21 10:58:57 +00:00
Steve Anton
79e7960152 Add SDP semantics option to RTCConfiguration
This setting allows the user of PeerConnection to choose whether
to use Plan B (current) or Unified Plan (future) semantics.
Unified Plan semantics are not yet supported.

Bug: chromium:465349
Change-Id: I77a5c376c83f335f734488e11e619582a314bffe
Reviewed-on: https://webrtc-review.googlesource.com/22766
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20806}
2017-11-21 02:09:03 +00:00
Zhi Huang
33c5c7f5e4 Revert "Encode log events periodically instead of for every event."
This reverts commit b154c27e72.

Reason for revert: Broke the internal project.

Original change's description:
> Encode log events periodically instead of for every event.
> 
> Updated unit test to take output_period and random seed as parameters.
> Updated the peerconnection interface to allow passing in an output_period.
> 
> This is in preparation of some upcoming CLs that will change the format
> to store batches of delta-encoded values.
> 
> 
> Bug: webrtc:8111
> Change-Id: Id5d9844dfad8d8edad346cd7cbebc7eadaaa5416
> Reviewed-on: https://webrtc-review.googlesource.com/22600
> Commit-Queue: Björn Terelius <terelius@webrtc.org>
> Reviewed-by: Elad Alon <eladalon@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20736}

TBR=solenberg@webrtc.org,eladalon@webrtc.org,terelius@webrtc.org,tommi@webrtc.org,sprang@webrtc.org,pthatcher@webrtc.org

Change-Id: I2257c46c014adb8c7c4fb28538635cabed1f2229
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8111
Reviewed-on: https://webrtc-review.googlesource.com/24160
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20738}
2017-11-17 21:02:02 +00:00
Bjorn Terelius
b154c27e72 Encode log events periodically instead of for every event.
Updated unit test to take output_period and random seed as parameters.
Updated the peerconnection interface to allow passing in an output_period.

This is in preparation of some upcoming CLs that will change the format
to store batches of delta-encoded values.


Bug: webrtc:8111
Change-Id: Id5d9844dfad8d8edad346cd7cbebc7eadaaa5416
Reviewed-on: https://webrtc-review.googlesource.com/22600
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20736}
2017-11-17 19:15:11 +00:00
Karl Wiberg
32df86ee0e Remove deprecated CreatePeerConnectionFactory() overloads
We need to get rid of the ones that don't take audio codec factory
arguments in order to eliminate the dependency on audio codec
implementations.

BUG=webrtc:8396

Change-Id: Id0c1c3b70c2b3479da81ba1056cc69e857e454bd
Reviewed-on: https://webrtc-review.googlesource.com/12281
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20555}
2017-11-03 10:16:22 +00:00