diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index b5c832d4b6..4216bd3de4 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -347,7 +347,6 @@ rtc_static_library("webrtc_common") { sources = [ "common_types.cc", "common_types.h", - "config.cc", "config.h", "typedefs.h", ] @@ -384,9 +383,6 @@ if (rtc_include_tests) { rtc_test("rtc_unittests") { testonly = true - sources = [ - "config_unittest.cc", - ] deps = [ ":webrtc_common", diff --git a/webrtc/DEPS b/webrtc/DEPS index 276991d119..0459f4c0d2 100644 --- a/webrtc/DEPS +++ b/webrtc/DEPS @@ -9,8 +9,8 @@ include_rules = [ "+libyuv", "-webrtc", # Has to be disabled; otherwise all dirs below will be allowed. # Individual headers that will be moved out of here, see webrtc:4243. + "+webrtc/call/rtp_config.h", "+webrtc/common_types.h", - "+webrtc/config.h", "+webrtc/transport.h", "+webrtc/typedefs.h", "+webrtc/voice_engine_configurations.h", diff --git a/webrtc/api/BUILD.gn b/webrtc/api/BUILD.gn index 3d19f03649..e58f3932ad 100644 --- a/webrtc/api/BUILD.gn +++ b/webrtc/api/BUILD.gn @@ -62,6 +62,7 @@ rtc_static_library("libjingle_peerconnection_api") { "proxy.h", "rtcerror.cc", "rtcerror.h", + "rtpparameters.cc", "rtpparameters.h", "rtpreceiverinterface.h", "rtpsender.h", @@ -258,6 +259,7 @@ if (rtc_include_tests) { "ortc/mediadescription_unittest.cc", "ortc/sessiondescription_unittest.cc", "rtcerror_unittest.cc", + "rtpparameters_unittest.cc", ] if (!build_with_chromium && is_clang) { diff --git a/webrtc/config.cc b/webrtc/api/rtpparameters.cc similarity index 52% rename from webrtc/config.cc rename to webrtc/api/rtpparameters.cc index 19a9a96079..29b14fb60a 100644 --- a/webrtc/config.cc +++ b/webrtc/api/rtpparameters.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2017 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 @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/config.h" +#include "webrtc/api/rtpparameters.h" #include #include @@ -16,27 +16,55 @@ #include "webrtc/rtc_base/checks.h" namespace webrtc { -std::string NackConfig::ToString() const { - std::stringstream ss; - ss << "{rtp_history_ms: " << rtp_history_ms; - ss << '}'; - return ss.str(); -} -std::string UlpfecConfig::ToString() const { - std::stringstream ss; - ss << "{ulpfec_payload_type: " << ulpfec_payload_type; - ss << ", red_payload_type: " << red_payload_type; - ss << ", red_rtx_payload_type: " << red_rtx_payload_type; - ss << '}'; - return ss.str(); -} +RtcpFeedback::RtcpFeedback() {} +RtcpFeedback::RtcpFeedback(RtcpFeedbackType type) : type(type) {} +RtcpFeedback::RtcpFeedback(RtcpFeedbackType type, + RtcpFeedbackMessageType message_type) + : type(type), message_type(message_type) {} +RtcpFeedback::~RtcpFeedback() {} -bool UlpfecConfig::operator==(const UlpfecConfig& other) const { - return ulpfec_payload_type == other.ulpfec_payload_type && - red_payload_type == other.red_payload_type && - red_rtx_payload_type == other.red_rtx_payload_type; -} +RtpCodecCapability::RtpCodecCapability() {} +RtpCodecCapability::~RtpCodecCapability() {} + +RtpHeaderExtensionCapability::RtpHeaderExtensionCapability() {} +RtpHeaderExtensionCapability::RtpHeaderExtensionCapability( + const std::string& uri) + : uri(uri) {} +RtpHeaderExtensionCapability::RtpHeaderExtensionCapability( + const std::string& uri, + int preferred_id) + : uri(uri), preferred_id(preferred_id) {} +RtpHeaderExtensionCapability::~RtpHeaderExtensionCapability() {} + +RtpExtension::RtpExtension() {} +RtpExtension::RtpExtension(const std::string& uri, int id) : uri(uri), id(id) {} +RtpExtension::RtpExtension(const std::string& uri, int id, bool encrypt) + : uri(uri), id(id), encrypt(encrypt) {} +RtpExtension::~RtpExtension() {} + +RtpFecParameters::RtpFecParameters() {} +RtpFecParameters::RtpFecParameters(FecMechanism mechanism) + : mechanism(mechanism) {} +RtpFecParameters::RtpFecParameters(FecMechanism mechanism, uint32_t ssrc) + : ssrc(ssrc), mechanism(mechanism) {} +RtpFecParameters::~RtpFecParameters() {} + +RtpRtxParameters::RtpRtxParameters() {} +RtpRtxParameters::RtpRtxParameters(uint32_t ssrc) : ssrc(ssrc) {} +RtpRtxParameters::~RtpRtxParameters() {} + +RtpEncodingParameters::RtpEncodingParameters() {} +RtpEncodingParameters::~RtpEncodingParameters() {} + +RtpCodecParameters::RtpCodecParameters() {} +RtpCodecParameters::~RtpCodecParameters() {} + +RtpCapabilities::RtpCapabilities() {} +RtpCapabilities::~RtpCapabilities() {} + +RtpParameters::RtpParameters() {} +RtpParameters::~RtpParameters() {} std::string RtpExtension::ToString() const { std::stringstream ss; @@ -137,7 +165,7 @@ std::vector RtpExtension::FilterDuplicateNonEncrypted( const std::vector& extensions) { std::vector filtered; for (auto extension = extensions.begin(); extension != extensions.end(); - ++extension) { + ++extension) { if (extension->encrypt) { filtered.push_back(*extension); continue; @@ -146,9 +174,9 @@ std::vector RtpExtension::FilterDuplicateNonEncrypted( // Only add non-encrypted extension if no encrypted with the same URI // is also present... if (std::find_if(extension + 1, extensions.end(), - [extension](const RtpExtension& check) { - return extension->uri == check.uri; - }) != extensions.end()) { + [extension](const RtpExtension& check) { + return extension->uri == check.uri; + }) != extensions.end()) { continue; } @@ -159,125 +187,4 @@ std::vector RtpExtension::FilterDuplicateNonEncrypted( } return filtered; } - -VideoStream::VideoStream() - : width(0), - height(0), - max_framerate(-1), - min_bitrate_bps(-1), - target_bitrate_bps(-1), - max_bitrate_bps(-1), - max_qp(-1) {} - -VideoStream::~VideoStream() = default; - -std::string VideoStream::ToString() const { - std::stringstream ss; - ss << "{width: " << width; - ss << ", height: " << height; - ss << ", max_framerate: " << max_framerate; - ss << ", min_bitrate_bps:" << min_bitrate_bps; - ss << ", target_bitrate_bps:" << target_bitrate_bps; - ss << ", max_bitrate_bps:" << max_bitrate_bps; - ss << ", max_qp: " << max_qp; - - ss << ", temporal_layer_thresholds_bps: ["; - for (size_t i = 0; i < temporal_layer_thresholds_bps.size(); ++i) { - ss << temporal_layer_thresholds_bps[i]; - if (i != temporal_layer_thresholds_bps.size() - 1) - ss << ", "; - } - ss << ']'; - - ss << '}'; - return ss.str(); -} - -VideoEncoderConfig::VideoEncoderConfig() - : content_type(ContentType::kRealtimeVideo), - encoder_specific_settings(nullptr), - min_transmit_bitrate_bps(0), - max_bitrate_bps(0), - number_of_streams(0) {} - -VideoEncoderConfig::VideoEncoderConfig(VideoEncoderConfig&&) = default; - -VideoEncoderConfig::~VideoEncoderConfig() = default; - -std::string VideoEncoderConfig::ToString() const { - std::stringstream ss; - ss << "{content_type: "; - switch (content_type) { - case ContentType::kRealtimeVideo: - ss << "kRealtimeVideo"; - break; - case ContentType::kScreen: - ss << "kScreenshare"; - break; - } - ss << ", encoder_specific_settings: "; - ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL"); - - ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps; - ss << '}'; - return ss.str(); -} - -VideoEncoderConfig::VideoEncoderConfig(const VideoEncoderConfig&) = default; - -void VideoEncoderConfig::EncoderSpecificSettings::FillEncoderSpecificSettings( - VideoCodec* codec) const { - if (codec->codecType == kVideoCodecH264) { - FillVideoCodecH264(codec->H264()); - } else if (codec->codecType == kVideoCodecVP8) { - FillVideoCodecVp8(codec->VP8()); - } else if (codec->codecType == kVideoCodecVP9) { - FillVideoCodecVp9(codec->VP9()); - } else { - RTC_NOTREACHED() << "Encoder specifics set/used for unknown codec type."; - } -} - -void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecH264( - VideoCodecH264* h264_settings) const { - RTC_NOTREACHED(); -} - -void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecVp8( - VideoCodecVP8* vp8_settings) const { - RTC_NOTREACHED(); -} - -void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecVp9( - VideoCodecVP9* vp9_settings) const { - RTC_NOTREACHED(); -} - -VideoEncoderConfig::H264EncoderSpecificSettings::H264EncoderSpecificSettings( - const VideoCodecH264& specifics) - : specifics_(specifics) {} - -void VideoEncoderConfig::H264EncoderSpecificSettings::FillVideoCodecH264( - VideoCodecH264* h264_settings) const { - *h264_settings = specifics_; -} - -VideoEncoderConfig::Vp8EncoderSpecificSettings::Vp8EncoderSpecificSettings( - const VideoCodecVP8& specifics) - : specifics_(specifics) {} - -void VideoEncoderConfig::Vp8EncoderSpecificSettings::FillVideoCodecVp8( - VideoCodecVP8* vp8_settings) const { - *vp8_settings = specifics_; -} - -VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( - const VideoCodecVP9& specifics) - : specifics_(specifics) {} - -void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( - VideoCodecVP9* vp9_settings) const { - *vp9_settings = specifics_; -} - } // namespace webrtc diff --git a/webrtc/api/rtpparameters.h b/webrtc/api/rtpparameters.h index 94d9d73039..46f71395ce 100644 --- a/webrtc/api/rtpparameters.h +++ b/webrtc/api/rtpparameters.h @@ -16,7 +16,6 @@ #include #include "webrtc/api/mediatypes.h" -#include "webrtc/config.h" #include "webrtc/rtc_base/optional.h" namespace webrtc { @@ -85,10 +84,10 @@ struct RtcpFeedback { rtc::Optional message_type; // Constructors for convenience. - RtcpFeedback() {} - explicit RtcpFeedback(RtcpFeedbackType type) : type(type) {} - RtcpFeedback(RtcpFeedbackType type, RtcpFeedbackMessageType message_type) - : type(type), message_type(message_type) {} + RtcpFeedback(); + explicit RtcpFeedback(RtcpFeedbackType type); + RtcpFeedback(RtcpFeedbackType type, RtcpFeedbackMessageType message_type); + ~RtcpFeedback(); bool operator==(const RtcpFeedback& o) const { return type == o.type && message_type == o.message_type; @@ -100,6 +99,9 @@ struct RtcpFeedback { // RtpParameters. This represents the static capabilities of an endpoint's // implementation of a codec. struct RtpCodecCapability { + RtpCodecCapability(); + ~RtpCodecCapability(); + // Build MIME "type/subtype" string from |name| and |kind|. std::string mime_type() const { return MediaTypeToString(kind) + "/" + name; } @@ -196,10 +198,10 @@ struct RtpHeaderExtensionCapability { bool preferred_encrypt = false; // Constructors for convenience. - RtpHeaderExtensionCapability() = default; - explicit RtpHeaderExtensionCapability(const std::string& uri) : uri(uri) {} - RtpHeaderExtensionCapability(const std::string& uri, int preferred_id) - : uri(uri), preferred_id(preferred_id) {} + RtpHeaderExtensionCapability(); + explicit RtpHeaderExtensionCapability(const std::string& uri); + RtpHeaderExtensionCapability(const std::string& uri, int preferred_id); + ~RtpHeaderExtensionCapability(); bool operator==(const RtpHeaderExtensionCapability& o) const { return uri == o.uri && preferred_id == o.preferred_id && @@ -210,6 +212,83 @@ struct RtpHeaderExtensionCapability { } }; +// RTP header extension, see RFC 5285. +struct RtpExtension { + RtpExtension(); + RtpExtension(const std::string& uri, int id); + RtpExtension(const std::string& uri, int id, bool encrypt); + ~RtpExtension(); + std::string ToString() const; + bool operator==(const RtpExtension& rhs) const { + return uri == rhs.uri && id == rhs.id && encrypt == rhs.encrypt; + } + static bool IsSupportedForAudio(const std::string& uri); + static bool IsSupportedForVideo(const std::string& uri); + // Return "true" if the given RTP header extension URI may be encrypted. + static bool IsEncryptionSupported(const std::string& uri); + + // Returns the named header extension if found among all extensions, + // nullptr otherwise. + static const RtpExtension* FindHeaderExtensionByUri( + const std::vector& extensions, + const std::string& uri); + + // Return a list of RTP header extensions with the non-encrypted extensions + // removed if both the encrypted and non-encrypted extension is present for + // the same URI. + static std::vector FilterDuplicateNonEncrypted( + const std::vector& extensions); + + // Header extension for audio levels, as defined in: + // http://tools.ietf.org/html/draft-ietf-avtext-client-to-mixer-audio-level-03 + static const char kAudioLevelUri[]; + static const int kAudioLevelDefaultId; + + // Header extension for RTP timestamp offset, see RFC 5450 for details: + // http://tools.ietf.org/html/rfc5450 + static const char kTimestampOffsetUri[]; + static const int kTimestampOffsetDefaultId; + + // Header extension for absolute send time, see url for details: + // http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time + static const char kAbsSendTimeUri[]; + static const int kAbsSendTimeDefaultId; + + // Header extension for coordination of video orientation, see url for + // details: + // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ts_126114v120700p.pdf + static const char kVideoRotationUri[]; + static const int kVideoRotationDefaultId; + + // Header extension for video content type. E.g. default or screenshare. + static const char kVideoContentTypeUri[]; + static const int kVideoContentTypeDefaultId; + + // Header extension for video timing. + static const char kVideoTimingUri[]; + static const int kVideoTimingDefaultId; + + // Header extension for transport sequence number, see url for details: + // http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions + static const char kTransportSequenceNumberUri[]; + static const int kTransportSequenceNumberDefaultId; + + static const char kPlayoutDelayUri[]; + static const int kPlayoutDelayDefaultId; + + // Encryption of Header Extensions, see RFC 6904 for details: + // https://tools.ietf.org/html/rfc6904 + static const char kEncryptHeaderExtensionsUri[]; + + // Inclusive min and max IDs for one-byte header extensions, per RFC5285. + static const int kMinId; + static const int kMaxId; + + std::string uri; + int id = 0; + bool encrypt = false; +}; + // See webrtc/config.h. Has "uri" and "id" fields. // TODO(deadbeef): This is missing the "encrypt" flag, which is unimplemented. typedef RtpExtension RtpHeaderExtensionParameters; @@ -222,10 +301,10 @@ struct RtpFecParameters { FecMechanism mechanism = FecMechanism::RED; // Constructors for convenience. - RtpFecParameters() = default; - explicit RtpFecParameters(FecMechanism mechanism) : mechanism(mechanism) {} - RtpFecParameters(FecMechanism mechanism, uint32_t ssrc) - : ssrc(ssrc), mechanism(mechanism) {} + RtpFecParameters(); + explicit RtpFecParameters(FecMechanism mechanism); + RtpFecParameters(FecMechanism mechanism, uint32_t ssrc); + ~RtpFecParameters(); bool operator==(const RtpFecParameters& o) const { return ssrc == o.ssrc && mechanism == o.mechanism; @@ -239,14 +318,18 @@ struct RtpRtxParameters { rtc::Optional ssrc; // Constructors for convenience. - RtpRtxParameters() = default; - explicit RtpRtxParameters(uint32_t ssrc) : ssrc(ssrc) {} + RtpRtxParameters(); + explicit RtpRtxParameters(uint32_t ssrc); + ~RtpRtxParameters(); bool operator==(const RtpRtxParameters& o) const { return ssrc == o.ssrc; } bool operator!=(const RtpRtxParameters& o) const { return !(*this == o); } }; struct RtpEncodingParameters { + RtpEncodingParameters(); + ~RtpEncodingParameters(); + // If unset, a value is chosen by the implementation. // // Note that the chosen value is NOT returned by GetParameters, because it @@ -338,6 +421,9 @@ struct RtpEncodingParameters { }; struct RtpCodecParameters { + RtpCodecParameters(); + ~RtpCodecParameters(); + // Build MIME "type/subtype" string from |name| and |kind|. std::string mime_type() const { return MediaTypeToString(kind) + "/" + name; } @@ -400,6 +486,9 @@ struct RtpCodecParameters { // endpoint. An application can use these capabilities to construct an // RtpParameters. struct RtpCapabilities { + RtpCapabilities(); + ~RtpCapabilities(); + // Supported codecs. std::vector codecs; @@ -422,6 +511,9 @@ struct RtpCapabilities { // RtpParameters, because our API includes an additional "RtpTransport" // abstraction on which RTCP parameters are set. struct RtpParameters { + RtpParameters(); + ~RtpParameters(); + // Used when calling getParameters/setParameters with a PeerConnection // RtpSender, to ensure that outdated parameters are not unintentionally // applied successfully. diff --git a/webrtc/config_unittest.cc b/webrtc/api/rtpparameters_unittest.cc similarity index 92% rename from webrtc/config_unittest.cc rename to webrtc/api/rtpparameters_unittest.cc index 03784d4afc..6cb90c2df1 100644 --- a/webrtc/config_unittest.cc +++ b/webrtc/api/rtpparameters_unittest.cc @@ -8,11 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/config.h" +#include -#include +#include "webrtc/api/rtpparameters.h" +#include "webrtc/test/gtest.h" -#include "webrtc/rtc_base/gunit.h" +namespace webrtc { using webrtc::RtpExtension; @@ -47,3 +48,4 @@ TEST(RtpExtensionTest, FilterDuplicateNonEncrypted) { EXPECT_EQ(2u, filtered.size()); EXPECT_EQ(extensions, filtered); } +} // namespace webrtc diff --git a/webrtc/call/BUILD.gn b/webrtc/call/BUILD.gn index d86df1e379..263f16dd35 100644 --- a/webrtc/call/BUILD.gn +++ b/webrtc/call/BUILD.gn @@ -38,6 +38,8 @@ rtc_source_set("call_interfaces") { rtc_source_set("rtp_interfaces") { sources = [ "rtcp_packet_sink_interface.h", + "rtp_config.cc", + "rtp_config.h", "rtp_packet_sink_interface.h", "rtp_stream_receiver_controller_interface.h", "rtp_transport_controller_send_interface.h", @@ -100,6 +102,7 @@ rtc_static_library("call") { public_deps = [ ":call_interfaces", "../api:call_api", + "../api:libjingle_peerconnection_api", ] deps = [ @@ -107,6 +110,7 @@ rtc_static_library("call") { ":rtp_interfaces", ":rtp_receiver", ":rtp_sender", + ":video_stream_api", "..:webrtc_common", "../api:transport_api", "../audio", @@ -127,13 +131,17 @@ rtc_static_library("call") { rtc_source_set("video_stream_api") { sources = [ + "video_config.cc", + "video_config.h", "video_receive_stream.cc", "video_receive_stream.h", "video_send_stream.cc", "video_send_stream.h", ] deps = [ + ":rtp_interfaces", "../:webrtc_common", + "../api:libjingle_peerconnection_api", "../api:transport_api", "../common_video:common_video", "../rtc_base:rtc_base_approved", @@ -209,6 +217,7 @@ if (rtc_include_tests) { ] deps = [ ":call_interfaces", + ":video_stream_api", "..:webrtc_common", "../api/audio_codecs:builtin_audio_encoder_factory", "../logging:rtc_event_log_api", diff --git a/webrtc/call/audio_receive_stream.h b/webrtc/call/audio_receive_stream.h index fdf1698b6b..018ad35fb7 100644 --- a/webrtc/call/audio_receive_stream.h +++ b/webrtc/call/audio_receive_stream.h @@ -18,9 +18,10 @@ #include "webrtc/api/audio_codecs/audio_decoder_factory.h" #include "webrtc/api/call/transport.h" +#include "webrtc/api/rtpparameters.h" #include "webrtc/api/rtpreceiverinterface.h" +#include "webrtc/call/rtp_config.h" #include "webrtc/common_types.h" -#include "webrtc/config.h" #include "webrtc/rtc_base/optional.h" #include "webrtc/rtc_base/scoped_ref_ptr.h" #include "webrtc/typedefs.h" diff --git a/webrtc/call/audio_send_stream.h b/webrtc/call/audio_send_stream.h index fa5b5eecc8..8720249c4b 100644 --- a/webrtc/call/audio_send_stream.h +++ b/webrtc/call/audio_send_stream.h @@ -18,8 +18,10 @@ #include "webrtc/api/audio_codecs/audio_encoder_factory.h" #include "webrtc/api/audio_codecs/audio_format.h" #include "webrtc/api/call/transport.h" -#include "webrtc/config.h" +#include "webrtc/api/rtpparameters.h" +#include "webrtc/call/rtp_config.h" #include "webrtc/rtc_base/optional.h" +#include "webrtc/rtc_base/scoped_ref_ptr.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc index b1f56d3886..edb9bf3106 100644 --- a/webrtc/call/call.cc +++ b/webrtc/call/call.cc @@ -26,7 +26,6 @@ #include "webrtc/call/flexfec_receive_stream_impl.h" #include "webrtc/call/rtp_stream_receiver_controller.h" #include "webrtc/call/rtp_transport_controller_send.h" -#include "webrtc/config.h" #include "webrtc/logging/rtc_event_log/rtc_event_log.h" #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" #include "webrtc/modules/congestion_controller/include/receive_side_congestion_controller.h" diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc index 530ad29bcc..29dd0e4862 100644 --- a/webrtc/call/call_perf_tests.cc +++ b/webrtc/call/call_perf_tests.cc @@ -15,7 +15,7 @@ #include "webrtc/api/audio_codecs/builtin_audio_encoder_factory.h" #include "webrtc/call/call.h" -#include "webrtc/config.h" +#include "webrtc/call/video_config.h" #include "webrtc/logging/rtc_event_log/rtc_event_log.h" #include "webrtc/modules/audio_coding/include/audio_coding_module.h" #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" diff --git a/webrtc/call/flexfec_receive_stream.h b/webrtc/call/flexfec_receive_stream.h index 84447ff4e2..400bca4c13 100644 --- a/webrtc/call/flexfec_receive_stream.h +++ b/webrtc/call/flexfec_receive_stream.h @@ -17,8 +17,9 @@ #include #include "webrtc/api/call/transport.h" +#include "webrtc/api/rtpparameters.h" #include "webrtc/call/rtp_packet_sink_interface.h" -#include "webrtc/config.h" +#include "webrtc/common_types.h" namespace webrtc { diff --git a/webrtc/call/rtp_config.cc b/webrtc/call/rtp_config.cc new file mode 100644 index 0000000000..dc3ea217ce --- /dev/null +++ b/webrtc/call/rtp_config.cc @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017 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. + */ + +#include "webrtc/call/rtp_config.h" + +#include + +namespace webrtc { + +std::string NackConfig::ToString() const { + std::stringstream ss; + ss << "{rtp_history_ms: " << rtp_history_ms; + ss << '}'; + return ss.str(); +} + +std::string UlpfecConfig::ToString() const { + std::stringstream ss; + ss << "{ulpfec_payload_type: " << ulpfec_payload_type; + ss << ", red_payload_type: " << red_payload_type; + ss << ", red_rtx_payload_type: " << red_rtx_payload_type; + ss << '}'; + return ss.str(); +} + +bool UlpfecConfig::operator==(const UlpfecConfig& other) const { + return ulpfec_payload_type == other.ulpfec_payload_type && + red_payload_type == other.red_payload_type && + red_rtx_payload_type == other.red_rtx_payload_type; +} +} // namespace webrtc diff --git a/webrtc/call/rtp_config.h b/webrtc/call/rtp_config.h new file mode 100644 index 0000000000..f33103dfb5 --- /dev/null +++ b/webrtc/call/rtp_config.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2017 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 WEBRTC_CALL_RTP_CONFIG_H_ +#define WEBRTC_CALL_RTP_CONFIG_H_ + +#include + +namespace webrtc { +// Settings for NACK, see RFC 4585 for details. +struct NackConfig { + NackConfig() : rtp_history_ms(0) {} + std::string ToString() const; + // Send side: the time RTP packets are stored for retransmissions. + // Receive side: the time the receiver is prepared to wait for + // retransmissions. + // Set to '0' to disable. + int rtp_history_ms; +}; + +// Settings for ULPFEC forward error correction. +// Set the payload types to '-1' to disable. +struct UlpfecConfig { + UlpfecConfig() + : ulpfec_payload_type(-1), + red_payload_type(-1), + red_rtx_payload_type(-1) {} + std::string ToString() const; + bool operator==(const UlpfecConfig& other) const; + + // Payload type used for ULPFEC packets. + int ulpfec_payload_type; + + // Payload type used for RED packets. + int red_payload_type; + + // RTX payload type for RED payload. + int red_rtx_payload_type; +}; +} // namespace webrtc +#endif // WEBRTC_CALL_RTP_CONFIG_H_ diff --git a/webrtc/call/video_config.cc b/webrtc/call/video_config.cc new file mode 100644 index 0000000000..e06d5e8dc1 --- /dev/null +++ b/webrtc/call/video_config.cc @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2014 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. + */ +#include "webrtc/call/video_config.h" + +#include +#include +#include + +#include "webrtc/rtc_base/checks.h" + +namespace webrtc { +VideoStream::VideoStream() + : width(0), + height(0), + max_framerate(-1), + min_bitrate_bps(-1), + target_bitrate_bps(-1), + max_bitrate_bps(-1), + max_qp(-1) {} + +VideoStream::~VideoStream() = default; + +std::string VideoStream::ToString() const { + std::stringstream ss; + ss << "{width: " << width; + ss << ", height: " << height; + ss << ", max_framerate: " << max_framerate; + ss << ", min_bitrate_bps:" << min_bitrate_bps; + ss << ", target_bitrate_bps:" << target_bitrate_bps; + ss << ", max_bitrate_bps:" << max_bitrate_bps; + ss << ", max_qp: " << max_qp; + + ss << ", temporal_layer_thresholds_bps: ["; + for (size_t i = 0; i < temporal_layer_thresholds_bps.size(); ++i) { + ss << temporal_layer_thresholds_bps[i]; + if (i != temporal_layer_thresholds_bps.size() - 1) + ss << ", "; + } + ss << ']'; + + ss << '}'; + return ss.str(); +} + +VideoEncoderConfig::VideoEncoderConfig() + : content_type(ContentType::kRealtimeVideo), + encoder_specific_settings(nullptr), + min_transmit_bitrate_bps(0), + max_bitrate_bps(0), + number_of_streams(0) {} + +VideoEncoderConfig::VideoEncoderConfig(VideoEncoderConfig&&) = default; + +VideoEncoderConfig::~VideoEncoderConfig() = default; + +std::string VideoEncoderConfig::ToString() const { + std::stringstream ss; + ss << "{content_type: "; + switch (content_type) { + case ContentType::kRealtimeVideo: + ss << "kRealtimeVideo"; + break; + case ContentType::kScreen: + ss << "kScreenshare"; + break; + } + ss << ", encoder_specific_settings: "; + ss << (encoder_specific_settings != NULL ? "(ptr)" : "NULL"); + + ss << ", min_transmit_bitrate_bps: " << min_transmit_bitrate_bps; + ss << '}'; + return ss.str(); +} + +VideoEncoderConfig::VideoEncoderConfig(const VideoEncoderConfig&) = default; + +void VideoEncoderConfig::EncoderSpecificSettings::FillEncoderSpecificSettings( + VideoCodec* codec) const { + if (codec->codecType == kVideoCodecH264) { + FillVideoCodecH264(codec->H264()); + } else if (codec->codecType == kVideoCodecVP8) { + FillVideoCodecVp8(codec->VP8()); + } else if (codec->codecType == kVideoCodecVP9) { + FillVideoCodecVp9(codec->VP9()); + } else { + RTC_NOTREACHED() << "Encoder specifics set/used for unknown codec type."; + } +} + +void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecH264( + VideoCodecH264* h264_settings) const { + RTC_NOTREACHED(); +} + +void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecVp8( + VideoCodecVP8* vp8_settings) const { + RTC_NOTREACHED(); +} + +void VideoEncoderConfig::EncoderSpecificSettings::FillVideoCodecVp9( + VideoCodecVP9* vp9_settings) const { + RTC_NOTREACHED(); +} + +VideoEncoderConfig::H264EncoderSpecificSettings::H264EncoderSpecificSettings( + const VideoCodecH264& specifics) + : specifics_(specifics) {} + +void VideoEncoderConfig::H264EncoderSpecificSettings::FillVideoCodecH264( + VideoCodecH264* h264_settings) const { + *h264_settings = specifics_; +} + +VideoEncoderConfig::Vp8EncoderSpecificSettings::Vp8EncoderSpecificSettings( + const VideoCodecVP8& specifics) + : specifics_(specifics) {} + +void VideoEncoderConfig::Vp8EncoderSpecificSettings::FillVideoCodecVp8( + VideoCodecVP8* vp8_settings) const { + *vp8_settings = specifics_; +} + +VideoEncoderConfig::Vp9EncoderSpecificSettings::Vp9EncoderSpecificSettings( + const VideoCodecVP9& specifics) + : specifics_(specifics) {} + +void VideoEncoderConfig::Vp9EncoderSpecificSettings::FillVideoCodecVp9( + VideoCodecVP9* vp9_settings) const { + *vp9_settings = specifics_; +} + +} // namespace webrtc diff --git a/webrtc/call/video_config.h b/webrtc/call/video_config.h new file mode 100644 index 0000000000..cdff513263 --- /dev/null +++ b/webrtc/call/video_config.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2013 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 WEBRTC_CALL_VIDEO_CONFIG_H_ +#define WEBRTC_CALL_VIDEO_CONFIG_H_ + +#include +#include + +#include "webrtc/common_types.h" +#include "webrtc/rtc_base/basictypes.h" +#include "webrtc/rtc_base/optional.h" +#include "webrtc/rtc_base/refcount.h" +#include "webrtc/rtc_base/scoped_ref_ptr.h" +#include "webrtc/typedefs.h" + +namespace webrtc { + +struct VideoStream { + VideoStream(); + ~VideoStream(); + std::string ToString() const; + + size_t width; + size_t height; + int max_framerate; + + int min_bitrate_bps; + int target_bitrate_bps; + int max_bitrate_bps; + + int max_qp; + + // Bitrate thresholds for enabling additional temporal layers. Since these are + // thresholds in between layers, we have one additional layer. One threshold + // gives two temporal layers, one below the threshold and one above, two give + // three, and so on. + // The VideoEncoder may redistribute bitrates over the temporal layers so a + // bitrate threshold of 100k and an estimate of 105k does not imply that we + // get 100k in one temporal layer and 5k in the other, just that the bitrate + // in the first temporal layer should not exceed 100k. + // TODO(kthelgason): Apart from a special case for two-layer screencast these + // thresholds are not propagated to the VideoEncoder. To be implemented. + std::vector temporal_layer_thresholds_bps; +}; + +class VideoEncoderConfig { + public: + // These are reference counted to permit copying VideoEncoderConfig and be + // kept alive until all encoder_specific_settings go out of scope. + // TODO(kthelgason): Consider removing the need for copying VideoEncoderConfig + // and use rtc::Optional for encoder_specific_settings instead. + class EncoderSpecificSettings : public rtc::RefCountInterface { + public: + // TODO(pbos): Remove FillEncoderSpecificSettings as soon as VideoCodec is + // not in use and encoder implementations ask for codec-specific structs + // directly. + void FillEncoderSpecificSettings(VideoCodec* codec_struct) const; + + virtual void FillVideoCodecVp8(VideoCodecVP8* vp8_settings) const; + virtual void FillVideoCodecVp9(VideoCodecVP9* vp9_settings) const; + virtual void FillVideoCodecH264(VideoCodecH264* h264_settings) const; + + private: + ~EncoderSpecificSettings() override {} + friend class VideoEncoderConfig; + }; + + class H264EncoderSpecificSettings : public EncoderSpecificSettings { + public: + explicit H264EncoderSpecificSettings(const VideoCodecH264& specifics); + void FillVideoCodecH264(VideoCodecH264* h264_settings) const override; + + private: + VideoCodecH264 specifics_; + }; + + class Vp8EncoderSpecificSettings : public EncoderSpecificSettings { + public: + explicit Vp8EncoderSpecificSettings(const VideoCodecVP8& specifics); + void FillVideoCodecVp8(VideoCodecVP8* vp8_settings) const override; + + private: + VideoCodecVP8 specifics_; + }; + + class Vp9EncoderSpecificSettings : public EncoderSpecificSettings { + public: + explicit Vp9EncoderSpecificSettings(const VideoCodecVP9& specifics); + void FillVideoCodecVp9(VideoCodecVP9* vp9_settings) const override; + + private: + VideoCodecVP9 specifics_; + }; + + enum class ContentType { + kRealtimeVideo, + kScreen, + }; + + class VideoStreamFactoryInterface : public rtc::RefCountInterface { + public: + // An implementation should return a std::vector with the + // wanted VideoStream settings for the given video resolution. + // The size of the vector may not be larger than + // |encoder_config.number_of_streams|. + virtual std::vector CreateEncoderStreams( + int width, + int height, + const VideoEncoderConfig& encoder_config) = 0; + + protected: + ~VideoStreamFactoryInterface() override {} + }; + + VideoEncoderConfig& operator=(VideoEncoderConfig&&) = default; + VideoEncoderConfig& operator=(const VideoEncoderConfig&) = delete; + + // Mostly used by tests. Avoid creating copies if you can. + VideoEncoderConfig Copy() const { return VideoEncoderConfig(*this); } + + VideoEncoderConfig(); + VideoEncoderConfig(VideoEncoderConfig&&); + ~VideoEncoderConfig(); + std::string ToString() const; + + rtc::scoped_refptr video_stream_factory; + std::vector spatial_layers; + ContentType content_type; + rtc::scoped_refptr encoder_specific_settings; + + // Padding will be used up to this bitrate regardless of the bitrate produced + // by the encoder. Padding above what's actually produced by the encoder helps + // maintaining a higher bitrate estimate. Padding will however not be sent + // unless the estimated bandwidth indicates that the link can handle it. + int min_transmit_bitrate_bps; + int max_bitrate_bps; + + // Max number of encoded VideoStreams to produce. + size_t number_of_streams; + + private: + // Access to the copy constructor is private to force use of the Copy() + // method for those exceptional cases where we do use it. + VideoEncoderConfig(const VideoEncoderConfig&); +}; + +} // namespace webrtc + +#endif // WEBRTC_CALL_VIDEO_CONFIG_H_ diff --git a/webrtc/call/video_receive_stream.h b/webrtc/call/video_receive_stream.h index 18e904d076..8ed93a1f1d 100644 --- a/webrtc/call/video_receive_stream.h +++ b/webrtc/call/video_receive_stream.h @@ -17,9 +17,10 @@ #include #include "webrtc/api/call/transport.h" +#include "webrtc/api/rtpparameters.h" +#include "webrtc/call/rtp_config.h" #include "webrtc/common_types.h" #include "webrtc/common_video/include/frame_callback.h" -#include "webrtc/config.h" #include "webrtc/media/base/videosinkinterface.h" #include "webrtc/rtc_base/platform_file.h" diff --git a/webrtc/call/video_send_stream.h b/webrtc/call/video_send_stream.h index a176709ac4..a458203ed5 100644 --- a/webrtc/call/video_send_stream.h +++ b/webrtc/call/video_send_stream.h @@ -17,9 +17,11 @@ #include #include "webrtc/api/call/transport.h" +#include "webrtc/api/rtpparameters.h" +#include "webrtc/call/rtp_config.h" +#include "webrtc/call/video_config.h" #include "webrtc/common_types.h" #include "webrtc/common_video/include/frame_callback.h" -#include "webrtc/config.h" #include "webrtc/media/base/videosinkinterface.h" #include "webrtc/media/base/videosourceinterface.h" #include "webrtc/rtc_base/platform_file.h" diff --git a/webrtc/config.h b/webrtc/config.h index 962e0f2fb9..46c1f42085 100644 --- a/webrtc/config.h +++ b/webrtc/config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2017 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 @@ -8,259 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ -// TODO(pbos): Move Config from common.h to here. - #ifndef WEBRTC_CONFIG_H_ #define WEBRTC_CONFIG_H_ -#include -#include +// TODO(holmer): Delete this file once downstream projects have been updated. -#include "webrtc/common_types.h" -#include "webrtc/rtc_base/basictypes.h" -#include "webrtc/rtc_base/optional.h" -#include "webrtc/rtc_base/refcount.h" -#include "webrtc/rtc_base/scoped_ref_ptr.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -// Settings for NACK, see RFC 4585 for details. -struct NackConfig { - NackConfig() : rtp_history_ms(0) {} - std::string ToString() const; - // Send side: the time RTP packets are stored for retransmissions. - // Receive side: the time the receiver is prepared to wait for - // retransmissions. - // Set to '0' to disable. - int rtp_history_ms; -}; - -// Settings for ULPFEC forward error correction. -// Set the payload types to '-1' to disable. -struct UlpfecConfig { - UlpfecConfig() - : ulpfec_payload_type(-1), - red_payload_type(-1), - red_rtx_payload_type(-1) {} - std::string ToString() const; - bool operator==(const UlpfecConfig& other) const; - - // Payload type used for ULPFEC packets. - int ulpfec_payload_type; - - // Payload type used for RED packets. - int red_payload_type; - - // RTX payload type for RED payload. - int red_rtx_payload_type; -}; - -// RTP header extension, see RFC 5285. -struct RtpExtension { - RtpExtension() {} - RtpExtension(const std::string& uri, int id) : uri(uri), id(id) {} - RtpExtension(const std::string& uri, int id, bool encrypt) : uri(uri), - id(id), encrypt(encrypt) {} - std::string ToString() const; - bool operator==(const RtpExtension& rhs) const { - return uri == rhs.uri && id == rhs.id && encrypt == rhs.encrypt; - } - static bool IsSupportedForAudio(const std::string& uri); - static bool IsSupportedForVideo(const std::string& uri); - // Return "true" if the given RTP header extension URI may be encrypted. - static bool IsEncryptionSupported(const std::string& uri); - - // Returns the named header extension if found among all extensions, - // nullptr otherwise. - static const RtpExtension* FindHeaderExtensionByUri( - const std::vector& extensions, - const std::string& uri); - - // Return a list of RTP header extensions with the non-encrypted extensions - // removed if both the encrypted and non-encrypted extension is present for - // the same URI. - static std::vector FilterDuplicateNonEncrypted( - const std::vector& extensions); - - // Header extension for audio levels, as defined in: - // http://tools.ietf.org/html/draft-ietf-avtext-client-to-mixer-audio-level-03 - static const char kAudioLevelUri[]; - static const int kAudioLevelDefaultId; - - // Header extension for RTP timestamp offset, see RFC 5450 for details: - // http://tools.ietf.org/html/rfc5450 - static const char kTimestampOffsetUri[]; - static const int kTimestampOffsetDefaultId; - - // Header extension for absolute send time, see url for details: - // http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time - static const char kAbsSendTimeUri[]; - static const int kAbsSendTimeDefaultId; - - // Header extension for coordination of video orientation, see url for - // details: - // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ts_126114v120700p.pdf - static const char kVideoRotationUri[]; - static const int kVideoRotationDefaultId; - - // Header extension for video content type. E.g. default or screenshare. - static const char kVideoContentTypeUri[]; - static const int kVideoContentTypeDefaultId; - - // Header extension for video timing. - static const char kVideoTimingUri[]; - static const int kVideoTimingDefaultId; - - // Header extension for transport sequence number, see url for details: - // http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions - static const char kTransportSequenceNumberUri[]; - static const int kTransportSequenceNumberDefaultId; - - static const char kPlayoutDelayUri[]; - static const int kPlayoutDelayDefaultId; - - // Encryption of Header Extensions, see RFC 6904 for details: - // https://tools.ietf.org/html/rfc6904 - static const char kEncryptHeaderExtensionsUri[]; - - // Inclusive min and max IDs for one-byte header extensions, per RFC5285. - static const int kMinId; - static const int kMaxId; - - std::string uri; - int id = 0; - bool encrypt = false; -}; - -struct VideoStream { - VideoStream(); - ~VideoStream(); - std::string ToString() const; - - size_t width; - size_t height; - int max_framerate; - - int min_bitrate_bps; - int target_bitrate_bps; - int max_bitrate_bps; - - int max_qp; - - // Bitrate thresholds for enabling additional temporal layers. Since these are - // thresholds in between layers, we have one additional layer. One threshold - // gives two temporal layers, one below the threshold and one above, two give - // three, and so on. - // The VideoEncoder may redistribute bitrates over the temporal layers so a - // bitrate threshold of 100k and an estimate of 105k does not imply that we - // get 100k in one temporal layer and 5k in the other, just that the bitrate - // in the first temporal layer should not exceed 100k. - // TODO(kthelgason): Apart from a special case for two-layer screencast these - // thresholds are not propagated to the VideoEncoder. To be implemented. - std::vector temporal_layer_thresholds_bps; -}; - -class VideoEncoderConfig { - public: - // These are reference counted to permit copying VideoEncoderConfig and be - // kept alive until all encoder_specific_settings go out of scope. - // TODO(kthelgason): Consider removing the need for copying VideoEncoderConfig - // and use rtc::Optional for encoder_specific_settings instead. - class EncoderSpecificSettings : public rtc::RefCountInterface { - public: - // TODO(pbos): Remove FillEncoderSpecificSettings as soon as VideoCodec is - // not in use and encoder implementations ask for codec-specific structs - // directly. - void FillEncoderSpecificSettings(VideoCodec* codec_struct) const; - - virtual void FillVideoCodecVp8(VideoCodecVP8* vp8_settings) const; - virtual void FillVideoCodecVp9(VideoCodecVP9* vp9_settings) const; - virtual void FillVideoCodecH264(VideoCodecH264* h264_settings) const; - private: - ~EncoderSpecificSettings() override {} - friend class VideoEncoderConfig; - }; - - class H264EncoderSpecificSettings : public EncoderSpecificSettings { - public: - explicit H264EncoderSpecificSettings(const VideoCodecH264& specifics); - void FillVideoCodecH264(VideoCodecH264* h264_settings) const override; - - private: - VideoCodecH264 specifics_; - }; - - class Vp8EncoderSpecificSettings : public EncoderSpecificSettings { - public: - explicit Vp8EncoderSpecificSettings(const VideoCodecVP8& specifics); - void FillVideoCodecVp8(VideoCodecVP8* vp8_settings) const override; - - private: - VideoCodecVP8 specifics_; - }; - - class Vp9EncoderSpecificSettings : public EncoderSpecificSettings { - public: - explicit Vp9EncoderSpecificSettings(const VideoCodecVP9& specifics); - void FillVideoCodecVp9(VideoCodecVP9* vp9_settings) const override; - - private: - VideoCodecVP9 specifics_; - }; - - enum class ContentType { - kRealtimeVideo, - kScreen, - }; - - class VideoStreamFactoryInterface : public rtc::RefCountInterface { - public: - // An implementation should return a std::vector with the - // wanted VideoStream settings for the given video resolution. - // The size of the vector may not be larger than - // |encoder_config.number_of_streams|. - virtual std::vector CreateEncoderStreams( - int width, - int height, - const VideoEncoderConfig& encoder_config) = 0; - - protected: - ~VideoStreamFactoryInterface() override {} - }; - - VideoEncoderConfig& operator=(VideoEncoderConfig&&) = default; - VideoEncoderConfig& operator=(const VideoEncoderConfig&) = delete; - - // Mostly used by tests. Avoid creating copies if you can. - VideoEncoderConfig Copy() const { return VideoEncoderConfig(*this); } - - VideoEncoderConfig(); - VideoEncoderConfig(VideoEncoderConfig&&); - ~VideoEncoderConfig(); - std::string ToString() const; - - rtc::scoped_refptr video_stream_factory; - std::vector spatial_layers; - ContentType content_type; - rtc::scoped_refptr encoder_specific_settings; - - // Padding will be used up to this bitrate regardless of the bitrate produced - // by the encoder. Padding above what's actually produced by the encoder helps - // maintaining a higher bitrate estimate. Padding will however not be sent - // unless the estimated bandwidth indicates that the link can handle it. - int min_transmit_bitrate_bps; - int max_bitrate_bps; - - // Max number of encoded VideoStreams to produce. - size_t number_of_streams; - - private: - // Access to the copy constructor is private to force use of the Copy() - // method for those exceptional cases where we do use it. - VideoEncoderConfig(const VideoEncoderConfig&); -}; - -} // namespace webrtc +#include "webrtc/api/rtpparameters.h" +#include "webrtc/call/rtp_config.h" #endif // WEBRTC_CONFIG_H_ diff --git a/webrtc/logging/BUILD.gn b/webrtc/logging/BUILD.gn index 8f1e493209..6b1e549d30 100644 --- a/webrtc/logging/BUILD.gn +++ b/webrtc/logging/BUILD.gn @@ -29,6 +29,7 @@ rtc_source_set("rtc_event_log_api") { ] deps = [ "..:webrtc_common", + "../api:libjingle_peerconnection_api", "../call:video_stream_api", "../rtc_base:rtc_base_approved", ] @@ -159,6 +160,7 @@ if (rtc_enable_protobuf) { ":rtc_event_log_api", ":rtc_event_log_impl", ":rtc_event_log_parser", + "../call:video_stream_api", "../rtc_base:rtc_base_approved", # TODO(kwiberg): Remove this dependency. diff --git a/webrtc/logging/rtc_event_log/rtc_event_log.h b/webrtc/logging/rtc_event_log/rtc_event_log.h index dc3351120c..d26dccbea9 100644 --- a/webrtc/logging/rtc_event_log/rtc_event_log.h +++ b/webrtc/logging/rtc_event_log/rtc_event_log.h @@ -15,7 +15,8 @@ #include #include -#include "webrtc/config.h" +#include "webrtc/api/rtpparameters.h" +#include "webrtc/common_types.h" #include "webrtc/rtc_base/platform_file.h" namespace webrtc { diff --git a/webrtc/logging/rtc_event_log/rtc_event_log2text.cc b/webrtc/logging/rtc_event_log/rtc_event_log2text.cc index 3f0310853f..bba6aceee8 100644 --- a/webrtc/logging/rtc_event_log/rtc_event_log2text.cc +++ b/webrtc/logging/rtc_event_log/rtc_event_log2text.cc @@ -16,8 +16,8 @@ #include #include // pair +#include "webrtc/call/video_config.h" #include "webrtc/common_types.h" -#include "webrtc/config.h" #include "webrtc/logging/rtc_event_log/rtc_event_log_parser.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" diff --git a/webrtc/media/base/mediachannel.h b/webrtc/media/base/mediachannel.h index 99ed29169b..1ab41231bf 100644 --- a/webrtc/media/base/mediachannel.h +++ b/webrtc/media/base/mediachannel.h @@ -18,7 +18,7 @@ #include "webrtc/api/rtpparameters.h" #include "webrtc/api/rtpreceiverinterface.h" #include "webrtc/api/video/video_timing.h" -#include "webrtc/config.h" +#include "webrtc/call/video_config.h" #include "webrtc/media/base/codec.h" #include "webrtc/media/base/mediaconstants.h" #include "webrtc/media/base/streamparams.h" diff --git a/webrtc/media/engine/simulcast.h b/webrtc/media/engine/simulcast.h index 4531bccaf3..81668e420a 100644 --- a/webrtc/media/engine/simulcast.h +++ b/webrtc/media/engine/simulcast.h @@ -13,7 +13,7 @@ #include -#include "webrtc/config.h" +#include "webrtc/call/video_config.h" #include "webrtc/rtc_base/basictypes.h" namespace cricket { diff --git a/webrtc/media/engine/webrtcmediaengine.h b/webrtc/media/engine/webrtcmediaengine.h index edbda66faa..8740917e9f 100644 --- a/webrtc/media/engine/webrtcmediaengine.h +++ b/webrtc/media/engine/webrtcmediaengine.h @@ -15,7 +15,6 @@ #include #include "webrtc/call/call.h" -#include "webrtc/config.h" #include "webrtc/media/base/mediaengine.h" namespace webrtc { diff --git a/webrtc/media/engine/webrtcvoiceengine.h b/webrtc/media/engine/webrtcvoiceengine.h index f938446842..a42459ab79 100644 --- a/webrtc/media/engine/webrtcvoiceengine.h +++ b/webrtc/media/engine/webrtcvoiceengine.h @@ -20,7 +20,6 @@ #include "webrtc/api/rtpreceiverinterface.h" #include "webrtc/call/audio_state.h" #include "webrtc/call/call.h" -#include "webrtc/config.h" #include "webrtc/media/base/rtputils.h" #include "webrtc/media/engine/apm_helpers.h" #include "webrtc/media/engine/webrtccommon.h" diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn index 50819f19ca..569d214816 100644 --- a/webrtc/modules/audio_coding/BUILD.gn +++ b/webrtc/modules/audio_coding/BUILD.gn @@ -1569,8 +1569,11 @@ if (rtc_include_tests) { ":isac_fix", ":webrtc_opus", "../..:webrtc_common", + "../../api:libjingle_peerconnection_api", "../../rtc_base:rtc_base_approved", + "../../system_wrappers:metrics_default", "../../system_wrappers:system_wrappers_default", + "../../test:field_trial", "../../test:test_main", "../audio_processing", "//testing/gtest", @@ -1702,6 +1705,8 @@ if (rtc_include_tests) { "../..:webrtc_common", "../../common_audio", "../../rtc_base:rtc_base_approved", + "../../system_wrappers:metrics_default", + "../../test:field_trial", ] configs += [ ":RTPencode_config" ] diff --git a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc index db2aacbf04..f8707c3e02 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc @@ -14,7 +14,6 @@ #include #include -#include "webrtc/config.h" #include "webrtc/modules/audio_processing/test/test_utils.h" #include "webrtc/modules/include/module_common_types.h" #include "webrtc/rtc_base/array_view.h" diff --git a/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc b/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc index 75e5aab60e..e49b632b01 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc @@ -10,7 +10,6 @@ #include "webrtc/modules/audio_processing/audio_processing_impl.h" -#include "webrtc/config.h" #include "webrtc/modules/audio_processing/test/test_utils.h" #include "webrtc/modules/include/module_common_types.h" #include "webrtc/test/gmock.h" diff --git a/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc b/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc index 6d0a61b07a..e478c72487 100644 --- a/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc +++ b/webrtc/modules/audio_processing/audio_processing_performance_unittest.cc @@ -15,7 +15,6 @@ #include #include -#include "webrtc/config.h" #include "webrtc/modules/audio_processing/test/test_utils.h" #include "webrtc/modules/include/module_common_types.h" #include "webrtc/rtc_base/array_view.h" diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn index 775ebcbb35..07ac7ae3a1 100644 --- a/webrtc/modules/rtp_rtcp/BUILD.gn +++ b/webrtc/modules/rtp_rtcp/BUILD.gn @@ -341,6 +341,7 @@ if (rtc_include_tests) { ":rtp_rtcp", "..:module_api", "../..:webrtc_common", + "../../api:libjingle_peerconnection_api", "../../api:transport_api", "../../common_video:common_video", "../../rtc_base:rtc_base_approved", diff --git a/webrtc/modules/rtp_rtcp/include/flexfec_sender.h b/webrtc/modules/rtp_rtcp/include/flexfec_sender.h index 3bcd2eb48c..82a01ccfff 100644 --- a/webrtc/modules/rtp_rtcp/include/flexfec_sender.h +++ b/webrtc/modules/rtp_rtcp/include/flexfec_sender.h @@ -14,7 +14,7 @@ #include #include -#include "webrtc/config.h" +#include "webrtc/api/rtpparameters.h" #include "webrtc/modules/include/module_common_types.h" #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h" diff --git a/webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h b/webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h index 98bc9ecad9..93cbd10c84 100644 --- a/webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h +++ b/webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h @@ -13,7 +13,7 @@ #include -#include "webrtc/config.h" +#include "webrtc/api/rtpparameters.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/rtc_base/array_view.h" #include "webrtc/rtc_base/basictypes.h" diff --git a/webrtc/modules/rtp_rtcp/source/flexfec_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/flexfec_sender_unittest.cc index 7c26b80bdd..da33837c8d 100644 --- a/webrtc/modules/rtp_rtcp/source/flexfec_sender_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/flexfec_sender_unittest.cc @@ -10,7 +10,7 @@ #include -#include "webrtc/config.h" +#include "webrtc/api/rtpparameters.h" #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/modules/rtp_rtcp/source/fec_test_helper.h" diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc index 790319a996..31d1b0e43c 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc @@ -16,8 +16,8 @@ #include #include +#include "webrtc/api/rtpparameters.h" #include "webrtc/common_types.h" -#include "webrtc/config.h" #include "webrtc/rtc_base/checks.h" #include "webrtc/rtc_base/logging.h" diff --git a/webrtc/pc/webrtcsdp.cc b/webrtc/pc/webrtcsdp.cc index e514fe7c60..7dc2605dbe 100644 --- a/webrtc/pc/webrtcsdp.cc +++ b/webrtc/pc/webrtcsdp.cc @@ -22,13 +22,8 @@ #include "webrtc/api/jsepicecandidate.h" #include "webrtc/api/jsepsessiondescription.h" -#include "webrtc/rtc_base/arraysize.h" -#include "webrtc/rtc_base/checks.h" -#include "webrtc/rtc_base/logging.h" -#include "webrtc/rtc_base/messagedigest.h" -#include "webrtc/rtc_base/stringutils.h" // for RtpExtension -#include "webrtc/config.h" +#include "webrtc/api/rtpparameters.h" #include "webrtc/media/base/codec.h" #include "webrtc/media/base/cryptoparams.h" #include "webrtc/media/base/mediaconstants.h" @@ -38,6 +33,11 @@ #include "webrtc/p2p/base/p2pconstants.h" #include "webrtc/p2p/base/port.h" #include "webrtc/pc/mediasession.h" +#include "webrtc/rtc_base/arraysize.h" +#include "webrtc/rtc_base/checks.h" +#include "webrtc/rtc_base/logging.h" +#include "webrtc/rtc_base/messagedigest.h" +#include "webrtc/rtc_base/stringutils.h" using cricket::AudioContentDescription; using cricket::Candidate; diff --git a/webrtc/test/call_test.cc b/webrtc/test/call_test.cc index 3efc022cee..b5d7236a65 100644 --- a/webrtc/test/call_test.cc +++ b/webrtc/test/call_test.cc @@ -15,7 +15,7 @@ #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h" #include "webrtc/api/audio_codecs/builtin_audio_encoder_factory.h" #include "webrtc/call/rtp_transport_controller_send.h" -#include "webrtc/config.h" +#include "webrtc/call/video_config.h" #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" #include "webrtc/rtc_base/checks.h" #include "webrtc/rtc_base/event.h" diff --git a/webrtc/video/payload_router.h b/webrtc/video/payload_router.h index 8b51861807..bfd4b8e557 100644 --- a/webrtc/video/payload_router.h +++ b/webrtc/video/payload_router.h @@ -15,7 +15,6 @@ #include "webrtc/api/video_codecs/video_encoder.h" #include "webrtc/common_types.h" -#include "webrtc/config.h" #include "webrtc/rtc_base/constructormagic.h" #include "webrtc/rtc_base/criticalsection.h" #include "webrtc/rtc_base/thread_annotations.h" diff --git a/webrtc/video/payload_router_unittest.cc b/webrtc/video/payload_router_unittest.cc index 9f58ceb432..2293a24a69 100644 --- a/webrtc/video/payload_router_unittest.cc +++ b/webrtc/video/payload_router_unittest.cc @@ -10,6 +10,7 @@ #include +#include "webrtc/call/video_config.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" #include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h" #include "webrtc/modules/video_coding/include/video_codec_interface.h" diff --git a/webrtc/video/rtp_video_stream_receiver.cc b/webrtc/video/rtp_video_stream_receiver.cc index 4678b8f0af..0dbb2f7da0 100644 --- a/webrtc/video/rtp_video_stream_receiver.cc +++ b/webrtc/video/rtp_video_stream_receiver.cc @@ -14,8 +14,8 @@ #include #include +#include "webrtc/call/video_config.h" #include "webrtc/common_types.h" -#include "webrtc/config.h" #include "webrtc/media/base/mediaconstants.h" #include "webrtc/modules/pacing/packet_router.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc index 901d80cbcd..039d935b04 100644 --- a/webrtc/voice_engine/channel.cc +++ b/webrtc/voice_engine/channel.cc @@ -15,7 +15,6 @@ #include "webrtc/audio/utility/audio_frame_operations.h" #include "webrtc/call/rtp_transport_controller_send_interface.h" -#include "webrtc/config.h" #include "webrtc/logging/rtc_event_log/rtc_event_log.h" #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" #include "webrtc/modules/audio_device/include/audio_device.h"