diff --git a/api/BUILD.gn b/api/BUILD.gn index 41130f5797..63bc99c741 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -69,6 +69,7 @@ rtc_static_library("libjingle_peerconnection_api") { "rtp_headers.h", "rtpparameters.cc", "rtpparameters.h", + "rtpreceiverinterface.cc", "rtpreceiverinterface.h", "rtpsenderinterface.h", "rtptransceiverinterface.h", diff --git a/api/mediastreaminterface.cc b/api/mediastreaminterface.cc index 0bc5d61e80..6f08a0caf1 100644 --- a/api/mediastreaminterface.cc +++ b/api/mediastreaminterface.cc @@ -45,4 +45,17 @@ AudioProcessorInterface::GetStats(bool /*has_remote_tracks*/) { return new_stats; } +VideoTrackInterface::ContentHint VideoTrackInterface::content_hint() const { + return ContentHint::kNone; +} + +bool AudioTrackInterface::GetSignalLevel(int* level) { + return false; +} + +rtc::scoped_refptr +AudioTrackInterface::GetAudioProcessor() { + return nullptr; +} + } // namespace webrtc diff --git a/api/mediastreaminterface.h b/api/mediastreaminterface.h index 3273c6d672..b7ba33231e 100644 --- a/api/mediastreaminterface.h +++ b/api/mediastreaminterface.h @@ -72,7 +72,7 @@ class MediaSourceInterface : public rtc::RefCountInterface, virtual bool remote() const = 0; protected: - virtual ~MediaSourceInterface() {} + ~MediaSourceInterface() override = default; }; // C++ version of MediaStreamTrack. @@ -106,7 +106,7 @@ class MediaStreamTrackInterface : public rtc::RefCountInterface, virtual TrackState state() const = 0; protected: - virtual ~MediaStreamTrackInterface() {} + ~MediaStreamTrackInterface() override = default; }; // VideoTrackSourceInterface is a reference counted source used for @@ -147,7 +147,7 @@ class VideoTrackSourceInterface virtual bool GetStats(Stats* stats) = 0; protected: - virtual ~VideoTrackSourceInterface() {} + ~VideoTrackSourceInterface() override = default; }; // VideoTrackInterface is designed to be invoked on the signaling thread except @@ -173,11 +173,11 @@ class VideoTrackInterface virtual VideoTrackSourceInterface* GetSource() const = 0; - virtual ContentHint content_hint() const { return ContentHint::kNone; } + virtual ContentHint content_hint() const; virtual void set_content_hint(ContentHint hint) {} protected: - virtual ~VideoTrackInterface() {} + ~VideoTrackInterface() override = default; }; // Interface for receiving audio data from a AudioTrack. @@ -269,7 +269,7 @@ class AudioProcessorInterface : public rtc::RefCountInterface { virtual AudioProcessorStatistics GetStats(bool has_remote_tracks); protected: - virtual ~AudioProcessorInterface() {} + ~AudioProcessorInterface() override = default; }; class AudioTrackInterface : public MediaStreamTrackInterface { @@ -286,17 +286,15 @@ class AudioTrackInterface : public MediaStreamTrackInterface { // Return true on success, otherwise false. // TODO(deadbeef): Change the interface to int GetSignalLevel() and pure // virtual after it's implemented in chromium. - virtual bool GetSignalLevel(int* level) { return false; } + virtual bool GetSignalLevel(int* level); // Get the audio processor used by the audio track. Return null if the track // does not have any processor. // TODO(deadbeef): Make the interface pure virtual. - virtual rtc::scoped_refptr GetAudioProcessor() { - return nullptr; - } + virtual rtc::scoped_refptr GetAudioProcessor(); protected: - virtual ~AudioTrackInterface() {} + ~AudioTrackInterface() override = default; }; typedef std::vector > @@ -331,7 +329,7 @@ class MediaStreamInterface : public rtc::RefCountInterface, virtual bool RemoveTrack(VideoTrackInterface* track) = 0; protected: - virtual ~MediaStreamInterface() {} + ~MediaStreamInterface() override = default; }; } // namespace webrtc diff --git a/api/rtpreceiverinterface.cc b/api/rtpreceiverinterface.cc new file mode 100644 index 0000000000..b62f744f3e --- /dev/null +++ b/api/rtpreceiverinterface.cc @@ -0,0 +1,48 @@ +/* + * Copyright 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/rtpreceiverinterface.h" + +namespace webrtc { + +RtpSource::RtpSource(int64_t timestamp_ms, + uint32_t source_id, + RtpSourceType source_type) + : timestamp_ms_(timestamp_ms), + source_id_(source_id), + source_type_(source_type) {} + +RtpSource::RtpSource(int64_t timestamp_ms, + uint32_t source_id, + RtpSourceType source_type, + uint8_t audio_level) + : timestamp_ms_(timestamp_ms), + source_id_(source_id), + source_type_(source_type), + audio_level_(audio_level) {} + +RtpSource::RtpSource(const RtpSource&) = default; +RtpSource& RtpSource::operator=(const RtpSource&) = default; +RtpSource::~RtpSource() = default; + +std::vector> +RtpReceiverInterface::streams() const { + return {}; +} + +std::vector RtpReceiverInterface::GetSources() const { + return {}; +} + +int RtpReceiverInterface::AttachmentId() const { + return 0; +} + +} // namespace webrtc diff --git a/api/rtpreceiverinterface.h b/api/rtpreceiverinterface.h index ac2e090dad..017c95a2aa 100644 --- a/api/rtpreceiverinterface.h +++ b/api/rtpreceiverinterface.h @@ -34,19 +34,16 @@ enum class RtpSourceType { class RtpSource { public: RtpSource() = delete; - RtpSource(int64_t timestamp_ms, uint32_t source_id, RtpSourceType source_type) - : timestamp_ms_(timestamp_ms), - source_id_(source_id), - source_type_(source_type) {} - + RtpSource(int64_t timestamp_ms, + uint32_t source_id, + RtpSourceType source_type); RtpSource(int64_t timestamp_ms, uint32_t source_id, RtpSourceType source_type, - uint8_t audio_level) - : timestamp_ms_(timestamp_ms), - source_id_(source_id), - source_type_(source_type), - audio_level_(audio_level) {} + uint8_t audio_level); + RtpSource(const RtpSource&); + RtpSource& operator=(const RtpSource&); + ~RtpSource(); int64_t timestamp_ms() const { return timestamp_ms_; } void update_timestamp_ms(int64_t timestamp_ms) { @@ -98,10 +95,7 @@ class RtpReceiverInterface : public rtc::RefCountInterface { // the [[AssociatedRemoteMediaStreams]] internal slot in the spec. // https://w3c.github.io/webrtc-pc/#dfn-x%5B%5Bassociatedremotemediastreams%5D%5D // TODO(hbos): Make pure virtual as soon as Chromium's mock implements this. - virtual std::vector> streams() - const { - return std::vector>(); - } + virtual std::vector> streams() const; // Audio or video receiver? virtual cricket::MediaType media_type() const = 0; @@ -124,19 +118,18 @@ class RtpReceiverInterface : public rtc::RefCountInterface { // TODO(zhihuang): Remove the default implementation once the subclasses // implement this. Currently, the only relevant subclass is the // content::FakeRtpReceiver in Chromium. - virtual std::vector GetSources() const { - return std::vector(); - } + virtual std::vector GetSources() const; + // TODO(hta): Remove default implementation or move function to // an internal interface. content::FakeRtpReceiver in Chromium needs this. // Returns an ID that changes if the attached track changes, but // otherwise remains constant. Used to generate IDs for stats. // The special value zero means that no track is attached. - virtual int AttachmentId() const { return 0; } + virtual int AttachmentId() const; protected: - virtual ~RtpReceiverInterface() {} + ~RtpReceiverInterface() override = default; }; // Define proxy for RtpReceiverInterface. diff --git a/common_video/h264/sps_parser.cc b/common_video/h264/sps_parser.cc index 1b9f0cd521..2be6da2274 100644 --- a/common_video/h264/sps_parser.cc +++ b/common_video/h264/sps_parser.cc @@ -26,6 +26,8 @@ typedef rtc::Optional OptionalSps; namespace webrtc { +SpsParser::SpsState::SpsState() = default; + // General note: this is based off the 02/2014 version of the H.264 standard. // You can find it on this page: // http://www.itu.int/rec/T-REC-H.264 diff --git a/common_video/h264/sps_parser.h b/common_video/h264/sps_parser.h index 0ccc481356..1fddc0c782 100644 --- a/common_video/h264/sps_parser.h +++ b/common_video/h264/sps_parser.h @@ -25,7 +25,7 @@ class SpsParser { // The parsed state of the SPS. Only some select values are stored. // Add more as they are actually needed. struct SpsState { - SpsState() = default; + SpsState(); uint32_t width = 0; uint32_t height = 0; diff --git a/logging/BUILD.gn b/logging/BUILD.gn index 95a5cac9d2..d31086b385 100644 --- a/logging/BUILD.gn +++ b/logging/BUILD.gn @@ -36,6 +36,7 @@ rtc_source_set("rtc_event_log_api") { sources = [ "rtc_event_log/encoder/rtc_event_log_encoder.h", "rtc_event_log/events/rtc_event.h", + "rtc_event_log/rtc_event_log.cc", "rtc_event_log/rtc_event_log.h", "rtc_event_log/rtc_event_log_factory_interface.h", ] diff --git a/logging/rtc_event_log/rtc_event_log.cc b/logging/rtc_event_log/rtc_event_log.cc new file mode 100644 index 0000000000..73a598d6b1 --- /dev/null +++ b/logging/rtc_event_log/rtc_event_log.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 "logging/rtc_event_log/rtc_event_log.h" + +namespace webrtc { + +bool RtcEventLogNullImpl::StartLogging( + std::unique_ptr output, + int64_t output_period_ms) { + return false; +} + +} // namespace webrtc diff --git a/logging/rtc_event_log/rtc_event_log.h b/logging/rtc_event_log/rtc_event_log.h index 3a52480891..79fd39a449 100644 --- a/logging/rtc_event_log/rtc_event_log.h +++ b/logging/rtc_event_log/rtc_event_log.h @@ -57,9 +57,7 @@ class RtcEventLog { class RtcEventLogNullImpl : public RtcEventLog { public: bool StartLogging(std::unique_ptr output, - int64_t output_period_ms) override { - return false; - } + int64_t output_period_ms) override; void StopLogging() override {} void Log(std::unique_ptr event) override {} }; diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.cc b/modules/remote_bitrate_estimator/test/bwe_test_logging.cc index fb9955ae32..68f3cb052e 100644 --- a/modules/remote_bitrate_estimator/test/bwe_test_logging.cc +++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.cc @@ -34,6 +34,9 @@ static std::string ToString(uint32_t v) { return ss.str(); } +Logging::ThreadState::ThreadState() = default; +Logging::ThreadState::~ThreadState() = default; + Logging::Context::Context(uint32_t name, int64_t timestamp_ms, bool enabled) { Logging::GetInstance()->PushState(ToString(name), timestamp_ms, enabled); } @@ -205,6 +208,8 @@ Logging::Logging() : thread_map_() { } +Logging::~Logging() = default; + Logging::State::State() : tag(""), timestamp_ms(0), enabled(true) {} Logging::State::State(const std::string& tag, int64_t timestamp_ms, diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.h b/modules/remote_bitrate_estimator/test/bwe_test_logging.h index 325beb7a1a..0f84249150 100644 --- a/modules/remote_bitrate_estimator/test/bwe_test_logging.h +++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.h @@ -331,12 +331,15 @@ class Logging { bool enabled; }; struct ThreadState { + ThreadState(); + ~ThreadState(); State global_state; std::stack stack; }; typedef std::map ThreadMap; Logging(); + ~Logging(); void PushState(const std::string& append_to_tag, int64_t timestamp_ms, bool enabled); void PopState(); diff --git a/modules/rtp_rtcp/BUILD.gn b/modules/rtp_rtcp/BUILD.gn index 24f3b7596e..799d6466f7 100644 --- a/modules/rtp_rtcp/BUILD.gn +++ b/modules/rtp_rtcp/BUILD.gn @@ -185,11 +185,6 @@ rtc_static_library("rtp_rtcp") { defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ] } - 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" ] - } - deps = [ ":rtp_rtcp_format", "..:module_api", diff --git a/modules/rtp_rtcp/source/flexfec_sender.cc b/modules/rtp_rtcp/source/flexfec_sender.cc index f046a349ee..28945ed96b 100644 --- a/modules/rtp_rtcp/source/flexfec_sender.cc +++ b/modules/rtp_rtcp/source/flexfec_sender.cc @@ -114,7 +114,7 @@ bool FlexfecSender::FecAvailable() const { std::vector> FlexfecSender::GetFecPackets() { std::vector> fec_packets_to_send; fec_packets_to_send.reserve(ulpfec_generator_.generated_fec_packets_.size()); - for (const auto& fec_packet : ulpfec_generator_.generated_fec_packets_) { + for (const auto* fec_packet : ulpfec_generator_.generated_fec_packets_) { std::unique_ptr fec_packet_to_send( new RtpPacketToSend(&rtp_header_extension_map_)); diff --git a/modules/rtp_rtcp/source/forward_error_correction.cc b/modules/rtp_rtcp/source/forward_error_correction.cc index 33829c4fb2..a00ecbbf42 100644 --- a/modules/rtp_rtcp/source/forward_error_correction.cc +++ b/modules/rtp_rtcp/source/forward_error_correction.cc @@ -655,7 +655,7 @@ void ForwardErrorCorrection::AttemptRecovery( continue; } - auto recovered_packet_ptr = recovered_packet.get(); + auto* recovered_packet_ptr = recovered_packet.get(); // Add recovered packet to the list of recovered packets and update any // FEC packets covering this packet with a pointer to the data. // TODO(holmer): Consider replacing this with a binary search for the diff --git a/modules/rtp_rtcp/source/packet_loss_stats.cc b/modules/rtp_rtcp/source/packet_loss_stats.cc index 69c20c4cf8..35184db3db 100644 --- a/modules/rtp_rtcp/source/packet_loss_stats.cc +++ b/modules/rtp_rtcp/source/packet_loss_stats.cc @@ -26,6 +26,8 @@ PacketLossStats::PacketLossStats() multiple_loss_historic_packet_count_(0) { } +PacketLossStats::~PacketLossStats() = default; + void PacketLossStats::AddLostPacket(uint16_t sequence_number) { // Detect sequence number wrap around. if (!lost_packets_buffer_.empty() && @@ -77,7 +79,7 @@ void PacketLossStats::ComputeLossCounts( std::vector*> buffers; buffers.push_back(&lost_packets_buffer_); buffers.push_back(&lost_packets_wrapped_buffer_); - for (auto buffer : buffers) { + for (const auto* buffer : buffers) { for (auto it = buffer->begin(); it != buffer->end(); ++it) { uint16_t current_num = *it; if (sequential_count > 0 && current_num != ((last_num + 1) & 0xFFFF)) { diff --git a/modules/rtp_rtcp/source/packet_loss_stats.h b/modules/rtp_rtcp/source/packet_loss_stats.h index 683399f123..7c4f65855b 100644 --- a/modules/rtp_rtcp/source/packet_loss_stats.h +++ b/modules/rtp_rtcp/source/packet_loss_stats.h @@ -21,7 +21,7 @@ namespace webrtc { class PacketLossStats { public: PacketLossStats(); - ~PacketLossStats() {} + ~PacketLossStats(); // Adds a lost packet to the stats by sequence number. void AddLostPacket(uint16_t sequence_number); diff --git a/modules/rtp_rtcp/source/receive_statistics_impl.cc b/modules/rtp_rtcp/source/receive_statistics_impl.cc index 0e40aacec2..49d29f00d1 100644 --- a/modules/rtp_rtcp/source/receive_statistics_impl.cc +++ b/modules/rtp_rtcp/source/receive_statistics_impl.cc @@ -52,6 +52,8 @@ StreamStatisticianImpl::StreamStatisticianImpl( rtcp_callback_(rtcp_callback), rtp_callback_(rtp_callback) {} +StreamStatisticianImpl::~StreamStatisticianImpl() = default; + void StreamStatisticianImpl::IncomingPacket(const RTPHeader& header, size_t packet_length, bool retransmitted) { diff --git a/modules/rtp_rtcp/source/receive_statistics_impl.h b/modules/rtp_rtcp/source/receive_statistics_impl.h index 1f827f62a9..d53787fece 100644 --- a/modules/rtp_rtcp/source/receive_statistics_impl.h +++ b/modules/rtp_rtcp/source/receive_statistics_impl.h @@ -29,7 +29,7 @@ class StreamStatisticianImpl : public StreamStatistician { Clock* clock, RtcpStatisticsCallback* rtcp_callback, StreamDataCountersCallback* rtp_callback); - virtual ~StreamStatisticianImpl() {} + ~StreamStatisticianImpl() override; // |reset| here and in next method restarts calculation of fraction_lost stat. bool GetStatistics(RtcpStatistics* statistics, bool reset) override; @@ -96,7 +96,7 @@ class ReceiveStatisticsImpl : public ReceiveStatistics, public: explicit ReceiveStatisticsImpl(Clock* clock); - ~ReceiveStatisticsImpl(); + ~ReceiveStatisticsImpl() override; // Implement ReceiveStatisticsProvider. std::vector RtcpReportBlocks(size_t max_blocks) override; diff --git a/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc b/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc index 444ba68a98..e524aeadaa 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc @@ -21,6 +21,7 @@ namespace webrtc { namespace rtcp { constexpr uint8_t SenderReport::kPacketType; constexpr size_t SenderReport::kMaxNumberOfReportBlocks; +constexpr size_t SenderReport::kSenderBaseLength; // Sender report (SR) (RFC 3550). // 0 1 2 3 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 @@ -46,6 +47,10 @@ SenderReport::SenderReport() sender_packet_count_(0), sender_octet_count_(0) {} +SenderReport::SenderReport(const SenderReport&) = default; +SenderReport::SenderReport(SenderReport&&) = default; +SenderReport& SenderReport::operator=(const SenderReport&) = default; +SenderReport& SenderReport::operator=(SenderReport&&) = default; SenderReport::~SenderReport() = default; bool SenderReport::Parse(const CommonHeader& packet) { diff --git a/modules/rtp_rtcp/source/rtcp_packet/sender_report.h b/modules/rtp_rtcp/source/rtcp_packet/sender_report.h index 844459a3a1..f1ee5250da 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/sender_report.h +++ b/modules/rtp_rtcp/source/rtcp_packet/sender_report.h @@ -27,6 +27,10 @@ class SenderReport : public RtcpPacket { static constexpr size_t kMaxNumberOfReportBlocks = 0x1f; SenderReport(); + SenderReport(const SenderReport&); + SenderReport(SenderReport&&); + SenderReport& operator=(const SenderReport&); + SenderReport& operator=(SenderReport&&); ~SenderReport() override; // Parse assumes header is already parsed and validated. @@ -65,7 +69,7 @@ class SenderReport : public RtcpPacket { PacketReadyCallback callback) const override; private: - const size_t kSenderBaseLength = 24; + static constexpr size_t kSenderBaseLength = 24; uint32_t sender_ssrc_; NtpTime ntp_; diff --git a/modules/rtp_rtcp/source/rtcp_sender.cc b/modules/rtp_rtcp/source/rtcp_sender.cc index d45a86f8c5..415de950cf 100644 --- a/modules/rtp_rtcp/source/rtcp_sender.cc +++ b/modules/rtp_rtcp/source/rtcp_sender.cc @@ -92,7 +92,7 @@ class PacketContainer : public rtcp::CompoundPacket { public: PacketContainer(Transport* transport, RtcEventLog* event_log) : transport_(transport), event_log_(event_log) {} - virtual ~PacketContainer() { + ~PacketContainer() override { for (RtcpPacket* packet : appended_packets_) delete packet; } diff --git a/modules/rtp_rtcp/source/rtp_format_h264.cc b/modules/rtp_rtcp/source/rtp_format_h264.cc index 226cc36656..0223402608 100644 --- a/modules/rtp_rtcp/source/rtp_format_h264.cc +++ b/modules/rtp_rtcp/source/rtp_format_h264.cc @@ -95,6 +95,8 @@ RtpPacketizerH264::RtpPacketizerH264(size_t max_payload_len, RtpPacketizerH264::~RtpPacketizerH264() { } +RtpPacketizerH264::Fragment::~Fragment() = default; + RtpPacketizerH264::Fragment::Fragment(const uint8_t* buffer, size_t length) : buffer(buffer), length(length) {} RtpPacketizerH264::Fragment::Fragment(const Fragment& fragment) diff --git a/modules/rtp_rtcp/source/rtp_format_h264.h b/modules/rtp_rtcp/source/rtp_format_h264.h index 5b6fe02295..04612b7191 100644 --- a/modules/rtp_rtcp/source/rtp_format_h264.h +++ b/modules/rtp_rtcp/source/rtp_format_h264.h @@ -30,7 +30,7 @@ class RtpPacketizerH264 : public RtpPacketizer { size_t last_packet_reduction_len, H264PacketizationMode packetization_mode); - virtual ~RtpPacketizerH264(); + ~RtpPacketizerH264() override; size_t SetPayloadData(const uint8_t* payload_data, size_t payload_size, @@ -49,6 +49,7 @@ class RtpPacketizerH264 : public RtpPacketizer { struct Fragment { Fragment(const uint8_t* buffer, size_t length); explicit Fragment(const Fragment& fragment); + ~Fragment(); const uint8_t* buffer = nullptr; size_t length = 0; std::unique_ptr tmp_buffer; @@ -100,7 +101,7 @@ class RtpPacketizerH264 : public RtpPacketizer { class RtpDepacketizerH264 : public RtpDepacketizer { public: RtpDepacketizerH264(); - virtual ~RtpDepacketizerH264(); + ~RtpDepacketizerH264() override; bool Parse(ParsedPayload* parsed_payload, const uint8_t* payload_data, diff --git a/modules/rtp_rtcp/source/rtp_format_video_generic.cc b/modules/rtp_rtcp/source/rtp_format_video_generic.cc index 0c9bb439e0..1d3c615bdc 100644 --- a/modules/rtp_rtcp/source/rtp_format_video_generic.cc +++ b/modules/rtp_rtcp/source/rtp_format_video_generic.cc @@ -112,6 +112,8 @@ std::string RtpPacketizerGeneric::ToString() { return "RtpPacketizerGeneric"; } +RtpDepacketizerGeneric::~RtpDepacketizerGeneric() = default; + bool RtpDepacketizerGeneric::Parse(ParsedPayload* parsed_payload, const uint8_t* payload_data, size_t payload_data_length) { diff --git a/modules/rtp_rtcp/source/rtp_format_video_generic.h b/modules/rtp_rtcp/source/rtp_format_video_generic.h index a9da5da1d5..9a916bf1e1 100644 --- a/modules/rtp_rtcp/source/rtp_format_video_generic.h +++ b/modules/rtp_rtcp/source/rtp_format_video_generic.h @@ -31,7 +31,7 @@ class RtpPacketizerGeneric : public RtpPacketizer { size_t max_payload_len, size_t last_packet_reduction_len); - virtual ~RtpPacketizerGeneric(); + ~RtpPacketizerGeneric() override; // Returns total number of packets to be generated. size_t SetPayloadData(const uint8_t* payload_data, @@ -64,7 +64,7 @@ class RtpPacketizerGeneric : public RtpPacketizer { // Depacketizer for generic codec. class RtpDepacketizerGeneric : public RtpDepacketizer { public: - virtual ~RtpDepacketizerGeneric() {} + ~RtpDepacketizerGeneric() override; bool Parse(ParsedPayload* parsed_payload, const uint8_t* payload_data, diff --git a/modules/rtp_rtcp/source/rtp_format_vp8.h b/modules/rtp_rtcp/source/rtp_format_vp8.h index 893086430a..7697480169 100644 --- a/modules/rtp_rtcp/source/rtp_format_vp8.h +++ b/modules/rtp_rtcp/source/rtp_format_vp8.h @@ -45,7 +45,7 @@ class RtpPacketizerVp8 : public RtpPacketizer { size_t max_payload_len, size_t last_packet_reduction_len); - virtual ~RtpPacketizerVp8(); + ~RtpPacketizerVp8() override; size_t SetPayloadData(const uint8_t* payload_data, size_t payload_size, @@ -159,7 +159,7 @@ class RtpPacketizerVp8 : public RtpPacketizer { // Depacketizer for VP8. class RtpDepacketizerVp8 : public RtpDepacketizer { public: - virtual ~RtpDepacketizerVp8() {} + ~RtpDepacketizerVp8() override = default; bool Parse(ParsedPayload* parsed_payload, const uint8_t* payload_data, diff --git a/modules/rtp_rtcp/source/rtp_format_vp9.h b/modules/rtp_rtcp/source/rtp_format_vp9.h index aa86ccdfa4..0171977710 100644 --- a/modules/rtp_rtcp/source/rtp_format_vp9.h +++ b/modules/rtp_rtcp/source/rtp_format_vp9.h @@ -37,7 +37,7 @@ class RtpPacketizerVp9 : public RtpPacketizer { size_t max_payload_length, size_t last_packet_reduction_len); - virtual ~RtpPacketizerVp9(); + ~RtpPacketizerVp9() override; std::string ToString() override; @@ -90,7 +90,7 @@ class RtpPacketizerVp9 : public RtpPacketizer { class RtpDepacketizerVp9 : public RtpDepacketizer { public: - virtual ~RtpDepacketizerVp9() {} + ~RtpDepacketizerVp9() override = default; bool Parse(ParsedPayload* parsed_payload, const uint8_t* payload, diff --git a/modules/rtp_rtcp/source/rtp_header_parser.cc b/modules/rtp_rtcp/source/rtp_header_parser.cc index 5d2971a0c6..df68f74dd9 100644 --- a/modules/rtp_rtcp/source/rtp_header_parser.cc +++ b/modules/rtp_rtcp/source/rtp_header_parser.cc @@ -18,7 +18,7 @@ namespace webrtc { class RtpHeaderParserImpl : public RtpHeaderParser { public: RtpHeaderParserImpl(); - virtual ~RtpHeaderParserImpl() {} + ~RtpHeaderParserImpl() override = default; bool Parse(const uint8_t* packet, size_t length, diff --git a/modules/rtp_rtcp/source/rtp_packet_history.cc b/modules/rtp_rtcp/source/rtp_packet_history.cc index 887406ad04..b3649f8a39 100644 --- a/modules/rtp_rtcp/source/rtp_packet_history.cc +++ b/modules/rtp_rtcp/source/rtp_packet_history.cc @@ -29,6 +29,12 @@ constexpr int kMinPacketDurationRtt = 3; } // namespace constexpr size_t RtpPacketHistory::kMaxCapacity; +RtpPacketHistory::StoredPacket::StoredPacket() = default; +RtpPacketHistory::StoredPacket::StoredPacket(StoredPacket&&) = default; +RtpPacketHistory::StoredPacket& RtpPacketHistory::StoredPacket::operator=( + RtpPacketHistory::StoredPacket&&) = default; +RtpPacketHistory::StoredPacket::~StoredPacket() = default; + RtpPacketHistory::RtpPacketHistory(Clock* clock) : clock_(clock), store_(false), prev_index_(0), rtt_ms_(-1) {} diff --git a/modules/rtp_rtcp/source/rtp_packet_history.h b/modules/rtp_rtcp/source/rtp_packet_history.h index 91134bf117..e9d5808b37 100644 --- a/modules/rtp_rtcp/source/rtp_packet_history.h +++ b/modules/rtp_rtcp/source/rtp_packet_history.h @@ -60,6 +60,10 @@ class RtpPacketHistory { private: struct StoredPacket { + StoredPacket(); + StoredPacket(StoredPacket&&); + StoredPacket& operator=(StoredPacket&&); + ~StoredPacket(); uint16_t sequence_number = 0; int64_t send_time = 0; StorageType storage_type = kDontRetransmit; diff --git a/modules/rtp_rtcp/source/rtp_receiver_audio.cc b/modules/rtp_rtcp/source/rtp_receiver_audio.cc index 270c00d48a..4f792952cc 100644 --- a/modules/rtp_rtcp/source/rtp_receiver_audio.cc +++ b/modules/rtp_rtcp/source/rtp_receiver_audio.cc @@ -38,6 +38,8 @@ RTPReceiverAudio::RTPReceiverAudio(RtpData* data_callback) memset(current_remote_energy_, 0, sizeof(current_remote_energy_)); } +RTPReceiverAudio::~RTPReceiverAudio() = default; + // Outband TelephoneEvent(DTMF) detection void RTPReceiverAudio::SetTelephoneEventForwardToDecoder( bool forward_to_decoder) { @@ -57,6 +59,10 @@ bool RTPReceiverAudio::TelephoneEventPayloadType( return telephone_event_payload_type_ == payload_type; } +TelephoneEventHandler* RTPReceiverAudio::GetTelephoneEventHandler() { + return this; +} + bool RTPReceiverAudio::CNGPayloadType(int8_t payload_type) { rtc::CritScope lock(&crit_sect_); return payload_type == cng_nb_payload_type_ || diff --git a/modules/rtp_rtcp/source/rtp_receiver_audio.h b/modules/rtp_rtcp/source/rtp_receiver_audio.h index b031002709..a2112230fc 100644 --- a/modules/rtp_rtcp/source/rtp_receiver_audio.h +++ b/modules/rtp_rtcp/source/rtp_receiver_audio.h @@ -27,7 +27,7 @@ class RTPReceiverAudio : public RTPReceiverStrategy, public TelephoneEventHandler { public: explicit RTPReceiverAudio(RtpData* data_callback); - virtual ~RTPReceiverAudio() {} + ~RTPReceiverAudio() override; // The following three methods implement the TelephoneEventHandler interface. // Forward DTMFs to decoder for playout. @@ -39,7 +39,7 @@ class RTPReceiverAudio : public RTPReceiverStrategy, // Is TelephoneEvent configured with |payload_type|. bool TelephoneEventPayloadType(const int8_t payload_type) const override; - TelephoneEventHandler* GetTelephoneEventHandler() override { return this; } + TelephoneEventHandler* GetTelephoneEventHandler() override; // Returns true if CNG is configured with |payload_type|. bool CNGPayloadType(const int8_t payload_type); diff --git a/modules/rtp_rtcp/source/rtp_receiver_impl.h b/modules/rtp_rtcp/source/rtp_receiver_impl.h index cd6b619ff0..d41e4030c4 100644 --- a/modules/rtp_rtcp/source/rtp_receiver_impl.h +++ b/modules/rtp_rtcp/source/rtp_receiver_impl.h @@ -35,7 +35,7 @@ class RtpReceiverImpl : public RtpReceiver { RTPPayloadRegistry* rtp_payload_registry, RTPReceiverStrategy* rtp_media_receiver); - virtual ~RtpReceiverImpl(); + ~RtpReceiverImpl() override; int32_t RegisterReceivePayload(int payload_type, const SdpAudioFormat& audio_format) override; diff --git a/modules/rtp_rtcp/source/rtp_receiver_strategy.cc b/modules/rtp_rtcp/source/rtp_receiver_strategy.cc index 6db24c9a02..b5a6356ed7 100644 --- a/modules/rtp_rtcp/source/rtp_receiver_strategy.cc +++ b/modules/rtp_rtcp/source/rtp_receiver_strategy.cc @@ -17,6 +17,8 @@ namespace webrtc { RTPReceiverStrategy::RTPReceiverStrategy(RtpData* data_callback) : data_callback_(data_callback) {} +RTPReceiverStrategy::~RTPReceiverStrategy() = default; + void RTPReceiverStrategy::GetLastMediaSpecificPayload( PayloadUnion* payload) const { rtc::CritScope cs(&crit_sect_); diff --git a/modules/rtp_rtcp/source/rtp_receiver_strategy.h b/modules/rtp_rtcp/source/rtp_receiver_strategy.h index 3288329977..24c05f14fa 100644 --- a/modules/rtp_rtcp/source/rtp_receiver_strategy.h +++ b/modules/rtp_rtcp/source/rtp_receiver_strategy.h @@ -30,7 +30,7 @@ class RTPReceiverStrategy { static RTPReceiverStrategy* CreateVideoStrategy(RtpData* data_callback); static RTPReceiverStrategy* CreateAudioStrategy(RtpData* data_callback); - virtual ~RTPReceiverStrategy() {} + virtual ~RTPReceiverStrategy(); // Parses the RTP packet and calls the data callback with the payload data. // Implementations are encouraged to use the provided packet buffer and RTP diff --git a/modules/rtp_rtcp/source/rtp_receiver_video.cc b/modules/rtp_rtcp/source/rtp_receiver_video.cc index 65d1831e8d..d8117b51e5 100644 --- a/modules/rtp_rtcp/source/rtp_receiver_video.cc +++ b/modules/rtp_rtcp/source/rtp_receiver_video.cc @@ -119,6 +119,10 @@ int32_t RTPReceiverVideo::ParseRtpPacket(WebRtcRTPHeader* rtp_header, : -1; } +TelephoneEventHandler* RTPReceiverVideo::GetTelephoneEventHandler() { + return nullptr; +} + RTPAliveType RTPReceiverVideo::ProcessDeadOrAlive( uint16_t last_payload_length) const { return kRtpDead; diff --git a/modules/rtp_rtcp/source/rtp_receiver_video.h b/modules/rtp_rtcp/source/rtp_receiver_video.h index f1e14f4d40..bebae0a2c8 100644 --- a/modules/rtp_rtcp/source/rtp_receiver_video.h +++ b/modules/rtp_rtcp/source/rtp_receiver_video.h @@ -23,7 +23,7 @@ class RTPReceiverVideo : public RTPReceiverStrategy { public: explicit RTPReceiverVideo(RtpData* data_callback); - virtual ~RTPReceiverVideo(); + ~RTPReceiverVideo() override; int32_t ParseRtpPacket(WebRtcRTPHeader* rtp_header, const PayloadUnion& specific_payload, @@ -32,7 +32,7 @@ class RTPReceiverVideo : public RTPReceiverStrategy { size_t packet_length, int64_t timestamp) override; - TelephoneEventHandler* GetTelephoneEventHandler() override { return NULL; } + TelephoneEventHandler* GetTelephoneEventHandler() override; RTPAliveType ProcessDeadOrAlive(uint16_t last_payload_length) const override; diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc index 27bf5b47a1..7707813d54 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc @@ -142,6 +142,8 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration) SetMaxRtpPacketSize(IP_PACKET_SIZE - kTcpOverIpv4HeaderSize); } +ModuleRtpRtcpImpl::~ModuleRtpRtcpImpl() = default; + // Returns the number of milliseconds until the module want a worker thread // to call Process. int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/modules/rtp_rtcp/source/rtp_rtcp_impl.h index 0bb9edee5b..fffce815d9 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl.h +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.h @@ -31,6 +31,7 @@ namespace webrtc { class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp { public: explicit ModuleRtpRtcpImpl(const RtpRtcp::Configuration& configuration); + ~ModuleRtpRtcpImpl() override; // Returns the number of milliseconds until the module want a worker thread to // call Process. diff --git a/modules/rtp_rtcp/source/ulpfec_generator.cc b/modules/rtp_rtcp/source/ulpfec_generator.cc index 3432bdd11d..85000eac9d 100644 --- a/modules/rtp_rtcp/source/ulpfec_generator.cc +++ b/modules/rtp_rtcp/source/ulpfec_generator.cc @@ -62,6 +62,8 @@ constexpr uint32_t kUnknownSsrc = 0; RedPacket::RedPacket(size_t length) : data_(new uint8_t[length]), length_(length), header_length_(0) {} +RedPacket::~RedPacket() = default; + void RedPacket::CreateHeader(const uint8_t* rtp_header, size_t header_length, int red_payload_type, @@ -213,7 +215,7 @@ std::vector> UlpfecGenerator::GetUlpfecPacketsAsRed( ForwardErrorCorrection::Packet* last_media_packet = media_packets_.back().get(); uint16_t seq_num = first_seq_num; - for (const auto& fec_packet : generated_fec_packets_) { + for (const auto* fec_packet : generated_fec_packets_) { // Wrap FEC packet (including FEC headers) in a RED packet. Since the // FEC packets in |generated_fec_packets_| don't have RTP headers, we // reuse the header from the last media packet. diff --git a/modules/rtp_rtcp/source/ulpfec_generator.h b/modules/rtp_rtcp/source/ulpfec_generator.h index 639c15be25..efc753f4c7 100644 --- a/modules/rtp_rtcp/source/ulpfec_generator.h +++ b/modules/rtp_rtcp/source/ulpfec_generator.h @@ -24,6 +24,7 @@ class FlexfecSender; class RedPacket { public: explicit RedPacket(size_t length); + ~RedPacket(); void CreateHeader(const uint8_t* rtp_header, size_t header_length, diff --git a/modules/rtp_rtcp/source/ulpfec_receiver_impl.h b/modules/rtp_rtcp/source/ulpfec_receiver_impl.h index edc3d31269..7dbc7ddfa5 100644 --- a/modules/rtp_rtcp/source/ulpfec_receiver_impl.h +++ b/modules/rtp_rtcp/source/ulpfec_receiver_impl.h @@ -25,7 +25,7 @@ namespace webrtc { class UlpfecReceiverImpl : public UlpfecReceiver { public: explicit UlpfecReceiverImpl(uint32_t ssrc, RecoveredPacketReceiver* callback); - virtual ~UlpfecReceiverImpl(); + ~UlpfecReceiverImpl() override; int32_t AddReceivedRedPacket(const RTPHeader& rtp_header, const uint8_t* incoming_rtp_packet,