Move the TransportController from p2p/base to pc/.
The TransportController was in p2p/base before and it cannot depend on pc/ or media/ level targets because of the circular dependency. To make the TransportController be responsible for creating and managing the RtpTransport related objects which are pc/ level targets, the TransportController is moved from p2p/base to pc/. The TransportController makes more sense in pc/ anyway, since its main responsibility is processing the "transport" parts of SDP which is PeerConnection-specific. This is also easier than moving RtpTransport related objects to p2p/base because those objects also depend on other media/ and pc/ level targets such as srtpfilter, cryptoparams etc. Bug: webrtc:7013 Change-Id: Ic48dd5c454046ff3c81331f4b459f96a3255f328 Reviewed-on: https://webrtc-review.googlesource.com/4560 Commit-Queue: Zhi Huang <zhihuang@webrtc.org> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20049}
This commit is contained in:
parent
024d8970a7
commit
b5261580bc
@ -64,8 +64,6 @@ rtc_static_library("rtc_p2p") {
|
||||
"base/tcpport.cc",
|
||||
"base/tcpport.h",
|
||||
"base/transport.h",
|
||||
"base/transportcontroller.cc",
|
||||
"base/transportcontroller.h",
|
||||
"base/transportdescription.cc",
|
||||
"base/transportdescription.h",
|
||||
"base/transportdescriptionfactory.cc",
|
||||
@ -147,7 +145,6 @@ if (rtc_include_tests) {
|
||||
"base/fakeicetransport.h",
|
||||
"base/fakepackettransport.h",
|
||||
"base/fakeportallocator.h",
|
||||
"base/faketransportcontroller.h",
|
||||
"base/mockicetransport.h",
|
||||
"base/testrelayserver.h",
|
||||
"base/teststunserver.h",
|
||||
@ -189,7 +186,6 @@ if (rtc_include_tests) {
|
||||
"base/stunrequest_unittest.cc",
|
||||
"base/stunserver_unittest.cc",
|
||||
"base/tcpport_unittest.cc",
|
||||
"base/transportcontroller_unittest.cc",
|
||||
"base/transportdescriptionfactory_unittest.cc",
|
||||
"base/turnport_unittest.cc",
|
||||
"base/turnserver_unittest.cc",
|
||||
|
||||
@ -55,6 +55,8 @@ rtc_static_library("rtc_pc_base") {
|
||||
"srtpsession.h",
|
||||
"srtptransport.cc",
|
||||
"srtptransport.h",
|
||||
"transportcontroller.cc",
|
||||
"transportcontroller.h",
|
||||
"voicechannel.h",
|
||||
]
|
||||
|
||||
@ -269,6 +271,7 @@ if (rtc_include_tests) {
|
||||
"srtpsession_unittest.cc",
|
||||
"srtptestutil.h",
|
||||
"srtptransport_unittest.cc",
|
||||
"transportcontroller_unittest.cc",
|
||||
]
|
||||
|
||||
include_dirs = [ "//third_party/libsrtp/srtp" ]
|
||||
@ -286,6 +289,7 @@ if (rtc_include_tests) {
|
||||
|
||||
deps = [
|
||||
":libjingle_peerconnection",
|
||||
":pc_test_utils",
|
||||
":rtc_pc",
|
||||
"../api:array_view",
|
||||
"../logging:rtc_event_log_api",
|
||||
@ -318,6 +322,7 @@ if (rtc_include_tests) {
|
||||
"test/fakedatachannelprovider.h",
|
||||
"test/fakeperiodicvideocapturer.h",
|
||||
"test/fakertccertificategenerator.h",
|
||||
"test/faketransportcontroller.h",
|
||||
"test/fakevideotrackrenderer.h",
|
||||
"test/fakevideotracksource.h",
|
||||
"test/mock_datachannel.h",
|
||||
@ -332,6 +337,7 @@ if (rtc_include_tests) {
|
||||
|
||||
deps = [
|
||||
":libjingle_peerconnection",
|
||||
":rtc_pc_base",
|
||||
"..:webrtc_common",
|
||||
"../api:libjingle_peerconnection_test_api",
|
||||
"../api:rtc_stats_api",
|
||||
|
||||
@ -27,13 +27,13 @@
|
||||
#include "media/base/videosourceinterface.h"
|
||||
#include "p2p/base/dtlstransportinternal.h"
|
||||
#include "p2p/base/packettransportinternal.h"
|
||||
#include "p2p/base/transportcontroller.h"
|
||||
#include "p2p/client/socketmonitor.h"
|
||||
#include "pc/audiomonitor.h"
|
||||
#include "pc/mediamonitor.h"
|
||||
#include "pc/mediasession.h"
|
||||
#include "pc/rtcpmuxfilter.h"
|
||||
#include "pc/srtpfilter.h"
|
||||
#include "pc/transportcontroller.h"
|
||||
#include "rtc_base/asyncinvoker.h"
|
||||
#include "rtc_base/asyncudpsocket.h"
|
||||
#include "rtc_base/criticalsection.h"
|
||||
|
||||
@ -15,8 +15,8 @@
|
||||
#include "media/base/fakevideocapturer.h"
|
||||
#include "media/base/testutils.h"
|
||||
#include "media/engine/fakewebrtccall.h"
|
||||
#include "p2p/base/faketransportcontroller.h"
|
||||
#include "pc/channelmanager.h"
|
||||
#include "pc/test/faketransportcontroller.h"
|
||||
#include "rtc_base/gunit.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/thread.h"
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
|
||||
#include "media/base/fakemediaengine.h"
|
||||
#include "media/engine/fakewebrtccall.h"
|
||||
#include "p2p/base/faketransportcontroller.h"
|
||||
#include "pc/audiotrack.h"
|
||||
#include "pc/channelmanager.h"
|
||||
#include "pc/localaudiosource.h"
|
||||
@ -23,6 +22,7 @@
|
||||
#include "pc/rtpreceiver.h"
|
||||
#include "pc/rtpsender.h"
|
||||
#include "pc/streamcollection.h"
|
||||
#include "pc/test/faketransportcontroller.h"
|
||||
#include "pc/test/fakevideotracksource.h"
|
||||
#include "pc/videotrack.h"
|
||||
#include "pc/videotracksource.h"
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef P2P_BASE_FAKETRANSPORTCONTROLLER_H_
|
||||
#define P2P_BASE_FAKETRANSPORTCONTROLLER_H_
|
||||
#ifndef PC_TEST_FAKETRANSPORTCONTROLLER_H_
|
||||
#define PC_TEST_FAKETRANSPORTCONTROLLER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#include "p2p/base/fakedtlstransport.h"
|
||||
#include "p2p/base/fakeicetransport.h"
|
||||
#include "p2p/base/transportcontroller.h"
|
||||
#include "pc/transportcontroller.h"
|
||||
#include "rtc_base/bind.h"
|
||||
#include "rtc_base/sslfingerprint.h"
|
||||
#include "rtc_base/thread.h"
|
||||
@ -156,4 +156,4 @@ class FakeTransportController : public TransportController {
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
#endif // P2P_BASE_FAKETRANSPORTCONTROLLER_H_
|
||||
#endif // PC_TEST_FAKETRANSPORTCONTROLLER_H_
|
||||
@ -8,7 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "p2p/base/transportcontroller.h"
|
||||
#include "pc/transportcontroller.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
@ -36,7 +36,7 @@ struct CandidatesData : public rtc::MessageData {
|
||||
cricket::Candidates candidates;
|
||||
};
|
||||
|
||||
} // namespace {
|
||||
} // namespace
|
||||
|
||||
namespace cricket {
|
||||
|
||||
@ -840,9 +840,8 @@ void TransportController::UpdateAggregateStates_n() {
|
||||
bool all_done_gathering = !channels_.empty();
|
||||
for (const auto& channel : channels_) {
|
||||
any_receiving = any_receiving || channel->dtls()->receiving();
|
||||
any_failed = any_failed ||
|
||||
channel->dtls()->ice_transport()->GetState() ==
|
||||
IceTransportState::STATE_FAILED;
|
||||
any_failed = any_failed || channel->dtls()->ice_transport()->GetState() ==
|
||||
IceTransportState::STATE_FAILED;
|
||||
all_connected = all_connected && channel->dtls()->writable();
|
||||
all_completed =
|
||||
all_completed && channel->dtls()->writable() &&
|
||||
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef P2P_BASE_TRANSPORTCONTROLLER_H_
|
||||
#define P2P_BASE_TRANSPORTCONTROLLER_H_
|
||||
#ifndef PC_TRANSPORTCONTROLLER_H_
|
||||
#define PC_TRANSPORTCONTROLLER_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
@ -29,10 +29,11 @@
|
||||
namespace rtc {
|
||||
class Thread;
|
||||
class PacketTransportInternal;
|
||||
}
|
||||
} // namespace rtc
|
||||
|
||||
namespace webrtc {
|
||||
class MetricsObserverInterface;
|
||||
}
|
||||
} // namespace webrtc
|
||||
|
||||
namespace cricket {
|
||||
|
||||
@ -276,4 +277,4 @@ class TransportController : public sigslot::has_slots<>,
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
#endif // P2P_BASE_TRANSPORTCONTROLLER_H_
|
||||
#endif // PC_TRANSPORTCONTROLLER_H_
|
||||
@ -13,10 +13,10 @@
|
||||
|
||||
#include "p2p/base/dtlstransport.h"
|
||||
#include "p2p/base/fakeportallocator.h"
|
||||
#include "p2p/base/faketransportcontroller.h"
|
||||
#include "p2p/base/p2ptransportchannel.h"
|
||||
#include "p2p/base/portallocator.h"
|
||||
#include "p2p/base/transportcontroller.h"
|
||||
#include "pc/test/faketransportcontroller.h"
|
||||
#include "pc/transportcontroller.h"
|
||||
#include "rtc_base/fakesslidentity.h"
|
||||
#include "rtc_base/gunit.h"
|
||||
#include "rtc_base/helpers.h"
|
||||
@ -906,4 +906,4 @@ TEST_F(TransportControllerTest, NeedsIceRestart) {
|
||||
EXPECT_TRUE(transport_controller_->NeedsIceRestart("video"));
|
||||
}
|
||||
|
||||
} // namespace cricket {
|
||||
} // namespace cricket
|
||||
@ -21,9 +21,9 @@
|
||||
#include "api/statstypes.h"
|
||||
#include "call/call.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/transportcontroller.h"
|
||||
#include "pc/datachannel.h"
|
||||
#include "pc/mediasession.h"
|
||||
#include "pc/transportcontroller.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
#include "rtc_base/sigslot.h"
|
||||
#include "rtc_base/sslidentity.h"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user