diff --git a/api/BUILD.gn b/api/BUILD.gn index 606e9d9917..0289fe8feb 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -38,6 +38,7 @@ rtc_static_library("libjingle_peerconnection_api") { sources = [ "candidate.cc", "candidate.h", + "cryptoparams.h", "datachannelinterface.h", "dtmfsenderinterface.h", "jsep.h", @@ -147,7 +148,6 @@ rtc_source_set("libjingle_logging_api") { } rtc_source_set("ortc_api") { - check_includes = false # TODO(deadbeef): Remove (bugs.webrtc.org/6828) sources = [ "ortc/mediadescription.cc", "ortc/mediadescription.h", @@ -167,8 +167,11 @@ rtc_source_set("ortc_api") { # TODO(deadbeef): Create a separate target for the common things ORTC and # PeerConnection code shares, so that ortc_api can depend on that instead of # libjingle_peerconnection_api. - public_deps = [ + deps = [ ":libjingle_peerconnection_api", + ":optional", + "..:webrtc_common", + "../rtc_base:rtc_base", ] if (!build_with_chromium && is_clang) { # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). diff --git a/api/cryptoparams.h b/api/cryptoparams.h new file mode 100644 index 0000000000..2350528358 --- /dev/null +++ b/api/cryptoparams.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 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 API_CRYPTOPARAMS_H_ +#define API_CRYPTOPARAMS_H_ + +#include + +namespace cricket { + +// Parameters for SRTP negotiation, as described in RFC 4568. +struct CryptoParams { + CryptoParams() : tag(0) {} + CryptoParams(int t, + const std::string& cs, + const std::string& kp, + const std::string& sp) + : tag(t), cipher_suite(cs), key_params(kp), session_params(sp) {} + + bool Matches(const CryptoParams& params) const { + return (tag == params.tag && cipher_suite == params.cipher_suite); + } + + int tag; + std::string cipher_suite; + std::string key_params; + std::string session_params; +}; + +} // namespace cricket + +#endif // API_CRYPTOPARAMS_H_ diff --git a/api/ortc/mediadescription.h b/api/ortc/mediadescription.h index 008aa31f32..1a6d0e9037 100644 --- a/api/ortc/mediadescription.h +++ b/api/ortc/mediadescription.h @@ -15,8 +15,8 @@ #include #include +#include "api/cryptoparams.h" #include "api/optional.h" -#include "media/base/cryptoparams.h" namespace webrtc { diff --git a/api/ortc/ortcfactoryinterface.h b/api/ortc/ortcfactoryinterface.h index a279a7b33f..d99fcd4465 100644 --- a/api/ortc/ortcfactoryinterface.h +++ b/api/ortc/ortcfactoryinterface.h @@ -27,7 +27,6 @@ #include "api/ortc/udptransportinterface.h" #include "api/rtcerror.h" #include "api/rtpparameters.h" -#include "p2p/base/packetsocketfactory.h" #include "rtc_base/network.h" #include "rtc_base/scoped_ref_ptr.h" #include "rtc_base/thread.h" diff --git a/api/ortc/srtptransportinterface.h b/api/ortc/srtptransportinterface.h index 79950d63a9..41c8ccc9c1 100644 --- a/api/ortc/srtptransportinterface.h +++ b/api/ortc/srtptransportinterface.h @@ -13,7 +13,7 @@ #include "api/ortc/rtptransportinterface.h" #include "api/rtcerror.h" -#include "media/base/cryptoparams.h" +#include "api/cryptoparams.h" namespace webrtc { diff --git a/media/base/cryptoparams.h b/media/base/cryptoparams.h index 56bdfaa7e4..9ba17eebba 100644 --- a/media/base/cryptoparams.h +++ b/media/base/cryptoparams.h @@ -8,32 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ +// TODO(bugs.webrtc.org/7504): Remove. #ifndef MEDIA_BASE_CRYPTOPARAMS_H_ #define MEDIA_BASE_CRYPTOPARAMS_H_ -#include - -namespace cricket { - -// Parameters for SRTP negotiation, as described in RFC 4568. -struct CryptoParams { - CryptoParams() : tag(0) {} - CryptoParams(int t, - const std::string& cs, - const std::string& kp, - const std::string& sp) - : tag(t), cipher_suite(cs), key_params(kp), session_params(sp) {} - - bool Matches(const CryptoParams& params) const { - return (tag == params.tag && cipher_suite == params.cipher_suite); - } - - int tag; - std::string cipher_suite; - std::string key_params; - std::string session_params; -}; - -} // namespace cricket +#include "api/cryptoparams.h" #endif // MEDIA_BASE_CRYPTOPARAMS_H_ diff --git a/ortc/BUILD.gn b/ortc/BUILD.gn index ec1a5c4a7f..fa107c282c 100644 --- a/ortc/BUILD.gn +++ b/ortc/BUILD.gn @@ -76,6 +76,7 @@ if (rtc_include_tests) { deps = [ ":ortc", + "../api:libjingle_peerconnection_api", "../api/audio_codecs:builtin_audio_decoder_factory", "../api/audio_codecs:builtin_audio_encoder_factory", "../media:rtc_media_tests_utils", diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn index ab1fd8ab01..431e217827 100644 --- a/p2p/BUILD.gn +++ b/p2p/BUILD.gn @@ -135,6 +135,7 @@ if (rtc_include_tests) { ] deps = [ ":rtc_p2p", + "../api:libjingle_peerconnection_api", "../api:ortc_api", "../rtc_base:rtc_base", "../rtc_base:rtc_base_approved", diff --git a/pc/mediasession.cc b/pc/mediasession.cc index 87d640795f..eb73c74f7f 100644 --- a/pc/mediasession.cc +++ b/pc/mediasession.cc @@ -18,9 +18,9 @@ #include #include +#include "api/cryptoparams.h" #include "api/optional.h" #include "common_types.h" // NOLINT(build/include) -#include "media/base/cryptoparams.h" #include "media/base/h264_profile_level_id.h" #include "media/base/mediaconstants.h" #include "p2p/base/p2pconstants.h" diff --git a/pc/mediasession.h b/pc/mediasession.h index 513f645b4b..aa48ba3265 100644 --- a/pc/mediasession.h +++ b/pc/mediasession.h @@ -18,9 +18,9 @@ #include #include +#include "api/cryptoparams.h" #include "api/mediatypes.h" #include "media/base/codec.h" -#include "media/base/cryptoparams.h" #include "media/base/mediachannel.h" #include "media/base/mediaconstants.h" #include "media/base/mediaengine.h" // For DataChannelType diff --git a/pc/srtpfilter.h b/pc/srtpfilter.h index 556d89a6b6..1cfc1228e9 100644 --- a/pc/srtpfilter.h +++ b/pc/srtpfilter.h @@ -17,8 +17,8 @@ #include #include +#include "api/cryptoparams.h" #include "api/optional.h" -#include "media/base/cryptoparams.h" #include "p2p/base/sessiondescription.h" #include "rtc_base/basictypes.h" #include "rtc_base/buffer.h" diff --git a/pc/srtpfilter_unittest.cc b/pc/srtpfilter_unittest.cc index 52f3afaac4..017df5baf1 100644 --- a/pc/srtpfilter_unittest.cc +++ b/pc/srtpfilter_unittest.cc @@ -12,7 +12,7 @@ #include "pc/srtpfilter.h" -#include "media/base/cryptoparams.h" +#include "api/cryptoparams.h" #include "rtc_base/gunit.h" using cricket::CryptoParams; diff --git a/pc/webrtcsdp.cc b/pc/webrtcsdp.cc index f2bc250311..8101a703ca 100644 --- a/pc/webrtcsdp.cc +++ b/pc/webrtcsdp.cc @@ -23,12 +23,12 @@ #include #include "api/candidate.h" +#include "api/cryptoparams.h" #include "api/jsepicecandidate.h" #include "api/jsepsessiondescription.h" // for RtpExtension #include "api/rtpparameters.h" #include "media/base/codec.h" -#include "media/base/cryptoparams.h" #include "media/base/mediaconstants.h" #include "media/base/rtputils.h" #include "media/sctp/sctptransportinternal.h"