Commit graph

51 commits

Author SHA1 Message Date
Danil Chapovalov
41b4bf97c1 Pass Environment instead of clock to Fake video encoders at construction
Some of the fake encoders, FakeVp8Encoder in particular, reuse structures that in turn rely on field trials. Thus fake encoders also can benefit from Environment passed at construction.

Bug: webrtc:15860
Change-Id: Ia1542b2663c75fd467e346aad9ead627ff9b3b0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346780
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42046}
2024-04-12 07:42:48 +00:00
Danil Chapovalov
3c5850148e Allow to create webrtc::Call with Environment
instead of passing utilities one by one

Bug: webrtc:15656
Change-Id: I1f3bf7ae66dcc62bbf17d81c927aabe748b42163
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328540
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41256}
2023-11-28 10:26:56 +00:00
Danil Chapovalov
a3ce407023 Cleanup Call construction
Return unique_ptr to clearly communicate ownership is transfered.
Remove Call::Config alias

Bug: None
Change-Id: Ie3aa1da383ad65fae490d218fced443d44961eab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/323160
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40934}
2023-10-16 06:34:26 +00:00
Danil Chapovalov
9ecc76e15b Use Timestamp type in RtpState struct
Bug: webrtc:13757
Change-Id: I7f8fc1a9c4cbf464b3969c4754ce5aa9c5b5f076
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303500
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39960}
2023-04-27 11:24:38 +00:00
Per K
f6ce1d39ee Allow injecting packets of type Any to Call::DeliverRtpPacket
MediaType::Any will be used by packets that can not be demuxed by
RtpTransport.

Bug: webrtc:14928
Change-Id: Ib759e65c7eede29defdad8073fd1ed6be814ab81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299280
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39710}
2023-03-29 06:36:17 +00:00
Danil Chapovalov
80b7c6befd Delete Call dependency on ProcessThread as unused
Last usage or ProcessThread was removed in
https://webrtc-review.googlesource.com/c/src/+/265921

Bug: webrtc:7219
Change-Id: Ia46d9e2530cd0dbf56a5c0ca6e1bf0936fd62672
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266363
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37287}
2022-06-21 08:59:38 +00:00
Tommi
3176ef79e9 Rename AudioReceiveStream to AudioReceiveStreamInterface
Bug: webrtc:7484
Change-Id: I22eaa7a9e082fc575cf7471d7a2f4f706564d54f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262805
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36965}
2022-05-23 08:44:26 +00:00
Tommi
dddbbebe2b Rename internal::AudioReceiveStream to AudioReceiveStreamImpl
Bug: webrtc:7484
Change-Id: Id0836a7fdd6fabbdc9bdc3b15e9965d9102bffa5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262803
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36959}
2022-05-22 12:22:18 +00:00
Ali Tofigh
641a1b11b6 Adopt absl::string_view in call/
Bug: webrtc:13579
Change-Id: Ib616eb3372da341fafb55c23038182751b9da5a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262780
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36910}
2022-05-17 12:00:45 +00:00
Artem Titov
ea24027e83 Use backticks not vertical bars to denote variables in comments for /call
Bug: webrtc:12338
Change-Id: I8f92127b61352bd4b98a0690e9a0435bb6c6f870
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226943
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34569}
2021-07-27 18:29:33 +00:00
Tommi
1c1f540487 Factor out common receive stream methods to a common interface.
Also including common Rtp config members.
Follow up changes will remove the ReceiveRtpConfig class in Call
and copy of extension headers, instead use the config directly
from the receive streams and not require stream recreation for changing
the headers.

Bug: webrtc:11993
Change-Id: I29ff3400d45d5bffddb3ad0a078403eb102afb65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221983
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34283}
2021-06-14 16:54:07 +00:00
Tomas Gunnarsson
c1d589146b Replace new rtc::RefCountedObject with rtc::make_ref_counted in a few files
Bug: webrtc:12701
Change-Id: Ie50225374f811424faf20caf4cf454b2fd1c4dc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215930
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33818}
2021-04-23 12:04:39 +00:00
Niels Möller
3e9cb2cbf2 Move deprecated code to their own build targets.
Moves the deprecated version of RtpRtcp module, and related classes
in video/.

Bug: webrtc:11581
Change-Id: Icc4cedb844fcd7c7372e8a907e5252f5b4fd955e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196904
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33025}
2021-01-18 13:09:47 +00:00
Alex Konradi
c20baf6067 Remove nesting of Naggy/Strict/NiceMock
This will soon become a compile-time error. Fix class hierarchies that
wrap StrictMock in a NiceMock or vice-versa by removing redundant
wrappings and removing inheritance from Nice/StrictMock and fixing the
call sites as appropriate.

Bug: b/173702213
Change-Id: Ic90b1f270c180f7308f40e52e358a8f6a6baad86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196461
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32783}
2020-12-07 08:19:50 +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
Tomas Gunnarsson
d21f7ab174 Remove media_has_been_sent from RtpState.
The field is unused and the way it's currently laid out in the code,
it maps to a state in the RtpSenderEgress class - which in turn puts
unnecessary threading restrictions on that class.

Bug: webrtc:11581
Change-Id: I41a4740c3277317f33f8e815d8c12c70b355c1db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177426
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31577}
2020-06-29 09:52:44 +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
Tomas Gunnarsson
f25761d798 Remove dependency from RtpRtcp on the Module interface.
The 'Module' part of the implementation must not be
called via the RtpRtcp interface, but is rather a part of
the contract with ProcessThread. That in turn is an
implementation detail for how timers are currently implemented
in the default implementation.

Along the way I'm deprecating away the factory function which
was inside the interface and tied it to one specific implementation.
Instead, I'm moving that to the implementation itself and down the
line, we don't have to go through it if we just want to create an
instance of the class.

The key change is in rtp_rtcp.h and the new rtp_rtcp_interface.h
header file (things moved from rtp_rtcp.h), the rest falls from that.

Change-Id: I294f13e947b9e3e4e649400ee94a11a81e8071ce
Bug: webrtc:11581
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176419
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31440}
2020-06-04 08:11: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
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
Per Åhgren
cc73ed3e70 APM: Add build flag to allow building WebRTC without APM
This CL adds a build flag to allow building the non-test parts
of WebRTC without the audio processing module.
The CL also ensures that the WebRTC code correctly handles
the case when no APM is available.

Bug: webrtc:5298
Change-Id: I5c8b5d1f7115e5cce2af4c2b5ff701fa1c54e49e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171509
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31133}
2020-04-26 23:06:44 +00:00
Erik Språng
014dd3c9f7 Trials should always be populated in call config.
The trials are always set when a Call instead is created by a
CallFactory, but a lot of unit tests creates instances directly.
This CL updates those call site. There is still a fallback in place
in RtpTransportControllerSend, since there are down-stream usages that
need to be clean up. After that, we'll remove the fallback.

Bug: webrtc:10809
Change-Id: I0aacf0473317bcd64252dd43d93c42de730e2ffa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160408
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29978}
2019-12-03 10:34:55 +00:00
Bjorn A Mellem
7a9a092708 Delete media transport integration.
MediaTransport is deprecated and the code is unused.

No-Try: True
Bug: webrtc:9719
Change-Id: I5b864c1e74bf04df16c15f51b8fac3d407331dcd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160620
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29923}
2019-11-26 19:19:36 +00:00
Niels Möller
04671b0543 Delete unused method PacedSender::QueueSizePackets
Corresponding mock class is deleted rather than updated,
since it appears unused.

Bug: webrtc:8422
Change-Id: If1c6c5ed73abff0d2545e8666c4bb8b63ee5b53f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/13862
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29505}
2019-10-17 08:35:38 +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
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
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
Fredrik Solenberg
3d2ed19d95 Remove Transport implementation from ChannelSend
Avoids taking a lock for each outgoing packet.

Bug: none
Change-Id: I54defbf07097ea8032b556b6900ca58c7486c3d9
Reviewed-on: https://webrtc-review.googlesource.com/c/112123
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26038}
2018-12-18 09:34:52 +00:00
Piotr (Peter) Slatala
179a3923b9 Implement TargetBitrate, NetworkRoute and overhead features of media transport interface.
So far ANA was not available for media transport interface. With recent changes to media transport, we can now account for packet overhead, network route (ip/tcp/udp/turn overheads) and we can also use bandwidth estimate from the media transport.


Bug: webrtc:9719
Change-Id: I98c9a09dd418b763c339ee2ee05592e164cf9199
Reviewed-on: https://webrtc-review.googlesource.com/c/110367
Commit-Queue: Peter Slatala <psla@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Anton Sukhanov <sukhanov@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25677}
2018-11-16 19:31:11 +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
Niels Möller
7d76a31f3d Use MediaTransportInterface, for audio streams.
Bug: webrtc:9719
Change-Id: I6d3db66b781173b207de51d84193fbd34a7f3239
Reviewed-on: https://webrtc-review.googlesource.com/c/104642
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Anton Sukhanov <sukhanov@webrtc.org>
Reviewed-by: Peter Slatala <psla@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25385}
2018-10-26 11:40:57 +00:00
Niels Möller
ae4237e5db Set ChannelReceive transport at construction time.
Followup to cl https://webrtc-review.googlesource.com/c/src/+/103640.
Set the rtcp_send_transport at construction time, delete
RegisterTransport, and the proxying of transport methods.

In addition, delete the unused RtcpRtpStats argument from the
constructor.

Bug: webrtc:9801
Change-Id: I80f25bc08dc2130386053568ddce4ef91654caeb
Reviewed-on: https://webrtc-review.googlesource.com/c/103803
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25010}
2018-10-05 10:56:40 +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
Sebastian Jansson
e5447fb6d1 Removed fake rtp transport controller send.
The fake rtp transport controller is only used by CallBitrateTest, but
the functionality tested in CallBitrateTest is now tested in
RtpBitrateConfiguratorTest. Removing the fake rtp transport controller
send reduces the complexity of refactoring the rtp transport controller
send interface.

Bug: webrtc:8415
Change-Id: I4673daea4e68521e7e14293514830d6e704219bc
Reviewed-on: https://webrtc-review.googlesource.com/54480
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22125}
2018-02-21 13:39:16 +00:00
Sebastian Jansson
fc8d26bd8a Reland "Moved BitrateConfig out of Call::Config."
This is a reland of 5897fe27ab.

Adding back CallConfig::kDefaultStartBitrateBps as deprecated.
Also making BitrateContraints::kDefaultStartBitrateBps private to stop
it from being used in other places.

Original change's description:
> Moved BitrateConfig out of Call::Config.
>
> This prepares for a CL extracting the bitrate configuration logic from
> the Call class.
>
> Also renaming BitrateConfig to BitrateConstraints.
>
> Bug: webrtc:8415
> Change-Id: I7e472683034c57bdc8093cdf5e78e477d1732480
> Reviewed-on: https://webrtc-review.googlesource.com/54400
> 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@{#22104}

Bug: webrtc:8415
Change-Id: Iacfe2d6daedff710832ab89210c7c66d4403c93b
Reviewed-on: https://webrtc-review.googlesource.com/55980
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@{#22123}
2018-02-21 11:38:42 +00:00
Lu Liu
e4bf600cad Revert "Moved BitrateConfig out of Call::Config."
This reverts commit 5897fe27ab.

Reason for revert: Breaking internal builds

Original change's description:
> Moved BitrateConfig out of Call::Config.
> 
> This prepares for a CL extracting the bitrate configuration logic from
> the Call class.
> 
> Also renaming BitrateConfig to BitrateConstraints.
> 
> Bug: webrtc:8415
> Change-Id: I7e472683034c57bdc8093cdf5e78e477d1732480
> Reviewed-on: https://webrtc-review.googlesource.com/54400
> 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@{#22104}

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

Change-Id: I598040edba7f1ff8b39d2d9c3c3ceca5627aaa0c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/55740
Reviewed-by: Lu Liu <lliuu@webrtc.org>
Commit-Queue: Lu Liu <lliuu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22106}
2018-02-20 19:16:38 +00:00
Sebastian Jansson
5897fe27ab Moved BitrateConfig out of Call::Config.
This prepares for a CL extracting the bitrate configuration logic from
the Call class.

Also renaming BitrateConfig to BitrateConstraints.

Bug: webrtc:8415
Change-Id: I7e472683034c57bdc8093cdf5e78e477d1732480
Reviewed-on: https://webrtc-review.googlesource.com/54400
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@{#22104}
2018-02-20 16:40:05 +00:00
Fredrik Solenberg
8f5787a919 Move ownership of voe::Channel into Audio[Receive|Send]Stream.
* VoEBase contains only stub methods (until downstream code is
  updated).

* voe::Channel and ChannelProxy classes remain, but are now created
  internally to the streams. As a result,
  internal::Audio[Receive|Send]Stream can have a ChannelProxy injected
  for testing.

* Stream classes share Call::module_process_thread_ for their RtpRtcp
  modules, rather than using a separate thread shared only among audio
  streams.

* voe::Channel instances use Call::worker_queue_ for encoding packets,
  rather than having a separate queue for audio (send) streams.

Bug: webrtc:4690
Change-Id: I8059ef224ad13aa0a6ded2cafc52599c7f64d68d
Reviewed-on: https://webrtc-review.googlesource.com/34640
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21578}
2018-01-11 12:58:31 +00:00
Oskar Sundbom
fedc00c391 Optional: Use nullopt and implicit construction in /call
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.

This CL was uploaded by git cl split.

Bug: None
Change-Id: I25e460b7a848c765369ce881f8833081eedf2558
Reviewed-on: https://webrtc-review.googlesource.com/23600
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21575}
2018-01-11 12:00:00 +00:00
Fredrik Solenberg
2a8779763a Remove voe::TransmitMixer
TransmitMixer's functionality is moved into the AudioTransportProxy
owned by AudioState. This removes the need for an AudioTransport
implementation in VoEBaseImpl, which means that the proxy is no longer
a proxy, hence AudioTransportProxy is renamed to AudioTransportImpl.

In the short term, AudioState needs to know which AudioDeviceModule is
used, so it is added in AudioState::Config. AudioTransportImpl needs
to know which AudioSendStream:s are currently enabled to send, so
AudioState maintains a map of them, which is reduced into a simple
vector for AudioTransportImpl.

To encode and transmit audio,
AudioSendStream::OnAudioData(std::unique_ptr<AudioFrame> audio_frame)
is introduced, which is used in both the Chromium and standalone use
cases. This removes the need for two different instances of
voe::Channel::ProcessAndEncodeAudio(), so there is now only one,
taking an AudioFrame as argument. Callers need to allocate their own
AudioFrame:s, which is wasteful but not a regression since this was
already happening in the voe::Channel functions.

Most of the logic changed resides in
AudioTransportImpl::RecordedDataIsAvailable(), where two strange
things were found:

  1. The clock drift parameter was ineffective since
     apm->echo_cancellation()->enable_drift_compensation(false) is
     called during initialization.

  2. The output parameter 'new_mic_volume' was never set - instead it
     was returned as a result, causing the ADM to never update the
     analog mic gain
     (https://cs.chromium.org/chromium/src/third_party/webrtc/voice_engine/voe_base_impl.cc?q=voe_base_impl.cc&dr&l=100).

Besides this, tests are updated, and some dead code is removed which
was found in the process.

Bug: webrtc:4690, webrtc:8591
Change-Id: I789d5296bf5efb7299a5ee05a4f3ce6abf9124b2
Reviewed-on: https://webrtc-review.googlesource.com/26681
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21301}
2017-12-15 16:48:57 +00:00
Fredrik Solenberg
d319534143 Move ADM initialization into WebRtcVoiceEngine
Bug: webrtc:4690
Change-Id: I3b8950fdb13835964c5bf41162731eff5048bf1a
Reviewed-on: https://webrtc-review.googlesource.com/23820
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20823}
2017-11-21 20:48:07 +00:00
Karl Wiberg
f3850f6933 Voice Engine: Require caller to supply an AudioDecoderFactory
So that we don't have to be capable of creating one ourselves, which
requires a dependency on the audio decoders.

In the process, remove the default values for the VoEBase::Init() arguments,
since there isn't a sensible default value for the audio decoder factory
anymore.

BUG=webrtc:8396

Change-Id: Idb433efa49e1a68e8206d369d27b3c255185777a
Reviewed-on: https://webrtc-review.googlesource.com/18200
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20552}
2017-11-02 13:54:57 +00:00
Fredrik Solenberg
a32dd018eb Reland "Remove AudioDeviceObserver and make ADM not inherit from the Module interface."
This is a reland of 34cdd2d402
Original change's description:
> Remove AudioDeviceObserver and make ADM not inherit from the Module interface.
> 
> (Re-upload of https://codereview.webrtc.org/3020493002/)
> 
> Bug: webrtc:4690, webrtc:7306
> Change-Id: I67fb9ebca1296aabc08eae8a292a5c69832dc35e
> Reviewed-on: https://webrtc-review.googlesource.com/5360
> Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20083}

Bug: webrtc:4690, webrtc:7306
Change-Id: Ib019439fe6ab0e6b759819e1e9bd320ba1d983bd
Reviewed-on: https://webrtc-review.googlesource.com/6300
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20137}
2017-10-04 11:31:18 +00:00
Fredrik Solenberg
d4404c232d Revert "Remove AudioDeviceObserver and make ADM not inherit from the Module interface."
This reverts commit 34cdd2d402.

Reason for revert: Breaks Chromium

Original change's description:
> Remove AudioDeviceObserver and make ADM not inherit from the Module interface.
> 
> (Re-upload of https://codereview.webrtc.org/3020493002/)
> 
> Bug: webrtc:4690, webrtc:7306
> Change-Id: I67fb9ebca1296aabc08eae8a292a5c69832dc35e
> Reviewed-on: https://webrtc-review.googlesource.com/5360
> Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20083}

TBR=solenberg@webrtc.org,henrika@webrtc.org

Change-Id: Iad03cafb7865f5a22394c3d4d1d3ff3e0fccd4ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:4690, webrtc:7306
Reviewed-on: https://webrtc-review.googlesource.com/5402
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20085}
2017-10-02 15:10:04 +00:00
Fredrik Solenberg
34cdd2d402 Remove AudioDeviceObserver and make ADM not inherit from the Module interface.
(Re-upload of https://codereview.webrtc.org/3020493002/)

Bug: webrtc:4690, webrtc:7306
Change-Id: I67fb9ebca1296aabc08eae8a292a5c69832dc35e
Reviewed-on: https://webrtc-review.googlesource.com/5360
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20083}
2017-10-02 15:01:20 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

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


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00