From 11b34f4d08da0644544c6de458c325c557179481 Mon Sep 17 00:00:00 2001 From: Paulina Hensman Date: Mon, 9 Apr 2018 14:24:52 +0200 Subject: [PATCH] Remove chromium clang style errors affecting sdk/android/media_jni Bug: webrtc:163 Change-Id: I1e98174817ca032ee13f9a6a386803382843389d Reviewed-on: https://webrtc-review.googlesource.com/67360 Reviewed-by: Karl Wiberg Commit-Queue: Paulina Hensman Cr-Commit-Position: refs/heads/master@{#22796} --- api/BUILD.gn | 1 + api/audio_options.cc | 18 +++++++ api/audio_options.h | 2 + call/BUILD.gn | 7 +++ call/audio_receive_stream.cc | 24 ++++++++++ call/audio_receive_stream.h | 8 ++++ call/audio_state.cc | 18 +++++++ call/audio_state.h | 9 ++-- call/call.h | 36 +------------- call/call_config.cc | 20 ++++++++ call/call_config.h | 52 ++++++++++++++++++++ call/flexfec_receive_stream.cc | 21 +++++++++ call/flexfec_receive_stream.h | 6 +-- media/BUILD.gn | 1 + media/base/mediachannel.cc | 86 ++++++++++++++++++++++++++++++++++ media/base/mediachannel.h | 69 +++++++++++++++------------ media/base/mediaengine.cc | 3 ++ media/base/mediaengine.h | 2 + media/base/streamparams.cc | 20 ++++++++ media/base/streamparams.h | 18 +++++-- sdk/android/BUILD.gn | 29 ------------ 21 files changed, 346 insertions(+), 104 deletions(-) create mode 100644 api/audio_options.cc create mode 100644 call/audio_receive_stream.cc create mode 100644 call/audio_state.cc create mode 100644 call/call_config.cc create mode 100644 call/call_config.h create mode 100644 call/flexfec_receive_stream.cc create mode 100644 media/base/mediachannel.cc diff --git a/api/BUILD.gn b/api/BUILD.gn index 1a2ae4b96c..fddea977d1 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -189,6 +189,7 @@ rtc_source_set("rtc_stats_api") { rtc_source_set("audio_options_api") { visibility = [ "*" ] sources = [ + "audio_options.cc", "audio_options.h", ] diff --git a/api/audio_options.cc b/api/audio_options.cc new file mode 100644 index 0000000000..c196d7d9df --- /dev/null +++ b/api/audio_options.cc @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2018 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 "api/audio_options.h" + +namespace cricket { + +AudioOptions::AudioOptions() = default; +AudioOptions::~AudioOptions() = default; + +} // namespace cricket diff --git a/api/audio_options.h b/api/audio_options.h index 8d2880b0a0..5d698424eb 100644 --- a/api/audio_options.h +++ b/api/audio_options.h @@ -23,6 +23,8 @@ namespace cricket { // We are moving all of the setting of options to structs like this, // but some things currently still use flags. struct AudioOptions { + AudioOptions(); + ~AudioOptions(); void SetAll(const AudioOptions& change) { SetFrom(&echo_cancellation, change.echo_cancellation); #if defined(WEBRTC_IOS) diff --git a/call/BUILD.gn b/call/BUILD.gn index 58238af131..3d6f32fb84 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -10,10 +10,15 @@ import("../webrtc.gni") rtc_source_set("call_interfaces") { sources = [ + "audio_receive_stream.cc", "audio_receive_stream.h", "audio_send_stream.h", + "audio_state.cc", "audio_state.h", "call.h", + "call_config.cc", + "call_config.h", + "flexfec_receive_stream.cc", "flexfec_receive_stream.h", "syncable.cc", "syncable.h", @@ -32,6 +37,8 @@ rtc_source_set("call_interfaces") { "../api:transport_api", "../api/audio:audio_mixer_api", "../api/audio_codecs:audio_codecs_api", + "../modules/audio_device:audio_device", + "../modules/audio_processing:audio_processing", "../modules/audio_processing:audio_processing_statistics", "../rtc_base:audio_format_to_string", "../rtc_base:rtc_base", diff --git a/call/audio_receive_stream.cc b/call/audio_receive_stream.cc new file mode 100644 index 0000000000..c3c2ac77d0 --- /dev/null +++ b/call/audio_receive_stream.cc @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2018 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 "call/audio_receive_stream.h" + +namespace webrtc { + +AudioReceiveStream::Stats::Stats() = default; +AudioReceiveStream::Stats::~Stats() = default; + +AudioReceiveStream::Config::Config() = default; +AudioReceiveStream::Config::~Config() = default; + +AudioReceiveStream::Config::Rtp::Rtp() = default; +AudioReceiveStream::Config::Rtp::~Rtp() = default; + +} // namespace webrtc diff --git a/call/audio_receive_stream.h b/call/audio_receive_stream.h index 54a4d9bcde..3c0e58d899 100644 --- a/call/audio_receive_stream.h +++ b/call/audio_receive_stream.h @@ -32,6 +32,8 @@ class AudioSinkInterface; class AudioReceiveStream { public: struct Stats { + Stats(); + ~Stats(); uint32_t remote_ssrc = 0; int64_t bytes_rcvd = 0; uint32_t packets_rcvd = 0; @@ -71,10 +73,16 @@ class AudioReceiveStream { }; struct Config { + Config(); + ~Config(); + std::string ToString() const; // Receive-stream specific RTP settings. struct Rtp { + Rtp(); + ~Rtp(); + std::string ToString() const; // Synchronization source (stream identifier) to be received. diff --git a/call/audio_state.cc b/call/audio_state.cc new file mode 100644 index 0000000000..725d27f423 --- /dev/null +++ b/call/audio_state.cc @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2018 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 "call/audio_state.h" + +namespace webrtc { + +AudioState::Config::Config() = default; +AudioState::Config::~Config() = default; + +} // namespace webrtc diff --git a/call/audio_state.h b/call/audio_state.h index e947beb00c..a85cd86e5f 100644 --- a/call/audio_state.h +++ b/call/audio_state.h @@ -11,13 +11,13 @@ #define CALL_AUDIO_STATE_H_ #include "api/audio/audio_mixer.h" +#include "modules/audio_device/include/audio_device.h" +#include "modules/audio_processing/include/audio_processing.h" #include "rtc_base/refcount.h" #include "rtc_base/scoped_ref_ptr.h" namespace webrtc { -class AudioDeviceModule; -class AudioProcessing; class AudioTransport; // AudioState holds the state which must be shared between multiple instances of @@ -25,6 +25,9 @@ class AudioTransport; class AudioState : public rtc::RefCountInterface { public: struct Config { + Config(); + ~Config(); + // The audio mixer connected to active receive streams. One per // AudioState. rtc::scoped_refptr audio_mixer; @@ -65,7 +68,7 @@ class AudioState : public rtc::RefCountInterface { static rtc::scoped_refptr Create( const AudioState::Config& config); - virtual ~AudioState() {} + ~AudioState() override {} }; } // namespace webrtc diff --git a/call/call.h b/call/call.h index 8630815a95..d2971be5d5 100644 --- a/call/call.h +++ b/call/call.h @@ -15,12 +15,9 @@ #include #include -#include "api/fec_controller.h" -#include "api/rtcerror.h" #include "call/audio_receive_stream.h" #include "call/audio_send_stream.h" -#include "call/audio_state.h" -#include "call/bitrate_constraints.h" +#include "call/call_config.h" #include "call/flexfec_receive_stream.h" #include "call/rtp_transport_controller_send_interface.h" #include "call/video_receive_stream.h" @@ -29,14 +26,10 @@ #include "rtc_base/bitrateallocationstrategy.h" #include "rtc_base/copyonwritebuffer.h" #include "rtc_base/networkroute.h" -#include "rtc_base/platform_file.h" #include "rtc_base/socket.h" namespace webrtc { -class AudioProcessing; -class RtcEventLog; - enum class MediaType { ANY, AUDIO, @@ -60,33 +53,6 @@ class PacketReceiver { virtual ~PacketReceiver() {} }; -struct CallConfig { - explicit CallConfig(RtcEventLog* event_log) : event_log(event_log) { - RTC_DCHECK(event_log); - } - - RTC_DEPRECATED static constexpr int kDefaultStartBitrateBps = 300000; - - // Bitrate config used until valid bitrate estimates are calculated. Also - // used to cap total bitrate used. This comes from the remote connection. - BitrateConstraints bitrate_config; - - // AudioState which is possibly shared between multiple calls. - // TODO(solenberg): Change this to a shared_ptr once we can use C++11. - rtc::scoped_refptr audio_state; - - // Audio Processing Module to be used in this call. - // TODO(solenberg): Change this to a shared_ptr once we can use C++11. - AudioProcessing* audio_processing = nullptr; - - // RtcEventLog to use for this call. Required. - // Use webrtc::RtcEventLog::CreateNull() for a null implementation. - RtcEventLog* event_log = nullptr; - - // FecController to use for this call. - FecControllerFactoryInterface* fec_controller_factory = nullptr; -}; - // A Call instance can contain several send and/or receive streams. All streams // are assumed to have the same remote endpoint and will share bitrate estimates // etc. diff --git a/call/call_config.cc b/call/call_config.cc new file mode 100644 index 0000000000..ca5fb60b34 --- /dev/null +++ b/call/call_config.cc @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2018 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 "call/call_config.h" + +namespace webrtc { + +CallConfig::CallConfig(RtcEventLog* event_log) : event_log(event_log) { + RTC_DCHECK(event_log); +} +CallConfig::~CallConfig() = default; + +} // namespace webrtc diff --git a/call/call_config.h b/call/call_config.h new file mode 100644 index 0000000000..421b52464e --- /dev/null +++ b/call/call_config.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018 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 CALL_CALL_CONFIG_H_ +#define CALL_CALL_CONFIG_H_ + +#include "api/fec_controller.h" +#include "api/rtcerror.h" +#include "call/audio_state.h" +#include "call/bitrate_constraints.h" +#include "rtc_base/platform_file.h" + +namespace webrtc { + +class AudioProcessing; +class RtcEventLog; + +struct CallConfig { + explicit CallConfig(RtcEventLog* event_log); + ~CallConfig(); + + RTC_DEPRECATED static constexpr int kDefaultStartBitrateBps = 300000; + + // Bitrate config used until valid bitrate estimates are calculated. Also + // used to cap total bitrate used. This comes from the remote connection. + BitrateConstraints bitrate_config; + + // AudioState which is possibly shared between multiple calls. + // TODO(solenberg): Change this to a shared_ptr once we can use C++11. + rtc::scoped_refptr audio_state; + + // Audio Processing Module to be used in this call. + // TODO(solenberg): Change this to a shared_ptr once we can use C++11. + AudioProcessing* audio_processing = nullptr; + + // RtcEventLog to use for this call. Required. + // Use webrtc::RtcEventLog::CreateNull() for a null implementation. + RtcEventLog* event_log = nullptr; + + // FecController to use for this call. + FecControllerFactoryInterface* fec_controller_factory = nullptr; +}; + +} // namespace webrtc + +#endif // CALL_CALL_CONFIG_H_ diff --git a/call/flexfec_receive_stream.cc b/call/flexfec_receive_stream.cc new file mode 100644 index 0000000000..86c000623d --- /dev/null +++ b/call/flexfec_receive_stream.cc @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2018 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 "call/flexfec_receive_stream.h" + +namespace webrtc { + +FlexfecReceiveStream::Config::Config(Transport* rtcp_send_transport) + : rtcp_send_transport(rtcp_send_transport) { + RTC_DCHECK(rtcp_send_transport); +} +FlexfecReceiveStream::Config::~Config() = default; + +} // namespace webrtc diff --git a/call/flexfec_receive_stream.h b/call/flexfec_receive_stream.h index 98ce351095..19f945e11e 100644 --- a/call/flexfec_receive_stream.h +++ b/call/flexfec_receive_stream.h @@ -36,10 +36,8 @@ class FlexfecReceiveStream : public RtpPacketSinkInterface { }; struct Config { - explicit Config(Transport* rtcp_send_transport) - : rtcp_send_transport(rtcp_send_transport) { - RTC_DCHECK(rtcp_send_transport); - } + explicit Config(Transport* rtcp_send_transport); + ~Config(); std::string ToString() const; diff --git a/media/BUILD.gn b/media/BUILD.gn index ffc4883adb..c2d6149155 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -83,6 +83,7 @@ rtc_static_library("rtc_media_base") { "base/codec.h", "base/cryptoparams.h", "base/device.h", + "base/mediachannel.cc", "base/mediachannel.h", "base/mediaconstants.cc", "base/mediaconstants.h", diff --git a/media/base/mediachannel.cc b/media/base/mediachannel.cc new file mode 100644 index 0000000000..019739d051 --- /dev/null +++ b/media/base/mediachannel.cc @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2018 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 "media/base/mediachannel.h" + +namespace cricket { + +VideoOptions::VideoOptions() = default; +VideoOptions::~VideoOptions() = default; + +void MediaChannel::SetInterface(NetworkInterface* iface) { + rtc::CritScope cs(&network_interface_crit_); + network_interface_ = iface; + SetDscp(enable_dscp_ ? PreferredDscp() : rtc::DSCP_DEFAULT); +} + +rtc::DiffServCodePoint MediaChannel::PreferredDscp() const { + return rtc::DSCP_DEFAULT; +} + +int MediaChannel::GetRtpSendTimeExtnId() const { + return -1; +} + +MediaSenderInfo::MediaSenderInfo() = default; +MediaSenderInfo::~MediaSenderInfo() = default; + +MediaReceiverInfo::MediaReceiverInfo() = default; +MediaReceiverInfo::~MediaReceiverInfo() = default; + +VoiceSenderInfo::VoiceSenderInfo() = default; +VoiceSenderInfo::~VoiceSenderInfo() = default; + +VoiceReceiverInfo::VoiceReceiverInfo() = default; +VoiceReceiverInfo::~VoiceReceiverInfo() = default; + +VideoSenderInfo::VideoSenderInfo() = default; +VideoSenderInfo::~VideoSenderInfo() = default; + +VideoReceiverInfo::VideoReceiverInfo() = default; +VideoReceiverInfo::~VideoReceiverInfo() = default; + +VoiceMediaInfo::VoiceMediaInfo() = default; +VoiceMediaInfo::~VoiceMediaInfo() = default; + +VideoMediaInfo::VideoMediaInfo() = default; +VideoMediaInfo::~VideoMediaInfo() = default; + +DataMediaInfo::DataMediaInfo() = default; +DataMediaInfo::~DataMediaInfo() = default; + +AudioSendParameters::AudioSendParameters() = default; +AudioSendParameters::~AudioSendParameters() = default; + +std::map AudioSendParameters::ToStringMap() const { + auto params = RtpSendParameters::ToStringMap(); + params["options"] = options.ToString(); + return params; +} + +VideoSendParameters::VideoSendParameters() = default; +VideoSendParameters::~VideoSendParameters() = default; + +std::map VideoSendParameters::ToStringMap() const { + auto params = RtpSendParameters::ToStringMap(); + params["conference_mode"] = (conference_mode ? "yes" : "no"); + return params; +} + +DataMediaChannel::DataMediaChannel() = default; +DataMediaChannel::DataMediaChannel(const MediaConfig& config) + : MediaChannel(config) {} +DataMediaChannel::~DataMediaChannel() = default; + +bool DataMediaChannel::GetStats(DataMediaInfo* info) { + return true; +} + +} // namespace cricket diff --git a/media/base/mediachannel.h b/media/base/mediachannel.h index 7695079563..57cbb3e4c0 100644 --- a/media/base/mediachannel.h +++ b/media/base/mediachannel.h @@ -94,6 +94,9 @@ static std::string VectorToString(const std::vector& vals) { // We are moving all of the setting of options to structs like this, // but some things currently still use flags. struct VideoOptions { + VideoOptions(); + ~VideoOptions(); + void SetAll(const VideoOptions& change) { SetFrom(&video_noise_reduction, change.video_noise_reduction); SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps); @@ -176,17 +179,11 @@ class MediaChannel : public sigslot::has_slots<> { explicit MediaChannel(const MediaConfig& config) : enable_dscp_(config.enable_dscp), network_interface_(NULL) {} MediaChannel() : enable_dscp_(false), network_interface_(NULL) {} - virtual ~MediaChannel() {} + ~MediaChannel() override {} // Sets the abstract interface class for sending RTP/RTCP data. - virtual void SetInterface(NetworkInterface *iface) { - rtc::CritScope cs(&network_interface_crit_); - network_interface_ = iface; - SetDscp(enable_dscp_ ? PreferredDscp() : rtc::DSCP_DEFAULT); - } - virtual rtc::DiffServCodePoint PreferredDscp() const { - return rtc::DSCP_DEFAULT; - } + virtual void SetInterface(NetworkInterface* iface); + virtual rtc::DiffServCodePoint PreferredDscp() const; // Called when a RTP packet is received. virtual void OnPacketReceived(rtc::CopyOnWriteBuffer* packet, const rtc::PacketTime& packet_time) = 0; @@ -217,9 +214,7 @@ class MediaChannel : public sigslot::has_slots<> { virtual bool RemoveRecvStream(uint32_t ssrc) = 0; // Returns the absoulte sendtime extension id value from media channel. - virtual int GetRtpSendTimeExtnId() const { - return -1; - } + virtual int GetRtpSendTimeExtnId() const; // Base method to send packet using NetworkInterface. bool SendPacket(rtc::CopyOnWriteBuffer* packet, @@ -294,6 +289,8 @@ struct SsrcReceiverInfo { }; struct MediaSenderInfo { + MediaSenderInfo(); + ~MediaSenderInfo(); void add_ssrc(const SsrcSenderInfo& stat) { local_stats.push_back(stat); } @@ -339,6 +336,8 @@ struct MediaSenderInfo { }; struct MediaReceiverInfo { + MediaReceiverInfo(); + ~MediaReceiverInfo(); void add_ssrc(const SsrcReceiverInfo& stat) { local_stats.push_back(stat); } @@ -383,6 +382,8 @@ struct MediaReceiverInfo { }; struct VoiceSenderInfo : public MediaSenderInfo { + VoiceSenderInfo(); + ~VoiceSenderInfo(); int ext_seqnum = 0; int jitter_ms = 0; int audio_level = 0; @@ -404,6 +405,8 @@ struct VoiceSenderInfo : public MediaSenderInfo { }; struct VoiceReceiverInfo : public MediaReceiverInfo { + VoiceReceiverInfo(); + ~VoiceReceiverInfo(); int ext_seqnum = 0; int jitter_ms = 0; int jitter_buffer_ms = 0; @@ -447,6 +450,8 @@ struct VoiceReceiverInfo : public MediaReceiverInfo { }; struct VideoSenderInfo : public MediaSenderInfo { + VideoSenderInfo(); + ~VideoSenderInfo(); std::vector ssrc_groups; // TODO(hbos): Move this to |VideoMediaInfo::send_codecs|? std::string encoder_implementation_name; @@ -473,6 +478,8 @@ struct VideoSenderInfo : public MediaSenderInfo { }; struct VideoReceiverInfo : public MediaReceiverInfo { + VideoReceiverInfo(); + ~VideoReceiverInfo(); std::vector ssrc_groups; // TODO(hbos): Move this to |VideoMediaInfo::receive_codecs|? std::string decoder_implementation_name; @@ -547,6 +554,8 @@ struct BandwidthEstimationInfo { typedef std::map RtpCodecParametersMap; struct VoiceMediaInfo { + VoiceMediaInfo(); + ~VoiceMediaInfo(); void Clear() { senders.clear(); receivers.clear(); @@ -560,6 +569,8 @@ struct VoiceMediaInfo { }; struct VideoMediaInfo { + VideoMediaInfo(); + ~VideoMediaInfo(); void Clear() { senders.clear(); receivers.clear(); @@ -577,6 +588,8 @@ struct VideoMediaInfo { }; struct DataMediaInfo { + DataMediaInfo(); + ~DataMediaInfo(); void Clear() { senders.clear(); receivers.clear(); @@ -636,14 +649,12 @@ struct RtpSendParameters : RtpParameters { }; struct AudioSendParameters : RtpSendParameters { + AudioSendParameters(); + ~AudioSendParameters() override; AudioOptions options; protected: - std::map ToStringMap() const override { - auto params = RtpSendParameters::ToStringMap(); - params["options"] = options.ToString(); - return params; - } + std::map ToStringMap() const override; }; struct AudioRecvParameters : RtpParameters { @@ -654,7 +665,7 @@ class VoiceMediaChannel : public MediaChannel { VoiceMediaChannel() {} explicit VoiceMediaChannel(const MediaConfig& config) : MediaChannel(config) {} - virtual ~VoiceMediaChannel() {} + ~VoiceMediaChannel() override {} virtual bool SetSendParameters(const AudioSendParameters& params) = 0; virtual bool SetRecvParameters(const AudioRecvParameters& params) = 0; virtual webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const = 0; @@ -702,6 +713,8 @@ class VoiceMediaChannel : public MediaChannel { // TODO(deadbeef): Rename to VideoSenderParameters, since they're intended to // encapsulate all the parameters needed for a video RtpSender. struct VideoSendParameters : RtpSendParameters { + VideoSendParameters(); + ~VideoSendParameters() override; // Use conference mode? This flag comes from the remote // description's SDP line 'a=x-google-flag:conference', copied over // by VideoChannel::SetRemoteContent_w, and ultimately used by @@ -711,11 +724,7 @@ struct VideoSendParameters : RtpSendParameters { bool conference_mode = false; protected: - std::map ToStringMap() const override { - auto params = RtpSendParameters::ToStringMap(); - params["conference_mode"] = (conference_mode ? "yes" : "no"); - return params; - } + std::map ToStringMap() const override; }; // TODO(deadbeef): Rename to VideoReceiverParameters, since they're intended to @@ -728,7 +737,7 @@ class VideoMediaChannel : public MediaChannel { VideoMediaChannel() {} explicit VideoMediaChannel(const MediaConfig& config) : MediaChannel(config) {} - virtual ~VideoMediaChannel() {} + ~VideoMediaChannel() override {} virtual bool SetSendParameters(const VideoSendParameters& params) = 0; virtual bool SetRecvParameters(const VideoRecvParameters& params) = 0; @@ -837,21 +846,21 @@ struct DataRecvParameters : RtpParameters { class DataMediaChannel : public MediaChannel { public: - DataMediaChannel() {} - explicit DataMediaChannel(const MediaConfig& config) : MediaChannel(config) {} - virtual ~DataMediaChannel() {} + DataMediaChannel(); + explicit DataMediaChannel(const MediaConfig& config); + ~DataMediaChannel() override; virtual bool SetSendParameters(const DataSendParameters& params) = 0; virtual bool SetRecvParameters(const DataRecvParameters& params) = 0; // TODO(pthatcher): Implement this. - virtual bool GetStats(DataMediaInfo* info) { return true; } + virtual bool GetStats(DataMediaInfo* info); virtual bool SetSend(bool send) = 0; virtual bool SetReceive(bool receive) = 0; - virtual void OnNetworkRouteChanged(const std::string& transport_name, - const rtc::NetworkRoute& network_route) {} + void OnNetworkRouteChanged(const std::string& transport_name, + const rtc::NetworkRoute& network_route) override {} virtual bool SendData( const SendDataParams& params, diff --git a/media/base/mediaengine.cc b/media/base/mediaengine.cc index d85e12773f..d40f765dd0 100644 --- a/media/base/mediaengine.cc +++ b/media/base/mediaengine.cc @@ -12,6 +12,9 @@ namespace cricket { +RtpCapabilities::RtpCapabilities() = default; +RtpCapabilities::~RtpCapabilities() = default; + webrtc::RtpParameters CreateRtpParametersWithOneEncoding() { webrtc::RtpParameters parameters; webrtc::RtpEncodingParameters encoding; diff --git a/media/base/mediaengine.h b/media/base/mediaengine.h index 920ed85854..b83217413f 100644 --- a/media/base/mediaengine.h +++ b/media/base/mediaengine.h @@ -39,6 +39,8 @@ class Call; namespace cricket { struct RtpCapabilities { + RtpCapabilities(); + ~RtpCapabilities(); std::vector header_extensions; }; diff --git a/media/base/streamparams.cc b/media/base/streamparams.cc index 2efa0d0976..ac09bfb020 100644 --- a/media/base/streamparams.cc +++ b/media/base/streamparams.cc @@ -38,6 +38,9 @@ bool GetStream(const StreamParamsVec& streams, return found != nullptr; } +MediaStreams::MediaStreams() = default; +MediaStreams::~MediaStreams() = default; + bool MediaStreams::GetAudioStream( const StreamSelector& selector, StreamParams* stream) { return GetStream(audio_, selector, stream); @@ -100,6 +103,16 @@ static std::string SsrcsToString(const std::vector& ssrcs) { return ost.str(); } +SsrcGroup::SsrcGroup(const std::string& usage, + const std::vector& ssrcs) + : semantics(usage), ssrcs(ssrcs) {} +SsrcGroup::SsrcGroup(const SsrcGroup&) = default; +SsrcGroup::SsrcGroup(SsrcGroup&&) = default; +SsrcGroup::~SsrcGroup() = default; + +SsrcGroup& SsrcGroup::operator=(const SsrcGroup&) = default; +SsrcGroup& SsrcGroup::operator=(SsrcGroup&&) = default; + bool SsrcGroup::has_semantics(const std::string& semantics_in) const { return (semantics == semantics_in && ssrcs.size() > 0); } @@ -113,6 +126,13 @@ std::string SsrcGroup::ToString() const { return ost.str(); } +StreamParams::StreamParams() = default; +StreamParams::StreamParams(const StreamParams&) = default; +StreamParams::StreamParams(StreamParams&&) = default; +StreamParams::~StreamParams() = default; +StreamParams& StreamParams::operator=(const StreamParams&) = default; +StreamParams& StreamParams::operator=(StreamParams&&) = default; + std::string StreamParams::ToString() const { std::ostringstream ost; ost << "{"; diff --git a/media/base/streamparams.h b/media/base/streamparams.h index 52f1918268..6523430291 100644 --- a/media/base/streamparams.h +++ b/media/base/streamparams.h @@ -43,8 +43,12 @@ extern const char kFidSsrcGroupSemantics[]; extern const char kSimSsrcGroupSemantics[]; struct SsrcGroup { - SsrcGroup(const std::string& usage, const std::vector& ssrcs) - : semantics(usage), ssrcs(ssrcs) {} + SsrcGroup(const std::string& usage, const std::vector& ssrcs); + SsrcGroup(const SsrcGroup&); + SsrcGroup(SsrcGroup&&); + ~SsrcGroup(); + SsrcGroup& operator=(const SsrcGroup&); + SsrcGroup& operator=(SsrcGroup&&); bool operator==(const SsrcGroup& other) const { return (semantics == other.semantics && ssrcs == other.ssrcs); @@ -62,6 +66,13 @@ struct SsrcGroup { }; struct StreamParams { + StreamParams(); + StreamParams(const StreamParams&); + StreamParams(StreamParams&&); + ~StreamParams(); + StreamParams& operator=(const StreamParams&); + StreamParams& operator=(StreamParams&&); + static StreamParams CreateLegacy(uint32_t ssrc) { StreamParams stream; stream.ssrcs.push_back(ssrc); @@ -216,7 +227,8 @@ typedef std::vector StreamParamsVec; // See https://code.google.com/p/webrtc/issues/detail?id=4107 struct MediaStreams { public: - MediaStreams() {} + MediaStreams(); + ~MediaStreams(); void CopyFrom(const MediaStreams& sources); bool empty() const { diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn index ff5a9fb7b1..a08cae7225 100644 --- a/sdk/android/BUILD.gn +++ b/sdk/android/BUILD.gn @@ -141,11 +141,6 @@ rtc_source_set("native_api_audio_device_module") { if (rtc_enable_android_aaudio) { deps += [ ":aaudio_audio_device_jni" ] } - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } } rtc_source_set("audio_device_base_jni") { @@ -477,14 +472,6 @@ rtc_static_library("media_jni") { "../../modules/audio_device:audio_device", "../../modules/audio_processing:audio_processing", ] - - if (is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ - "//build/config/clang:extra_warnings", - "//build/config/clang:find_bad_constructs", - ] - } } rtc_static_library("null_media_jni") { @@ -495,14 +482,6 @@ rtc_static_library("null_media_jni") { deps = [ ":base_jni", ] - - if (is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ - "//build/config/clang:extra_warnings", - "//build/config/clang:find_bad_constructs", - ] - } } generate_jni("generated_peerconnection_jni") { @@ -1167,14 +1146,6 @@ rtc_static_library("native_api_codecs") { "native_api/codecs/wrapper.h", ] - if (is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ - "//build/config/clang:extra_warnings", - "//build/config/clang:find_bad_constructs", - ] - } - deps = [ ":base_jni", ":video_jni",