Commit graph

71 commits

Author SHA1 Message Date
Qingsi Wang
72a43a1d2c Collect packet loss and RTT stats of STUN binding requests.
STUN candidates use STUN binding requests to keep NAT bindings open.
Related stats including packet loss and RTT can be now collected via the
legacy GetStats in PeerConnection.

Bug: None
Change-Id: I7b0eee1ccb07eb670a32ee303c9590047b25f31c
Reviewed-on: https://webrtc-review.googlesource.com/54100
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22113}
2018-02-21 00:49:26 +00:00
Jonas Olsson
45cc890560 Assorted logging pedantry
This cl fixes various minor issues found during a quick scan of the current log
usage.

Bug: webrtc:8529
Change-Id: I1e1eb02ef220177dbb327203509736ad7f70cc1c
Reviewed-on: https://webrtc-review.googlesource.com/52262
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Grunell <henrikg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21996}
2018-02-13 10:47:24 +00:00
Qingsi Wang
93a843944a Bind the structured ICE logging with P2PTransportChannel.
This change list passes the instance of RtcEventLog from Peerconnection
down to P2PTransportChannel, and binds the structured ICE logging with
ICE layer objects. Logs of ICE connectivity checks are injected for
candidate pairs.

TBR=terelius@webrtc.org

Bug: None
Change-Id: Ia979dbbac6d31dcf0f8988da1065bdfc3e461821
Reviewed-on: https://webrtc-review.googlesource.com/34660
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21884}
2018-02-03 07:06:49 +00:00
Taylor Brandstetter
6e2e7ce419 Reland "Move JsepTransport from p2p/base to pc/."
This is a reland of 4770fd935a
Original change's description:
> Move JsepTransport from p2p/base to pc/.
> 
> The JsepTransport class is moved to pc/ and the utility methods and
> enums are moved to where they are used.
> 
> With JsepTransport moved to pc/, JsepTransport can depend on objects in
> pc/ including RtpTranport, SrtpTransport etc.
> 
> Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7
> 
> Bug: webrtc:8636
> Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
> Reviewed-on: https://webrtc-review.googlesource.com/33701
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21333}

Bug: webrtc:8636
Change-Id: Ibce42be898b96dd8e0266b595611d2ffc86581a8
Reviewed-on: https://webrtc-review.googlesource.com/34586
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21371}
2017-12-19 20:50:41 +00:00
Jonas Oreland
202994ca64 This is a recommit of
https://webrtc.googlesource.com/src.git/+/26246cac660a95f439b7d1c593edec2929806d3f
that was reverted due to compile error on windows.

Changes since last is an addition of a cast to uint16_t in stun.cc:1018.

---

Add RelayPortFactoryInterface that allows for custom relay (e.g turn) ports

This patch adds a RelayPortFactoryInterface that allows
for custom relay ports. The factor is added as optional argument
to BasicPortAlloctor. If none is provided a default implementation
that mimics existing behavior is created.

The patch also adds 2 stun functions, namely to copy a
StunAttribute and to remove StunAttribute's from a StunMessage.

Bug: webrtc:8640
Change-Id: If23638317130060286f576c94401de55c60a1821
Reviewed-on: https://webrtc-review.googlesource.com/34181
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21345}
2017-12-19 07:09:19 +00:00
Oleh Prypin
8424acdde3 Revert "Move JsepTransport from p2p/base to pc/."
This reverts commit 4770fd935a.

Reason for revert: breaks downstream projects

Original change's description:
> Move JsepTransport from p2p/base to pc/.
> 
> The JsepTransport class is moved to pc/ and the utility methods and
> enums are moved to where they are used.
> 
> With JsepTransport moved to pc/, JsepTransport can depend on objects in
> pc/ including RtpTranport, SrtpTransport etc.
> 
> Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7
> 
> Bug: webrtc:8636
> Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
> Reviewed-on: https://webrtc-review.googlesource.com/33701
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21333}

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

Change-Id: Ia72c6d7f185a95b21fd0aec90e7fdc00cb1fb423
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8636
Reviewed-on: https://webrtc-review.googlesource.com/34600
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21335}
2017-12-18 21:00:05 +00:00
Taylor Brandstetter
4770fd935a Move JsepTransport from p2p/base to pc/.
The JsepTransport class is moved to pc/ and the utility methods and
enums are moved to where they are used.

With JsepTransport moved to pc/, JsepTransport can depend on objects in
pc/ including RtpTranport, SrtpTransport etc.

Forked from https://webrtc-review.googlesource.com/c/src/+/31762/7

Bug: webrtc:8636
Change-Id: I4e8569fe3012946e87deb280f6139f0fd98de34d
Reviewed-on: https://webrtc-review.googlesource.com/33701
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21333}
2017-12-18 18:59:43 +00:00
Guido Urdaneta
f1a7a8c602 Revert "Add RelayPortFactoryInterface that allows for custom relay (e.g turn) ports"
This reverts commit 26246cac66.

Reason for revert: Introduces compile failure on MSVC, which is preventing rolls into Chromium.

Sample errors:
[12263/40346] CXX obj/third_party/webrtc/p2p/rtc_p2p/stun.obj
FAILED: obj/third_party/webrtc/p2p/rtc_p2p/stun.obj 
ninja -t msvc -e environment.x64 -- E:\b\c\goma_client/gomacc.exe "e:\b\c\win_toolchain\vs_files\a9e1098bba66d2acccc377d5ee81265910f29272\vc\tools\msvc\14.11.25503\bin\hostx64\x64/cl.exe" /nologo /showIncludes  @obj/third_party/webrtc/p2p/rtc_p2p/stun.obj.rsp /c ../../third_party/webrtc/p2p/base/stun.cc /Foobj/third_party/webrtc/p2p/rtc_p2p/stun.obj /Fd"obj/third_party/webrtc/p2p/rtc_p2p_cc.pdb"
../../third_party/webrtc/p2p/base/stun.cc(1018): error C2220: warning treated as error - no 'object' file generated
../../third_party/webrtc/p2p/base/stun.cc(1018): warning C4267: 'argument': conversion from 'size_t' to 'uint16_t', possible loss of data
  

Original change's description:
> Add RelayPortFactoryInterface that allows for custom relay (e.g turn) ports
> 
> This patch adds a RelayPortFactoryInterface that allows
> for custom relay ports. The factor is added as optional argument
> to BasicPortAlloctor. If none is provided a default implementation
> that mimics existing behavior is created.
> 
> The patch also adds 2 stun functions, namely to copy a
> StunAttribute and to remove StunAttribute's from a StunMessage.
> 
> Bug: webrtc:8640
> Change-Id: I59bd51f0f5e2f8c187dff9fcf003a24c35ed037f
> Reviewed-on: https://webrtc-review.googlesource.com/32600
> Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21267}

TBR=jonaso@webrtc.org,pthatcher@webrtc.org

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

Bug: webrtc:8640
Change-Id: Idf83a1111727d2b5188b9c123f7471be7e99e973
Reviewed-on: https://webrtc-review.googlesource.com/33600
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21304}
2017-12-15 18:34:57 +00:00
Jonas Oreland
26246cac66 Add RelayPortFactoryInterface that allows for custom relay (e.g turn) ports
This patch adds a RelayPortFactoryInterface that allows
for custom relay ports. The factor is added as optional argument
to BasicPortAlloctor. If none is provided a default implementation
that mimics existing behavior is created.

The patch also adds 2 stun functions, namely to copy a
StunAttribute and to remove StunAttribute's from a StunMessage.

Bug: webrtc:8640
Change-Id: I59bd51f0f5e2f8c187dff9fcf003a24c35ed037f
Reviewed-on: https://webrtc-review.googlesource.com/32600
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21267}
2017-12-14 08:24:11 +00:00
Steve Anton
babf91738c Fix cpplint errors in port/port_unittest
Bug: webrtc:5273
Change-Id: Id76af16956e5c25a7f897a8e36e6883616387676
Reviewed-on: https://webrtc-review.googlesource.com/26442
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20942}
2017-11-29 19:57:09 +00:00
Oskar Sundbom
903dcd733a Optional: Use nullopt and implicit construction in /p2p
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.

Bug: None
Change-Id: Ia65be19b24c93db360a313f82a84bfae1a49bf2d
Reviewed-on: https://webrtc-review.googlesource.com/23605
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20929}
2017-11-29 11:13:39 +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
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
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
f2737d23d1 Enable the clang style plugin in primary p2p/ target
Bug: webrtc:163
Change-Id: I318982ee549fe71cd48f74cdfad4173506742411
Reviewed-on: https://webrtc-review.googlesource.com/17040
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20509}
2017-11-01 00:19:05 +00:00
Steve Anton
1cf1b7d66f Fix clang style warnings in p2p/base/port.h and its subclasses
Bug: webrtc:163
Change-Id: I8308bf1f1b4cf57edd2eb8fda010cb8b667771a2
Reviewed-on: https://webrtc-review.googlesource.com/16361
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20483}
2017-10-30 18:44:09 +00:00
Raphael Kubo da Costa
7f90e2cced IWYU: Include math.h for round(3).
math.h was being implicitly included, which can break the build with
alternative libc implementations.

Bug: None
Change-Id: I969b320b65d0f44abb33d3e1036cfbcb859a4952
Reviewed-on: https://webrtc-review.googlesource.com/9384
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#20292}
2017-10-13 16:24:37 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/p2p/base/port.cc (Browse further)