Commit graph

71 commits

Author SHA1 Message Date
Niels Möller
afb246b5a9 Update pc/ to not use implicit conversion from scoped_refptr<T> to T*.
Bug: webrtc:13464
Change-Id: I768646af8ded6338ef51486b8d69db1ad71e9a2c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259500
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36588}
2022-04-20 13:18:33 +00:00
Florent Castelli
72424408ed Remove calls to deprecated CreatePC() and CreateDC()
Anything linking to //third_party/jsoncpp is hiding deprecated usage
warnings, so these were not discovered earlier.

Bug: chromium:983223
Change-Id: Id0ade4ca016f19db16377dbeeb756358a7e94fa2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258124
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36463}
2022-04-06 11:57:50 +00:00
Harald Alvestrand
c24a2189d7 Update IWYU tool with a mapping file
Also apply IWYU to all .cc files in pc/, and correct BUILD file to match.
Note: Some files came out wrong when iwyu was applied. These are not included.

Bug: none
Change-Id: Ib5ea46b8fcc505414d0447cca7218ad3afc2e321
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252280
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36064}
2022-02-24 11:05:06 +00:00
Florent Castelli
e1b685a50a simulcast: Limit audio transceivers to single stream
We don't support audio simulcast, so we should reject the layers
early during an addTransceiver() call.

Bug: webrtc:12719
Change-Id: Ieeb92c66de741e9b11943e0173a6f2e052926f13
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216685
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33886}
2021-04-30 18:55:47 +00:00
Harald Alvestrand
6060df5948 Reland "Implement transceiver.stop()"
This is a reland of 11dc6571cb

One fix that makes Web Platform Tests pass in debug mode is applied.

Original change's description:
> Implement transceiver.stop()
>
> This adds RtpTransceiver.StopStandard(), which behaves according to
> the specification at
> https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
>
> It modifies RTCPeerConnection.getTransceivers() to return only
> transceivers that have not been stopped.
>
> Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762
>
> Bug: chromium:980879
> Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31893}

Bug: chromium:980879
Change-Id: Ide31d929ac5ea118d83fdf6a35a592af23f7dfa7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181263
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31907}
2020-08-11 10:46:23 +00:00
Harald Alvestrand
a88c9776de Revert "Implement transceiver.stop()"
This reverts commit 11dc6571cb.

Reason for revert: Breaks Chromium WPT tests

Original change's description:
> Implement transceiver.stop()
> 
> This adds RtpTransceiver.StopStandard(), which behaves according to
> the specification at
> https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
> 
> It modifies RTCPeerConnection.getTransceivers() to return only
> transceivers that have not been stopped.
> 
> Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762
> 
> Bug: chromium:980879
> Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31893}

TBR=sakal@webrtc.org,kthelgason@webrtc.org,hta@webrtc.org,guidou@webrtc.org,marinaciocea@webrtc.org

Change-Id: Ibdc24f7d41e481293ca74ba6d1572de64f7e4654
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:980879
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181262
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31897}
2020-08-10 18:06:30 +00:00
Harald Alvestrand
11dc6571cb Implement transceiver.stop()
This adds RtpTransceiver.StopStandard(), which behaves according to
the specification at
https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop

It modifies RTCPeerConnection.getTransceivers() to return only
transceivers that have not been stopped.

Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762

Bug: chromium:980879
Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31893}
2020-08-10 13:29:15 +00:00
Ying Wang
ef3998ffd1 Add directive to make webrtc metrics optional.
Bug: webrtc:11144
Change-Id: I4e75e6aec033784685de3670e880bb9f2b6ee8d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161043
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30040}
2019-12-09 13:55:50 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Florent Castelli
3fbf1e2e4a Reduce kMaxSimulcastStreams to 3
Because of webrtc:10801, we don't actually support 4 simulcast layers but 3.
Until this is fixed, we limit the value to what we can currently handle.

Bug: webrtc:8785
Change-Id: I513b7c8d4c889fa0d80c91adc1c4f874acb86fdc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144625
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28487}
2019-07-04 15:54:36 +00:00
Amit Hilbuch
f4770401dc Reland "Adding a restriction for legal RID values."
This is a reland of 07f3279a73

Original change's description:
> Adding a restriction for legal RID values.
>
> According to the spec, RID values should be constrained to only
> alpha-numeric values. This was not enforced in our implementation to
> allow for more flexibility.
> It has been brought to our attention that some values that we currently
> consider legal (such as the '~', '=' ';' characters) might cause confusion
> with the simulcast syntax that uses these characters to indicate other
> meanings.
> What's worse, is that some characters, when used in RIDs (such as
> \u{1f937} \u{1f4a9} and \u{1f926}) cause uncontrollable laughter for some
> users which might also be a health hazard.
> This change resolves these issues by restricting RIDs to alpha-numeric.
>
> Bug: webrtc:10491
> Change-Id: I16e262c87525d0289764beacd098e1525a355463
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132061
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27499}

TBR=steveanton@webrtc.org

Bug: webrtc:10491
Change-Id: I856581306a9258480ee9184f12b55c2a23dd8636
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131983
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Reviewed-by: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27530}
2019-04-09 21:19:31 +00:00
Mirko Bonadei
6a489f22c7 Fully qualify googletest symbols.
Semi-automatically created with:

git grep -l " testing::" | xargs sed -i "s/ testing::/ ::testing::/g"
git grep -l "(testing::" | xargs sed -i "s/(testing::/(::testing::/g"
git cl format

After this, two .cc files failed to compile and I have fixed them
manually.

Bug: webrtc:10523
Change-Id: I4741d3bcedc831b6c5fdc04485678617eb4ce031
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132018
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27526}
2019-04-09 17:18:20 +00:00
Guido Urdaneta
a857698d54 Revert "Adding a restriction for legal RID values."
This reverts commit 07f3279a73.

Reason for revert: Suspect of producing consistent failure in some Chrome trybots, blocking rolls.

Failed test:
external/wpt/webrtc/RTCPeerConnection-addTransceiver.https.html


First failure:
https://ci.chromium.org/p/chromium/builders/try/linux-rel/64597

Original change's description:
> Adding a restriction for legal RID values.
> 
> According to the spec, RID values should be constrained to only
> alpha-numeric values. This was not enforced in our implementation to
> allow for more flexibility.
> It has been brought to our attention that some values that we currently
> consider legal (such as the '~', '=' ';' characters) might cause confusion
> with the simulcast syntax that uses these characters to indicate other
> meanings.
> What's worse, is that some characters, when used in RIDs (such as
> \u{1f937} \u{1f4a9} and \u{1f926}) cause uncontrollable laughter for some
> users which might also be a health hazard.
> This change resolves these issues by restricting RIDs to alpha-numeric.
> 
> Bug: webrtc:10491
> Change-Id: I16e262c87525d0289764beacd098e1525a355463
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132061
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27499}

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

Change-Id: I89f9d8a8d3fa82de8a7d429f11ad7cc30812ba7c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10491
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132244
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27525}
2019-04-09 17:12:33 +00:00
Amit Hilbuch
07f3279a73 Adding a restriction for legal RID values.
According to the spec, RID values should be constrained to only
alpha-numeric values. This was not enforced in our implementation to
allow for more flexibility.
It has been brought to our attention that some values that we currently
consider legal (such as the '~', '=' ';' characters) might cause confusion
with the simulcast syntax that uses these characters to indicate other
meanings.
What's worse, is that some characters, when used in RIDs (such as
\u{1f937} \u{1f4a9} and \u{1f926}) cause uncontrollable laughter for some
users which might also be a health hazard.
This change resolves these issues by restricting RIDs to alpha-numeric.

Bug: webrtc:10491
Change-Id: I16e262c87525d0289764beacd098e1525a355463
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132061
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27499}
2019-04-08 22:41:24 +00:00
Amit Hilbuch
e2a284d299 Adding metrics to measure usage of simulcast API.
Metrics are added to measure:
1. The number of send encodings in calls to AddTransceiver.
2. The number of times that simulcast is disabled because there is no
support from remote peer.
3. The number of times simulcast is indicated in ApplyLocal and
ApplyRemote and with which API surface (no simulcast, legacy munging,
spec-compliant).

Bug: webrtc:10372
Change-Id: I84717a1911efdf8aaf43cd6c04c7f09fcf2c58f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125482
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26979}
2019-03-05 22:01:34 +00:00
Amit Hilbuch
aabd036ecb Simulcast should be disabled if RID header extension is not supported.
Simulcast is disabled if the RIDs are not negotiated.
This change addresses the scenario in which RIDs are negotiated but
support for the RID extension is not negotiated.
In such cases, the RID extension cannot be used, so support for
simulcast should be turned off, as if RIDs were not negotiated.

A similar case can be made for MIDs, however MIDs are not explicitly
specified in simulcast. RIDs are only guaranteed to be  unique within
a media section so it would seem that MIDs should be required.
However, applications supply RID values and can guarantee their
uniqueness, so unlike RIDs, the use of MIDs is not enforced as mandatory.

Bug: webrtc:10075
Change-Id: Ic1b27878ea152eaee43a38bbfda11144307766fe
Reviewed-on: https://webrtc-review.googlesource.com/c/125176
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26934}
2019-03-01 22:44:36 +00:00
Amit Hilbuch
619b29423c RtpSender's RtpParameters were invalidated in a call to SLD/SRD.
RtpSender uses a transactional model when getting and setting RtpParameters.
One must call GetParameters() and then can use the returned object in a
subsequent call to SetParameters().
PeerConnection was calling GetParameters() and SetParameters() during
negotiation in SetLocalDescription and SetRemoteDescription effectively
invalidating any parameters that the client previously held.
This change introduces an internal way for the platform to modify
parameters without invalidating the transactional model, provided that
the modification is not severe.
Ex. removing simulcast layers is a severe modification and will
invalidate any outstanding parameters.

Bug: webrtc:10339
Change-Id: I362e8ca4d9556e04a1aa7a3e74e2c275f8d16fbc
Reviewed-on: https://webrtc-review.googlesource.com/c/124504
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26864}
2019-02-27 01:46:50 +00:00
Amit Hilbuch
2297d3311a Rejected simulcast layers will no longer appear in GetParameters().
Added a layer in RtpSender that bridges the gap between the layers
that the user sees and the layer that the media engine sees.
Media engine still maintains the invariant that the number of layers
cannot be changed, while RtpSender adds and removes layers between
the user GetParameters and SetParameters calls and the media engine.

Bug: webrtc:10251
Change-Id: I33839c1f9a9052cb6130253e5a582606f2cbe54a
Reviewed-on: https://webrtc-review.googlesource.com/c/122641
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26756}
2019-02-19 22:01:53 +00:00
Amit Hilbuch
aa58415bfa Reland "Enabling Simulcast use via AddTransceiver."
This is a reland of ce470aab51

Original change's description:
> Enabling Simulcast use via AddTransceiver.
> 
> This change removes the restriction on multiple send encodings when
> calling AddTransceiver. If RIDs are not provided in the
> simulcast scenario, they are auto-generated by the platform.
> 
> This effectively enables the use of spec-compliant simulcast.
> Tests are also added to verify simulcast functionality.
> 
> Bug: webrtc:10075
> Change-Id: I088feba70a26e85abcc7bfbe3ea1fe5103cd47d2
> Reviewed-on: https://webrtc-review.googlesource.com/c/121389
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26590}

Bug: webrtc:10075
Change-Id: Ib4392e36d5d60b966ecff56d4df69bf60d13a73d
Reviewed-on: https://webrtc-review.googlesource.com/c/122962
Reviewed-by: Amit Hilbuch <amithi@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26694}
2019-02-14 20:58:34 +00:00
Emircan Uysaler
78323436cf Revert "Enabling Simulcast use via AddTransceiver."
This reverts commit ce470aab51.

Failing below Layout test.
https://cs.chromium.org/chromium/src/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpReceiver-getParameters-expected.txt?type=cs&sq=package:chromium&g=0

Original change's description:
> Enabling Simulcast use via AddTransceiver.
> 
> This change removes the restriction on multiple send encodings when
> calling AddTransceiver. If RIDs are not provided in the
> simulcast scenario, they are auto-generated by the platform.
> 
> This effectively enables the use of spec-compliant simulcast.
> Tests are also added to verify simulcast functionality.
> 
> Bug: webrtc:10075
> Change-Id: I088feba70a26e85abcc7bfbe3ea1fe5103cd47d2
> Reviewed-on: https://webrtc-review.googlesource.com/c/121389
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26590}

TBR=steveanton@webrtc.org,orphis@webrtc.org,amithi@webrtc.org

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

Bug: webrtc:10075
Change-Id: Idef5ca735eaef190f83eec8630cd54e23737d813
Reviewed-on: https://webrtc-review.googlesource.com/c/122040
Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26618}
2019-02-08 21:40:45 +00:00
Amit Hilbuch
ce470aab51 Enabling Simulcast use via AddTransceiver.
This change removes the restriction on multiple send encodings when
calling AddTransceiver. If RIDs are not provided in the
simulcast scenario, they are auto-generated by the platform.

This effectively enables the use of spec-compliant simulcast.
Tests are also added to verify simulcast functionality.

Bug: webrtc:10075
Change-Id: I088feba70a26e85abcc7bfbe3ea1fe5103cd47d2
Reviewed-on: https://webrtc-review.googlesource.com/c/121389
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26590}
2019-02-07 17:29:59 +00:00