Commit graph

142 commits

Author SHA1 Message Date
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
Zhi Huang
6f36747fb1 Use local codec parameters in the answer.
Previously when creating an answer, we used the codecs from the remote list
to get correctly mapped codec id, but the side effect is that we also used
the remote codec parameters which is wrong.

With this change, we use the local codecs with local parameters and the
|NegotiateCodecs| method will take care of the codec id mapping.

Bug: webrtc:8550
Change-Id: Ib7b2fe5f6ed3a72c58cf5df8bf2c1d00476c141c
Reviewed-on: https://webrtc-review.googlesource.com/25285
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20843}
2017-11-22 23:46:34 +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
Oskar Sundbom
63e232a2cf Optional: Use nullopt and implicit construction in /pc/peerconnectionendtoend_unittest.cc
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

R=hbos@webrtc.org

Bug: None
Change-Id: I2fc923e788b744fc167f02f9fecd19bea512af81
Reviewed-on: https://webrtc-review.googlesource.com/23613
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20834}
2017-11-22 14:21:57 +00:00
Oskar Sundbom
b95fd2ce0b Optional: Use nullopt and implicit construction in /pc/peerconnectioninterface_unittest.cc
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

R=hbos@webrtc.org

Bug: None
Change-Id: I8f22aef3ad016c5714bc09351135ec4c65ff0cbd
Reviewed-on: https://webrtc-review.googlesource.com/23577
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20830}
2017-11-22 11:39:07 +00:00
Karl Wiberg
e40468ba3d Move some numeric utility code from rtc_base/ to rtc_base/numerics/
Specifically, I'm moving

  safe_compare.h
  safe_conversions.h
  safe_minmax.h

They shouldn't be part of the API, and moving them to an appropriate
subdirectory of rtc_base/ is a good way to keep track of that.

BUG=webrtc:8445

Change-Id: I458531aeb30bcf4291c4bec3bf22a2fffbf054ff
Reviewed-on: https://webrtc-review.googlesource.com/20860
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20829}
2017-11-22 11:21:47 +00:00
Oskar Sundbom
9b28a03b95 Optional: Use nullopt and implicit construction in /pc/peerconnection.cc
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

R=hbos@webrtc.org

Bug: None
Change-Id: I57a1ac8c2a05de403ff87b319c7a50fad17c1c96
Reviewed-on: https://webrtc-review.googlesource.com/23571
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20827}
2017-11-22 11:05:27 +00:00
Henrik Boström
9e6fd2bd47 Add streams() to RtpReceiverInterface and implementations.
This makes the receiver know about its associated set of streams, the
equivalent of the [[AssociatedRemoteMediaStreams]] slot in the spec,
https://w3c.github.io/webrtc-pc/#dfn-x%5B%5Bassociatedremotemediastreams%5D%5D

This does not change layers below peerconnection.cc. The streams are set
upon the receiver's construction and is not modified for the duration of
its lifetime.

When we support modifying the associated set of streams of a receiver
the receiver needs to know about it. The receiver's streams() should be
used in all places where a receiver's streams need to be known.

Bug: webrtc:8473
Change-Id: I31202973aed98e61fa9b6a78b52e815227b6c17d
Reviewed-on: https://webrtc-review.googlesource.com/22922
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20825}
2017-11-22 09:04:17 +00:00
Gary Liu
37e489c985 Add network_type to local RTCIceCandidateStats
Details:
  * Add RTCNetworkType enum
  * Add network_type to local ice candidate stats

Bug: webrtc:8435
Change-Id: Idb872849c09ad49c8f759d02afdc825e397afa07
Reviewed-on: https://webrtc-review.googlesource.com/14680
Commit-Queue: Gary Liu <qinghualiu@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20822}
2017-11-21 19:58:37 +00:00
Oskar Sundbom
36f8f3eaab Optional: Use nullopt and implicit construction in /pc
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

TBR=pthatcher@webrtc.org

Bug: None
Change-Id: If41c462dc3ddff664d0b70d249d760e2ca4c8ab3
Reviewed-on: https://webrtc-review.googlesource.com/23576
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20820}
2017-11-21 17:53:37 +00:00
Mirko Bonadei
c61ce0d0cd Fixing some clang-tidy findings.
Bug: None
Change-Id: I949c1ff35284ce79c99e8f76148f63b8bba965a9
Reviewed-on: https://webrtc-review.googlesource.com/24041
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20818}
2017-11-21 16:43:07 +00:00
Oskar Sundbom
89e712649d Optional: Use nullopt and implicit construction in /pc/rtcstatscollector.cc
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

R=hbos@webrtc.org

Bug: None
Change-Id: I435258d0b16660bcc58c236158c19507ef60f57b
Reviewed-on: https://webrtc-review.googlesource.com/23609
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20817}
2017-11-21 15:04:17 +00:00
Edward Lemur
872cf38c4d Fix some dependencies for peerconnection_and_implicit_call_api.
Some targets depend on "api/peerconnectioninterface.h" which is part of
//api:peerconnection_and_implicit_call_api.
Furthermore, peerconnection_and_implicit_call_api depends among other
things of headers in //media:rtc_media_base, so we should add it as a
dependency as well.

Bug: webrtc:7504
Change-Id: Ifab69253d52532876509b3507917b1c93d99a2ac
Reviewed-on: https://webrtc-review.googlesource.com/24660
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20815}
2017-11-21 13:59:27 +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
03fdc1042f Remove an unused debug message.
TBR=zhihuang@webrtc.org

Bug: None
Change-Id: If4cbffbba1e25a839a89c2b5956138481cb00edd
Reviewed-on: https://webrtc-review.googlesource.com/24740
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20805}
2017-11-21 00:18:12 +00:00
Zhi Huang
f2d7beb1d4 Created the DtlsSrtpTransport.
The DtlsSrtpTransport is designed to take DTLS responsibilities from BaseChannel.
DtlsSrtpTransport is responsible for exporting keys from DtlsTransport
and setting up the wrapped SrtpTransport.

The DtlsSrtpTransport is not hooked up to BaseChannel yet in this CL.

Bug: webrtc:7013
Change-Id: I318c00dadf9b1e033ec842de6e1536e9227ab713
Reviewed-on: https://webrtc-review.googlesource.com/6700
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20804}
2017-11-20 23:18:22 +00:00
Steve Anton
4171afb186 Use RtpTransceivers in PeerConnection
Moves ownership of the RtpSenders/RtpReceivers/BaseChannels to
RtpTransceiver objects. For now, there can only be one
RtpTransceiver for audio and one for video. Future work to
implement Unified Plan will relax this restriction.

Bug: webrtc:7600
Change-Id: I9dfe324de61e2b363948858da72624396e27fc1a
Reviewed-on: https://webrtc-review.googlesource.com/21461
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@{#20802}
2017-11-20 22:41:44 +00:00
Ivo Creusen
ae02609645 Add parallel stats interface with optional stats to APM.
This new parallel GetStatistics function uses Optionals to indicate if stats are valid or not, and no longer relies on default values. It also takes an argument to indicate if receive streams are present, and if not several stats will not be set.

Bug: b/67926135
Change-Id: I175de1c65c414bea6ec9ca8b0b16f07cb2308d9f
Reviewed-on: https://webrtc-review.googlesource.com/17942
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20789}
2017-11-20 13:13:20 +00:00
Oskar Sundbom
cbc71b22a9 Optional: Use nullopt and implicit construction in /pc/rtcstatscollector_unittest.cc
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

R=hta@webrtc.org

Bug: None
Change-Id: Ie5488de731bbd377d7694c1c26af26168bf6afd3
Reviewed-on: https://webrtc-review.googlesource.com/23606
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20777}
2017-11-20 03:03:40 +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
Åsa Persson
c3ed630560 Add stats googHasEnteredLowResolution.
Indicates if the forced sw fallback has had an effect (or would have had an effect if it had been
enabled).


Bug: webrtc:6634
Change-Id: I574b9001a2fae650fb894a1caa0d0f84257658e3
Reviewed-on: https://webrtc-review.googlesource.com/23300
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20729}
2017-11-17 13:02:07 +00:00
henrika
32026c3078 Removes Set/GetLoudspeakerStatus APIs from the ADM.
int32_t SetLoudspeakerStatus(bool enable)
int32_t GetLoudspeakerStatus(bool* enabled) const

These APIs are only implemented on iOS and they do not belong in the
native audio layer since the client can achieve the same functionality
by using the shared audio session in sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h.
It also gives the client a better flexibility in how the audio routing is done.

Bug: webrtc:7306
Change-Id: I853e2f57e0f5ae0a0f9fc4729ce961d81f92588b
Reviewed-on: https://webrtc-review.googlesource.com/23740
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20721}
2017-11-16 19:44:24 +00:00
henrika
c97cf03ede Removes unused sample-rate APIs from the ADM.
The following four methods are removed:

SetRecordingSampleRate(const uint32_t samplesPerSec)
RecordingSampleRate(uint32_t* samplesPerSec) const
SetPlayoutSampleRate(const uint32_t samplesPerSec)
PlayoutSampleRate(uint32_t* samplesPerSec) const

Bug: webrtc:7306
Change-Id: I2c3c2e7bd3fb1264da197699fd5de15ab6c35c1b
Reviewed-on: https://webrtc-review.googlesource.com/22001
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20703}
2017-11-16 08:59:53 +00:00
Zhi Huang
1d88d7446e Remove the unused code.
In BaseChannel, |selected_candidate_pair| is removed.
In MediaContentDescription, |buffered_mode_latency_| and its
getter/setter are removed.

TBR=pthatcher@webrtc.org

Bug: None
Change-Id: I68c0a61136dcd078f587105f09c72098d7f8e620
Reviewed-on: https://webrtc-review.googlesource.com/23520
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20694}
2017-11-16 04:08:03 +00:00
Zhi Huang
801b868bd8 Remove the CA_UPDATE and related code.
The downstream application doesn't use CA_UPDATE and the related code are
removed to simplify the BaseChannel.

TBR=pthatcher@webrtc.org

Bug: webrtc:8521
Change-Id: I9adc1539db7feb7b5c3aafba7a2be7100f2c068a
Reviewed-on: https://webrtc-review.googlesource.com/22205
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20693}
2017-11-16 01:46:02 +00:00
Patrik Höglund
7aee3d538c Fix ortc_api circular deps.
This will help keep ortc dependencies clean in the future, since
gn --check forces us to depend on components from which we include
headers.

cryptoparams.h moves into api/, but ortc appears to think it
should be there anyway. We could consider moving it into the ortc/ api,
but it doesn't appear to be specific to ortc.

Bug: webrtc:6828
Change-Id: Iddae438d10b5e84b2fbc52565364319e20f90613
Reviewed-on: https://webrtc-review.googlesource.com/22660
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20686}
2017-11-15 13:31:51 +00:00
Zhi Huang
5f5918f4ef Merge MediaChannel's OnTransportOverheadChanged and OnNetworkRouteChanged callbacks.
OnTransportOverChanged is merged into OnNetworkRouteChanged in MediaChannel
because the transport overhead will be added to rtc::NetworkRoute structure.

This CL depends on https://webrtc-review.googlesource.com/c/src/+/13520

Bug: None
Change-Id: I6ed6583f6c91db4ce61a89406de39774239f3a04
Reviewed-on: https://webrtc-review.googlesource.com/15200
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20678}
2017-11-14 20:42:36 +00:00
henrika
8962b54a43 Removes Set/GetRecordingChannel() from the ADM
These two unused APIs are removed:

SetRecordingChannel(const ChannelType channel)
RecordingChannel(ChannelType* channel) const

Bug: webrtc:7306
Change-Id: I3289c4b9a5eebb64cc0aa3a1c1144e9c4d6a661d
Reviewed-on: https://webrtc-review.googlesource.com/22681
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20667}
2017-11-14 08:30:16 +00:00
Zhi Huang
942bc2e4b9 Reland: Replaced the SignalSelectedCandidatePairChanged with a new signal.
|packet_overhead| field is added to rtc::NetworkRoute structure.

In PackTransportInternal:
1. network_route() is added which returns the current network route.
2. debug_name() is removed.
3. transport_name() is moved from DtlsTransportInternal and
IceTransportInternal to PacketTransportInternal.

When the selected candidate pair is changed, the P2PTransportChannel
will fire the SignalNetworkRouteChanged instead of
SignalSelectedCandidatePairChanged to upper layers.

The Rtp/SrtpTransport takes the responsibility of calculating the
transport overhead from the BaseChannel so that the BaseChannel
doesn't need to depend on P2P layer transports.

TBR=pthatcher@webrtc.org

Bug: webrtc:7013
Change-Id: If9928b25a7259544c2d9c42048b53ab24292fc67
Reviewed-on: https://webrtc-review.googlesource.com/22767
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20664}
2017-11-13 22:50:11 +00:00
Zhi Huang
8c316c1a89 Revert "Replaced the SignalSelectedCandidatePairChanged with a new signal."
This reverts commit 71677452f9.

Reason for revert: Broke Chromium.

Original change's description:
> Replaced the SignalSelectedCandidatePairChanged with a new signal.
> 
> |transport overhead| field is added to rtc::NetworkRoute structure.
> 
> In PackTransportInternal:
> 1. network_route() is added which returns the current network route.
> 2. debug_name() is removed.
> 3. transport_name() is moved from DtlsTransportInternal and
>    IceTransportInternal to PacketTransportInternal.
> 
> When the selected candidate pair is changed, the P2PTransportChannel
> will fire the SignalNetworkRouteChanged instead of
> SignalSelectedCandidatePairChanged to upper layers.
> 
> The Rtp/SrtpTransport takes the responsibility of calculating the
> transport overhead from the BaseChannel so that the BaseChannel
> doesn't need to depend on P2P layer transports.
> 
> Bug: webrtc:7013
> Change-Id: I60d30d785666a50a95052d00bf08f829d8f57e9c
> Reviewed-on: https://webrtc-review.googlesource.com/13520
> Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20661}

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

Change-Id: Ie0c76786855b65bb8caba7065593c961e4bf9de7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7013
Reviewed-on: https://webrtc-review.googlesource.com/22764
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20662}
2017-11-13 21:13:55 +00:00
Zhi Huang
71677452f9 Replaced the SignalSelectedCandidatePairChanged with a new signal.
|transport overhead| field is added to rtc::NetworkRoute structure.

In PackTransportInternal:
1. network_route() is added which returns the current network route.
2. debug_name() is removed.
3. transport_name() is moved from DtlsTransportInternal and
   IceTransportInternal to PacketTransportInternal.

When the selected candidate pair is changed, the P2PTransportChannel
will fire the SignalNetworkRouteChanged instead of
SignalSelectedCandidatePairChanged to upper layers.

The Rtp/SrtpTransport takes the responsibility of calculating the
transport overhead from the BaseChannel so that the BaseChannel
doesn't need to depend on P2P layer transports.

Bug: webrtc:7013
Change-Id: I60d30d785666a50a95052d00bf08f829d8f57e9c
Reviewed-on: https://webrtc-review.googlesource.com/13520
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20661}
2017-11-13 20:57:31 +00:00
Steve Anton
6e634bf4cf Add RtpTransceiverInterface and implementing class
Introduces the public API interface corresponding to the
standardized RtpTransceiver object in the WebRTC spec.
https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver

The RtpTransceiver will be the internal representation for both
Plan B and Unified Plan SDP, but the public API interface will
only support Unified Plan (existing users should continue to use
GetSenders/GetReceivers, which will still be supported).

Bug: webrtc:7600
Change-Id: I417ffda683209ba9a9b4cbd274f91ca8295779a7
Reviewed-on: https://webrtc-review.googlesource.com/21460
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20659}
2017-11-13 19:55:21 +00:00
Henrik Boström
fdb92012fb Avoid use-after-move in PeerConnection::Set[Local/Remote]Description.
In Set[Local/Remote]Description we have a raw pointer |desc| whose
ownership is passed to a helper function. Before this CL we continue
to use |desc| after ownership is passed under the assumption that the
object is not deleted.

In this CL, we instead rely on [local/remote]_description() after the
helper function has been called. In practice, this is a pointer to
the same object, but it removes the assumption about |desc| being
valid after its ownership is passed.

Bug: None
Change-Id: I144a190ea00f303f4713b64c45aa3e811c0f4b2e
Reviewed-on: https://webrtc-review.googlesource.com/21320
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20654}
2017-11-13 13:53:38 +00:00
Henrik Boström
8f91f1ee71 Make hbos@webrtc.org OWNER of peerconnection*.
hbos knows and makes changes to the webrtc-pc spec[1] and works on
making Chromium's RTCPeerConnection spec-compliant. This includes
knowing and interacting with WebRTC-layer PeerConnection/Interface and
sometimes making changes to it.

hbos would like to share the peerconnection* ownership responsibilty as
it is relevant and owning it will speed up some of the process.

[1] https://w3c.github.io/webrtc-pc/

Bug: None
NOTRY: True
Change-Id: I8f419b7fc6c7fcf19951aa3f304769c915300d1b
Reviewed-on: https://webrtc-review.googlesource.com/21327
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20649}
2017-11-13 12:27:29 +00:00
Mirko Bonadei
2a8231063c Avoiding unnecessary copies.
clang-tidy spotted out these unnecessary copies, this CL removes them.

Bug: None
Change-Id: I9035a5a5394e170e8193966b4790946fb22b3b76
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/22060
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20648}
2017-11-13 12:07:31 +00:00
Sebastian Jansson
13f35ec3d7 Sets names of peerconnection worker and network thread
Bug: None
Change-Id: I7117964a013fff2203bf27dd826f0bc6b753f097
Reviewed-on: https://webrtc-review.googlesource.com/20861
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20644}
2017-11-13 10:34:58 +00:00
Zhi Huang
c99b6c7936 Remove the SetEncryptedHeaderExtensionIds methods.
The existing methods SetEncrypedHeaderExtensionIds in SrtpTransport and SrtpSession
are removed because those methods could be confusing. When these methods are called
the head extension IDs are not actually updated and the user need to call SetRtpParams
again to make that happen. The existing setter just caches the new IDs.

To make it less confusing, the SetEncryptedHeaderExtensionIds is removed and the new
extension IDs will be set immediately when setting the crypto params.

For SDES, the crypto params and the header extension IDs will be set at the same time.

For DTLS, the new header extensions are cached in BaseChannel and will be set when
the DTLS handshake is completed.

Another major change is that when doing DTLS-SRTP, the encrypted header extension
IDs will be updated only when they are changed.

Bug: webrtc:7013
Change-Id: Ib70d4797456ae5ecb61b3dfff15c7e3e7ede89bd
Reviewed-on: https://webrtc-review.googlesource.com/15860
Commit-Queue: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20639}
2017-11-11 01:14:35 +00:00
Steve Anton
83119dd833 Fix and re-enable flaky PeerConnectionIntegrationTests
PeerConnectionIntegrationTest.AddMediaToConnectedBundleDoesNotRestartIce
--> Fixed by an earlier CL (https://webrtc-review.googlesource.com/c/src/+/16261)
    so re-enabled.

PeerConnectionIntegrationTest/PeerConnectionIntegrationIceStatesTest.VerifyIceStates
--> An existing bug causes this to by flaky when using a fake clock.
    Fake clock removed with a TODO to change it back when the bug is fixed.

PeerConnectionIntegrationTest.TrackStatsUpdatedCorrectlyWhenUnsignaledSsrcChanges
--> The heuristic that >25% concealed audio samples is abnormal is
    unfortunately not reliable enough on certain slow trybots. Bump the
    threshold to 50% in hopes that is enough.

Bug: webrtc:8496
Change-Id: I17cfdf956a8a72ac399212c3c7efcdd2236be00d
Reviewed-on: https://webrtc-review.googlesource.com/20963
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20638}
2017-11-11 00:50:35 +00:00
Mirko Bonadei
675513b96a Stop using LOG macros in favor of RTC_ prefixed macros.
This CL has been generated with the following script:

for m in PLOG \
  LOG_TAG \
  LOG_GLEM \
  LOG_GLE_EX \
  LOG_GLE \
  LAST_SYSTEM_ERROR \
  LOG_ERRNO_EX \
  LOG_ERRNO \
  LOG_ERR_EX \
  LOG_ERR \
  LOG_V \
  LOG_F \
  LOG_T_F \
  LOG_E \
  LOG_T \
  LOG_CHECK_LEVEL_V \
  LOG_CHECK_LEVEL \
  LOG
do
  git grep -l $m | xargs sed -i "s,\b$m\b,RTC_$m,g"
done
git checkout rtc_base/logging.h
git cl format

Bug: webrtc:8452
Change-Id: I1a53ef3e0a5ef6e244e62b2e012b864914784600
Reviewed-on: https://webrtc-review.googlesource.com/21325
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20617}
2017-11-09 11:56:32 +00:00
Steve Anton
8699a3229f Have BaseChannel take MediaChannel as unique_ptr
Bug: None
Change-Id: I9a0c67cc364623b7c17824271edfbd782f88dbfb
Reviewed-on: https://webrtc-review.googlesource.com/18300
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20594}
2017-11-07 18:46:06 +00:00
Steve Anton
c9e1560d32 Modernize and cleanup ChannelManager
Bug: None
Change-Id: Ifd07c10dc1d3655e0138900c9a9897810cec3d54
Reviewed-on: https://webrtc-review.googlesource.com/18080
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20593}
2017-11-07 18:09:45 +00:00
Ivo Creusen
1c9faeef5f Disable several flaky PeerConnectionIntegration tests.
TBR=perkj@webrtc.org

Bug: webrtc:8496
Change-Id: I44722868798d3e3b3c056eb0554cd98402c4a6e0
Reviewed-on: https://webrtc-review.googlesource.com/20868
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20585}
2017-11-07 13:29:55 +00:00
Steve Anton
d25da378c7 Inline various trivial methods from the WebRtcSession merge
Bug: webrtc:8323
Change-Id: I402480b71a5e9cd8936fbbc5d15d62e4f3c910a6
Reviewed-on: https://webrtc-review.googlesource.com/16381
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20576}
2017-11-06 22:54:05 +00:00
Steve Anton
75737c0c6a Merge WebRtcSession into PeerConnection
This literally copies & pastes the code from WebRtcSession into
PeerConnection as private methods. The only other changes were to
inline the WebRtcSession construction/initialization/destruction
into PeerConnection and fix issues using rtc::Bind on the
reference-counted PeerConnection.

Bug: webrtc:8323
Change-Id: Ib3f071ac10d18566a21a3b04813b1d4ec691ef3c
Reviewed-on: https://webrtc-review.googlesource.com/15160
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20574}
2017-11-06 21:15:20 +00:00
Steve Anton
ba818675b9 Prepare WebRtcSession to be merged into PeerConnection
This commit prepares WebRtcSession so that it can be cleanly
copy & pasted into PeerConnection in the next commit. To accomplish
this, the following was done:
1. Added a pointer to the owning PeerConnection to WebRtcSession.
2. Replace WebRtcSession state enum with signaling state.
3. All signals/observers only observed by PeerConnection were
   replaced with direct calls to PeerConnection methods.
4. All duplicated fields were moved to PeerConnection.
5. The remaining tests that still use WebRtcSession for mocks were
   updated to minimize dependence on WebRtcSession construction.

Bug: webrtc:8323
Change-Id: Ifc1a4ee819dcc9beca5363291012f7d5563ff7b1
Reviewed-on: https://webrtc-review.googlesource.com/9020
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20573}
2017-11-06 21:11:19 +00:00
Steve Anton
ff52f1b91e Fix flake in AddMediaToConnectedBundleDoesNotRestartIce test
EXPECT_EQ(0u, caller()->ice_connection_state_history().size());

Was failing since it cleared the connection state history before
the caller had finished transitioning to Completed, so the initial
transitions would be mistaken for later transitions.

Bug: None
Change-Id: I7043638f077ac5dcaeeca0d3ea6accc93c920364
Reviewed-on: https://webrtc-review.googlesource.com/16261
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20570}
2017-11-06 19:22:37 +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