Commit graph

213 commits

Author SHA1 Message Date
Niels Möller
16e27a1dc5 Reland "Delete leftover includes and declarations for MediaConstraintsInterface"
Original cl: https://webrtc-review.googlesource.com/95721

Bug: webrtc:9239
Change-Id: I7eac85839182bbcecd0d9bd71ae26f6a1c516df4
Reviewed-on: https://webrtc-review.googlesource.com/96401
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24529}
2018-09-03 09:00:01 +00:00
Steve Anton
bb19276a32 Use AsyncInvoker in PeerConnection instead of MessageHandler
Bug: webrtc:9702
Change-Id: I89d66d1165a096601aed37b8febad60620073899
Reviewed-on: https://webrtc-review.googlesource.com/97180
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24515}
2018-08-31 20:10:30 +00:00
Niels Moller
ec4a060a55 Revert "Delete leftover includes and declarations for MediaConstraintsInterface"
This reverts commit a1e4ae2371.

Reason for revert: Breakage in downstream code still using constraints.

Original change's description:
> Delete leftover includes and declarations for MediaConstraintsInterface
> 
> Bug: webrtc:9239
> Change-Id: I1f49d6847572faecd6022a44222d6271302fe443
> Reviewed-on: https://webrtc-review.googlesource.com/95721
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24442}

TBR=kwiberg@webrtc.org,nisse@webrtc.org,hta@webrtc.org

Change-Id: Idbef4c57a0d3b82e94a431c5407a86c9fcd4be41
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9239
Reviewed-on: https://webrtc-review.googlesource.com/96160
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24444}
2018-08-27 11:26:42 +00:00
Niels Möller
a1e4ae2371 Delete leftover includes and declarations for MediaConstraintsInterface
Bug: webrtc:9239
Change-Id: I1f49d6847572faecd6022a44222d6271302fe443
Reviewed-on: https://webrtc-review.googlesource.com/95721
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24442}
2018-08-27 10:41:57 +00:00
Jonas Oreland
fc1acd2364 Add support for enabling simulcast in "Plan B" using MediaConstraints.
BUG=webrtc:9655

Change-Id: Ieb5fe5d97b6d4381608a51593bca5423979d1b9f
Reviewed-on: https://webrtc-review.googlesource.com/95481
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24424}
2018-08-24 09:55:59 +00:00
Niels Möller
f06f923ef0 Delete almost all use of MediaConstraintsInterface in the PeerConnection API
Bug: webrtc:9239
Change-Id: I04f4370f624346bf72c7e4e090b57987b558213b
Reviewed-on: https://webrtc-review.googlesource.com/74420
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24396}
2018-08-23 07:14:37 +00:00
Benjamin Wright
6f80f098ec Adds the custom TLS certificate verifier pointer to the reconfigure option as
well. This allows the verifier to be attached at a later point after ice
candidates.

Bug: webrtc:9623
Change-Id: I06f31256c494f6a790c6047e8602b8665dfe2f7e
Reviewed-on: https://webrtc-review.googlesource.com/93943
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24280}
2018-08-14 17:58:24 +00:00
Steve Anton
f820a5ea1c Fix use after move in SafeSetError
There is not actually any noticeable bug with the code as it was
since the RTCError move operators don't reset the type of the moved
object. But the clang static analyzer complains about this and it's
bad practice.

Bug: webrtc:9593
Change-Id: I8c04f193d10733371e0125c5349f9798f916eecf
Reviewed-on: https://webrtc-review.googlesource.com/93500
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24266}
2018-08-10 20:13:26 +00:00
Zach Stein
e20867ff6d Add AsyncResolverFactory interface and basic implementation.
The factory is plumbed down to P2PTransportChannel and will eventually
be used to resolve hostnames. Uses of PacketSocketFacotry::CreateAsyncResolver
will eventually be migrated to use this factory instead.

Bug: webrtc:4165
Change-Id: I1c48b2ffb8649609a831eba291f67ce544bb10eb
Reviewed-on: https://webrtc-review.googlesource.com/91300
Commit-Queue: Zach Stein <zstein@webrtc.org>
Reviewed-by: Emad Omara <emadomara@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24176}
2018-08-02 21:20:15 +00:00
Harald Alvestrand
7a1c7f782a Modified peerconnection's "observer" slot to be nulled on close.
This prevents usage of the observer post-close; modified the "usage
report notification" handler to not report when called post-close.
This fits the description of the original bug, so likely fixes it.

Bug: chromium:868337
Change-Id: Ic6757d2fb335203a6a6aacb2c9b52854b40332f7
Reviewed-on: https://webrtc-review.googlesource.com/91121
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24164}
2018-08-01 09:44:57 +00:00
Harald Alvestrand
c0e9725916 Add API to report "interesting" usage patterns to PC client
Bug: chromium:866792
Change-Id: Ic8bec5494aaa617c833c90be2b912f7367b44929
Reviewed-on: https://webrtc-review.googlesource.com/90246
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24111}
2018-07-26 09:12:03 +00:00
Steve Anton
24db573bea Step 1: Add RemoveTrackNew which returns an RTCError
Bug: webrtc:9534
Change-Id: I400bdcd0eb2e993b3f2252a2c7606cd105854e6b
Reviewed-on: https://webrtc-review.googlesource.com/89480
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24070}
2018-07-23 19:34:59 +00:00
Qingsi Wang
ee01a839d2 Remove MetricsObserverInterface.
The usage of MetricsObserverInterface to log metrics has been replaced
by RTC_HISTOGRAM_* macros in WebRTC.

Bug: webrtc:9409
Change-Id: I67df74a18942ac7ea4227e4affdf84f06258a287
Reviewed-on: https://webrtc-review.googlesource.com/86780
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24048}
2018-07-19 23:00:20 +00:00
Harald Alvestrand
76829d7c3d Add UMA metric for ICE candidate addition outcome
Bug: webrtc:9532
Change-Id: I58af94c03f5bbf25db2b558a8fe1ae53634fb99f
Reviewed-on: https://webrtc-review.googlesource.com/89063
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24032}
2018-07-19 02:23:59 +00:00
Steve Anton
0f5400acfa [Unified Plan] Implement FiredDirection for RtpTransceiver
Bug: webrtc:9236
Change-Id: Ib5a8215f3762f35b68d2a285c7d676f93f1212c5
Reviewed-on: https://webrtc-review.googlesource.com/88921
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24010}
2018-07-17 23:56:04 +00:00
Harald Alvestrand
056d811b6a Add counting of PCs with private IP addresses exposed
Bug: chromium:718508
Change-Id: I37f166808297c565cbb4b4393a23f7a18ab2862d
Reviewed-on: https://webrtc-review.googlesource.com/88640
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23990}
2018-07-16 18:04:09 +00:00
Qingsi Wang
7fc821d42d Reland "Reland "Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*.""
This is a reland of 1a2cc0acba

Original change's description:
> Reland "Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*."
>
> This is a reland of 870bca1f41
>
> Original change's description:
> > Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*.
> >
> > We now use RTC_HISTOGRAM_* macros in system_wrappers/include/metrics.h
> > to report the metrics in pc/ and p2p/ that are currently been reported
> > using MetricsObserverInterface.
> >
> > TBR=tommi@webrtc.org
> >
> > Bug: webrtc:9409
> > Change-Id: I47c9975402293c72250203fa1ec19eb1668766f6
> > Reviewed-on: https://webrtc-review.googlesource.com/83782
> > Commit-Queue: Qingsi Wang <qingsi@google.com>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Taylor (left Google) <deadbeef@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#23914}
>
> TBR=steveanton@webrtc.org,hta@webrtc.org,tommi@webrtc.org
>
> Bug: webrtc:9409
> Change-Id: I37fc95ced60dea25aa9b4f5ad44bdf7174c8bd5c
> Reviewed-on: https://webrtc-review.googlesource.com/88060
> Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Cr-Commit-Position: refs/heads/master@{#23919}

TBR=steveanton@webrtc.org,tommi@webrtc.org

Bug: webrtc:9409
Change-Id: Ib55f0b6c9bcb9d9585924a4dfac5cf643ff4d76b
Reviewed-on: https://webrtc-review.googlesource.com/88343
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23957}
2018-07-12 21:35:47 +00:00
Steve Anton
d78323faba Remove AddTrack override with MediaStreams
Bug: None
Change-Id: I992d356a7271fd89a174b0f458f9030092953b3e
Reviewed-on: https://webrtc-review.googlesource.com/88302
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23943}
2018-07-11 20:17:09 +00:00
Qingsi Wang
78fef76e6a Revert "Reland "Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*.""
This reverts commit 1a2cc0acba.

Reason for revert: It breaks internal Android debug build. Need further investigation.

Original change's description:
> Reland "Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*."
> 
> This is a reland of 870bca1f41
> 
> Original change's description:
> > Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*.
> >
> > We now use RTC_HISTOGRAM_* macros in system_wrappers/include/metrics.h
> > to report the metrics in pc/ and p2p/ that are currently been reported
> > using MetricsObserverInterface.
> >
> > TBR=tommi@webrtc.org
> >
> > Bug: webrtc:9409
> > Change-Id: I47c9975402293c72250203fa1ec19eb1668766f6
> > Reviewed-on: https://webrtc-review.googlesource.com/83782
> > Commit-Queue: Qingsi Wang <qingsi@google.com>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Taylor (left Google) <deadbeef@webrtc.org>
> > Reviewed-by: Steve Anton <steveanton@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#23914}
> 
> TBR=steveanton@webrtc.org,hta@webrtc.org,tommi@webrtc.org
> 
> Bug: webrtc:9409
> Change-Id: I37fc95ced60dea25aa9b4f5ad44bdf7174c8bd5c
> Reviewed-on: https://webrtc-review.googlesource.com/88060
> Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Cr-Commit-Position: refs/heads/master@{#23919}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,tommi@webrtc.org,hta@webrtc.org,qingsi@google.com,qingsi@webrtc.org

Change-Id: I4a75fc7f52bfd0780526537a5a9a016fb9c20d6a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9409
Reviewed-on: https://webrtc-review.googlesource.com/88320
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23938}
2018-07-11 18:37:36 +00:00
Henrik Boström
199e27bb63 RtpReceiverInterface::stream_ids() added.
This is the first step to removing streams from third_party/webrtc.
RtpReceiverInterface::streams() will have to be removed separately.
See https://crbug.com/webrtc/9480 for more information.

Bug: webrtc:9480
Change-Id: I6f9e6ddcda5e2245cc601d2cc6205b7b363f73ef
Reviewed-on: https://webrtc-review.googlesource.com/86840
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23929}
2018-07-11 10:14:56 +00:00
Qingsi Wang
1a2cc0acba Reland "Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*."
This is a reland of 870bca1f41

Original change's description:
> Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*.
>
> We now use RTC_HISTOGRAM_* macros in system_wrappers/include/metrics.h
> to report the metrics in pc/ and p2p/ that are currently been reported
> using MetricsObserverInterface.
>
> TBR=tommi@webrtc.org
>
> Bug: webrtc:9409
> Change-Id: I47c9975402293c72250203fa1ec19eb1668766f6
> Reviewed-on: https://webrtc-review.googlesource.com/83782
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Taylor (left Google) <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23914}

TBR=steveanton@webrtc.org,hta@webrtc.org,tommi@webrtc.org

Bug: webrtc:9409
Change-Id: I37fc95ced60dea25aa9b4f5ad44bdf7174c8bd5c
Reviewed-on: https://webrtc-review.googlesource.com/88060
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23919}
2018-07-11 04:40:26 +00:00
Qingsi Wang
13f4c896d5 Revert "Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*."
This reverts commit 870bca1f41.

Reason for revert: it breaks internal tests and builds

Original change's description:
> Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*.
>
> We now use RTC_HISTOGRAM_* macros in system_wrappers/include/metrics.h
> to report the metrics in pc/ and p2p/ that are currently been reported
> using MetricsObserverInterface.
>
> TBR=tommi@webrtc.org
>
> Bug: webrtc:9409
> Change-Id: I47c9975402293c72250203fa1ec19eb1668766f6
> Reviewed-on: https://webrtc-review.googlesource.com/83782
> Commit-Queue: Qingsi Wang <qingsi@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Taylor (left Google) <deadbeef@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23914}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,hta@webrtc.org,tommi@webrtc.org

Change-Id: I1afd92d44f3b8cf3ae9aa6e6daa9a3a272e8097f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9409
Reviewed-on: https://webrtc-review.googlesource.com/88040
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23916}
2018-07-10 21:26:28 +00:00
Qingsi Wang
870bca1f41 Replace the usage of MetricsObserverInterface by RTC_HISTOGRAM_*.
We now use RTC_HISTOGRAM_* macros in system_wrappers/include/metrics.h
to report the metrics in pc/ and p2p/ that are currently been reported
using MetricsObserverInterface.

TBR=tommi@webrtc.org

Bug: webrtc:9409
Change-Id: I47c9975402293c72250203fa1ec19eb1668766f6
Reviewed-on: https://webrtc-review.googlesource.com/83782
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor (left Google) <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23914}
2018-07-10 20:02:16 +00:00
Karl Wiberg
918f50c5d1 Use absl::make_unique and absl::WrapUnique directly
Instead of going through our wrappers in ptr_util.h.

This CL was generated by the following script:

  git grep -l ptr_util | xargs perl -pi -e 's,#include "rtc_base/ptr_util.h",#include "absl/memory/memory.h",'
  git grep -l MakeUnique | xargs perl -pi -e 's,\b(rtc::)?MakeUnique\b,absl::make_unique,g'
  git grep -l WrapUnique | xargs perl -pi -e 's,\b(rtc::)?WrapUnique\b,absl::WrapUnique,g'
  git checkout -- rtc_base/ptr_util{.h,_unittest.cc}
  git cl format

Followed by manually adding dependencies on
//third_party/abseil-cpp/absl/memory until `gn check` stopped
complaining.

Bug: webrtc:9473
Change-Id: I89ccd363f070479b8c431eb2c3d404a46eaacc1c
Reviewed-on: https://webrtc-review.googlesource.com/86600
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23850}
2018-07-05 10:59:49 +00:00
Harald Alvestrand
b2a7478221 Fix usage logging of TURN and STUN servers
Also adds tests, and adds a bit of logging in ParseIceServers.

Bug: chromium:718508
Change-Id: Id41ccb7cccbdab5af76e380b32b4d8ba0c4a0a72
Reviewed-on: https://webrtc-review.googlesource.com/86121
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23769}
2018-06-28 12:52:07 +00:00
Harald Alvestrand
183e09d23c Correct data histogram entry for incoming DC
Both incoming and outgoing datachannels should cause
the DATA_ADDED flag to be set.

This CL also moves all tests into their own file, and
improves scaffolding.

Bug: chromium:718508
Change-Id: I5c4c257ccb6f26799f7593bce8b27ebf59015b1e
Reviewed-on: https://webrtc-review.googlesource.com/85348
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23766}
2018-06-28 10:33:23 +00:00
Steve Anton
07563732f6 [Unified Plan] Avoid offering two senders with the same ID
This can happen with the following sequence of API calls:
1) AddTrack(track) + offer/answer
2) RemoveTrack(track's sender) + offer/answer
3) AddTrack(same track)

Since the first transceiver had already been used to send, it will
not get re-used by the second call to AddTrack. Another RtpSender
will be created with its ID = the track ID. But the code hits a
DCHECK when CreateOffer is later called since both m= sections will
offer the same track ID component of the MSID.

The fix implemented here is to randomly generate a sender ID if
there is already an RtpSender with the track's ID.

Bug: webrtc:8734
Change-Id: Ic2dda23d66e364e77ff7505e1c37e53105a17dae
Reviewed-on: https://webrtc-review.googlesource.com/84249
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23748}
2018-06-26 19:06:17 +00:00
Steve Anton
1bc9716078 [Unified Plan] Do not initialize recvonly transceivers with any send streams
Bug: None
Change-Id: Ie519a9ea3740f0b4fac97a4ffd486e7b4fa47cd9
Reviewed-on: https://webrtc-review.googlesource.com/84560
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23747}
2018-06-26 17:41:56 +00:00
Steve Anton
111fdfd732 Refactor RtpSender to take the sender ID as a constructor argument
This change also standardizes the RtpSender to a single constructor
and moves the |track| and |stream_ids| arguments to setter methods.

Bug: webrtc:8734
Change-Id: I227a84868a80797f6cc2a1af6eec6d76da8ea159
Reviewed-on: https://webrtc-review.googlesource.com/84248
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@{#23730}
2018-06-25 21:01:02 +00:00
Harald Alvestrand
1979384e40 Ensure that PC usage is recorded if a PC is alive for 60 seconds.
Bug: chromium:718508
Change-Id: Id2cbcb370b56cb8a6a6c821e0f89c51089cc8e6b
Reviewed-on: https://webrtc-review.googlesource.com/83140
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23723}
2018-06-25 10:25:38 +00:00
Steve Anton
b983bae923 Remove unused/deprecated DTMF methods
PeerConnectionInterface::CreateDtmfSender
DtmfSenderInterface::track

Bug: webrtc:9426
Change-Id: I7d151d8e0bdd60750ed60466083245631d540a91
Reviewed-on: https://webrtc-review.googlesource.com/84244
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23690}
2018-06-20 21:00:10 +00:00
Danil Chapovalov
66cadcc6b9 Replace rtc::Optional with absl::optional in pc
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script with parameter 'pc'

find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"[\./api]*:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: Ide3b9eb32df7f25991f898ac58fcb119c9f8ae12
Reviewed-on: https://webrtc-review.googlesource.com/84181
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23669}
2018-06-19 20:55:07 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Steve Anton
60b6c1dfa9 [Unified Plan] Clear RtpSender "SSRC" when the SDP has no send streams
This fixes a crash that occurs with this sequence of events:
1. AddTrack. SetLocalDescription(CreateOffer())
2. RemoveTrack. SetLocalDescription(CreateOffer())
3. AddTrack.

When AddTrack is called again it re-uses the RtpTransceiver/
RtpSender and try to configure the underlying MediaChannel. But the
MediaChannel would DCHECK since the send stream had been destroyed
by the SLD in 2. and would not get created until SLD is called
again.

Bug: webrtc:9401
Change-Id: I4b5572886e17263aaa4ce0408663444d72e09243
Reviewed-on: https://webrtc-review.googlesource.com/83420
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23605}
2018-06-14 00:31:15 +00:00
Qingsi Wang
241d0c16c0 Remove ContinualGatheringPolicy::GATHER_CONTINUALLY_AND_RECOVER.
This policy is not implemented.

Bug: None
Change-Id: I6c162d61c2488a4726c20df5c14439f83633a198
Reviewed-on: https://webrtc-review.googlesource.com/76041
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23591}
2018-06-13 01:00:00 +00:00
Zhi Huang
b57e169f3c Add a flag to actively reset the SRTP parameters
Add a new flag to RtcConfiguration. By setting that flag to true, the
SRTP parameters will be reset whenever the DTLS transports are reset
after every offer/answer negotiation.

The flag is added to Android and Objc wrapper as well.

This should only be used as a workaround for the linked bug, if the
application knows that the other party is affected (for instance,
using a version number).

TBR=sakal@webrtc.org, denicija@webrtc.org

Bug: chromium:835958
Change-Id: I6db025e1c69bf83e1b1908f7df4627430db9920c
Reviewed-on: https://webrtc-review.googlesource.com/83101
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23587}
2018-06-12 20:32:00 +00:00
Qingsi Wang
7685e86fa6 Pass the RtcEventLog instance to ICE via JsepTransportController.
This CL fixes a bug that the RtcEventLog owned by PeerConnection was not
passed to P2PTransportChannel after JsepTransportController was
introduced to deprecate the legacy TransportController.

Bug: webrtc:9337
Change-Id: I406cd9c0761dfe67f969aa99c6141e1ab38249d5
Reviewed-on: https://webrtc-review.googlesource.com/79964
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23572}
2018-06-12 05:04:35 +00:00
Zhi Huang
6c789e08d5 Revert "Add a flag to actively reset the SRTP parameters"
This reverts commit bae103126c.

Reason for revert: Merge native code change with Android and Objc wrapper.

Original change's description:
> Add a flag to actively reset the SRTP parameters
> 
> Add a new flag to RtcConfiguration. By setting that flag to true, the
> SRTP parameters will be reset whenever the DTLS transports are reset
> after every offer/answer negotiation.
> 
> This should only be used as a workaround for the linked bug, if the
> application knows that the other party is affected (for instance,
> using a version number).
> 
> Bug: chromium:835958
> Change-Id: Ifb4b99f68dc272507728ab59c07627f0d1b9c605
> Reviewed-on: https://webrtc-review.googlesource.com/81642
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23570}

TBR=deadbeef@webrtc.org,zhihuang@webrtc.org

Change-Id: Ibd7a3b8f45ff8df4af33d758f8fd3e2d5158e8e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:835958
Reviewed-on: https://webrtc-review.googlesource.com/83080
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23571}
2018-06-12 00:56:07 +00:00
Zhi Huang
bae103126c Add a flag to actively reset the SRTP parameters
Add a new flag to RtcConfiguration. By setting that flag to true, the
SRTP parameters will be reset whenever the DTLS transports are reset
after every offer/answer negotiation.

This should only be used as a workaround for the linked bug, if the
application knows that the other party is affected (for instance,
using a version number).

Bug: chromium:835958
Change-Id: Ifb4b99f68dc272507728ab59c07627f0d1b9c605
Reviewed-on: https://webrtc-review.googlesource.com/81642
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23570}
2018-06-11 23:06:26 +00:00
Taylor Brandstetter
cdd05f0cc1 Implement proper SCTP data channel closing procedure.
The proper closing procedure is:
1. Alice resets outgoing stream.
2. Bob receives incoming stream reset, resets his outgoing stream.
3. Alice receives incoming stream reset; channel closed!
4. Bob receives acknowledgement of reset; channel closed!

https://tools.ietf.org/html/draft-ietf-rtcweb-data-channel-13#section-6.7

However, up until now we've been sending both an incoming and outgoing reset
from the side initiating the closing procedure, and doing nothing on the remote
side.

This means that if you call "Close" and the remote endpoint is using an old
version of WebRTC, the channel's state will be stuck at "closing" since the
remote endpoint won't send a reset. Which is already what happens when Firefox
is talking to Chrome.

This CL also fixes an issue where the DataChannel's state prematurely went to
"closed" before the closing procedure was complete. Which could result in a
new DataChannel attempting to re-use the ID and failing.

TBR=magjed@webrtc.org

Bug: chromium:449934, webrtc:4453
Change-Id: Ic1ba813e46538c6c65868961aae6a9780d68a5e2
Reviewed-on: https://webrtc-review.googlesource.com/79061
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23478}
2018-05-31 21:01:53 +00:00
Piasy Xu
311428fecb Remove unnecessary set_stream_ids call
Both AudioRtpSender and VideoRtpSender receive stream_ids in their
constructor, no need to call set_stream_ids again.

Bug: None
Change-Id: I6238a6d6e31076a0b3245c89e2825d8dee5166c0
Reviewed-on: https://webrtc-review.googlesource.com/80220
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23476}
2018-05-31 18:44:28 +00:00
Harald Alvestrand
8ebba7420c Add collection of usage signatures on PeerConnections
This generates a number that represent a set of bits that
indicates how a PeerConnection has been used over time.

Bug: chromium:718508
Change-Id: I6df177684c50bc825bc41ea97996574292084d41
Reviewed-on: https://webrtc-review.googlesource.com/79823
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23471}
2018-05-31 13:07:09 +00:00
Benjamin Wright
d6f86e8fca This changeset adds dependency injection support for SSL Root Certs.
This extends the API surface so that
custom certificates can be provided by an API user in both the standalone and
factory creation paths for the OpenSSLAdapter. Prior to this change the SSL
roots were hardcoded in a header file and directly included into
openssladapter.cc. This forces the 100 kilobytes of certificates to always be
compiled into the library. This is undesirable in certain linking cases where
these certificates can be shared from another binary that already has an
equivalent set of trusted roots hard coded into the binary.

Support for removing the hard coded SSL roots has also been added through a new
build flag. By default the hard coded SSL roots will be included and will be
used if no other trusted root certificates are provided.

The main goal of this CL is to reduce total binary size requirements of WebRTC
by about 100kb in certain applications where adding these certificates is
redundant.

Change-Id: Ifd36d92b5cb32d1b3098a61ddfc244d76df8f30f

Bug: chromium:526260
Change-Id: Ifd36d92b5cb32d1b3098a61ddfc244d76df8f30f
Reviewed-on: https://webrtc-review.googlesource.com/64841
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23180}
2018-05-09 00:24:05 +00:00
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
cab58888ad Integrated PeerConnectionDependencies into PeerConnection::Initialize
Integrates the new PeerConnectionDependencies structure into
PeerConnection::Initialize to simplify future injections.

Bug: webrtc:7913
Change-Id: Ida1feae8b81819dfbfe5b79ed7807a63b091e73f
Reviewed-on: https://webrtc-review.googlesource.com/73960
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23130}
2018-05-04 19:18:05 +00:00
Wez
939eb80ed0 Add missing casts-to-int to int/uint16 comparisons.
These are required to avoid compilation errors due to signed/unsigned
comparison, on some toolchains (specifically Clang/Fuchsia).

Bug: chromium:839351
Change-Id: I52e726acd4e8d6744e98d7583bc82fcec81060d9
Reviewed-on: https://webrtc-review.googlesource.com/74100
Commit-Queue: Wez <wez@google.com>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23109}
2018-05-04 08:21:44 +00:00
Steve Anton
f764cf4677 Don't transition ICE to Checking if there are no transports
This attempts to make it more clear that an offer or answer with
no transports will no start ICE.

Bug: None
Change-Id: Ifb8d9e445b8fbef1fb1590477dd6bdb4fc651a90
Reviewed-on: https://webrtc-review.googlesource.com/73640
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23070}
2018-05-02 00:43:07 +00:00
Steve Anton
25cfeb9ef1 Fix possible race between the stats collector and transport controller
Previously, it would be possible for the RTCStatsCollector to start
an async network task to gather stats that would be run after the
PeerConnection was closed when the transport controller was set to
null.

Bug: chromium:829238
Change-Id: I22fb4ce603caf2614814780b95b62127cee28284
Reviewed-on: https://webrtc-review.googlesource.com/72525
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23046}
2018-04-26 19:35:24 +00:00
Steve Anton
c79268f15a Add IsClosed checks to various PeerConnection methods
This brings the implementations in line with the WebRTC
specification.

Bug: chromium:829238
Change-Id: I7ef64e7b6ccf0e9f60f017443565494239ff19cc
Reviewed-on: https://webrtc-review.googlesource.com/71961
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23013}
2018-04-24 23:07:21 +00:00