From ca07d541924c258047b97def60e31c69b8c5c809 Mon Sep 17 00:00:00 2001 From: Dor Hen Date: Tue, 22 Oct 2024 02:41:05 -0700 Subject: [PATCH] Comment unused variables in implemented functions 4\n Bug: webrtc:370878648 Change-Id: I32d472174ce4f9f31b829ea89a82a003d333d2b8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364539 Reviewed-by: Danil Chapovalov Reviewed-by: Harald Alvestrand Commit-Queue: Dor Hen Cr-Commit-Position: refs/heads/main@{#43279} --- api/audio_codecs/audio_decoder.cc | 15 ++++++----- api/audio_codecs/audio_encoder.cc | 27 ++++++++++--------- api/media_stream_interface.cc | 2 +- api/rtp_sender_interface.cc | 5 ++-- api/video/video_bitrate_allocator.cc | 2 +- api/video/video_frame_buffer.cc | 2 +- api/video_codecs/video_decoder.cc | 4 +-- api/video_codecs/video_encoder.cc | 8 +++--- common_audio/resampler/push_sinc_resampler.cc | 2 +- .../ooura/fft_size_128/ooura_fft.cc | 2 +- .../events/rtc_event_ice_candidate_pair.h | 8 +++--- .../rtc_event_ice_candidate_pair_config.h | 8 +++--- .../events/rtc_event_rtcp_packet_incoming.h | 8 +++--- .../events/rtc_event_rtcp_packet_outgoing.h | 8 +++--- 14 files changed, 52 insertions(+), 49 deletions(-) diff --git a/api/audio_codecs/audio_decoder.cc b/api/audio_codecs/audio_decoder.cc index 23ef2c879b..aa91ac8e4d 100644 --- a/api/audio_codecs/audio_decoder.cc +++ b/api/audio_codecs/audio_decoder.cc @@ -130,7 +130,8 @@ bool AudioDecoder::HasDecodePlc() const { return false; } -size_t AudioDecoder::DecodePlc(size_t num_frames, int16_t* decoded) { +size_t AudioDecoder::DecodePlc(size_t /* num_frames */, + int16_t* /* decoded */) { return 0; } @@ -142,18 +143,18 @@ int AudioDecoder::ErrorCode() { return 0; } -int AudioDecoder::PacketDuration(const uint8_t* encoded, - size_t encoded_len) const { +int AudioDecoder::PacketDuration(const uint8_t* /* encoded */, + size_t /* encoded_len */) const { return kNotImplemented; } -int AudioDecoder::PacketDurationRedundant(const uint8_t* encoded, - size_t encoded_len) const { +int AudioDecoder::PacketDurationRedundant(const uint8_t* /* encoded */, + size_t /* encoded_len */) const { return kNotImplemented; } -bool AudioDecoder::PacketHasFec(const uint8_t* encoded, - size_t encoded_len) const { +bool AudioDecoder::PacketHasFec(const uint8_t* /* encoded */, + size_t /* encoded_len */) const { return false; } diff --git a/api/audio_codecs/audio_encoder.cc b/api/audio_codecs/audio_encoder.cc index de64550126..24a7292b38 100644 --- a/api/audio_codecs/audio_encoder.cc +++ b/api/audio_codecs/audio_encoder.cc @@ -67,31 +67,32 @@ bool AudioEncoder::GetDtx() const { return false; } -bool AudioEncoder::SetApplication(Application application) { +bool AudioEncoder::SetApplication(Application /* application */) { return false; } -void AudioEncoder::SetMaxPlaybackRate(int frequency_hz) {} +void AudioEncoder::SetMaxPlaybackRate(int /* frequency_hz */) {} -void AudioEncoder::SetTargetBitrate(int target_bps) {} +void AudioEncoder::SetTargetBitrate(int /* target_bps */) {} rtc::ArrayView> AudioEncoder::ReclaimContainedEncoders() { return nullptr; } -bool AudioEncoder::EnableAudioNetworkAdaptor(const std::string& config_string, - RtcEventLog* event_log) { +bool AudioEncoder::EnableAudioNetworkAdaptor( + const std::string& /* config_string */, + RtcEventLog* /* event_log */) { return false; } void AudioEncoder::DisableAudioNetworkAdaptor() {} void AudioEncoder::OnReceivedUplinkPacketLossFraction( - float uplink_packet_loss_fraction) {} + float /* uplink_packet_loss_fraction */) {} void AudioEncoder::OnReceivedUplinkRecoverablePacketLossFraction( - float uplink_recoverable_packet_loss_fraction) { + float /* uplink_recoverable_packet_loss_fraction */) { RTC_DCHECK_NOTREACHED(); } @@ -100,20 +101,20 @@ void AudioEncoder::OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps) { } void AudioEncoder::OnReceivedUplinkBandwidth( - int target_audio_bitrate_bps, - std::optional bwe_period_ms) {} + int /* target_audio_bitrate_bps */, + std::optional /* bwe_period_ms */) {} void AudioEncoder::OnReceivedUplinkAllocation(BitrateAllocationUpdate update) { OnReceivedUplinkBandwidth(update.target_bitrate.bps(), update.bwe_period.ms()); } -void AudioEncoder::OnReceivedRtt(int rtt_ms) {} +void AudioEncoder::OnReceivedRtt(int /* rtt_ms */) {} -void AudioEncoder::OnReceivedOverhead(size_t overhead_bytes_per_packet) {} +void AudioEncoder::OnReceivedOverhead(size_t /* overhead_bytes_per_packet */) {} -void AudioEncoder::SetReceiverFrameLengthRange(int min_frame_length_ms, - int max_frame_length_ms) {} +void AudioEncoder::SetReceiverFrameLengthRange(int /* min_frame_length_ms */, + int /* max_frame_length_ms */) {} ANAStats AudioEncoder::GetANAStats() const { return ANAStats(); diff --git a/api/media_stream_interface.cc b/api/media_stream_interface.cc index ee132b77d6..185b72f46e 100644 --- a/api/media_stream_interface.cc +++ b/api/media_stream_interface.cc @@ -25,7 +25,7 @@ VideoTrackInterface::ContentHint VideoTrackInterface::content_hint() const { return ContentHint::kNone; } -bool AudioTrackInterface::GetSignalLevel(int* level) { +bool AudioTrackInterface::GetSignalLevel(int* /* level */) { return false; } diff --git a/api/rtp_sender_interface.cc b/api/rtp_sender_interface.cc index ea928e056a..1ec869617a 100644 --- a/api/rtp_sender_interface.cc +++ b/api/rtp_sender_interface.cc @@ -15,8 +15,9 @@ namespace webrtc { -void RtpSenderInterface::SetParametersAsync(const RtpParameters& parameters, - SetParametersCallback callback) { +void RtpSenderInterface::SetParametersAsync( + const RtpParameters& /* parameters */, + SetParametersCallback /* callback */) { RTC_DCHECK_NOTREACHED() << "Default implementation called"; } diff --git a/api/video/video_bitrate_allocator.cc b/api/video/video_bitrate_allocator.cc index 7de8451b21..128a34ac36 100644 --- a/api/video/video_bitrate_allocator.cc +++ b/api/video/video_bitrate_allocator.cc @@ -54,6 +54,6 @@ VideoBitrateAllocation VideoBitrateAllocator::Allocate( return GetAllocation(parameters.total_bitrate.bps(), parameters.framerate); } -void VideoBitrateAllocator::SetLegacyConferenceMode(bool enabled) {} +void VideoBitrateAllocator::SetLegacyConferenceMode(bool /* enabled */) {} } // namespace webrtc diff --git a/api/video/video_frame_buffer.cc b/api/video/video_frame_buffer.cc index 30d7e87b3d..202dd0d634 100644 --- a/api/video/video_frame_buffer.cc +++ b/api/video/video_frame_buffer.cc @@ -78,7 +78,7 @@ const NV12BufferInterface* VideoFrameBuffer::GetNV12() const { } rtc::scoped_refptr VideoFrameBuffer::GetMappedFrameBuffer( - rtc::ArrayView types) { + rtc::ArrayView /* types */) { RTC_CHECK(type() == Type::kNative); return nullptr; } diff --git a/api/video_codecs/video_decoder.cc b/api/video_codecs/video_decoder.cc index d60636cf8e..5b2d2264ee 100644 --- a/api/video_codecs/video_decoder.cc +++ b/api/video_codecs/video_decoder.cc @@ -21,14 +21,14 @@ namespace webrtc { int32_t DecodedImageCallback::Decoded(VideoFrame& decodedImage, - int64_t decode_time_ms) { + int64_t /* decode_time_ms */) { // The default implementation ignores custom decode time value. return Decoded(decodedImage); } void DecodedImageCallback::Decoded(VideoFrame& decodedImage, std::optional decode_time_ms, - std::optional qp) { + std::optional /* qp */) { Decoded(decodedImage, decode_time_ms.value_or(-1)); } diff --git a/api/video_codecs/video_encoder.cc b/api/video_codecs/video_encoder.cc index c3b5f3a4e9..c5b851ae11 100644 --- a/api/video_codecs/video_encoder.cc +++ b/api/video_codecs/video_encoder.cc @@ -310,7 +310,7 @@ bool VideoEncoder::RateControlParameters::operator!=( VideoEncoder::RateControlParameters::~RateControlParameters() = default; void VideoEncoder::SetFecControllerOverride( - FecControllerOverride* fec_controller_override) {} + FecControllerOverride* /* fec_controller_override */) {} int32_t VideoEncoder::InitEncode(const VideoCodec* codec_settings, int32_t number_of_cores, @@ -335,11 +335,11 @@ int VideoEncoder::InitEncode(const VideoCodec* codec_settings, settings.max_payload_size); } -void VideoEncoder::OnPacketLossRateUpdate(float packet_loss_rate) {} +void VideoEncoder::OnPacketLossRateUpdate(float /* packet_loss_rate */) {} -void VideoEncoder::OnRttUpdate(int64_t rtt_ms) {} +void VideoEncoder::OnRttUpdate(int64_t /* rtt_ms */) {} void VideoEncoder::OnLossNotification( - const LossNotification& loss_notification) {} + const LossNotification& /* loss_notification */) {} } // namespace webrtc diff --git a/common_audio/resampler/push_sinc_resampler.cc b/common_audio/resampler/push_sinc_resampler.cc index d4b7eed026..75bf33a7df 100644 --- a/common_audio/resampler/push_sinc_resampler.cc +++ b/common_audio/resampler/push_sinc_resampler.cc @@ -33,7 +33,7 @@ PushSincResampler::~PushSincResampler() {} size_t PushSincResampler::Resample(const int16_t* source, size_t source_length, int16_t* destination, - size_t destination_capacity) { + size_t /* destination_capacity */) { if (!float_buffer_.get()) float_buffer_.reset(new float[destination_frames_]); diff --git a/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc b/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc index 693312012b..b7a529d1b1 100644 --- a/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc +++ b/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc @@ -313,7 +313,7 @@ static void rftbsub_128_C(float* a) { } // namespace -OouraFft::OouraFft(bool sse2_available) { +OouraFft::OouraFft([[maybe_unused]] bool sse2_available) { #if defined(WEBRTC_ARCH_X86_FAMILY) use_sse2_ = sse2_available; #else diff --git a/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h b/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h index d99812483a..ad6313c83a 100644 --- a/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h +++ b/logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h @@ -73,15 +73,15 @@ class RtcEventIceCandidatePair final : public RtcEvent { uint32_t candidate_pair_id() const { return candidate_pair_id_; } uint32_t transaction_id() const { return transaction_id_; } - static std::string Encode(rtc::ArrayView batch) { + static std::string Encode(rtc::ArrayView /* batch */) { // TODO(terelius): Implement return ""; } static RtcEventLogParseStatus Parse( - absl::string_view encoded_bytes, - bool batched, - std::vector& output) { + absl::string_view /* encoded_bytes */, + bool /* batched */, + std::vector& /* output */) { // TODO(terelius): Implement return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__); } diff --git a/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h b/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h index 1c006f931e..52d75942a4 100644 --- a/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h +++ b/logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h @@ -118,15 +118,15 @@ class RtcEventIceCandidatePairConfig final : public RtcEvent { return candidate_pair_desc_; } - static std::string Encode(rtc::ArrayView batch) { + static std::string Encode(rtc::ArrayView /* batch */) { // TODO(terelius): Implement return ""; } static RtcEventLogParseStatus Parse( - absl::string_view encoded_bytes, - bool batched, - std::vector& output) { + absl::string_view /* encoded_bytes */, + bool /* batched */, + std::vector& /* output */) { // TODO(terelius): Implement return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__); } diff --git a/logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.h b/logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.h index 8d2cecaee5..5a63f2e1e6 100644 --- a/logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.h +++ b/logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.h @@ -40,15 +40,15 @@ class RtcEventRtcpPacketIncoming final : public RtcEvent { const rtc::Buffer& packet() const { return packet_; } - static std::string Encode(rtc::ArrayView batch) { + static std::string Encode(rtc::ArrayView /* batch */) { // TODO(terelius): Implement return ""; } static RtcEventLogParseStatus Parse( - absl::string_view encoded_bytes, - bool batched, - std::vector& output) { + absl::string_view /* encoded_bytes */, + bool /* batched */, + std::vector& /* output */) { // TODO(terelius): Implement return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__); } diff --git a/logging/rtc_event_log/events/rtc_event_rtcp_packet_outgoing.h b/logging/rtc_event_log/events/rtc_event_rtcp_packet_outgoing.h index f3cf1f55d8..9b6fef09cd 100644 --- a/logging/rtc_event_log/events/rtc_event_rtcp_packet_outgoing.h +++ b/logging/rtc_event_log/events/rtc_event_rtcp_packet_outgoing.h @@ -40,15 +40,15 @@ class RtcEventRtcpPacketOutgoing final : public RtcEvent { const rtc::Buffer& packet() const { return packet_; } - static std::string Encode(rtc::ArrayView batch) { + static std::string Encode(rtc::ArrayView /* batch */) { // TODO(terelius): Implement return ""; } static RtcEventLogParseStatus Parse( - absl::string_view encoded_bytes, - bool batched, - std::vector& output) { + absl::string_view /* encoded_bytes */, + bool /* batched */, + std::vector& /* output */) { // TODO(terelius): Implement return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__); }