From 461e828d578c762b5cd6785c056cfd1b09fdf237 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 30 Oct 2024 08:19:14 +0000 Subject: [PATCH] Revert "Comment unused variables in implemented functions 10\n" This reverts commit f5e0f038440ae1cf46f84c3d740a75e420d808ca. Reason for revert: Use of [[maybe_unused]] in .h files compiled in objC Original change's description: > Comment unused variables in implemented functions 10\n > > Bug: webrtc:370878648 > Change-Id: Ic2dda55058ed4474d898fa938c2a66dab2f6f20e > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366204 > Reviewed-by: Harald Alvestrand > Reviewed-by: Danil Chapovalov > Commit-Queue: Dor Hen > Cr-Commit-Position: refs/heads/main@{#43327} Bug: webrtc:370878648, b/376178831 Change-Id: Ibeaecd6ae21b6fc478ce153ad72f8941d7af4a46 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367060 Reviewed-by: Christoffer Dewerin Commit-Queue: Harald Alvestrand Bot-Commit: rubber-stamper@appspot.gserviceaccount.com Cr-Commit-Position: refs/heads/main@{#43331} --- api/peer_connection_interface.h | 17 ++++---- audio/channel_send_unittest.cc | 2 +- call/call_perf_tests.cc | 22 +++++------ .../third_party/SocketRocket/SRWebSocket.m | 11 +++--- .../events/rtc_event_generic_packet_sent.h | 2 +- .../events/rtc_event_probe_cluster_created.h | 8 ++-- .../events/rtc_event_probe_result_failure.h | 8 ++-- .../events/rtc_event_probe_result_success.h | 8 ++-- .../events/rtc_event_remote_estimate.h | 8 ++-- .../events/rtc_event_route_change.h | 8 ++-- .../rtc_event_video_receive_stream_config.h | 8 ++-- .../rtc_event_video_send_stream_config.h | 8 ++-- logging/rtc_event_log/fake_rtc_event_log.cc | 5 +-- media/base/adapted_video_track_source.h | 6 +-- media/base/media_engine.h | 39 +++++++++---------- media/base/rtp_utils.cc | 2 +- 16 files changed, 78 insertions(+), 84 deletions(-) diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h index 0108a69347..69144089f9 100644 --- a/api/peer_connection_interface.h +++ b/api/peer_connection_interface.h @@ -1315,22 +1315,22 @@ class PeerConnectionObserver { // See https://w3c.github.io/webrtc-pc/#event-icecandidateerror virtual void OnIceCandidateError(const std::string& /* address */, int /* port */, - const std::string& /* url */, - int /* error_code */, - const std::string& /* error_text */) {} + const std::string& url, + int error_code, + const std::string& error_text) {} // Ice candidates have been removed. // TODO(honghaiz): Make this a pure virtual method when all its subclasses // implement it. virtual void OnIceCandidatesRemoved( - const std::vector& /* candidates */) {} + const std::vector& candidates) {} // Called when the ICE connection receiving status changes. - virtual void OnIceConnectionReceivingChange(bool /* receiving */) {} + virtual void OnIceConnectionReceivingChange(bool receiving) {} // Called when the selected candidate pair for the ICE connection changes. virtual void OnIceSelectedCandidatePairChanged( - const cricket::CandidatePairChangeEvent& /* event */) {} + const cricket::CandidatePairChangeEvent& event) {} // This is called when a receiver and its track are created. // TODO(zhihuang): Make this pure virtual when all subclasses implement it. @@ -1338,9 +1338,8 @@ class PeerConnectionObserver { // Plan users should prefer OnTrack, OnAddTrack is only called as backwards // compatibility (and is called in the exact same situations as OnTrack). virtual void OnAddTrack( - rtc::scoped_refptr /* receiver */, - const std::vector< - rtc::scoped_refptr>& /* streams */) {} + rtc::scoped_refptr receiver, + const std::vector>& streams) {} // This is called when signaling indicates a transceiver will be receiving // media from the remote endpoint. This is fired during a call to diff --git a/audio/channel_send_unittest.cc b/audio/channel_send_unittest.cc index b415b5fc34..6c123a2ec6 100644 --- a/audio/channel_send_unittest.cc +++ b/audio/channel_send_unittest.cc @@ -235,7 +235,7 @@ TEST_F(ChannelSendTest, AudioLevelsAttachedToCorrectTransformedFrame) { std::vector sent_audio_levels; auto send_rtp = [&](rtc::ArrayView data, - const PacketOptions& /* options */) { + const PacketOptions& options) { RtpPacketReceived packet(&extension_manager); packet.Parse(data); RTPHeader header; diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc index 6ec41fef89..dfda906f2d 100644 --- a/call/call_perf_tests.cc +++ b/call/call_perf_tests.cc @@ -746,7 +746,7 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) { void OnVideoStreamsCreated(VideoSendStream* send_stream, const std::vector& - /* receive_streams */) override { + receive_streams) override { send_stream_ = send_stream; } @@ -839,9 +839,9 @@ void CallPerfTest::TestMinAudioVideoBitrate(int test_bitrate_from, } void OnTransportCreated( - test::PacketTransport* /* to_receiver */, + test::PacketTransport* to_receiver, SimulatedNetworkInterface* sender_network, - test::PacketTransport* /* to_sender */, + test::PacketTransport* to_sender, SimulatedNetworkInterface* receiver_network) override { send_simulated_network_ = sender_network; receive_simulated_network_ = receiver_network; @@ -894,7 +894,7 @@ void CallPerfTest::TestMinAudioVideoBitrate(int test_bitrate_from, Unit::kUnitless, ImprovementDirection::kNeitherIsBetter); } - void OnCallsCreated(Call* sender_call, Call* /* receiver_call */) override { + void OnCallsCreated(Call* sender_call, Call* receiver_call) override { sender_call_ = sender_call; BitrateConstraints bitrate_config; bitrate_config.min_bitrate_bps = min_bwe_; @@ -960,8 +960,8 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory, frame_generator_capturer->ChangeResolution(640, 360); } - void OnSinkWantsChanged(rtc::VideoSinkInterface* /* sink */, - const rtc::VideoSinkWants& /* wants */) override {} + void OnSinkWantsChanged(rtc::VideoSinkInterface* sink, + const rtc::VideoSinkWants& wants) override {} void ModifySenderBitrateConfig( BitrateConstraints* bitrate_config) override { @@ -970,7 +970,7 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory, void OnVideoStreamsCreated(VideoSendStream* send_stream, const std::vector& - /* receive_streams */) override { + receive_streams) override { send_stream_ = send_stream; } @@ -980,7 +980,7 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory, void ModifyVideoConfigs( VideoSendStream::Config* send_config, - std::vector* /* receive_configs */, + std::vector* receive_configs, VideoEncoderConfig* encoder_config) override { send_config->encoder_settings.encoder_factory = encoder_factory_; send_config->rtp.payload_name = payload_name_; @@ -1021,7 +1021,7 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory, } } - Action OnSendRtp(rtc::ArrayView /* packet */) override { + Action OnSendRtp(rtc::ArrayView packet) override { const Timestamp now = clock_->CurrentTime(); if (now - last_getstats_time_ > kMinGetStatsInterval) { last_getstats_time_ = now; @@ -1059,7 +1059,7 @@ TEST_F(CallPerfTest, TestEncodeFramerateVp8Simulcast) { InternalEncoderFactory internal_encoder_factory; test::FunctionVideoEncoderFactory encoder_factory( [&internal_encoder_factory](const Environment& env, - const SdpVideoFormat& /* format */) { + const SdpVideoFormat& format) { return std::make_unique( env, &internal_encoder_factory, nullptr, SdpVideoFormat::VP8()); }); @@ -1072,7 +1072,7 @@ TEST_F(CallPerfTest, TestEncodeFramerateVp8SimulcastLowerInputFps) { InternalEncoderFactory internal_encoder_factory; test::FunctionVideoEncoderFactory encoder_factory( [&internal_encoder_factory](const Environment& env, - const SdpVideoFormat& /* format */) { + const SdpVideoFormat& format) { return std::make_unique( env, &internal_encoder_factory, nullptr, SdpVideoFormat::VP8()); }); diff --git a/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m b/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m index 06959c7291..ab0d1b89bc 100644 --- a/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m +++ b/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m @@ -527,11 +527,9 @@ static __strong NSData *CRLFCRLF; CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Sec-WebSocket-Protocol"), (__bridge CFStringRef)[_requestedProtocols componentsJoinedByString:@", "]); } - [_urlRequest.allHTTPHeaderFields - enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop __unused) { - CFHTTPMessageSetHeaderFieldValue( - request, (__bridge CFStringRef)key, (__bridge CFStringRef)obj); - }]; + [_urlRequest.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + CFHTTPMessageSetHeaderFieldValue(request, (__bridge CFStringRef)key, (__bridge CFStringRef)obj); + }]; NSData *message = CFBridgingRelease(CFHTTPMessageCopySerializedMessage(request)); @@ -1629,7 +1627,7 @@ static const size_t SRFrameHeaderOverhead = 32; //#define SR_ENABLE_LOG -static inline void SRFastLog([[maybe_unused]] NSString *format, ...) { +static inline void SRFastLog(NSString *format, ...) { #ifdef SR_ENABLE_LOG __block va_list arg_list; va_start (arg_list, format); @@ -1642,6 +1640,7 @@ static inline void SRFastLog([[maybe_unused]] NSString *format, ...) { #endif } + #ifdef HAS_ICU static inline int32_t validate_dispatch_data_partial_string(NSData *data) { diff --git a/logging/rtc_event_log/events/rtc_event_generic_packet_sent.h b/logging/rtc_event_log/events/rtc_event_generic_packet_sent.h index 15ad3395c6..031002c2c9 100644 --- a/logging/rtc_event_log/events/rtc_event_generic_packet_sent.h +++ b/logging/rtc_event_log/events/rtc_event_generic_packet_sent.h @@ -94,7 +94,7 @@ class RtcEventGenericPacketSent final : public RtcEvent { static RtcEventLogParseStatus Parse( absl::string_view /* encoded_bytes */, bool /* batched */, - std::vector& /* output */) { + std::vector& output) { // TODO(terelius): Implement return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__); } diff --git a/logging/rtc_event_log/events/rtc_event_probe_cluster_created.h b/logging/rtc_event_log/events/rtc_event_probe_cluster_created.h index fed8b3cfc1..b927f1e52d 100644 --- a/logging/rtc_event_log/events/rtc_event_probe_cluster_created.h +++ b/logging/rtc_event_log/events/rtc_event_probe_cluster_created.h @@ -69,15 +69,15 @@ class RtcEventProbeClusterCreated final : public RtcEvent { uint32_t min_probes() const { return min_probes_; } uint32_t min_bytes() const { return min_bytes_; } - 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_probe_result_failure.h b/logging/rtc_event_log/events/rtc_event_probe_result_failure.h index cd63b735b3..ca57d08481 100644 --- a/logging/rtc_event_log/events/rtc_event_probe_result_failure.h +++ b/logging/rtc_event_log/events/rtc_event_probe_result_failure.h @@ -63,15 +63,15 @@ class RtcEventProbeResultFailure final : public RtcEvent { int32_t id() const { return id_; } ProbeFailureReason failure_reason() const { return failure_reason_; } - 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_probe_result_success.h b/logging/rtc_event_log/events/rtc_event_probe_result_success.h index 44dc218861..60f9023dc5 100644 --- a/logging/rtc_event_log/events/rtc_event_probe_result_success.h +++ b/logging/rtc_event_log/events/rtc_event_probe_result_success.h @@ -56,15 +56,15 @@ class RtcEventProbeResultSuccess final : public RtcEvent { int32_t id() const { return id_; } int32_t bitrate_bps() const { return bitrate_bps_; } - 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_remote_estimate.h b/logging/rtc_event_log/events/rtc_event_remote_estimate.h index 73333c7d47..d01abe726d 100644 --- a/logging/rtc_event_log/events/rtc_event_remote_estimate.h +++ b/logging/rtc_event_log/events/rtc_event_remote_estimate.h @@ -48,15 +48,15 @@ class RtcEventRemoteEstimate final : public RtcEvent { Type GetType() const override { return kType; } bool IsConfigEvent() const override { return false; } - 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_route_change.h b/logging/rtc_event_log/events/rtc_event_route_change.h index 0001aa6f3d..5ff2b29475 100644 --- a/logging/rtc_event_log/events/rtc_event_route_change.h +++ b/logging/rtc_event_log/events/rtc_event_route_change.h @@ -53,15 +53,15 @@ class RtcEventRouteChange final : public RtcEvent { bool connected() const { return connected_; } uint32_t overhead() const { return overhead_; } - 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_video_receive_stream_config.h b/logging/rtc_event_log/events/rtc_event_video_receive_stream_config.h index b05e30b53d..d506fc76f2 100644 --- a/logging/rtc_event_log/events/rtc_event_video_receive_stream_config.h +++ b/logging/rtc_event_log/events/rtc_event_video_receive_stream_config.h @@ -53,15 +53,15 @@ class RtcEventVideoReceiveStreamConfig final : public RtcEvent { const rtclog::StreamConfig& config() const { return *config_; } - 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_video_send_stream_config.h b/logging/rtc_event_log/events/rtc_event_video_send_stream_config.h index baca0ee048..f007055600 100644 --- a/logging/rtc_event_log/events/rtc_event_video_send_stream_config.h +++ b/logging/rtc_event_log/events/rtc_event_video_send_stream_config.h @@ -53,15 +53,15 @@ class RtcEventVideoSendStreamConfig final : public RtcEvent { const rtclog::StreamConfig& config() const { return *config_; } - 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/fake_rtc_event_log.cc b/logging/rtc_event_log/fake_rtc_event_log.cc index ca6b1c4242..836492fa9b 100644 --- a/logging/rtc_event_log/fake_rtc_event_log.cc +++ b/logging/rtc_event_log/fake_rtc_event_log.cc @@ -20,9 +20,8 @@ namespace webrtc { -bool FakeRtcEventLog::StartLogging( - std::unique_ptr /* output */, - int64_t /* output_period_ms */) { +bool FakeRtcEventLog::StartLogging(std::unique_ptr output, + int64_t output_period_ms) { return true; } diff --git a/media/base/adapted_video_track_source.h b/media/base/adapted_video_track_source.h index 6bf90862f3..670331dbe3 100644 --- a/media/base/adapted_video_track_source.h +++ b/media/base/adapted_video_track_source.h @@ -86,11 +86,9 @@ class RTC_EXPORT AdaptedVideoTrackSource bool SupportsEncodedOutput() const override { return false; } void GenerateKeyFrame() override {} void AddEncodedSink( - rtc::VideoSinkInterface* /* sink */) - override {} + rtc::VideoSinkInterface* sink) override {} void RemoveEncodedSink( - rtc::VideoSinkInterface* /* sink */) - override {} + rtc::VideoSinkInterface* sink) override {} void ProcessConstraints( const webrtc::VideoTrackSourceConstraints& constraints) override; diff --git a/media/base/media_engine.h b/media/base/media_engine.h index ea89116cf6..780bac0022 100644 --- a/media/base/media_engine.h +++ b/media/base/media_engine.h @@ -105,22 +105,22 @@ class VoiceEngineInterface : public RtpHeaderExtensionQueryInterface { virtual rtc::scoped_refptr GetAudioState() const = 0; virtual std::unique_ptr CreateSendChannel( - webrtc::Call* /* call */, - const MediaConfig& /* config */, - const AudioOptions& /* options */, - const webrtc::CryptoOptions& /* crypto_options */, - webrtc::AudioCodecPairId /* codec_pair_id */) { + webrtc::Call* call, + const MediaConfig& config, + const AudioOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::AudioCodecPairId codec_pair_id) { // TODO(hta): Make pure virtual when all downstream has updated RTC_CHECK_NOTREACHED(); return nullptr; } virtual std::unique_ptr - CreateReceiveChannel(webrtc::Call* /* call */, - const MediaConfig& /* config */, - const AudioOptions& /* options */, - const webrtc::CryptoOptions& /* crypto_options */, - webrtc::AudioCodecPairId /* codec_pair_id */) { + CreateReceiveChannel(webrtc::Call* call, + const MediaConfig& config, + const AudioOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::AudioCodecPairId codec_pair_id) { // TODO(hta): Make pure virtual when all downstream has updated RTC_CHECK_NOTREACHED(); return nullptr; @@ -155,22 +155,21 @@ class VideoEngineInterface : public RtpHeaderExtensionQueryInterface { VideoEngineInterface& operator=(const VideoEngineInterface&) = delete; virtual std::unique_ptr CreateSendChannel( - webrtc::Call* /* call */, - const MediaConfig& /* config */, - const VideoOptions& /* options */, - const webrtc::CryptoOptions& /* crypto_options */, - webrtc:: - VideoBitrateAllocatorFactory* /* video_bitrate_allocator_factory */) { + webrtc::Call* call, + const MediaConfig& config, + const VideoOptions& options, + const webrtc::CryptoOptions& crypto_options, + webrtc::VideoBitrateAllocatorFactory* video_bitrate_allocator_factory) { // Default implementation, delete when all is updated RTC_CHECK_NOTREACHED(); return nullptr; } virtual std::unique_ptr - CreateReceiveChannel(webrtc::Call* /* call */, - const MediaConfig& /* config */, - const VideoOptions& /* options */, - const webrtc::CryptoOptions& /* crypto_options */) { + CreateReceiveChannel(webrtc::Call* call, + const MediaConfig& config, + const VideoOptions& options, + const webrtc::CryptoOptions& crypto_options) { // Default implementation, delete when all is updated RTC_CHECK_NOTREACHED(); return nullptr; diff --git a/media/base/rtp_utils.cc b/media/base/rtp_utils.cc index bbfead5d03..9546ed6e30 100644 --- a/media/base/rtp_utils.cc +++ b/media/base/rtp_utils.cc @@ -238,7 +238,7 @@ bool ValidateRtpHeader(const uint8_t* rtp, // ValidateRtpHeader() must be called before this method to make sure, we have // a sane rtp packet. bool UpdateRtpAbsSendTimeExtension(uint8_t* rtp, - size_t /* length */, + size_t length, int extension_id, uint64_t time_us) { // 0 1 2 3