Comment unused variables in implemented functions 8\n

Bug: webrtc:370878648
Change-Id: If66e079ff5e455b5c3c483c4c42ef7b38bd34307
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366262
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43316}
This commit is contained in:
Dor Hen 2024-10-27 15:59:51 +02:00 committed by WebRTC LUCI CQ
parent 90c67e7729
commit b52416eccf
29 changed files with 90 additions and 78 deletions

View File

@ -1041,15 +1041,17 @@ class RTC_EXPORT PeerConnectionInterface : public webrtc::RefCountInterface {
// The observer is invoked as soon as the operation completes, which could be
// before or after the SetLocalDescription() method has exited.
virtual void SetLocalDescription(
std::unique_ptr<SessionDescriptionInterface> desc,
rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {}
std::unique_ptr<SessionDescriptionInterface> /* desc */,
rtc::scoped_refptr<SetLocalDescriptionObserverInterface> /* observer */) {
}
// Creates an offer or answer (depending on current signaling state) and sets
// it as the local session description.
//
// The observer is invoked as soon as the operation completes, which could be
// before or after the SetLocalDescription() method has exited.
virtual void SetLocalDescription(
rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {}
rtc::scoped_refptr<SetLocalDescriptionObserverInterface> /* observer */) {
}
// Like SetLocalDescription() above, but the observer is invoked with a delay
// after the operation completes. This helps avoid recursive calls by the
// observer but also makes it possible for states to change in-between the
@ -1059,7 +1061,8 @@ class RTC_EXPORT PeerConnectionInterface : public webrtc::RefCountInterface {
// ones taking SetLocalDescriptionObserverInterface as argument.
virtual void SetLocalDescription(SetSessionDescriptionObserver* observer,
SessionDescriptionInterface* desc) = 0;
virtual void SetLocalDescription(SetSessionDescriptionObserver* observer) {}
virtual void SetLocalDescription(
SetSessionDescriptionObserver* /* observer */) {}
// Sets the remote session description.
//
@ -1078,8 +1081,9 @@ class RTC_EXPORT PeerConnectionInterface : public webrtc::RefCountInterface {
// for synchronizing peer connection states to the application.
// TODO(https://crbug.com/webrtc/11798): Delete this method in favor of the
// ones taking SetRemoteDescriptionObserverInterface as argument.
virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer,
SessionDescriptionInterface* desc) {}
virtual void SetRemoteDescription(
SetSessionDescriptionObserver* /* observer */,
SessionDescriptionInterface* /* desc */) {}
// According to spec, we must only fire "negotiationneeded" if the Operations
// Chain is empty. This method takes care of validating an event previously
@ -1124,8 +1128,9 @@ class RTC_EXPORT PeerConnectionInterface : public webrtc::RefCountInterface {
virtual bool AddIceCandidate(const IceCandidateInterface* candidate) = 0;
// TODO(hbos): Remove default implementation once implemented by downstream
// projects.
virtual void AddIceCandidate(std::unique_ptr<IceCandidateInterface> candidate,
std::function<void(RTCError)> callback) {}
virtual void AddIceCandidate(
std::unique_ptr<IceCandidateInterface> /* candidate */,
std::function<void(RTCError)> /* callback */) {}
// Removes a group of remote candidates from the ICE agent. Needed mainly for
// continual gathering, to avoid an ever-growing list of candidates as

View File

@ -127,45 +127,47 @@ class VideoQualityAnalyzerInterface
// Will be called when frame will be obtained from PeerConnection stack.
// `peer_name` is name of the peer on which side frame was rendered.
virtual void OnFrameRendered(absl::string_view /* peer_name */,
const VideoFrame& frame) {}
const VideoFrame& /* frame */) {}
// Will be called if encoder return not WEBRTC_VIDEO_CODEC_OK.
// All available codes are listed in
// modules/video_coding/include/video_error_codes.h
// `peer_name` is name of the peer on which side error acquired.
virtual void OnEncoderError(absl::string_view peer_name,
const VideoFrame& frame,
int32_t error_code) {}
virtual void OnEncoderError(absl::string_view /* peer_name */,
const VideoFrame& /* frame */,
int32_t /* error_code */) {}
// Will be called if decoder return not WEBRTC_VIDEO_CODEC_OK.
// All available codes are listed in
// modules/video_coding/include/video_error_codes.h
// `peer_name` is name of the peer on which side error acquired.
virtual void OnDecoderError(absl::string_view peer_name,
uint16_t frame_id,
int32_t error_code,
const DecoderStats& stats) {}
virtual void OnDecoderError(absl::string_view /* peer_name */,
uint16_t /* frame_id */,
int32_t /* error_code */,
const DecoderStats& /* stats */) {}
// Will be called every time new stats reports are available for the
// Peer Connection identified by `pc_label`.
void OnStatsReports(
absl::string_view pc_label,
const rtc::scoped_refptr<const RTCStatsReport>& report) override {}
absl::string_view /* pc_label */,
const rtc::scoped_refptr<const RTCStatsReport>& /* report */) override {}
// Will be called before test adds new participant in the middle of a call.
virtual void RegisterParticipantInCall(absl::string_view peer_name) {}
virtual void RegisterParticipantInCall(absl::string_view /* peer_name */) {}
// Will be called after test removed existing participant in the middle of the
// call.
virtual void UnregisterParticipantInCall(absl::string_view peer_name) {}
virtual void UnregisterParticipantInCall(absl::string_view /* peer_name */) {}
// Informs analyzer that peer `receiver_peer_name` should not receive any
// stream from sender `sender_peer_name`.
// This method is a no-op if the sender or the receiver does not exist.
virtual void OnPauseAllStreamsFrom(absl::string_view sender_peer_name,
absl::string_view receiver_peer_name) {}
virtual void OnPauseAllStreamsFrom(
absl::string_view /* sender_peer_name */,
absl::string_view /* receiver_peer_name */) {}
// Informs analyzer that peer `receiver_peer_name` is expected to receive all
// streams from `sender_peer_name`.
// This method is a no-op if the sender or the receiver does not exist.
virtual void OnResumeAllStreamsFrom(absl::string_view sender_peer_name,
absl::string_view receiver_peer_name) {}
virtual void OnResumeAllStreamsFrom(
absl::string_view /* sender_peer_name */,
absl::string_view /* receiver_peer_name */) {}
// Tells analyzer that analysis complete and it should calculate final
// statistics.
@ -179,7 +181,7 @@ class VideoQualityAnalyzerInterface
// Returns the sender peer name of the last stream where this frame was
// captured. The sender for this frame id may change when the frame ids wrap
// around. Also it will crash, if the specified `frame_id` wasn't captured.
virtual std::string GetSenderPeerName(uint16_t frame_id) const {
virtual std::string GetSenderPeerName(uint16_t /* frame_id */) const {
RTC_CHECK(false) << "Not implemented.";
}
};

View File

@ -68,7 +68,7 @@ struct BarEncoderTemplateAdapter {
static std::unique_ptr<VideoEncoder> CreateEncoder(
const Environment& /* env */,
const SdpVideoFormat& format) {
const SdpVideoFormat& /* format */) {
return std::make_unique<StrictMock<MockVideoEncoder>>();
}

View File

@ -83,8 +83,9 @@ VideoEncoder::EncoderInfo GetEncoderInfoWithHardwareAccelerated(
class FakeEncodedImageCallback : public EncodedImageCallback {
public:
Result OnEncodedImage(const EncodedImage& encoded_image,
const CodecSpecificInfo* codec_specific_info) override {
Result OnEncodedImage(
const EncodedImage& /* encoded_image */,
const CodecSpecificInfo* /* codec_specific_info */) override {
++callback_count_;
return Result(Result::OK, callback_count_);
}
@ -109,18 +110,19 @@ class VideoEncoderSoftwareFallbackWrapperTestBase : public ::testing::Test {
class CountingFakeEncoder : public VideoEncoder {
public:
void SetFecControllerOverride(
FecControllerOverride* fec_controller_override) override {
FecControllerOverride* /* fec_controller_override */) override {
// Ignored.
}
int32_t InitEncode(const VideoCodec* codec_settings,
const VideoEncoder::Settings& settings) override {
int32_t InitEncode(const VideoCodec* /* codec_settings */,
const VideoEncoder::Settings& /* settings */) override {
++init_encode_count_;
return init_encode_return_code_;
}
int32_t Encode(const VideoFrame& frame,
const std::vector<VideoFrameType>* frame_types) override {
int32_t Encode(
const VideoFrame& frame,
const std::vector<VideoFrameType>* /* frame_types */) override {
++encode_count_;
last_video_frame_ = frame;
if (encode_complete_callback_ &&
@ -141,7 +143,7 @@ class VideoEncoderSoftwareFallbackWrapperTestBase : public ::testing::Test {
return WEBRTC_VIDEO_CODEC_OK;
}
void SetRates(const RateControlParameters& parameters) override {}
void SetRates(const RateControlParameters& /* parameters */) override {}
EncoderInfo GetEncoderInfo() const override {
++supports_native_handle_count_;
@ -986,7 +988,7 @@ TEST_F(PreferTemporalLayersFallbackTest, PrimesEncoderOnSwitch) {
FakeEncodedImageCallback callback1;
class DummyFecControllerOverride : public FecControllerOverride {
public:
void SetFecAllowed(bool fec_allowed) override {}
void SetFecAllowed(bool /* fec_allowed */) override {}
};
DummyFecControllerOverride fec_controller_override1;
VideoEncoder::RateControlParameters rate_params1;

View File

@ -25,7 +25,7 @@ struct Dav1dDecoderTemplateAdapter {
}
static std::unique_ptr<VideoDecoder> CreateDecoder(
const SdpVideoFormat& format) {
const SdpVideoFormat& /* format */) {
return CreateDav1dDecoder();
}
};

View File

@ -27,7 +27,7 @@ struct LibvpxVp8DecoderTemplateAdapter {
static std::unique_ptr<VideoDecoder> CreateDecoder(
const Environment& env,
const SdpVideoFormat& format) {
const SdpVideoFormat& /* format */) {
return CreateVp8Decoder(env);
}
};

View File

@ -25,7 +25,7 @@ struct LibvpxVp9DecoderTemplateAdapter {
}
static std::unique_ptr<VideoDecoder> CreateDecoder(
const SdpVideoFormat& format) {
const SdpVideoFormat& /* format */) {
return VP9Decoder::Create();
}
};

View File

@ -32,7 +32,7 @@ struct OpenH264DecoderTemplateAdapter {
}
static std::unique_ptr<VideoDecoder> CreateDecoder(
const SdpVideoFormat& format) {
const SdpVideoFormat& /* format */) {
#if defined(WEBRTC_USE_H264)
return H264Decoder::Create();

View File

@ -32,7 +32,7 @@ struct LibaomAv1EncoderTemplateAdapter {
static std::unique_ptr<VideoEncoder> CreateEncoder(
const Environment& env,
const SdpVideoFormat& format) {
const SdpVideoFormat& /* format */) {
return CreateLibaomAv1Encoder(env);
}

View File

@ -36,7 +36,7 @@ struct LibvpxVp8EncoderTemplateAdapter {
static std::unique_ptr<VideoEncoder> CreateEncoder(
const Environment& env,
const SdpVideoFormat& format) {
const SdpVideoFormat& /* format */) {
return CreateVp8Encoder(env);
}

View File

@ -33,8 +33,8 @@ struct OpenH264EncoderTemplateAdapter {
}
static std::unique_ptr<VideoEncoder> CreateEncoder(
const Environment& env,
const SdpVideoFormat& format) {
[[maybe_unused]] const Environment& env,
[[maybe_unused]] const SdpVideoFormat& format) {
#if defined(WEBRTC_USE_H264)
return CreateH264Encoder(env, H264EncoderSettings::Parse(format));
#else
@ -42,7 +42,8 @@ struct OpenH264EncoderTemplateAdapter {
#endif
}
static bool IsScalabilityModeSupported(ScalabilityMode scalability_mode) {
static bool IsScalabilityModeSupported(
[[maybe_unused]] ScalabilityMode scalability_mode) {
#if defined(WEBRTC_USE_H264)
return H264Encoder::SupportsScalabilityMode(scalability_mode);
#else

View File

@ -29,7 +29,7 @@ namespace webrtc {
std::unique_ptr<Vp8FrameBufferController> Vp8TemporalLayersFactory::Create(
const VideoCodec& codec,
const VideoEncoder::Settings& settings,
const VideoEncoder::Settings& /* settings */,
FecControllerOverride* fec_controller_override) {
std::vector<std::unique_ptr<Vp8FrameBufferController>> controllers;
const int num_streams = SimulcastUtility::NumberOfSimulcastStreams(codec);

View File

@ -95,7 +95,7 @@ AudioReceiveStreamImpl::AudioReceiveStreamImpl(
}
AudioReceiveStreamImpl::AudioReceiveStreamImpl(
const Environment& env,
const Environment& /* env */,
PacketRouter* packet_router,
const webrtc::AudioReceiveStreamInterface::Config& config,
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,

View File

@ -64,7 +64,7 @@ TEST_F(AudioSendStreamCallTest, SupportsCName) {
void ModifyAudioConfigs(AudioSendStream::Config* send_config,
std::vector<AudioReceiveStreamInterface::Config>*
receive_configs) override {
/* receive_configs */) override {
send_config->rtp.c_name = kCName;
}
@ -93,7 +93,7 @@ TEST_F(AudioSendStreamCallTest, NoExtensionsByDefault) {
void ModifyAudioConfigs(AudioSendStream::Config* send_config,
std::vector<AudioReceiveStreamInterface::Config>*
receive_configs) override {
/* receive_configs */) override {
send_config->rtp.extensions.clear();
}
@ -131,7 +131,7 @@ TEST_F(AudioSendStreamCallTest, SupportsAudioLevel) {
void ModifyAudioConfigs(AudioSendStream::Config* send_config,
std::vector<AudioReceiveStreamInterface::Config>*
receive_configs) override {
/* receive_configs */) override {
send_config->rtp.extensions.clear();
send_config->rtp.extensions.push_back(
RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelExtensionId));
@ -173,7 +173,7 @@ class TransportWideSequenceNumberObserver : public AudioSendTest {
void ModifyAudioConfigs(AudioSendStream::Config* send_config,
std::vector<AudioReceiveStreamInterface::Config>*
receive_configs) override {
/* receive_configs */) override {
send_config->rtp.extensions.clear();
send_config->rtp.extensions.push_back(
RtpExtension(RtpExtension::kTransportSequenceNumberUri,
@ -225,7 +225,7 @@ TEST_F(AudioSendStreamCallTest, SendDtmf) {
void OnAudioStreamsCreated(AudioSendStream* send_stream,
const std::vector<AudioReceiveStreamInterface*>&
receive_streams) override {
/* receive_streams */) override {
// Need to start stream here, else DTMF events are dropped.
send_stream->Start();
for (int event = kDtmfEventFirst; event <= kDtmfEventLast; ++event) {

View File

@ -235,7 +235,8 @@ struct ConfigHelper {
void SetupMockForSetupSendCodec(bool expect_set_encoder_call) {
if (expect_set_encoder_call) {
EXPECT_CALL(*channel_send_, SetEncoder)
.WillOnce([this](int payload_type, const SdpAudioFormat& format,
.WillOnce([this](int /* payload_type */,
const SdpAudioFormat& /* format */,
std::unique_ptr<AudioEncoder> encoder) {
this->audio_encoder_ = std::move(encoder);
return true;
@ -581,8 +582,8 @@ TEST(AudioSendStreamTest, SendCodecCanApplyVad) {
helper.config().send_codec_spec->cng_payload_type = 105;
std::unique_ptr<AudioEncoder> stolen_encoder;
EXPECT_CALL(*helper.channel_send(), SetEncoder)
.WillOnce([&stolen_encoder](int payload_type,
const SdpAudioFormat& format,
.WillOnce([&stolen_encoder](int /* payload_type */,
const SdpAudioFormat& /* format */,
std::unique_ptr<AudioEncoder> encoder) {
stolen_encoder = std::move(encoder);
return true;

View File

@ -52,8 +52,8 @@ struct FakeAsyncAudioProcessingHelper {
FakeTaskQueueFactory() = default;
~FakeTaskQueueFactory() override = default;
std::unique_ptr<TaskQueueBase, TaskQueueDeleter> CreateTaskQueue(
absl::string_view name,
Priority priority) const override {
absl::string_view /* name */,
Priority /* priority */) const override {
return std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter>(
new FakeTaskQueue());
}

View File

@ -128,7 +128,7 @@ class ChannelReceiveTest : public Test {
return packet;
}
void HandleGeneratedRtcp(ChannelReceiveInterface& channel,
void HandleGeneratedRtcp(ChannelReceiveInterface& /* channel */,
rtc::ArrayView<const uint8_t> packet) {
if (packet[1] == rtcp::ReceiverReport::kPacketType) {
// Ignore RR, it requires no response

View File

@ -188,10 +188,11 @@ TEST(ChannelSendFrameTransformerDelegateTest,
SendFrame(_, 0, 0, ElementsAreArray(mock_data), _,
ElementsAreArray(csrcs), Optional(audio_level_dbov)));
ON_CALL(*mock_frame_transformer, Transform)
.WillByDefault([&](std::unique_ptr<TransformableFrameInterface> frame) {
callback->OnTransformedFrame(CreateMockReceiverFrame(
csrcs, std::optional<uint8_t>(audio_level_dbov)));
});
.WillByDefault(
[&](std::unique_ptr<TransformableFrameInterface> /* frame */) {
callback->OnTransformedFrame(CreateMockReceiverFrame(
csrcs, std::optional<uint8_t>(audio_level_dbov)));
});
delegate->Transform(AudioFrameType::kEmptyFrame, 0, 0, mock_data,
sizeof(mock_data), 0,
/*ssrc=*/0, /*mimeType=*/"audio/opus",

View File

@ -153,7 +153,7 @@ TEST_F(ChannelSendTest, IncreaseRtpTimestampByPauseDuration) {
uint32_t timestamp;
int sent_packets = 0;
auto send_rtp = [&](rtc::ArrayView<const uint8_t> data,
const PacketOptions& options) {
const PacketOptions& /* options */) {
++sent_packets;
RtpPacketReceived packet;
packet.Parse(data);

View File

@ -55,13 +55,13 @@ AudioEndToEndTest::CreateRenderer() {
void AudioEndToEndTest::OnFakeAudioDevicesCreated(
AudioDeviceModule* send_audio_device,
AudioDeviceModule* recv_audio_device) {
AudioDeviceModule* /* recv_audio_device */) {
send_audio_device_ = send_audio_device;
}
void AudioEndToEndTest::ModifyAudioConfigs(
AudioSendStream::Config* send_config,
std::vector<AudioReceiveStreamInterface::Config>* receive_configs) {
std::vector<AudioReceiveStreamInterface::Config>* /* receive_configs */) {
// Large bitrate by default.
const webrtc::SdpAudioFormat kDefaultFormat("opus", 48000, 2,
{{"stereo", "1"}});

View File

@ -39,8 +39,8 @@ class MockTaskQueueFactory : public TaskQueueFactory {
: task_queue_(task_queue) {}
std::unique_ptr<TaskQueueBase, TaskQueueDeleter> CreateTaskQueue(
absl::string_view name,
Priority priority) const override {
absl::string_view /* name */,
Priority /* priority */) const override {
// Default MockTaskQueue::Delete is no-op, therefore it's safe to pass the
// raw pointer.
return std::unique_ptr<TaskQueueBase, TaskQueueDeleter>(task_queue_);

View File

@ -357,7 +357,7 @@ void ResourceAdaptationProcessor::UpdateResourceLimitations(
}
void ResourceAdaptationProcessor::OnVideoSourceRestrictionsUpdated(
VideoSourceRestrictions restrictions,
VideoSourceRestrictions /* restrictions */,
const VideoAdaptationCounters& adaptation_counters,
rtc::scoped_refptr<Resource> reason,
const VideoSourceRestrictions& unfiltered_restrictions) {

View File

@ -65,7 +65,7 @@ class VideoSourceRestrictionsListenerForTesting
VideoSourceRestrictions restrictions,
const VideoAdaptationCounters& adaptation_counters,
rtc::scoped_refptr<Resource> reason,
const VideoSourceRestrictions& unfiltered_restrictions) override {
const VideoSourceRestrictions& /* unfiltered_restrictions */) override {
RTC_DCHECK_RUN_ON(&sequence_checker_);
++restrictions_updated_count_;
restrictions_ = restrictions;

View File

@ -36,7 +36,7 @@ TEST_F(ResourceTest, RegisteringListenerReceivesCallbacks) {
fake_resource_->SetResourceListener(&resource_listener);
EXPECT_CALL(resource_listener, OnResourceUsageStateMeasured(_, _))
.Times(1)
.WillOnce([](rtc::scoped_refptr<Resource> resource,
.WillOnce([](rtc::scoped_refptr<Resource> /* resource */,
ResourceUsageState usage_state) {
EXPECT_EQ(ResourceUsageState::kOveruse, usage_state);
});

View File

@ -31,9 +31,9 @@ std::string FakeAdaptationConstraint::Name() const {
}
bool FakeAdaptationConstraint::IsAdaptationUpAllowed(
const VideoStreamInputState& input_state,
const VideoSourceRestrictions& restrictions_before,
const VideoSourceRestrictions& restrictions_after) const {
const VideoStreamInputState& /* input_state */,
const VideoSourceRestrictions& /* restrictions_before */,
const VideoSourceRestrictions& /* restrictions_after */) const {
return is_adaptation_up_allowed_;
}

View File

@ -686,7 +686,7 @@ Adaptation VideoStreamAdapter::GetAdaptationTo(
}
void VideoStreamAdapter::BroadcastVideoRestrictionsUpdate(
const VideoStreamInputState& input_state,
const VideoStreamInputState& /* input_state */,
const rtc::scoped_refptr<Resource>& resource) {
RTC_DCHECK_RUN_ON(&sequence_checker_);
VideoSourceRestrictions filtered = FilterRestrictionsByDegradationPreference(

View File

@ -114,9 +114,9 @@ class FakeVideoStream {
class FakeVideoStreamAdapterListner : public VideoSourceRestrictionsListener {
public:
void OnVideoSourceRestrictionsUpdated(
VideoSourceRestrictions restrictions,
const VideoAdaptationCounters& adaptation_counters,
rtc::scoped_refptr<Resource> reason,
VideoSourceRestrictions /* restrictions */,
const VideoAdaptationCounters& /* adaptation_counters */,
rtc::scoped_refptr<Resource> /* reason */,
const VideoSourceRestrictions& unfiltered_restrictions) override {
calls_++;
last_restrictions_ = unfiltered_restrictions;

View File

@ -305,7 +305,7 @@ std::map<BitrateAllocatorObserver*, int> NormalRateAllocation(
std::map<BitrateAllocatorObserver*, int> MaxRateAllocation(
const std::vector<AllocatableTrack>& allocatable_tracks,
uint32_t bitrate,
uint32_t sum_max_bitrates) {
uint32_t /* sum_max_bitrates */) {
std::map<BitrateAllocatorObserver*, int> allocation;
for (const auto& observer_config : allocatable_tracks) {

View File

@ -332,7 +332,7 @@ class BitrateAllocatorTestNoEnforceMin : public ::testing::Test {
uint32_t max_bitrate_bps,
uint32_t pad_up_bitrate_bps,
bool enforce_min_bitrate,
absl::string_view track_id,
absl::string_view /* track_id */,
double bitrate_priority) {
allocator_->AddObserver(
observer, {min_bitrate_bps, max_bitrate_bps, pad_up_bitrate_bps, 0,