Commit Graph

15 Commits

Author SHA1 Message Date
c1ad1ff178 Do all BaseChannel operations within a single Thread::Invoke.
Instead of doing a separate Invoke for each channel, this CL first
gathers a list of operations to be performed on the signaling thread,
then does a single Invoke on the worker thread (and nested Invoke
on the network thread) to update all channels at once.

This includes the methods:
* Enable
* SetLocalContent/SetRemoteContent
* RegisterRtpDemuxerSink
* UpdateRtpHeaderExtensionMap

Also, removed the need for a network thread Invoke in
IsReadyToSendMedia_w by moving ownership of was_ever_writable_ to the
worker thread.

Bug: webrtc:12266
Change-Id: I31e61fe0758aeb053b09db84f234deb58dfb3d05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194181
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32817}
2020-12-11 03:25:43 +00:00
a094787cb7 Remove one use of sigslot from webrtc_session_description_factory
This instance turned out to only be used for a single constant, known at
creation time callback function, so a function was more appropriate.

Bug: none
Change-Id: If131f75ed82607af50c4d85f1e80a693170ff687
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192362
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32569}
2020-11-09 16:13:15 +00:00
9cd199dfe1 Make SdpOfferAnswerHandler be owned, not contained.
And add a Create() method to the class.
This makes it possible to experiment with subclassing the
SdpOfferAnswer object without modifying the PeerConnection.

Bug: webrtc:11995
Change-Id: I0a7c91a8999858ddcb1ea59ac4eb9a3b0663b0f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190288
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32501}
2020-10-27 08:45:07 +00:00
f01bd6c266 Break circular dependency on WebRtcSessionDescriptionFactory
After this change, SdpOfferAnswerHandler implements a read-only
interface called SdpStateProvider, which allows enough access
for WebRtcSessionDescriptionFactory to learn what it needs to know.

Bug: webrtc:12060
Change-Id: Ic888b5027b2df5fee407d32b89da66ff044c40de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190145
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32486}
2020-10-26 10:22:46 +00:00
763f5a9a8d Move initialization of WebRtcSessionDescriptionFactory to SdpHandler
Also move ssrc_generator and audio/video options, as well as some
signal handling that's related.

These variables were not referenced in peer_connection.cc any more.

Bug: webrtc:11995
Change-Id: I29f8661afad488380d256220b35330233e8233e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189967
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32471}
2020-10-22 13:20:28 +00:00
d89ce53daf Make WebRtcSessionDescriptionFactory depend on SdpOfferAnswerHandler
This factory is only used by SdpOfferAnswerHandler, so it should not
need to depend on PeerConnection.

Bug: webrtc:11995
Change-Id: Ib27d9d9fdf440be7db8890bf0e7520d0c67bde22
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189780
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32460}
2020-10-21 09:58:03 +00:00
e15fb15035 Separate RTP object handling (senders, receivers, transceivers)
This is part of the PeerConnection disassembly project.

Bug: webrtc:11995
Change-Id: I4f207c8af39e267c4b5752c0828b84e221e1f080
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188624
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32443}
2020-10-19 14:56:38 +00:00
1f7eab68c0 Remove superfluous #includes from peer_connection.cc, and add IWYU
Also adds a script that runs iwyu to the tools_webrtc directory.

Bug: webrtc:11995
Change-Id: I2185a9957e3578c2ec6d0d306061a48fcfe840d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188800
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32431}
2020-10-18 18:48:10 +00:00
d3ef499418 Enable payload type based demuxing with multiple tracks when applicable.
This fixes regressions caused by:
https://webrtc-review.googlesource.com/c/src/+/183120

... which disabled payload type demuxing when multiple video tracks are
present, to avoid one channel creating a default track intended for
another channel.

However, this isn't an issue when not bundling, as each track will be
delivered on separate transport.

And it's also not an issue when each track uses a distinct set of
payload types (e.g., VP8 is mapped to PT 96 in one m= section, and PT 97
in another).

This CL addresses both of those cases; PT demuxing is only disabled
when two bundled m= sections have overlapping payload types.

Bug: chromium:1139052, webrtc:12029
Change-Id: Ied844bffac2a5fac29147c11b56a5f83a95ecb36
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187560
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32419}
2020-10-16 03:09:22 +00:00
6f04b653ae Move the streams concept into sdp_offer_answer
This makes it easier to see that the tying of tracks
to streams affects only the SDP negotiation, and not
what's sent on the wire.

Bug: webrtc:11995
Change-Id: I8ca5adf0050e4a2be55d164a6d0e4d5811582476
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187359
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32368}
2020-10-09 13:06:51 +00:00
bc9ca25ac9 Move (phase 3) more functions called only in sdp_offer_answer
This is starting to get near the end of code moves.

Bug: webrtc:11995
Change-Id: I2f98e1025970db823c8c51bd9ab9f91f380d78a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186520
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32320}
2020-10-05 22:10:08 +00:00
a474fbf413 Move more functions called only in sdp_offer_answer into that file.
After this CL, sdp_offer_answer is bigger than peer_connection.

Bug: webrtc:11995
Change-Id: Ie923fabf836de46fa939fe6fd7b3d936bbc85dab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186380
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32301}
2020-10-02 21:03:37 +00:00
75b9ab6751 Move have_pending_rtp_data_channel_ to sdp_offer_answer
Also use accessors for the last few member variable references
in PeerConnection.

This completes removing the variable accesses from SdpOfferAnswerHandler
to PeerConnection.

Bug: webrtc:11995
Change-Id: I70c78b43035c15f20559f7a6a5b50c3a613fe907
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186200
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32272}
2020-10-01 12:28:09 +00:00
c06e374a55 Move more functions from PeerConnection to SdpOfferAnswer
These are functions that are called only from SdpOfferAnswer,
or that logically belong in the SdpOfferAnswer class.

Bug: webrtc:11995
Change-Id: I92136ee84e20e50957814c21b041ca152a2acca4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186268
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32271}
2020-10-01 12:25:59 +00:00
cdcfab0a52 Refactor webrtc::PeerConnection to split out offer/answer
This reduces the size of peer_connection.cc by more than 2000 lines.

Design doc for refatoring (available on request):
https://docs.google.com/document/d/1ETeUhon9sJihEUpA9ZZHpOGhzDqlZGLQOk3cD_CjKDM/edit

Bug: webrtc:11995
Change-Id: I9ed8603807b45bb192a01df026755cb6b5365291
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185801
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32212}
2020-09-28 14:27:51 +00:00