Commit graph

288 commits

Author SHA1 Message Date
Tommi
6eda26c550 Reland "Remove AudioReceiveStream::Reconfigure() method."
This reverts commit 8a18e5b3c9.

Reason for revert: Removing the problematic DCHECK.

Original change's description:
> Revert "Remove AudioReceiveStream::Reconfigure() method."
>
> This reverts commit e2561e17e2.
>
> Reason for revert: Speculative revert: breaks an downstream project
>
> Original change's description:
> > Remove AudioReceiveStream::Reconfigure() method.
> >
> > Instead, adding specific setters that are needed at runtime:
> > * SetDepacketizerToDecoderFrameTransformer
> > * SetDecoderMap
> > * SetUseTransportCcAndNackHistory
> >
> > The whole config struct is big and much of the state it holds, needs to
> > be considered const. For that reason the Reconfigure() method is too
> > broad of an interface since it overwrites the whole config struct
> > and doesn't actually handle all the potential config changes that might
> > occur when the config changes.
> >
> > Bug: webrtc:11993
> > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34252}
>
> TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:11993
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34253}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:11993
Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:26:15 +00:00
Andrey Logvin
8a18e5b3c9 Revert "Remove AudioReceiveStream::Reconfigure() method."
This reverts commit e2561e17e2.

Reason for revert: Speculative revert: breaks an downstream project

Original change's description:
> Remove AudioReceiveStream::Reconfigure() method.
>
> Instead, adding specific setters that are needed at runtime:
> * SetDepacketizerToDecoderFrameTransformer
> * SetDecoderMap
> * SetUseTransportCcAndNackHistory
>
> The whole config struct is big and much of the state it holds, needs to
> be considered const. For that reason the Reconfigure() method is too
> broad of an interface since it overwrites the whole config struct
> and doesn't actually handle all the potential config changes that might
> occur when the config changes.
>
> Bug: webrtc:11993
> Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34252}

TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11993
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34253}
2021-06-09 10:24:20 +00:00
Tommi
e2561e17e2 Remove AudioReceiveStream::Reconfigure() method.
Instead, adding specific setters that are needed at runtime:
* SetDepacketizerToDecoderFrameTransformer
* SetDecoderMap
* SetUseTransportCcAndNackHistory

The whole config struct is big and much of the state it holds, needs to
be considered const. For that reason the Reconfigure() method is too
broad of an interface since it overwrites the whole config struct
and doesn't actually handle all the potential config changes that might
occur when the config changes.

Bug: webrtc:11993
Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34252}
2021-06-09 09:39:30 +00:00
Tommi
1050fbca91 Remove synchronization from VideoSendStream construction.
* Make VideoSendStream and VideoSendStreamImpl construction non-blocking.
* Move ownership of the rtp video sender to VideoSendStream.
* Most state is constructed in initializer lists.
* More state is now const (including VideoSendStreamImpl ptr)
* Adding thread checks to classes that appear to have had a race before
  E.g. RtpTransportControllerSend. The change in threading now actually
  fixes an issue we weren't aware of.
* Moved from using weak_ptr to safety flag and made some PostTask calls
  cancellable that could potentially have been problematic. Initalizing
  the flag without thread synchronization is also simpler.

This should speed up renegotiation significantly when there are
multiple channels. A follow-up change will improve SetSend as well
which is another costly step during renegotiation.

Bug: webrtc:12840
Change-Id: If4b28da5a085643ce132c7cfcf80a62cd1a625c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221105
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34224}
2021-06-03 19:13:45 +00:00
Markus Handell
d99430410b Call: introduce SendStats.
Call send statistic updates are initiated on the send
transport sequence which forced calls to PostTask to the
worker thread which keeps several related attributes
protected by it.

Change this by:
* Using std::atomics for three attributes where synchronization
doesn't really matter and which can be accessed on either
context.
* Introducing a thread-compatible internal class which keeps
the statistics protected by the send transport sequence, and
emits UMA statistics on destruction.

The change also achieves the following trivial changes:
* The call origin time is now tracked by a proper
webrtc::Timestamp.
* The explicit use of the |send_transport_queue_| was replaced by
a more relaxed sequence checker.

Bug: webrtc:11993
Change-Id: I428a4d98b5fd2fd31222f62e597a9d61a3d4899f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220931
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34187}
2021-06-01 15:23:36 +00:00
Vojin Ilic
504fc192d0 Add ability to pass factory for RtpTransportControllerSend to PeerConnectionFactoryDependencies.
This way we can have custom implementation of RtpTransportControllerSendInterface and pass it properly to Call.
Call relies on RtpTransportControllerSendInterface already so this is natural way to customize RTP related classes.

If there is custom factory present in dependencies it will be used, otherwise default factory will be used.

Intention behind this change is to have ability to have custom QoS with custom parameters.

Bug: webrtc:12778
Change-Id: I5b88957025621ef4bcd63eaa98c218ad213da9c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217769
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@nvidia.com>
Cr-Commit-Position: refs/heads/master@{#34181}
2021-06-01 06:57:31 +00:00
Tommi
90738ddb4e Split VideoReceiveStream2 init into worker / network steps.
This is in preparation for actually doing this initialization
differently in the Call class. This CL takes the registration
steps that are inherently network thread associated and makes
them separate from the ctor/dtor.

Inject Call* instead of worker_thread(), which will simplify upcoming
work that needs to access the network_thread() as well.

This is related to:
https://webrtc-review.googlesource.com/c/src/+/220608
https://webrtc-review.googlesource.com/c/src/+/220609

Bug: webrtc:11993
Change-Id: I72769fd61de84967d9a645750c40d01660a2716b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220764
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34172}
2021-05-31 17:10:23 +00:00
Tommi
0377bab21b Split FlexfecReceiveStreamImpl init into worker / network steps.
This is comparable to this change for AudioReceiveStream:
https://webrtc-review.googlesource.com/c/src/+/220608/

Bug: webrtc:11993
Change-Id: I6bad7fa693441f80e86d8b021b8cf42727dc9142
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220609
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34170}
2021-05-31 15:29:41 +00:00
Tommi
02df2eb1de Split AudioStream initialization into worker / network steps.
This is in preparation for actually doing this initialization
differently in the Call class. This CL takes the registration
steps that are inherently network thread associated and makes
them separate from the ctor/dtor.

Bug: webrtc:11993
Change-Id: Ice2e16c108e0c302157534a3aa2b46738aaa7a93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220608
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34163}
2021-05-31 12:16:37 +00:00
Tommi
948e40cfdf Add thread guards and constness to Call members.
Bug: webrtc:11993
Change-Id: I8f6f6fb800f19b9fa2071a1d159dfe9334ab20cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220606
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34161}
2021-05-31 10:55:12 +00:00
Tommi
cae1f1d47b Move PostTask for DeliverRtcp from PeerConnection to Call.
This is part of moving the thread hops from the network thread to
worker (required by Call) into Call itself so that we can eventually
remove them.

Bug: webrtc:11993
Change-Id: Ib3ccdd6c75a3848daae2e3ce6c9a55d9617c2f50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220604
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34160}
2021-05-31 10:34:09 +00:00
Markus Handell
c81afe365d Call: prepare receive stats for thread switch.
This change collects the receive stats that Call
maintains into a new thread-compatible
internal class which can easily be switched to
the network thread.

Bug: webrtc:11993
Change-Id: I9fa9a7f057149789aa327e5ba8a8cb3379762272
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220760
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34158}
2021-05-31 08:37:26 +00:00
Tommi
cbb4421eac Remove DeliverPacketAsync.
This is currently unused and since we ultimately don't want the delivery
of packets to be async at this stage (but rather stay on the network
thread), we don't need it.

Bug: webrtc:11993
Change-Id: I6809026b6901c8ecfacd961e98ddf79aaa16d0bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220601
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34152}
2021-05-29 07:37:33 +00:00
Per Kjellander
fe2063ebc7 Remove REMB throttling funcionality from PacketRouter
This removes PacketRouter inheritance from  RemoteBitrateObserver and TransportFeedbackSenderInterface.
Call binds methods for sending REMB and transport feedback messages from RemoteCongestionController to PacketRouter.
This is needed until the RTCPTranseiver is used instead of the RTP modules.

Bug: webrtc:12693
Change-Id: I7088de497cd6d1e15c98788ff3e6b0a2c8897ea8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215965
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33993}
2021-05-12 11:24:58 +00:00
Tommi
2497a27b22 Store RtpPacketReceived::arrival_time as Timestamp.
Previously this value was rounded up to a millisecond value.
This change is complementary to another change:
https://webrtc-review.googlesource.com/c/src/+/216398

Bug: webrtc:12722
Change-Id: I0fd2baceb4608132615fb6ad241ec863e343edb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217521
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33928}
2021-05-05 16:22:33 +00:00
Tommi
3f418ccf99 Add documentation+DCHECK for the packet path from transport to call.
An upcoming change will remove PeerConnection's involvement in
the RTCP packet path and keep the flow consistent with the RTP packet
path.

Bug: webrtc:11993
Change-Id: I7ce1bbe8bbc352a49310e2e55b55ca5d8d927935
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217389
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33927}
2021-05-05 14:13:03 +00:00
Tomas Gunnarsson
eb9c3f237b Handle OnPacketSent on the network thread via MediaChannel.
* Adds a OnPacketSent callback to MediaChannel, which matches with
  MediaChannel::NetworkInterface::SendPacket.
* Moves the OnPacketSent handling to the media channel implementations
  (video/voice) and removes the PeerConnection/SdpOfferAnswerHandler
  layer from the call path.
* Call::OnSentPacket is called directly from the channels on the network
  thread. This eliminates a PostTask to the worker thread for every
  audio/video network packet.
* Remove sigslot dependency from MediaChannel (and derived).

Bug: webrtc:11993
Change-Id: I1f79a7aa60f05d47e1882f9be1c9323ea8fac5f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215403
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33777}
2021-04-19 16:59:48 +00:00
Tomas Gunnarsson
e984aa2e58 Add thread accessors to Call.
Classes associated with the Call instance, need access to these threads
and/or awareness, for checking for thread correctness.

Bug: webrtc:11993
Change-Id: I93bcee0657875f211be2ec959b96f818fa9fd8a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215584
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33772}
2021-04-19 15:59:20 +00:00
Tomas Gunnarsson
9915db3453 Move Call's histogram reporting code into destructor.
This is for better compatibility with thread annotations and how the
histogram data is collected. In the dtor we can make assumptions about
the state of the object, but that context is lost in member methods
even though they're only called from the destructor (and therefore
thread annotations can't "know" that the object is being destructed
inside those calls).

Bug: webrtc:11993
Change-Id: I8b698cc3340fb0db49430da6f7a9b9a02cabf0c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208200
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33295}
2021-02-18 09:58:54 +00:00
Etienne Pierre-Doray
cc4743795b [Battery]: Delay start of CallStats.
To avoid unnecessary repeating tasks, CallStats' timer is started only
upon Call::EnsureStarted().

Bug: chromium:1152887
Change-Id: I1015315f42127bf510affc3d22c930b20eac8bba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206880
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33232}
2021-02-11 12:00:05 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +00:00
Tomas Gunnarsson
ad3258647e Reland "Prepare to avoid hops to worker for network events."
This is a reland of d48a2b14e7

The diff of the reland (what caused the tsan error) can be seen
by diffing patch sets 2 and 3. Essentially I missed keeping the calls
to the transport controller on the worker thread. Note to self to add
thread/sequence checks to that code so that we won't have to rely on
tsan :)

Original change's description:
> Prepare to avoid hops to worker for network events.
>
> This moves the thread hop for network events, from BaseChannel and
> into Call. The reason for this is to move the control over those hops
> (including DeliverPacket[Async]) into the same class where the state
> is held that is affected by those hops. Once that's done, we can start
> moving the relevant network state over to the network thread and
> eventually remove the hops.
>
> I'm also adding several TODOs for tracking future steps and give
> developers a heads up.
>
> Bug: webrtc:11993
> Change-Id: Ice7ee3b5b6893532df52039324293979196d341d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204800
> Commit-Queue: Tommi <tommi@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33138}

Bug: webrtc:11993, webrtc:12430
Change-Id: I4fccaa418d22c2087a55bbb3ddbb25fac3b4dfcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205580
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33153}
2021-02-03 17:44:47 +00:00
Mirko Bonadei
47ec157fbf Revert "Prepare to avoid hops to worker for network events."
This reverts commit d48a2b14e7.

Reason for revert: TSan tests started to fail constantly after this CL (it looks like it is flaky and the CQ was lucky to get green). See https://ci.chromium.org/ui/p/webrtc/builders/ci/Linux%20Tsan%20v2/25042/overview.

Original change's description:
> Prepare to avoid hops to worker for network events.
>
> This moves the thread hop for network events, from BaseChannel and
> into Call. The reason for this is to move the control over those hops
> (including DeliverPacket[Async]) into the same class where the state
> is held that is affected by those hops. Once that's done, we can start
> moving the relevant network state over to the network thread and
> eventually remove the hops.
>
> I'm also adding several TODOs for tracking future steps and give
> developers a heads up.
>
> Bug: webrtc:11993
> Change-Id: Ice7ee3b5b6893532df52039324293979196d341d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204800
> Commit-Queue: Tommi <tommi@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33138}

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

Change-Id: Id87cf9cbcc8ed58e74d755a110f0ef9dd980e298
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11993
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205525
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33145}
2021-02-03 12:08:37 +00:00
Tomas Gunnarsson
d48a2b14e7 Prepare to avoid hops to worker for network events.
This moves the thread hop for network events, from BaseChannel and
into Call. The reason for this is to move the control over those hops
(including DeliverPacket[Async]) into the same class where the state
is held that is affected by those hops. Once that's done, we can start
moving the relevant network state over to the network thread and
eventually remove the hops.

I'm also adding several TODOs for tracking future steps and give
developers a heads up.

Bug: webrtc:11993
Change-Id: Ice7ee3b5b6893532df52039324293979196d341d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204800
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33138}
2021-02-02 20:13:00 +00:00
Tomas Gunnarsson
41bfcf4a63 Inject network thread to Call.
This will allow for transitioning PacketReceiver callbacks and
network related callbacks from being posted over to the worker thread
and instead can stay on the network thread along with related state.

Bug: webrtc:11993
Change-Id: I38df462d4dee064015c490f2b8f809cb47f23cf1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202039
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33116}
2021-01-31 10:56:14 +00:00
Tomas Gunnarsson
a722d2ac1e Add DeliverPacketAsync method to PacketReceiver.
This change includes a basic first implementation of the method in Call.
The implementation assumes being called on the network thread
and simply posts to the worker thread which is what currently happens
inside the BaseChannel class (but I'm that moving out of there).

Bug: webrtc:11993
Change-Id: Id94934808f655071ea9dc87ab20d2a4d8ca7e61e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202255
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33033}
2021-01-19 11:53:50 +00:00
Mirko Bonadei
b985748f66 Add WebRTC code freshness version string.
This CL adds a string to the resulting WebRTC library (trying to make
sure the version string will be there no matter how WebRTC is packaged).

This CL should be followed by some process to regularly and
automatically update the version string.

No-Try: True
No-Presubmit: True
Bug: webrtc:12159
Change-Id: I9143aeae2cd54d0d4048c138772888100d7873cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191223
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32825}
2020-12-14 16:22:35 +00:00
Mirko Bonadei
20e4c80fbe Reland "Introduce RTC_NO_UNIQUE_ADDRESS."
This is a reland of f5e261aaf6

This CL disables RTC_NO_UNIQUE_ADDRESS on MSan builds since
there have been some issues.

Original change's description:
> Introduce RTC_NO_UNIQUE_ADDRESS.
>
> This macro introduces the possibility to suggest the compiler that a
> data member doesn't need an address different from other non static
> data members.
>
> The usage of a macro is to maintain portability since at the moment
> the attribute [[no_unique_address]] is only supported by clang
> with at least -std=c++11 but it should be supported by all the
> compilers starting from C++20.
>
> Bug: webrtc:11495
> Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32246}

Bug: webrtc:11495, webrtc:12218
Change-Id: I4e6c7cc37d3daffad2407c9a2acfa897fa5b426a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189968
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32668}
2020-11-23 11:29:36 +00:00
Mirko Bonadei
0abd518abd Revert "Introduce RTC_NO_UNIQUE_ADDRESS."
This reverts commit f5e261aaf6.

Reason for revert: Breaks downstream projects.

Original change's description:
> Introduce RTC_NO_UNIQUE_ADDRESS.
>
> This macro introduces the possibility to suggest the compiler that a
> data member doesn't need an address different from other non static
> data members.
>
> The usage of a macro is to maintain portability since at the moment
> the attribute [[no_unique_address]] is only supported by clang
> with at least -std=c++11 but it should be supported by all the
> compilers starting from C++20.
>
> Bug: webrtc:11495
> Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32246}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org

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

Bug: webrtc:11495
Change-Id: Ice318d1b11ca3dff09c190187a0b0a32ca945fe3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186944
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32335}
2020-10-07 07:37:01 +00:00
Mirko Bonadei
f5e261aaf6 Introduce RTC_NO_UNIQUE_ADDRESS.
This macro introduces the possibility to suggest the compiler that a
data member doesn't need an address different from other non static
data members.

The usage of a macro is to maintain portability since at the moment
the attribute [[no_unique_address]] is only supported by clang
with at least -std=c++11 but it should be supported by all the
compilers starting from C++20.

Bug: webrtc:11495
Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32246}
2020-09-30 09:52:49 +00:00
Erik Språng
ceb44959ca Reland: Wires up WebrtcKeyValueBasedConfig in media engines.
This is a reland of
https://webrtc-review.googlesource.com/c/src/+/174261

Patchset 1 contains the old cl (plus a merge conflict fix).
Later patchets are bufixes: A PeerConnection can be created without a
Call instance (in the case of DataChannel only), so we can't always
use that to fetch the current trials.

Old CL descritpion:

This replaces field_trial:: -based functions from system_wrappers.
Field trials are still used as fallback, but injectable trials are now
possible.

// Since re-land is otherwise unchanged, setting previous reviewers as TBR
TBR=kthelgason@webrtc.org,mbonadei@webrtc.org,stefan@webrtc.org,srte@webrtc.org

Bug: webrtc:11926
Change-Id: I57a9e8c3454f226f77fb93215bcac83da65034b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185003
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32163}
2020-09-22 16:08:22 +00:00
Artem Titov
5956a17ed6 Revert "Wires up WebrtcKeyValueBasedConfig in media engines."
This reverts commit 591b2ab82e.

Reason for revert: Breaks downstream project

Original change's description:
> Wires up WebrtcKeyValueBasedConfig in media engines.
> 
> This replaces field_trial:: -based functions from system_wrappers.
> Field trials are still used as fallback, but injectable trials are now
> possible.
> 
> Bug: webrtc:11926
> Change-Id: I70f28c4fbabf6d9e55052342000e38612b46682c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174261
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32129}

TBR=mbonadei@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,perkj@webrtc.org

Change-Id: I3e169149a8b787aa6366bb357abb71794534c63a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11926
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184507
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32132}
2020-09-17 20:17:38 +00:00
Erik Språng
591b2ab82e Wires up WebrtcKeyValueBasedConfig in media engines.
This replaces field_trial:: -based functions from system_wrappers.
Field trials are still used as fallback, but injectable trials are now
possible.

Bug: webrtc:11926
Change-Id: I70f28c4fbabf6d9e55052342000e38612b46682c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174261
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32129}
2020-09-17 16:24:10 +00:00
Erik Språng
7703f23b60 Adds ability to delay pacer start until media is added.
This avoids the pacer thread waking up at 5ms interval if a
PeerConnection is created without actually using media.

The TaskQueuePacedSender solves the problem too, this CL is mostly a
safeguard in case we still find issues when turning it on...

Can be turned off by setting field trial "WebRTC-LazyPacerStart" to
"Disabled".

Bug: webrtc:10809
Change-Id: I8501106e608eccb14487576f24bdceaf3f324d80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183982
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32101}
2020-09-14 21:42:55 +00:00
Henrik Boström
29444c6524 [Adaptation] Multi-processor support for injected Resources.
Because a single Resource only has a single ResourceListener, injected
Resources only gets wired up to the stream's ResourceAdaptationProcessor
that was last to call SetResourceListener. This could potentially lead
to the relevant stream not adapting based on the injected resource
because it got wired up to the wrong stream's processor.

This CL fixes this issue by introducing BroadcastResourceListener. By
listening to 1 resource (the injected one), it can spawn N "adapter"
resources that mirror's the injected resource's usage signal, allowing
all ResourceAdaptationProcessor's to react to the signal.

This is wired up in Call, and tests are updated to verify the signal
gets through.

Bug: chromium:1101263, webrtc:11720
Change-Id: I8a37284cb9a68f08ca1bdb1ee050b7144c451297
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178386
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31612}
2020-07-02 10:28:11 +00:00
Per Kjellander
4c50e70569 Ensure CreateTimeControllerBasedCallFactory use simulated time in Call::SharedModuleThread
Also removes unnecessary Call::SharedModulesThread ctor.

Bug: webrtc:11598
Change-Id: I6d6a7ca4359598fbbfd4ae1aa550be6227ea27e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178394
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31594}
2020-06-30 15:38:35 +00:00
Henrik Boström
f4a9991cce [Adaptation] Adding adaptation resources from Call.
This CL adds AddAdaptationResource to Call and
AddAdaptationResource/GetAdaptationResources method to relevant
VideoSendStream and VideoStreamEncoder interfaces and implementations.

Unittests are added to ensure that resources can be added to the Call
both before and after the creation of a VideoSendStream and that the
resources always gets added to the streams.

In a follow-up CL, we will continue to plumb the resources all the way
to PeerConnectionInterface, and an integration test will then be added
to ensure that injected resources are capable of triggering adaptation.

Bug: webrtc:11525
Change-Id: I499e9c23c3e359df943414d420b2e0ce2e9b2d56
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177002
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31499}
2020-06-11 12:43:21 +00:00
Tommi
8edfe6e667 Remove unnecessary sequence checker.
Just use the task queue it represents instead.
Also rename the accessor to not confuse it with the 'network thread'.

Bug: none
Change-Id: Ic6c61652768ca3ff60dc0a2acc4850350feeb98e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176226
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31375}
2020-05-28 10:23:07 +00:00
Tommi
0d4647dffe Remove send_crit_, bitrate_crit_ and last_bandwidth_bps_crit_ locks.
...from the Call class.

With minimal shifting of ownership of a few variables, we can
maintain their state fully on the worker thread, where they're used.

This change also removes the dependency on RWLockWrapper.


Bug: webrtc:11612
Change-Id: Ia14be5bd6b50bd0b32d04f078b1e283080c00a19
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176122
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31360}
2020-05-26 19:43:10 +00:00
Tommi
31001a610d Remove receive_crit_ from Call.
This lock isn't needed anymore which has been clarified with recent
refactoring. Updated thread guards and related comments.

Change-Id: Ia7a1e59c45b67597264e73158654e4dffe6c4fc5
Bug: webrtc:11610
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176120
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31351}
2020-05-26 11:00:21 +00:00
Tommi
25c77c1aea Add SharedModuleThread class to share a module thread across Call instances.
This reduces the number of threads allocated per PeerConnection when
more than one PC is needed.

Bug: webrtc:11598
Change-Id: I3c1fd71705f90c4b4bbb1bc3f0f659c94016e69a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175904
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31347}
2020-05-25 17:21:56 +00:00
Tommi
04c94ad491 Fix misleading SequenceChecker variable name.
I named the network sequence checker 'worker' some time ago.
It represents the network TQ in RtpTransportControllerSendInterface
though, so should rather be called 'network'.

Bug: none
Change-Id: If82d7528b8cfcc180e1515b2fad63ed01610ec32
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175340
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31291}
2020-05-17 17:17:50 +00:00
Tommi
822a874463 Switch CallStats to TQ interface + callbacks on the worker thread.
Bug: webrtc:11489
Change-Id: I08c4cd42dfa28d88ed9f0aa8c8b2cfb606bf00df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174240
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31203}
2020-05-10 23:24:35 +00:00
Tommi
553c869c58 Start consolidating management/querying of stats on the Call thread.
Call is instantiated on what we traditionally call the 'worker thread'
in PeerConnection terms. Call statistics are however gathered, processed
and reported in a number of different ways, which results in a lot of
locking, which is also unpredictable due to the those actions themselves
contending with other parts of the system.

Designating the worker thread as the general owner of the stats, helps
us keeps things regular and avoids loading unrelated task queues/threads
with reporting things like histograms or locking up due to a call to
GetStats().

This is a reland of remaining changes from https://webrtc-review.googlesource.com/c/src/+/172847:
This applies the changes from the above CL to the forked files and
switches call.cc over to using the forked implementation.

Bug: webrtc:11489
Change-Id: I93ad560500806ddd0e6df1448b1bcf5a1aae7583
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174000
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31186}
2020-05-08 07:24:39 +00:00
Danil Chapovalov
cad3e0e2fa Replace DataSize and DataRate factories with newer versions
This is search and replace change:
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::Bytes<\(.*\)>()/DataSize::Bytes(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::bytes/DataSize::Bytes/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BitsPerSec<\(.*\)>()/DataRate::BitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BytesPerSec<\(.*\)>()/DataRate::BytesPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::KilobitsPerSec<\(.*\)>()/DataRate::KilobitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::bps/DataRate::BitsPerSec/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::kbps/DataRate::KilobitsPerSec/g"
git cl format

Bug: webrtc:9709
Change-Id: I65aaca69474ba038c1fe2dd8dc30d3f8e7b94c29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168647
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30545}
2020-02-18 16:09:50 +00:00
Danil Chapovalov
0c626afcf3 Use newer version of TimeDelta and TimeStamp factories in webrtc
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g"
git cl format

Bug: None
Change-Id: I87469d2e4a38369654da839ab7c838215a7911e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168402
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30491}
2020-02-10 12:21:17 +00:00
Harald Alvestrand
977b265702 Reduce some logging at INFO level by moving log statements
from LS_INFO to LS_VERBOSE.

By default, unit tests run with logging at info level.
A random run today produced more than 70.000 lines of
output. This CL would reduce that by approximately 15.000.

Bug: none
Change-Id: Ie62708cebf109510a2443aa5ab5c4e645ffc6707
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161950
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30077}
2019-12-12 21:54:06 +00:00
Erik Språng
17f82cfc68 Verifies trials are populated when creating a Call.
This check just makes it more clear what the expectations are.

Pululating trials was made mandatory in an earlier CL, but if you don't
populate this field it will trigger a DCHECK at lower layer where we're
actually trying to parse an experiment. That is confusing and
misleading.

Bug: None
Change-Id: I1f520841a5a3b911048c8ee6d309eb7bb179e037
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161301
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30005}
2019-12-04 13:36:02 +00:00
Erik Språng
662678dbf7 Adds injectable trials from peerconnection down to transport controller.
This will be immediately useful to guarantee consistent state across
components referencing the pacer, but will be a net benefit overall
imo.

Bug: webrtc:10809
Change-Id: I49630696f757a832ccf2e4c8597193bf087ce53b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159885
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29859}
2019-11-21 12:41:45 +00:00
Ivo Creusen
c3d1f9b0cd Enable injection of a custom NetEqFactory into PeerConnectionFactory.
Injecting both a custom NetEqFactory and an AudioDecoderFactory is not
supported, in that case the AudioDecoderFactory should be wrapped inside
the NetEqFactory.

Bug: webrtc:11005
Change-Id: I4e311eb1bfa03c91bca587d70540e81829f881c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158720
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29673}
2019-11-01 11:30:36 +00:00
Sebastian Jansson
f34116e356 Replacing bandwidth adaptation trial with stable target in Opus encoder.
This also means that the NetworkEstimate::bandwidth can be deprecated
as it's currently just a copy of the target_rate.

Bug: webrtc:10981
Change-Id: I1bc57b98480bd77ce052736b19d630c775428546
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153669
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29288}
2019-09-24 16:35:02 +00:00
Sebastian Jansson
40de3cc5ef Propagating TargetRate struct to BitrateAllocator.
Bug: webrtc:9883
Change-Id: I443ac7f1ef0f933e2165fdb2f912d314acc7f2f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153345
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29241}
2019-09-19 14:03:04 +00:00
Sebastian Jansson
93b1ea2168 Using struct for bitrate allocation limits.
Bug: webrtc:9883
Change-Id: I855c29808ffa14626d78842491fdf81cd00589e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153344
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29227}
2019-09-18 17:03:59 +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
Niels Möller
7bf7a427bf Delete flag VideoReceiveStream::Config::Rtp::remb
This flag became unused in https://codereview.webrtc.org/2789843002;
it was set, but the setting had no effect.

Bug: webrtc:7135
Change-Id: I012a7c3600bc7a371c7a589695823b30ed5647a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152661
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29192}
2019-09-16 11:20:55 +00:00
Niels Möller
f13df86414 Delete audio methods SignalNetworkState
These methods were defined, and called, but not doing anything.

Bug: None
Change-Id: I9955843a6bd86e4a583b0213ddb6b3b42e2ab815
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150792
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29020}
2019-08-30 09:27:30 +00:00
Tommi
25eb47ccf1 Make the RtpHeaderParserImpl available to tests and tools only.
There are a few reasons for making this test only:
* The code is only used by tests and utilities.
* The pure interface has only a single implementation so an interface isn't really needed.
  (a followup change could remove it altogether)
* The implementation always incorporates locking regardless of how the class gets used.
  See e.g. previous use in the Packet class.
* The implementation is a layer on top of RtpUtility::RtpHeaderParser which is
  sufficient for most production cases.

Change-Id: Ide6d50567cf8ae5127a2eb04cceeb10cf317ec36
Bug: none
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150658
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29010}
2019-08-29 15:56:40 +00:00
Florent Castelli
4e615d590a Wire the stable target bitrate from GoogCC to the BitrateAllocator
Deprecated the field BitrateAllocationUpdate::link_capacity since it is only
used by the Opus codec in order to smooth the target bitrate, which is
equivalent to the stable_target_bitrate field.

The unused field trial WebRTC-Bwe-StableBandwidthEstimate is also removed.

Bug: webrtc:10126
Change-Id: Ic4a8a9ca4202136d011b91dc23c3a27cfd00d975
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149839
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28941}
2019-08-22 15:25:15 +00:00
Erik Språng
6950b3088c Fix thread naming in Call constructor
This only fixes the name string you get when you query the threads, the
functionality is not changes.

Bug: None
Change-Id: I29408cf38e0e41faa127a70a010d37a980bb24ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149167
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28875}
2019-08-16 12:44:30 +00:00
Tommi
48b48e5cc9 Enable thread check in Call::GetStats().
I've updated all the tests that previously were calling this method on
the wrong thread, so we can enable this check now.

I've also landed some changes that simplify the threading model in this
class and subsequently I've removed some locks and can remove some more
in this CL.

Added some comments about future improvements for GetStats() to reduce
synchronization.

Simplified CallStats::OnRttUpdate() to have one fewer async methods.

Bug: webrtc:10847
Change-Id: I48e6809172142cc4be4385b7d4aa2affb52a963a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148588
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28821}
2019-08-09 11:43:16 +00:00
Tommi
78a7138600 Remove MediaTransport from Call.
There aren't any tests for this and the code isn't currently
active except for the fact that it adds complexity to the Call
class, synchronization into the active code path and makes future
improvements to the class more complex or impossible.

Bug: webrtc:9719
Change-Id: Ia41af0b2186b8a36ca70a07858990b6af7f3a5c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148078
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28807}
2019-08-08 10:58:57 +00:00
Danil Chapovalov
83bbe91398 Delete deprecated rtc_event_log header
Bug: webrtc:10206
Change-Id: I9ed3148843c647372993729b87c0e74741ab540b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147870
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28791}
2019-08-07 10:58:17 +00:00
Erik Språng
425d6aaa4c Add RtpPacketPacer interface for pacer control
The PacedSender is being reworked and will need an interface so we can
inject different implementations of it.

This CL introduces a new RtpPacketPacer interface inside the pacing
module. This interface handles the details of _how_ packets should be
paced, such as pacing rates/account for audio/max queue length etc.

The RtpPacketSender interface exposed from the rtp_rtcp module handles
only the actual sending of packets.

Some minor cleanups are included here.

Bug: webrtc:10809
Change-Id: I150b1a6262306d99e3f9d5f0b4afdb16a50e5ad8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145212
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28699}
2019-07-29 15:37:39 +00:00
Erik Språng
aa59eca891 Move RtpPacketSender and merge it with RtpPacketPacer.
This interface is intended to only handle packet-sending parts of the
paced sender.

See https://webrtc-review.googlesource.com/c/src/+/145212 for context

Bug: webrtc:10809
Change-Id: I93f0b40e1865665c2d436db67021350a0ed0687b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145216
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28662}
2019-07-24 13:28:21 +00:00
Jonas Olsson
0182a0300f Reland "Remove the injectable bitrate allocation strategy API."
This is a reland of 80cb3f6db6

Original change's description:
> Remove the injectable bitrate allocation strategy API.
>
> This removes PeerConnectionInterface::SetBitrateAllocationStrategy()
> plus a ton of now-dead code.
>
> Bug: webrtc:10556
> Change-Id: Icfae3bdd011588552934d9db4df16000847db7c3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133169
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28523}

TBR=kwiberg@webrtc.org

Bug: webrtc:10556
Change-Id: Ic17a7a7cc447292306876ee9582ad62fd2499765
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145900
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28585}
2019-07-17 10:20:45 +00:00
Mirko Bonadei
e95b57cdfc Revert "Remove the injectable bitrate allocation strategy API."
This reverts commit 80cb3f6db6.

Reason for revert: Performance regression on downstream project.

Original change's description:
> Remove the injectable bitrate allocation strategy API.
> 
> This removes PeerConnectionInterface::SetBitrateAllocationStrategy()
> plus a ton of now-dead code.
> 
> Bug: webrtc:10556
> Change-Id: Icfae3bdd011588552934d9db4df16000847db7c3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133169
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28523}

TBR=henrika@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org,srte@webrtc.org,alexnarest@webrtc.org,jonasolsson@webrtc.org

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

Bug: webrtc:10556
Change-Id: Ife905d661e7b1a227662395c729a9336c62fd2d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145338
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28560}
2019-07-12 15:27:19 +00:00
Jonas Olsson
80cb3f6db6 Remove the injectable bitrate allocation strategy API.
This removes PeerConnectionInterface::SetBitrateAllocationStrategy()
plus a ton of now-dead code.

Bug: webrtc:10556
Change-Id: Icfae3bdd011588552934d9db4df16000847db7c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133169
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28523}
2019-07-10 13:13:25 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Danil Chapovalov
53d45baa50 Make TaskQueueFactory required construction parameter for Call
Bug: webrtc:10284
Change-Id: I573ee0087c035e26918260c21b8b0213ddfe7ebc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143791
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28467}
2019-07-03 14:02:45 +00:00
Sebastian Jansson
3d61ab12e6 Adds send time to ReceivedPacket struct.
Bug: webrtc:10742
Change-Id: I7e83d5ec2e23d1db38d02a0c883466ecdcd387c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141874
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28290}
2019-06-14 15:01:36 +00:00
Sebastian Jansson
607a6f1c55 Moves conversion to ReceivedPacket from RtpPacketReceived to Call.
This moves the conversion from RtpPacketReceived to ReceivedPacket to
Call rather than RtpTransportController. This prepares for reusing the
struct for receive side network state estimation.

Bug: webrtc:10742
Change-Id: I9581438bc912ef4bb635a5d9a6dea488cf871d48
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141872
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28284}
2019-06-14 12:19:49 +00:00
Sebastian Jansson
4ad51d8b31 Removes SendSideCongestionController.
Bug: webrtc:9586
Change-Id: Id6f3508eb19f277d74c34edfbcaeb8a22320b030
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140286
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28222}
2019-06-11 11:09:24 +00:00
Ying Wang
8b27910cbc Include downlink delay into congestion window size.
Change-Id: I33db0c8134b6b3181a7b3abcf32a622a89ff3ab4

Bug: webrtc:10688
Change-Id: I33db0c8134b6b3181a7b3abcf32a622a89ff3ab4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138275
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28079}
2019-05-27 16:07:19 +00:00
Anton Sukhanov
4f08faae82 Introduce MediaTransportConfig
Currently we pass media_transport from PeerConnection to media layers. The goal of this change is to replace media_transport with struct MediaTransportCondif, which will enable adding different transports (i.e. we plan to add DatagramTransport) as well as other media-transport related settings without changing 100s of files.

TODO: In the future we should consider also adding rtp_transport in the same config, but it will require a bit more work, so I did not include it in the same change.


Bug: webrtc:9719
Change-Id: Ie31e1faa3ed9e6beefe30a3da208130509ce00cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137181
Commit-Queue: Anton Sukhanov <sukhanov@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28016}
2019-05-21 18:58:33 +00:00
Ying Wang
0810a7c25a Add base class NetworkPredictor and NetworkPredictorFactory and wire up.
Add base class NetworkPredictor and NetworkPredictorFactory in /api, make it possible to inject customized NetworkPredictor in PeerConnectionFactory level. The NetworkPredictor object will be pass down to GoogCCNetworkControl and DelayBasedBwe.

Bug: webrtc:10492
Change-Id: Iceeadbe1c9388b11ce4ac01ee56554cb0bf64d04
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130201
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27543}
2019-04-10 12:38:58 +00:00
Sebastian Jansson
b55015e4e1 Replacing SequencedTaskChecker with SequenceChecker.
Bug: webrtc:9883
Change-Id: I5e3189da2a46e6f4ed1a3c5a5dfd2f7d75a16b5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130961
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27518}
2019-04-09 12:28:04 +00:00
Johannes Kron
f59666b3b2 Fix potential bug due to malformed input
A reasonable amount of incoming packets could generate feedback
for millions of packets.

Bug: chromium:949020
Change-Id: I7f3e6b75b683af5b2732c472cc92c6788540486b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131333
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27481}
2019-04-08 11:46:47 +00:00
Benjamin Wright
a556448138 Don't recreate the VideoReceiveStream on SetFrameDecryptor in the MediaEngine.
This change introduces new logic to allow the injection of the FrameDecryptor
into an arbitrary already running VideoReceiveStream without resetting it. It
does this by taking advantage of the BufferedFrameDecryptor which will
forcefully be created regardless of whether a FrameDecryptor is passed in
during construction of the VideoReceiver if the
crypto_option.require_frame_encryption is true. By allowing the
BufferedFrameDecryptor to swap out which FrameDecryptor it uses this allows the
Receiver to switch decryptors without resetting the stream.

This is intended to mostly be used when you set your FrameDecryptor at a point
post creation for the first time.

Bug: webrtc:10416
Change-Id: If656b2acc447e2e77537cfa394729e5c3a8b660a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130361
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27458}
2019-04-05 07:58:05 +00:00
Danil Chapovalov
359fe33163 Move TaskQueueFactory from Call::Create parameter to CallConfig
to decouple it from other optional parameters
and with plan to make it mandatory

Bug: webrtc:10284
Change-Id: I71c1d3d9eaf09d00b99b0bc4c811ab173ea5f01f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130473
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27385}
2019-04-01 09:27:44 +00:00
Danil Chapovalov
c42f1a764d Revert "Move TaskQueueFactory from Call::Create parameter to CallConfig"
This reverts commit 90705cbc41.

Reason for revert: failed to compile due to conflict with another recent change

Original change's description:
> Move TaskQueueFactory from Call::Create parameter to CallConfig
> 
> to decouple it from other optional parameters
> and with plan to make it mandatory
> 
> Bug: webrtc:10284
> Change-Id: I1224abd90d8e06e0ee2d2baaa6d0fd54f8caad2b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130470
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27382}

TBR=danilchap@webrtc.org,nisse@webrtc.org

Change-Id: Ibe70f191d35f72e0373e49e5300d765b88d02db0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10284
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130472
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27383}
2019-04-01 08:41:03 +00:00
Danil Chapovalov
90705cbc41 Move TaskQueueFactory from Call::Create parameter to CallConfig
to decouple it from other optional parameters
and with plan to make it mandatory

Bug: webrtc:10284
Change-Id: I1224abd90d8e06e0ee2d2baaa6d0fd54f8caad2b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130470
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27382}
2019-04-01 08:31:02 +00:00
Sebastian Jansson
11c012a4ce Removing avoidable usages of Clock::GetRealTimeClock().
Bug: webrtc:10365
Change-Id: I56523f9b4de697b9136d7f8df74f43051c7b5b42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130484
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27363}
2019-03-29 18:09:37 +00:00
Piotr (Peter) Slatala
7fbfaa49d2 PeerConnection::SetBitrate now also configures media transport.
(so far SetBitrate did not do anything for media transport)

Bug: webrtc:9719
Change-Id: I48e669341ffe6c9e4697ff9146c314be7796a209
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127980
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Commit-Queue: Peter Slatala <psla@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27169}
2019-03-18 19:38:21 +00:00
Piotr (Peter) Slatala
946b968111 Add support for target rate constraints
WebRTC video engine now configures bitrate on media transport
correctly.

Bug: webrtc:9719
Change-Id: I85884cd76644b7eca3763cec8ce9e31b5b64db27
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127941
Commit-Queue: Peter Slatala <psla@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27167}
2019-03-18 18:54:58 +00:00
Jonas Oreland
6d83592367 Improve handling of packets with unknown ssrc.
Add a feature (gated by field trial) that stores
packets with unknown ssrc in a circular buffer
and replays them once a receive stream with matching
ssrc is created.

This improves situation where media is incoming
but signaling or SetFrameDecryptor is slow.

BUG=webrtc:10405

Change-Id: I7c7b2f4bd96c942c09e96db0cdae4ce5efef2541
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127543
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27159}
2019-03-18 11:34:43 +00:00
Benjamin Wright
41f9f2cc57 ClangTidy fixes for call/
These are manual edits please verify there are no typos.
Feel free to auto-submit if there are no issues.

Bug: webrtc:10410
Change-Id: I08ff36bd689fa7c3716c8e7017bd571cc9f09f35
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127642
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27125}
2019-03-14 09:38:01 +00:00
Sebastian Jansson
44dd9f29c7 Adds ChannelSend specific encoder task queue.
Before this change the encoder tasks runs on a shared worker queue.
That makes the destruction require synchronization to avoid races.
By keeping a separate encode queue to ChannelSend, we can safely
destruct the object without worrying for left over tasks, as they
will be stopped when the task queue is destroyed.

For TaskQueue implementations using one thread per TaskQueue this
will increase the thread count by the number of AudioSendStreams,
which typically is just one.

This is partly a reland of 9b9344742b

Original change's description:
> Removes lock from ChannelSend.
>
> The lock isn't really needed as encoder_queue_is_active_ can be checked
> on the task queue to provide synchronization.
>
> There is one behavioral change due to this: We will not cancel any currently
> pending encoding tasks when we stop sending, they will be allowed to finish.
>
> Bug: webrtc:10365
> Change-Id: I2b4897dde8d49bc7ee5d2d69694616aee8aaea38
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125096
> Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26963}

Bug: webrtc:10365
Change-Id: Iafb84e25d90ec8639359be80fad65763d08e5719
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125740
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27038}
2019-03-08 15:53:12 +00:00
Sebastian Jansson
0b69826ffb Don't inject worker queue into send streams.
This prepares for making AudioSendStream use its own task queue. In the
future more of the functionality that depends on running on the task
queue is planned to be moved directly into RtpTransportControllerSend.

They should instead get it from the transport controller. This affects
the media transport tests which previously assumed that the transport
controller could be missing. However, this is not something that is used
in production, so this is an improvement of the tests as they will
behave more like production code.

Bug: webrtc:9883
Change-Id: Ie32f4c2f6433ec37ac16a08d531ceb690ea9c0b5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126000
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27010}
2019-03-07 09:42:26 +00:00
Niels Möller
8fb1a6ad27 Delete a few return values from audio streams and video send streams.
Bug: webrtc:10198
Change-Id: I583dbb717aea26c9d282a3786062d285121fbf66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125723
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26986}
2019-03-06 10:56:08 +00:00
Sebastian Jansson
977b3351b9 Injecting Clock into audio streams.
Bug: webrtc:10365
Change-Id: Ia47fd806b84d94fd90b734c87c5e338e36fb695a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125191
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26969}
2019-03-05 10:49:46 +00:00
Sebastian Jansson
572c60f44d Injecting Clock into video senders.
Bug: webrtc:10365
Change-Id: I1dc42345a95929970d4f390e04eff56ca0c6d60b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125190
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26959}
2019-03-04 21:55:02 +00:00
Sebastian Jansson
8026d60ea9 Injecting Clock in video receive.
Bug: webrtc:10365
Change-Id: Id20fca5b8ad13c133e05efa8972d8f5679507064
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125192
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26958}
2019-03-04 21:53:57 +00:00
Sebastian Jansson
4e5f5eddef Allow Clock injection in Call.
Bug: webrtc:10365
Change-Id: I447df5add93648aebd4cf3e37d13310d990e0ba4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125193
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26955}
2019-03-04 18:40:12 +00:00
Sebastian Jansson
da6806c204 Injecting Clock into BitrateAllocator.
Bug: webrtc:10365
Change-Id: I9b722f09a25b3ec0f2899f1c83eae5a4648b6965
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125188
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26952}
2019-03-04 16:26:03 +00:00
Sebastian Jansson
896b47c928 Injecting ProcessThread and TaskQueueFactory in Call.
Bug: webrtc:10365
Change-Id: I7bda014f1075da141fefe9ac26e3fcfd16cf0223
Reviewed-on: https://webrtc-review.googlesource.com/c/125181
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26932}
2019-03-01 20:25:16 +00:00
Sebastian Jansson
ed50e6c759 Inject TaskQueueFactory in RtpTransportControllerSend.
Bug: webrtc:10365
Change-Id: I1656dcf774fb347afd8b28aa998acff8942cdd9f
Reviewed-on: https://webrtc-review.googlesource.com/c/125180
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26928}
2019-03-01 17:44:01 +00:00
Sebastian Jansson
547a1dceef Removes injection of RtpTransportControllerSend from Call::Create.
Bug: webrtc:10365
Change-Id: Ie319611828116f8ffbb582d5ab2099240b26699e
Reviewed-on: https://webrtc-review.googlesource.com/c/124784
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26926}
2019-03-01 14:49:04 +00:00
Sebastian Jansson
74682c1191 Inject TaskQueueFactory to video streams.
Bug: webrtc:10365
Change-Id: Ib655d8eac4467926bcb86cf2cb3728eabf5342d8
Reviewed-on: https://webrtc-review.googlesource.com/c/125089
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26921}
2019-03-01 11:35:39 +00:00
Sebastian Jansson
418dd0b96a Stop using special RTT value for DelayBasedBwe.
There are two RTT values reported to GoogCC. They come from the same
source initially but one is calculated and smoothed in the video call stats.
However, there's not really any technical reasons why this value should
be received via the stats, this has just been maintained for legacy reasons.

Experiments shows no real difference between the modes, therefore the
stats-reported RTT is removed in this CL as a cleanup.

Bug: None
Change-Id: If1462d6c91570ffb883ecef2ba034f04a571c9b5
Reviewed-on: https://webrtc-review.googlesource.com/c/123883
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26833}
2019-02-25 09:51:33 +00:00
Johannes Kron
7ff164e6e1 Plumbing of feedback on request setting
Bug: webrtc:10263
Change-Id: I23c09e680d6381598e4172b76025ff84f33aa4de
Reviewed-on: https://webrtc-review.googlesource.com/c/121422
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26606}
2019-02-08 10:54:21 +00:00
Piotr (Peter) Slatala
48c5493393 Add 'UpdateAllocationLimits' in media transport.
Bug: webrtc:9719
Change-Id: I90bd1d9858c259d7339420c574ad83d6fb18299c
Reviewed-on: https://webrtc-review.googlesource.com/c/118946
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Anton Sukhanov <sukhanov@webrtc.org>
Commit-Queue: Peter Slatala <psla@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26426}
2019-01-28 18:20:47 +00:00
Sebastian Jansson
79f0d4d0c7 Enables feature to account for unacknowledged data.
By enabling this trial, we can also remove reporting of packet
feedback status from send streams that was used before.

Bug: webrtc:9718
Change-Id: I3e7c4656b0ac6592a834617e044f23a072454181
Reviewed-on: https://webrtc-review.googlesource.com/c/118281
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26363}
2019-01-23 10:00:52 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Niels Möller
4687915495 Enable use of MediaTransportInterface for video streams.
Bug: webrtc:9719
Change-Id: I8c6027b4b15ed641e42fd210b3ea87d121508a69
Reviewed-on: https://webrtc-review.googlesource.com/c/111751
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Peter Slatala <psla@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26219}
2019-01-11 14:06:15 +00:00
Piotr (Peter) Slatala
b275788016 Register stat callbacks after rate observer is registered.
Currently the stats callback is registered too early.
For now we ignore media transport for these callbacks (it was ignored
already), and we will introduce changes to media transport in the
future.

Bug: webrtc:9719
Bug: chromium:906998
Bug: chromium:906533
Change-Id: I24c0265d46ec2eb35743de6cd96a11d8c41fefbe
Reviewed-on: https://webrtc-review.googlesource.com/c/114904
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Peter Slatala <psla@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26062}
2018-12-19 21:19:01 +00:00
Sebastian Jansson
2701bc93df Signals start rate when registering to TargetTransferRateObserver.
Bug: webrtc:10121
Change-Id: Ib608a98406d61225544d8b13bbcccb65c34e37f0
Reviewed-on: https://webrtc-review.googlesource.com/c/113814
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25983}
2018-12-12 09:22:32 +00:00
Sam Zackrisson
ff0581672e Delete the WebRTC.Call.TimeSendingAudioRtpPacketsInSeconds metric
It never saw much use, and is blocking refactoring.

Histograms.xml-side cleanup:
https://chromium-review.googlesource.com/c/chromium/src/+/1344141

Bug: webrtc:7882
Change-Id: I112232a573fcd218dc7a51bfcdd7898847d14f18
Reviewed-on: https://webrtc-review.googlesource.com/c/111506
Commit-Queue: Niels Moller <nisse@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25780}
2018-11-26 09:32:35 +00:00
Sebastian Jansson
89c94b9aea Adds target bandwidth to BitrateAllocator.
The target bandwidth is a more stable target rate as it does not follow
the variation in the control signal directly. It's intended to be used to
configure the audio frame length.

Bug: webrtc:9718
Change-Id: Idcc83ba0fef90e0ead2926d18ba6893a2b0f085f
Reviewed-on: https://webrtc-review.googlesource.com/c/107729
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25718}
2018-11-21 07:42:09 +00:00
Piotr (Peter) Slatala
cc8e8bb73f Pass the media transport from JsepTransportController to Call.
Add TargetRateObservers for media transport in the call object.



Bug: webrtc:9719
Change-Id: I5448d05359cf09b8cd2a678b2ac876aa8f8970e7
Reviewed-on: https://webrtc-review.googlesource.com/c/110622
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Anton Sukhanov <sukhanov@webrtc.org>
Commit-Queue: Peter Slatala <psla@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25662}
2018-11-15 17:36:48 +00:00
Oskar Sundbom
56ef305b67 Move event logging of config into AudioSendStream.
It was previously logged in Call, but streams are not always created
with the full configuration, which caused header extensions to be
missing from the log.

Bug: webrtc:9885
Change-Id: I86c0424004c4629ebab0f6b155b83fb90e15b131
Reviewed-on: https://webrtc-review.googlesource.com/c/108601
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25483}
2018-11-02 12:04:24 +00:00
Christoffer Rodbro
992a868393 Fix for clock reset repair.
Bug: none
Change-Id: I9a7ebbc75f1cc222e2b1b9c8ef546e54710275e8
Reviewed-on: https://webrtc-review.googlesource.com/c/108600
Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25434}
2018-10-30 15:36:47 +00:00
Christoffer Rodbro
76ad154eef New method for precise packet reception time measurement.
Bug: webrtc:9054
Change-Id: I43a32122e9af992b5e0ba8b187c9ad4f22aba80d
Reviewed-on: https://webrtc-review.googlesource.com/c/104503
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25167}
2018-10-15 11:25:26 +00:00
Stefan Holmer
64be7fa7d8 Move FecController to RtpVideoSender.
This also moves the packet feedback tracking to RtpVideoSender.

Bug: webrtc:9517
Change-Id: Ifb1ff85051730108a0b0d1dd30f6f8595ad2af6e
Reviewed-on: https://webrtc-review.googlesource.com/c/95920
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25019}
2018-10-05 14:39:01 +00:00
Sebastian Jansson
35fa280229 Adds allocated rate without feedback to new congestion controller.
When bitrate is allocated to streams that does not have packet feedback,
the allocated bitrate should be included in the estimate. This was
previously only implemented for the old congestion controller and not
for the new task queue based version.

To make the behavior more robust, the responsibility for tracking this
is moved to BitrateAllocator where it's handled consistently for
multiple streams without feedback.

Bug: webrtc:9586, webrtc:8243
Change-Id: I8af7fec23e1bdc08cc61cf1b4ff10461c3711fb0
Reviewed-on: https://webrtc-review.googlesource.com/102681
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24905}
2018-10-01 07:48:02 +00:00
Niels Möller
cb7e1d2edb Use SdpVideoFormat in VideoReceiveStream::Decoder
Replaces payload_name and codec_params.

Tbr: srte@webrtc.org
Bug: webrtc:9106
Change-Id: Ib45c501c6eb41e92fbb24ab00ada18bf10be42ed
Reviewed-on: https://webrtc-review.googlesource.com/98161
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24691}
2018-09-11 15:03:04 +00:00
Mirko Bonadei
8fdcac3f06 Remove clang:find_bad_constructs suppression from call:call.
This CL removes //build/config/clang:find_bad_constructs from the
suppressed_configs list, which means that clang:find_bad_constructs
is now enabled on these translation units.

Bug: webrtc:9251, webrtc:163
Change-Id: I74cb86c29cebb69dd22083718f1446f18f705cd4
Reviewed-on: https://webrtc-review.googlesource.com/95883
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24483}
2018-08-29 11:57:00 +00:00
Niels Möller
2ff1f2a342 Reland "Refactor RtpVideoStreamReceiver without RtpReceiver."
This is a reland of 0b9e01d605

Original change's description:
> Refactor RtpVideoStreamReceiver without RtpReceiver.
> 
> Bug: webrtc:7135
> Change-Id: Iabf3330e579b892efc160683f9f90efbf6ff9a40
> Reviewed-on: https://webrtc-review.googlesource.com/92398
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24232}

Bug: webrtc:7135
Change-Id: I707d4c5262e7b428bc7ceac2d886ff34c4a8d76a
Reviewed-on: https://webrtc-review.googlesource.com/93261
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24254}
2018-08-10 08:56:49 +00:00
Niels Moller
1788dcb506 Revert "Refactor RtpVideoStreamReceiver without RtpReceiver."
This reverts commit 0b9e01d605.

Reason for revert: Appears to breaks AV sync, failing perftests: 
CallPerfTest.PlaysOutAudioAndVideoInSyncWithVideoNtpDrift
CallPerfTest.PlaysOutAudioAndVideoInSyncWithAudioFasterThanVideoDrift
CallPerfTest.PlaysOutAudioAndVideoInSyncWithVideoFasterThanAudioDrift



Original change's description:
> Refactor RtpVideoStreamReceiver without RtpReceiver.
> 
> Bug: webrtc:7135
> Change-Id: Iabf3330e579b892efc160683f9f90efbf6ff9a40
> Reviewed-on: https://webrtc-review.googlesource.com/92398
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24232}

TBR=danilchap@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,sprang@webrtc.org

Change-Id: I70a1dcb519c51937e35e04ac82b2ab495bec0a3d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7135
Reviewed-on: https://webrtc-review.googlesource.com/93260
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24235}
2018-08-09 06:19:14 +00:00
Niels Möller
0b9e01d605 Refactor RtpVideoStreamReceiver without RtpReceiver.
Bug: webrtc:7135
Change-Id: Iabf3330e579b892efc160683f9f90efbf6ff9a40
Reviewed-on: https://webrtc-review.googlesource.com/92398
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24232}
2018-08-08 15:21:55 +00:00
Niels Möller
7008287219 Delete struct webrtc::PacketTime.
Replaced by a int64_t representing time in us.

Bug: webtrc:9584
Change-Id: I0505c020ef741ad940203ec300e8adb103856dda
Reviewed-on: https://webrtc-review.googlesource.com/91840
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24204}
2018-08-07 10:07:15 +00:00
Stefan Holmer
dbdb3a0079 Refactoring PayloadRouter.
- Move PayloadRouter to RtpTransportControllerInterface.
- Move RetransmissionLimiter inside RtpTransportControllerSend from
  VideoSendStreamImpl.
- Move video RTP specifics into PayloadRouter, in particular ownership
  of the RTP modules.
- PayloadRouter now contains all video specific RTP code, and will be
  renamed in a follow-up to VideoRtpSender.
- Introduce VideoRtpSenderInterface.

Bug: webrtc:9517
Change-Id: I1c7b293fa6f9c320286c80533b3c584498034a38
Reviewed-on: https://webrtc-review.googlesource.com/88240
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24009}
2018-07-17 14:46:15 +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
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
Danil Chapovalov
b9b146c9fe Replace rtc::Optional with absl::optional in audio, call and video
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script with parameters 'audio call video':
#!/bin/bash
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: I02c5db956846a88a268a300ba086703a02d62e36
Reviewed-on: https://webrtc-review.googlesource.com/83722
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23628}
2018-06-15 12:09:49 +00:00
Niels Möller
65ec0fc81e Delete unneeded includes of basictypes.h.
This is a kitchen-sink header, some pieces should be moved to
byteorder.h, the rest likely deleted.

Delete most includes of basictypes.h. In leaf headers,
include stddef.h and stdint.h explicitly where needed.

Bug: webrtc:6853
Change-Id: Ibc809936a8f94d418e4eb650da1e89c1b9142073
Reviewed-on: https://webrtc-review.googlesource.com/77721
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23333}
2018-05-21 19:35:08 +00:00
Sebastian Jansson
dfce03af6e Allows injection of network controller factory into peer connection factory.
Bug: webrtc:9155
Change-Id: I0a17024042f154297aba20f5d2dc766feb27f3f7
Reviewed-on: https://webrtc-review.googlesource.com/73123
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23313}
2018-05-18 17:07:16 +00:00
Sebastian Jansson
c6c44268bc Moves network control interface to API.
This prepares for allowing injection of a network controller.

Bug: webrtc:9155
Change-Id: I5624f47738db9c5cd4750eac76cb6289e06a7aa3
Reviewed-on: https://webrtc-review.googlesource.com/73100
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23188}
2018-05-09 11:01:36 +00:00
Sebastian Jansson
e6256055e7 Moving task queue from Call to transport controller.
Moving ownership of worker task queue in Call to
RtpTransportControllerSend. This CL also ensures that the task queue
is not destroyed until the process thread running
SendSideCongestionController is stopped.

The worker queue should be owned by RtpTransportControllerSend since
it is mainly used for rtp and transport related tasks such as bitrate
allocation and signaling network state.

Bug: webrtc:9232
Change-Id: I211edf1a3b9f9b2572875d5584cb788cb2449ef9
Reviewed-on: https://webrtc-review.googlesource.com/63023
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23119}
2018-05-04 12:44:44 +00:00
Niels Möller
259a497632 Reland "Reland "Move rtp-specific config out of EncoderSettings.""
This reverts commit 6c2c13af06.

Reason for revert: Intend to investigate and fix perf problems.

Original change's description:
> Revert "Reland "Move rtp-specific config out of EncoderSettings.""
> 
> This reverts commit 04dd176862.
> 
> Reason for revert: Regression in ramp up perf tests.
> 
> Original change's description:
> > Reland "Move rtp-specific config out of EncoderSettings."
> >
> > This is a reland of bc900cb1d1
> >
> > Original change's description:
> > > Move rtp-specific config out of EncoderSettings.
> > >
> > > In VideoSendStream::Config, move payload_name and payload_type from
> > > EncoderSettings to Rtp.
> > >
> > > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > > and should perhaps be renamed in a follow up cl. It's no longer
> > > passed as an argument to VideoCodecInitializer::SetupCodec.
> > >
> > > The latter then needs a different way to know the codec type,
> > > which is provided by a new codec_type member in VideoEncoderConfig.
> > >
> > > Bug: webrtc:8830
> > > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#22532}
> >
> > Bug: webrtc:8830
> > Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> > Reviewed-on: https://webrtc-review.googlesource.com/63721
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22595}
> 
> TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
> 
> Bug: webrtc:8830,chromium:827080
> Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
> Reviewed-on: https://webrtc-review.googlesource.com/65520
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22677}

TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org

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

Bug: webrtc:8830, chromium:827080
Change-Id: I9b62987bf5daced90dfeb3ebb6739c80117c487f
Reviewed-on: https://webrtc-review.googlesource.com/66862
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22751}
2018-04-05 14:30:09 +00:00
Jonas Olsson
0a713b63ed replace stringstream in call/
Bug: webrtc:8982
Change-Id: Ib4149bd421afa9018dcd76c60d0a6acfc3b764ff
Reviewed-on: https://webrtc-review.googlesource.com/64881
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22737}
2018-04-04 16:09:15 +00:00
Niels Möller
6c2c13af06 Revert "Reland "Move rtp-specific config out of EncoderSettings.""
This reverts commit 04dd176862.

Reason for revert: Regression in ramp up perf tests.

Original change's description:
> Reland "Move rtp-specific config out of EncoderSettings."
>
> This is a reland of bc900cb1d1
>
> Original change's description:
> > Move rtp-specific config out of EncoderSettings.
> >
> > In VideoSendStream::Config, move payload_name and payload_type from
> > EncoderSettings to Rtp.
> >
> > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > and should perhaps be renamed in a follow up cl. It's no longer
> > passed as an argument to VideoCodecInitializer::SetupCodec.
> >
> > The latter then needs a different way to know the codec type,
> > which is provided by a new codec_type member in VideoEncoderConfig.
> >
> > Bug: webrtc:8830
> > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22532}
>
> Bug: webrtc:8830
> Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> Reviewed-on: https://webrtc-review.googlesource.com/63721
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22595}

TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org

Bug: webrtc:8830,chromium:827080
Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
Reviewed-on: https://webrtc-review.googlesource.com/65520
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22677}
2018-03-29 11:45:18 +00:00
Tommi
38c5d9345d Reduce locking for CallStats (preparation for TaskQueue).
Reduce synchronization in the class significantly and not hold a lock
while calling out to external implementations.

* Rewrite tests to use a real ProcessThread.
* Update some code to use C++ 11 constructs & library features.

Bug: webrtc:9064
Change-Id: I240a819efb6ef8197da3f2edf7acf068d2a27e8b
Reviewed-on: https://webrtc-review.googlesource.com/64521
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22649}
2018-03-28 13:24:07 +00:00
Niels Möller
04dd176862 Reland "Move rtp-specific config out of EncoderSettings."
This is a reland of bc900cb1d1

Original change's description:
> Move rtp-specific config out of EncoderSettings.
> 
> In VideoSendStream::Config, move payload_name and payload_type from
> EncoderSettings to Rtp.
> 
> EncoderSettings now contains configuration for VideoStreamEncoder only,
> and should perhaps be renamed in a follow up cl. It's no longer
> passed as an argument to VideoCodecInitializer::SetupCodec.
> 
> The latter then needs a different way to know the codec type,
> which is provided by a new codec_type member in VideoEncoderConfig.
> 
> Bug: webrtc:8830
> Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> Reviewed-on: https://webrtc-review.googlesource.com/62062
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22532}

Bug: webrtc:8830
Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
Reviewed-on: https://webrtc-review.googlesource.com/63721
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22595}
2018-03-26 08:39:39 +00:00
Karl Wiberg
2b85792b01 Move rw_lock_wrapper.h to rtc_base/synchronization/
This moves it from an API directory (system_wrappers/include/) to a
non-API directory, which is exactly what we want for utilities like
this.

BUG=webrtc:8445
NOPRESUBMIT=true

Change-Id: Ie2879aca5fc1667e4222499d2a8fc2bba9ae2425
Reviewed-on: https://webrtc-review.googlesource.com/21328
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22587}
2018-03-23 19:47:08 +00:00
Sebastian Jansson
12130bb135 Reporting feedback availability to congestion controller.
This CL adds reporting of per packet feedback availability from Call
via RtpTransportControllerSend to SendSideCongestionController.

This is part of a series of CLs tracking the transport feedback status
of the streams known to BitrateAllocator and reporting the status to
the congestion controller.

Bug: webrtc:8415
Change-Id: I20b3dbb4a027c46476bc2d2bc875374bff05609a
Reviewed-on: https://webrtc-review.googlesource.com/63220
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22566}
2018-03-22 14:11:54 +00:00
Sebastian Jansson
b34556e598 Added receive time calculator under field trial.
The receive time calculator combines the packet time stamps received
from the socket interface with the system clock used in WebRTC. This
means that the packet timestamps are set in the WebRTC clock timebase
and that large jumps in the time stamps from the socket will not affect
the reported receive time stamps.

Bug: None
Change-Id: I293925c41919829524a115bb9377027bf0a797fb
Reviewed-on: https://webrtc-review.googlesource.com/61862
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22540}
2018-03-21 15:40:39 +00:00
Niels Moller
92be1caf4f Revert "Move rtp-specific config out of EncoderSettings."
This reverts commit bc900cb1d1.

Reason for revert: Broke downstream projects.

Original change's description:
> Move rtp-specific config out of EncoderSettings.
> 
> In VideoSendStream::Config, move payload_name and payload_type from
> EncoderSettings to Rtp.
> 
> EncoderSettings now contains configuration for VideoStreamEncoder only,
> and should perhaps be renamed in a follow up cl. It's no longer
> passed as an argument to VideoCodecInitializer::SetupCodec.
> 
> The latter then needs a different way to know the codec type,
> which is provided by a new codec_type member in VideoEncoderConfig.
> 
> Bug: webrtc:8830
> Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> Reviewed-on: https://webrtc-review.googlesource.com/62062
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22532}

TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org

Change-Id: I01f06c1fcf21eb2cd40dca7d4f268614200ee490
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8830
Reviewed-on: https://webrtc-review.googlesource.com/63720
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22537}
2018-03-21 13:53:49 +00:00
Sebastian Jansson
fe617a3af1 Adding has_packet_feedback to LimitObserver callback.
This CL adds a boolean indicating availability of per packet feedback
to the OnAllocationLimitsChanged callback on the
BitrateAllocator::LimitObserver interface.

This is part of a series of CLs tracking the transport feedback status
of the streams known to BitrateAllocator and reporting the status to
the congestion controller.

Bug: webrtc:8415
Change-Id: I5bd6e5796733da312556f2f681ff06d49ea2becc
Reviewed-on: https://webrtc-review.googlesource.com/63201
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22533}
2018-03-21 13:13:08 +00:00
Niels Möller
bc900cb1d1 Move rtp-specific config out of EncoderSettings.
In VideoSendStream::Config, move payload_name and payload_type from
EncoderSettings to Rtp.

EncoderSettings now contains configuration for VideoStreamEncoder only,
and should perhaps be renamed in a follow up cl. It's no longer
passed as an argument to VideoCodecInitializer::SetupCodec.

The latter then needs a different way to know the codec type,
which is provided by a new codec_type member in VideoEncoderConfig.

Bug: webrtc:8830
Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
Reviewed-on: https://webrtc-review.googlesource.com/62062
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22532}
2018-03-21 12:55:08 +00:00
Oleh Prypin
04d49500e2 Revert "Using safe casts of allocation limits in Call."
This reverts commit 4a9b4d6332.

Reason for revert: Breaks downstream projects

Original change's description:
> Using safe casts of allocation limits in Call.
> 
> Bug: None
> Change-Id: I71d0e1f92bf820d117b354dd7701c9c719cc2c0a
> Reviewed-on: https://webrtc-review.googlesource.com/61784
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22490}

TBR=nisse@webrtc.org,srte@webrtc.org

Change-Id: I720e97981574fd152cb7ed4204e29f9ea0b2e909
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/62920
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Commit-Queue: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22491}
2018-03-19 13:29:52 +00:00
Sebastian Jansson
4a9b4d6332 Using safe casts of allocation limits in Call.
Bug: None
Change-Id: I71d0e1f92bf820d117b354dd7701c9c719cc2c0a
Reviewed-on: https://webrtc-review.googlesource.com/61784
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22490}
2018-03-19 12:18:51 +00:00
Erik Språng
097085140e Reland: Add ability to emulate degraded network in Call via field trial
This is especially useful in Chrome, allowing use to emulate network
conditions in incoming or outgoing media without the need for platform
specific tools or hacks. It also doesn't interfere with the rest of the
network traffic.

Also includes some refactorings.

TBR=stefan@webrtc.org, philipel@webrtc.org

Originally reviewed on: https://webrtc-review.googlesource.com/33013

Bug: webrtc:8910
Change-Id: I162dde5fa20a260b41e5187fcf30b49f5e6fb0e0
Reviewed-on: https://webrtc-review.googlesource.com/61782
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22430}
2018-03-14 17:03:25 +00:00
Ilya Nikolaevskiy
16cba5c18d Revert "Add ability to emulate degraded network in Call via field trial"
This reverts commit 31a12c557d.

Reason for revert: Breaks downstream project.

Original change's description:
> Add ability to emulate degraded network in Call via field trial
> 
> This is especially useful in Chrome, allowing use to emulate network
> conditions in incoming or outgoing media without the need for platform
> specific tools or hacks. It also doesn't interfere with the rest of the
> network traffic.
> 
> Also includes some refactorings.
> 
> Bug: webrtc:8910
> Change-Id: I2656a2d4218acbe7f8ffd669de19a02275735438
> Reviewed-on: https://webrtc-review.googlesource.com/33013
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22418}

TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org

Change-Id: I22bda6da01c2ff5abd6f408c5ee9e4fba21294f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8910
Reviewed-on: https://webrtc-review.googlesource.com/61700
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22419}
2018-03-14 10:52:01 +00:00
Erik Språng
31a12c557d Add ability to emulate degraded network in Call via field trial
This is especially useful in Chrome, allowing use to emulate network
conditions in incoming or outgoing media without the need for platform
specific tools or hacks. It also doesn't interfere with the rest of the
network traffic.

Also includes some refactorings.

Bug: webrtc:8910
Change-Id: I2656a2d4218acbe7f8ffd669de19a02275735438
Reviewed-on: https://webrtc-review.googlesource.com/33013
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22418}
2018-03-14 10:22:50 +00:00
Sebastian Jansson
19704ec698 Removing AvailableBandwidth method on transport controller.
Removing the Synchronous call AvailableBandwidth from the
RtpTransportControllerSend interface. The bandwidth estimate is
provided trough a new interface that communicates with a struct
making it easier to add parameters in the future.

This prepares for removing locking behavior in
SendSideCongestionController that exists just to support this feature.

To keep backwards compatibility with the old
SendSideCongestionController, the struct TargetTransferRate
is constructed in RtpTransportControllerSend. This step can be
removed in the future when the old SendSideCongestionController
 is deprecated.

Bug: webrtc:8415
Change-Id: I06f64a89848157de412901c989650d1ecf35246b
Reviewed-on: https://webrtc-review.googlesource.com/60800
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22387}
2018-03-12 15:53:49 +00:00
Sebastian Jansson
a06e919b9f Removing interface to access pacer via SSCC.
SSCC was accessing the pacer just to report values back to
RtpTransportControllerSend which already owns the pacer.
This CL moves those access methods.

To make RtpTransportControllerSend simpler, Call is made
responsible to keep track of network status used only as a
condition for report the pacer queuing delay.

Bug: webrtc:8415
Change-Id: I306bc9fcd3d8dcc7a637d51f2629ececebd48cad
Reviewed-on: https://webrtc-review.googlesource.com/60483
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22331}
2018-03-07 19:01:50 +00:00
Ying Wang
012b7e7473 Add a couple of logs.
Bug: webrtc:8963
Change-Id: I462b0fe493306429fdec499f1324f06a80ae17ac
Reviewed-on: https://webrtc-review.googlesource.com/59681
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22293}
2018-03-05 16:42:02 +00:00
Sebastian Jansson
45087cd23f Moved retransmission rate limiter to Call class.
Ownership of the retransmission rate limiter for video is moved
from send side congestion controller to Call. This is to reduce the
interface on the rtp transport controller send.

Bug: webrtc:8415
Change-Id: Ie9c7317400a9eb61a3c8325b9e527844ffc13769
Reviewed-on: https://webrtc-review.googlesource.com/58745
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22254}
2018-03-01 17:22:28 +00:00
philipel
832b1c80d4 Propagating total_bitrate_bps from BitrateAllocator to ProbeController, part 2.
Added total_bitrate_bps to RtpTransportControllerSend::SetAllocatedSendBitrateLimits.

Bug: webrtc:8955
Change-Id: Ifa2d70e189b8976ab5bf77e9d6b159dddabfb270
Reviewed-on: https://webrtc-review.googlesource.com/58940
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22252}
2018-03-01 16:18:18 +00:00
Sebastian Jansson
25e5110ab0 Explicit injection of rate limiter in VideoSendStream.
Injecting the retransmission rate limiter used in video send stream
directly rather than using the transport controller reference.
This prepares for removing ownership of the retransmission rate limiter
from the congestion controller.

Bug: webrtc:8415
Change-Id: Iee8af53e62f407ee430625008f2d2b0cabb1f369
Reviewed-on: https://webrtc-review.googlesource.com/58800
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22251}
2018-03-01 16:01:08 +00:00