mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Revert "Clean up libjingle API dependencies."
This reverts commit 57fb3154b5
.
Reason for revert: Breaks jingle_glue in chromium; need to leave candidate.h in place and include the new location until it's fixed.
Original change's description:
> Clean up libjingle API dependencies.
>
> This CL moves candidate.h into the public API, since it has
> been implicitly included before.
>
> This is a straightforward way of solving the circular
> dependencies involving that file. For instance,
> libjingle_peerconnection_api includes candidate.h from
> jsepicecandidate.h, but _api can't depend on rtc_p2p, which
> depends on _api. In fact, _api can't depend on much at all
> since it's a very high level abstraction; instead, things
> should depend on it.
>
> Furthermore, we have the case where deprecated headers
> include headers in internal modules. I just have to turn
> off include checking for those, but that's not a big deal.
>
> This CL punts the problem of callfactoryinterface.h being
> implicitly included, and pulling in most of the call
> module with it. This should be addressed in a follow-up
> CL.
>
> Bug: webrtc:7504
> Change-Id: I1b1729408158418333ccdf702bf529386090f0d7
> Reviewed-on: https://webrtc-review.googlesource.com/2020
> Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20034}
TBR=phoglund@webrtc.org,deadbeef@webrtc.org,solenberg@webrtc.org,perkj@webrtc.org
Change-Id: Ic5c3d0cf0b8c4d48ecbc49efdb76b373e3c950a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:7504
Reviewed-on: https://webrtc-review.googlesource.com/4702
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20036}
This commit is contained in:
parent
bf66794c06
commit
7bcfc3b232
23 changed files with 66 additions and 97 deletions
47
api/BUILD.gn
47
api/BUILD.gn
|
@ -34,9 +34,12 @@ rtc_source_set("call_api") {
|
|||
}
|
||||
|
||||
rtc_static_library("libjingle_peerconnection_api") {
|
||||
# Cannot have GN check enabled since that would introduce dependency cycles
|
||||
# TODO(kjellander): Remove (bugs.webrtc.org/7504)
|
||||
check_includes = false
|
||||
cflags = []
|
||||
sources = [
|
||||
"candidate.h",
|
||||
"datachannel.h",
|
||||
"datachannelinterface.h",
|
||||
"dtmfsenderinterface.h",
|
||||
"jsep.h",
|
||||
|
@ -44,14 +47,17 @@ rtc_static_library("libjingle_peerconnection_api") {
|
|||
"jsepsessiondescription.h",
|
||||
"mediaconstraintsinterface.cc",
|
||||
"mediaconstraintsinterface.h",
|
||||
"mediastream.h",
|
||||
"mediastreaminterface.cc",
|
||||
"mediastreaminterface.h",
|
||||
"mediastreamproxy.h",
|
||||
"mediastreamtrack.h",
|
||||
"mediastreamtrackproxy.h",
|
||||
"mediatypes.cc",
|
||||
"mediatypes.h",
|
||||
"notifier.h",
|
||||
"peerconnectionfactoryproxy.h",
|
||||
"peerconnectioninterface.h",
|
||||
"peerconnectionproxy.h",
|
||||
"proxy.h",
|
||||
"rtcerror.cc",
|
||||
|
@ -59,11 +65,15 @@ rtc_static_library("libjingle_peerconnection_api") {
|
|||
"rtpparameters.cc",
|
||||
"rtpparameters.h",
|
||||
"rtpreceiverinterface.h",
|
||||
"rtpsender.h",
|
||||
"rtpsenderinterface.h",
|
||||
"statstypes.cc",
|
||||
"statstypes.h",
|
||||
"streamcollection.h",
|
||||
"umametrics.h",
|
||||
"videosourceproxy.h",
|
||||
"videotracksource.h",
|
||||
"webrtcsdp.h",
|
||||
]
|
||||
|
||||
if (!build_with_chromium && is_clang) {
|
||||
|
@ -71,15 +81,8 @@ rtc_static_library("libjingle_peerconnection_api") {
|
|||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
|
||||
public_deps = [
|
||||
":libjingle_api_deprecated_headers",
|
||||
":peerconnection_and_implicit_call_api",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":optional",
|
||||
":rtc_stats_api",
|
||||
":video_frame_api",
|
||||
"..:webrtc_common",
|
||||
"../rtc_base:rtc_base",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
|
@ -94,34 +97,6 @@ rtc_static_library("libjingle_peerconnection_api") {
|
|||
}
|
||||
}
|
||||
|
||||
rtc_source_set("peerconnection_and_implicit_call_api") {
|
||||
# The peerconnectioninterface.h file pulls in call/callfactoryinterface.h
|
||||
# and the entire call module with it. We need to either get rid of this
|
||||
# dependency or pull most of call/ into the API. For now, silence the warnings
|
||||
# this creates since it creates a circular dependency (call very much depends
|
||||
# on API). See bugs.webrtc.org/7504.
|
||||
check_includes = false
|
||||
sources = [
|
||||
"peerconnectioninterface.h",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("libjingle_api_deprecated_headers") {
|
||||
# We need to include headers from undeclared targets here, since they cause
|
||||
# circular dependencies. These deprecated headers are going away anyway.
|
||||
# See http://bugs.webrtc.org/5883.
|
||||
check_includes = false
|
||||
sources = [
|
||||
"datachannel.h",
|
||||
"mediastream.h",
|
||||
"mediastreamtrack.h",
|
||||
"rtpsender.h",
|
||||
"streamcollection.h",
|
||||
"videotracksource.h",
|
||||
"webrtcsdp.h",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("ortc_api") {
|
||||
check_includes = false # TODO(deadbeef): Remove (bugs.webrtc.org/6828)
|
||||
sources = [
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/jsep.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/jsep.h"
|
||||
#include "api/jsepicecandidate.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
|
||||
namespace cricket {
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
// TODO(zhihuang): Remove unrelated headers once downstream applications stop
|
||||
// relying on them; they were previously transitively included by
|
||||
// mediachannel.h, which is no longer a dependency of this file.
|
||||
#include "media/base/streamparams.h"
|
||||
#include "media/base/videosinkinterface.h"
|
||||
#include "media/base/videosourceinterface.h"
|
||||
#include "rtc_base/ratetracker.h"
|
||||
|
|
|
@ -25,6 +25,7 @@ rtc_static_library("rtc_p2p") {
|
|||
"base/asyncstuntcpsocket.h",
|
||||
"base/basicpacketsocketfactory.cc",
|
||||
"base/basicpacketsocketfactory.h",
|
||||
"base/candidate.h",
|
||||
"base/common.h",
|
||||
"base/dtlstransport.cc",
|
||||
"base/dtlstransport.h",
|
||||
|
|
|
@ -8,28 +8,31 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef API_CANDIDATE_H_
|
||||
#define API_CANDIDATE_H_
|
||||
#ifndef P2P_BASE_CANDIDATE_H_
|
||||
#define P2P_BASE_CANDIDATE_H_
|
||||
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/helpers.h"
|
||||
#include "rtc_base/network_constants.h"
|
||||
#include "rtc_base/network.h"
|
||||
#include "rtc_base/socketaddress.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
// Candidate for ICE based connection discovery.
|
||||
// TODO(phoglund): remove things in here that are not needed in the public API.
|
||||
|
||||
class Candidate {
|
||||
public:
|
||||
// TODO(pthatcher): Match the ordering and param list as per RFC 5245
|
||||
// TODO: Match the ordering and param list as per RFC 5245
|
||||
// candidate-attribute syntax. http://tools.ietf.org/html/rfc5245#section-15.1
|
||||
Candidate()
|
||||
: id_(rtc::CreateRandomString(8)),
|
||||
|
@ -170,12 +173,11 @@ class Candidate {
|
|||
related_address_ = related_address;
|
||||
}
|
||||
const std::string& tcptype() const { return tcptype_; }
|
||||
void set_tcptype(const std::string& tcptype) {
|
||||
void set_tcptype(const std::string& tcptype){
|
||||
tcptype_ = tcptype;
|
||||
}
|
||||
|
||||
// The name of the transport channel of this candidate.
|
||||
// TODO(phoglund): remove.
|
||||
const std::string& transport_name() const { return transport_name_; }
|
||||
void set_transport_name(const std::string& transport_name) {
|
||||
transport_name_ = transport_name;
|
||||
|
@ -288,6 +290,18 @@ class Candidate {
|
|||
std::string url_;
|
||||
};
|
||||
|
||||
// Used during parsing and writing to map component to channel name
|
||||
// and back. This is primarily for converting old G-ICE candidate
|
||||
// signalling to new ICE candidate classes.
|
||||
class CandidateTranslator {
|
||||
public:
|
||||
virtual ~CandidateTranslator() {}
|
||||
virtual bool GetChannelNameFromComponent(
|
||||
int component, std::string* channel_name) const = 0;
|
||||
virtual bool GetComponentFromChannelName(
|
||||
const std::string& channel_name, int* component) const = 0;
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
#endif // API_CANDIDATE_H_
|
||||
#endif // P2P_BASE_CANDIDATE_H_
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/candidatepairinterface.h"
|
||||
|
||||
namespace cricket {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/candidatepairinterface.h"
|
||||
#include "p2p/base/jseptransport.h"
|
||||
#include "p2p/base/packettransportinternal.h"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <memory>
|
||||
#include <utility> // for std::pair
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/dtlstransport.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/p2ptransportchannel.h"
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/optional.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "p2p/base/transportinfo.h"
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#include <iterator>
|
||||
#include <set>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/umametrics.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/candidatepairinterface.h"
|
||||
#include "p2p/base/common.h"
|
||||
#include "p2p/base/relayport.h" // For RELAY_PORT_TYPE.
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/candidatepairinterface.h"
|
||||
#include "p2p/base/icetransportinternal.h"
|
||||
#include "p2p/base/portallocator.h"
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/optional.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/candidatepairinterface.h"
|
||||
#include "p2p/base/jseptransport.h"
|
||||
#include "p2p/base/packetlossestimator.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/dtlstransport.h"
|
||||
#include "p2p/base/jseptransport.h"
|
||||
#include "p2p/base/p2ptransportchannel.h"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/transportdescription.h"
|
||||
#include "rtc_base/helpers.h"
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/jsepicecandidate.h"
|
||||
#include "api/jsepsessiondescription.h"
|
||||
#include "api/webrtcsdp.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "pc/mediasession.h"
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/mediastreaminterface.h"
|
||||
#include "api/peerconnectioninterface.h"
|
||||
#include "media/base/mediachannel.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/port.h"
|
||||
#include "pc/peerconnection.h"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/jsepicecandidate.h"
|
||||
#include "api/jsepsessiondescription.h"
|
||||
// for RtpExtension
|
||||
|
@ -30,6 +29,7 @@
|
|||
#include "media/base/mediaconstants.h"
|
||||
#include "media/base/rtputils.h"
|
||||
#include "media/sctp/sctptransportinternal.h"
|
||||
#include "p2p/base/candidate.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/port.h"
|
||||
#include "pc/mediasession.h"
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/candidate.h"
|
||||
#include "api/optional.h"
|
||||
#include "api/peerconnectioninterface.h"
|
||||
#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"
|
||||
|
|
|
@ -526,7 +526,6 @@ rtc_static_library("rtc_base_generic") {
|
|||
"nethelpers.h",
|
||||
"network.cc",
|
||||
"network.h",
|
||||
"network_constants.h",
|
||||
"networkmonitor.cc",
|
||||
"networkmonitor.h",
|
||||
"nullsocketserver.cc",
|
||||
|
|
|
@ -38,6 +38,12 @@ class Network;
|
|||
class NetworkMonitorInterface;
|
||||
class Thread;
|
||||
|
||||
static const uint16_t kNetworkCostMax = 999;
|
||||
static const uint16_t kNetworkCostHigh = 900;
|
||||
static const uint16_t kNetworkCostUnknown = 50;
|
||||
static const uint16_t kNetworkCostLow = 10;
|
||||
static const uint16_t kNetworkCostMin = 0;
|
||||
|
||||
// By default, ignore loopback interfaces on the host.
|
||||
const int kDefaultNetworkIgnoreMask = ADAPTER_TYPE_LOOPBACK;
|
||||
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef RTC_BASE_NETWORK_CONSTANTS_H_
|
||||
#define RTC_BASE_NETWORK_CONSTANTS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace rtc {
|
||||
|
||||
static const uint16_t kNetworkCostMax = 999;
|
||||
static const uint16_t kNetworkCostHigh = 900;
|
||||
static const uint16_t kNetworkCostUnknown = 50;
|
||||
static const uint16_t kNetworkCostLow = 10;
|
||||
static const uint16_t kNetworkCostMin = 0;
|
||||
|
||||
enum AdapterType {
|
||||
// This enum resembles the one in Chromium net::ConnectionType.
|
||||
ADAPTER_TYPE_UNKNOWN = 0,
|
||||
ADAPTER_TYPE_ETHERNET = 1 << 0,
|
||||
ADAPTER_TYPE_WIFI = 1 << 1,
|
||||
ADAPTER_TYPE_CELLULAR = 1 << 2,
|
||||
ADAPTER_TYPE_VPN = 1 << 3,
|
||||
ADAPTER_TYPE_LOOPBACK = 1 << 4
|
||||
};
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
#endif // RTC_BASE_NETWORK_CONSTANTS_H_
|
|
@ -12,7 +12,6 @@
|
|||
#define RTC_BASE_NETWORKMONITOR_H_
|
||||
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/network_constants.h"
|
||||
#include "rtc_base/sigslot.h"
|
||||
#include "rtc_base/thread.h"
|
||||
|
||||
|
@ -28,6 +27,16 @@ enum class NetworkBindingResult {
|
|||
NETWORK_CHANGED = -4
|
||||
};
|
||||
|
||||
enum AdapterType {
|
||||
// This enum resembles the one in Chromium net::ConnectionType.
|
||||
ADAPTER_TYPE_UNKNOWN = 0,
|
||||
ADAPTER_TYPE_ETHERNET = 1 << 0,
|
||||
ADAPTER_TYPE_WIFI = 1 << 1,
|
||||
ADAPTER_TYPE_CELLULAR = 1 << 2,
|
||||
ADAPTER_TYPE_VPN = 1 << 3,
|
||||
ADAPTER_TYPE_LOOPBACK = 1 << 4
|
||||
};
|
||||
|
||||
class NetworkBinderInterface {
|
||||
public:
|
||||
// Binds a socket to the network that is attached to |address| so that all
|
||||
|
|
Loading…
Reference in a new issue