This change moves SctpTransport to be owned by JsepTransport, which now
holds a DataChannelTransport implementation for SCTP when it is used for
data channels.
This simplifies negotiation and fallback to SCTP. Negotiation can now
use a composite DataChannelTransport, just as negotiation for RTP uses a
composite RTP transport.
PeerConnection also has one fewer way it needs to manage data channels.
It now handles SCTP and datagram- or media-transport-based data channels
the same way.
There are a few leaky abstractions left. For example, PeerConnection
calls Start() on the SctpTransport at a particular point in negotiation,
but does not need to call this for other transports. Similarly, PC
exposes an interface to the SCTP transport directly to the user; there
is no equivalent for other transports.
Bug: webrtc:9719
Change-Id: I0d3151c48c1a511368277981fc4cf818a9f8ebb4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150341
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29012}
Also adding code in preparation of hiding the Module
implementation in PacedSender. The implementation details of
how the PacedSender+ProcessThread interaction works, has now
been moved into PacedSender (and out of RtpTransportControllerSend).
Instead of adding a "GetModuleImplementationForTesting" method
to the PacedSender class (which would have been the lazy way
out), I incorporated MockedProcessThread in the PacedSender tests.
This means more boilerplate code but the Module functionality
can be tested separately from the PacedSender and down the line
I think it would be a good idea to start using a separate thread
in the test, which is how the class under test is really used
in production.
Bug: none
Change-Id: Iec1b7c97cb0b363b331143ca70545e6ebafe2cd4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149176
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29011}
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}
Fix HexEncodeTest.TestZeroLengthNoDelimiter with enable_iterator_debugging=true,
use_custom_libcxx=false on Windows.
When passed empty string, hex_encode_with_delimiter would dereference
std::string::end() iterator in expression &*s.begin();
Bug: webrtc:10927
Change-Id: I27ce5fecf1f2a5c49a1b85bb94e1dcc92c4c3697
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150651
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Yves Gerey <yvesg@google.com>
Commit-Queue: Kimmo Kinnunen FI <kkinnunen@nvidia.com>
Cr-Commit-Position: refs/heads/master@{#29009}
The ScopedFakeClock contains a lock. Due to declaration order, this is
the first member of VideoStreamEncoderTest to be destroyed. However,
there are cyclic tasks that may still be running at that time, and they
may try to read the time, so if we're unlucky they may trigger a use
after free condition.
This only affects test and is simply solved by moving the declaration
to before the classes that uses it.
Bug: webrtc:10929
Change-Id: I998d5ced877f355e4a45ee5cf75b2eb75faa6113
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150795
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29008}
This fixes a bug in delay manager relative arrival delay mode that caused the effective minimum target level to be 2 packets instead of 1.
Bug: webrtc:10333
Change-Id: I33d32c8da692a3db22179edb923873d307f740fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150785
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29002}
Also annotate a few of the remaining uses, to guide further splits of
that large build target.
Bug: webrtc:8733
Change-Id: I16ac33ab48e6d39a1a8dbc2a3fc671d8db6dbfe9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150789
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29001}
Increased the tolarence of the RTP clock estimation without causing overlap between any of the known frequencies.
Bug: None
Change-Id: I7c3ffa0e69b25799d740f7eed17c7bfd464cd254
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149835
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29000}
The sink is only added once, but before this fix, the value was
updated to the same value, causing a tsan failure. This CL adds
a check so we don't update the value if it's set.
Bug: webrtc:10909
Change-Id: I46c8f7044f1441c0155b18881d1b8e0aeb7568c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150783
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28999}
The new target does not depend on libjingle_peerconnection_api, and to
do this, the named "audio" and "video" string literals had to be moved from
media_stream_interface.cc to media_types.cc.
In this cl, the dependency on libjingle_peerconnection_api can be
dropped from a few targets.
No-Presubmit: True
Bug: webrtc:8733
Change-Id: Icc675280d5c3c537f2255a9389ff18a482049921
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/53861
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28998}
This CL simplifies the pacer queue by removing the now unnecessary
beginpop/cancelpop/finalizepop methods. Instead there's a const top()
and a pop() much like an stl queue.
Old methods using the deprecated pacing code path are cleaned away.
Bug: webrtc:10633
Change-Id: Ib6da4d46a571bf56415172b790cc9e3f63206a38
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150522
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28997}
This was an oversight when integrating datagram-based data channels into
JsepTransportController. If a DatagramTransport exists, but only to be
used for data channels, JsepTransportController will still create an RTP
transport for it and use it for RTP.
Bug: webrtc:9719
Change-Id: I93cdb8bfc03159882a83a9f5097d3ef99fed215f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150241
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28993}
This reverts commit 87bed4793ff8f463202f442381339626d0b27f0d.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Reland "Preserve min and max playout delay from RTP header extension"
>
> This reverts commit f31cc08ba01ed403e89255b5f3f38d5dbdde855e.
>
> Reason for revert: Reland with fixes
>
> Original change's description:
> > Revert "Preserve min and max playout delay from RTP header extension"
> >
> > This reverts commit 85ba9972c42544c4771e394c9aa1d20bf5d09a91.
> >
> > Reason for revert: Audio might be more out of sync than needed due to jitter in received video stream.
> >
> > Original change's description:
> > > Preserve min and max playout delay from RTP header extension
> > >
> > > Audio and video synchronization can sometimes override the minimum
> > > and maximum playout delay that is set through the RTP header
> > > extension. This CL makes sure that the playout delay always is
> > > within the limits set by the RTP header extension.
> > >
> > > Bug: webrtc:10886
> > > Change-Id: Ie2dd4b901c4ed178759b555a8be04bd8b8f63bda
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150645
> > > Commit-Queue: Johannes Kron <kron@webrtc.org>
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#28980}
> >
> > TBR=stefan@webrtc.org,kron@webrtc.org
> >
> > Change-Id: I417e440d8a7e04ab3e19faa4454b704d2b971cd7
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: webrtc:10886
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150652
> > Reviewed-by: Johannes Kron <kron@webrtc.org>
> > Commit-Queue: Johannes Kron <kron@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#28984}
>
> TBR=stefan@webrtc.org,kron@webrtc.org
>
> Change-Id: I5a3908a8c45f7faedab6f009b22df81d674e13a0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10886
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150653
> Reviewed-by: Johannes Kron <kron@webrtc.org>
> Commit-Queue: Johannes Kron <kron@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28985}
TBR=stefan@webrtc.org,kron@webrtc.org
Change-Id: Id2e5d1ff804881e956a07fa4ae0f8301895dcc95
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10886
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150654
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28986}
This reverts commit f31cc08ba01ed403e89255b5f3f38d5dbdde855e.
Reason for revert: Reland with fixes
Original change's description:
> Revert "Preserve min and max playout delay from RTP header extension"
>
> This reverts commit 85ba9972c42544c4771e394c9aa1d20bf5d09a91.
>
> Reason for revert: Audio might be more out of sync than needed due to jitter in received video stream.
>
> Original change's description:
> > Preserve min and max playout delay from RTP header extension
> >
> > Audio and video synchronization can sometimes override the minimum
> > and maximum playout delay that is set through the RTP header
> > extension. This CL makes sure that the playout delay always is
> > within the limits set by the RTP header extension.
> >
> > Bug: webrtc:10886
> > Change-Id: Ie2dd4b901c4ed178759b555a8be04bd8b8f63bda
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150645
> > Commit-Queue: Johannes Kron <kron@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#28980}
>
> TBR=stefan@webrtc.org,kron@webrtc.org
>
> Change-Id: I417e440d8a7e04ab3e19faa4454b704d2b971cd7
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:10886
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150652
> Reviewed-by: Johannes Kron <kron@webrtc.org>
> Commit-Queue: Johannes Kron <kron@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28984}
TBR=stefan@webrtc.org,kron@webrtc.org
Change-Id: I5a3908a8c45f7faedab6f009b22df81d674e13a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10886
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150653
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28985}
This reverts commit 85ba9972c42544c4771e394c9aa1d20bf5d09a91.
Reason for revert: Audio might be more out of sync than needed due to jitter in received video stream.
Original change's description:
> Preserve min and max playout delay from RTP header extension
>
> Audio and video synchronization can sometimes override the minimum
> and maximum playout delay that is set through the RTP header
> extension. This CL makes sure that the playout delay always is
> within the limits set by the RTP header extension.
>
> Bug: webrtc:10886
> Change-Id: Ie2dd4b901c4ed178759b555a8be04bd8b8f63bda
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150645
> Commit-Queue: Johannes Kron <kron@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28980}
TBR=stefan@webrtc.org,kron@webrtc.org
Change-Id: I417e440d8a7e04ab3e19faa4454b704d2b971cd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10886
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150652
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28984}
Audio and video synchronization can sometimes override the minimum
and maximum playout delay that is set through the RTP header
extension. This CL makes sure that the playout delay always is
within the limits set by the RTP header extension.
Bug: webrtc:10886
Change-Id: Ie2dd4b901c4ed178759b555a8be04bd8b8f63bda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150645
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28980}
The packets belonging to a frame were kept in PacketBuffer
until the frame was decoded. This CL clears the dependencies
of an existing RtpFrameObject to PacketBuffer so that we can
free up PacketBuffer as soon as the RtpFrameObject is created.
Bug: none
Change-Id: Ic939be91815519ae1d1c67ada82006417b2d26a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149818
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28977}
Number of received FEC bytes is used for the
WebRTC.Video.FecBitrateReceivedInKbps UMA histogram. Before this cl,
that value is based on a FEC packet counter updated by
ReceiveStatistics::FecPacketReceived. This cl deletes that method, and
instead adds a byte count to the FecPacketCounter struct, which is
maintained by the UlpFecReceiver and used for other FEC-related stats.
Bug: webrtc:10917
Change-Id: I24bd494b6909a2fe109d28e2b71ca8f413d05911
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150533
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28976}
Previously the kDontRetransmit value was used to indicate packets that
should not be retransmitted but were put in the RtpPacketHistory anyway
as a temporary storage while waiting for a callback from PacedSender.
Since PacedSender now always owns the delayed packets directly, we can
remove all usage of StorageTye in RtpPacketHistory, and only put
packets there after pacing if RtpPacketToSend::allow_retransmission()
returns true.
Bug: webrtc:10633
Change-Id: I003b76ba43bd87658cc2a39e908fd28ebcd403f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150521
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28974}
The performance cost is not trivial but according to my profiling,
it is acceptable.
Bug: b/139745386
Change-Id: I0e63221ccf22e9f6fb32c630ff63a279e765994a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150539
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28973}
Add separate setting for configuring min bitrate that only applies when
adapting up in resolution.
Bug: none
Change-Id: I83d33ac3110a22602065b8d83130e3f619cb1eba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150329
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Mirta Dvornicic <mirtad@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28970}
The |frames_dropped| statistics contain not only frames that are dropped
but also frames that are in internal queues. This CL changes that so
that |frames_dropped| only contains frames that are dropped.
Bug: chromium:990317
Change-Id: If222568501b277a75bc514661c4f8f861b56aaed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150111
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28968}
This patch adds a new (optional) attribute to TURN_ALLOCATE_REQUEST,
TURN_LOGGING_ID (0xFF05).
The attribute is put into the comprehension-optional range
so that a TURN server should ignore it if it doesn't know if.
https://tools.ietf.org/html/rfc5389#section-18.2
The intended usage of this attribute is to correlate client and
backend logs.
Bug: webrtc:10897
Change-Id: I51fdbe15f9025e817cd91ee8e2c3355133212daa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149829
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28966}
This CL removes the old non-paced code path and instead uses a helper
class to just immediately pass the packet through the same code path as
when an actual pacer is used.
Bug: webrtc:10633
Change-Id: Id9a3ee4719829ad07710f5468e5452aa4bc8570b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150530
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28963}