Comment unused variables in implemented functions 9\n
Bug: webrtc:370878648 Change-Id: I2cdc8456c9fe1131fa09f02cdb4ba4ab13beccc2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366740 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Dor Hen <dorhen@meta.com> Cr-Commit-Position: refs/heads/main@{#43326}
This commit is contained in:
parent
0f39556075
commit
bec7015797
@ -1260,11 +1260,12 @@ class PeerConnectionObserver {
|
|||||||
PeerConnectionInterface::SignalingState new_state) = 0;
|
PeerConnectionInterface::SignalingState new_state) = 0;
|
||||||
|
|
||||||
// Triggered when media is received on a new stream from remote peer.
|
// Triggered when media is received on a new stream from remote peer.
|
||||||
virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) {}
|
virtual void OnAddStream(
|
||||||
|
rtc::scoped_refptr<MediaStreamInterface> /* stream */) {}
|
||||||
|
|
||||||
// Triggered when a remote peer closes a stream.
|
// Triggered when a remote peer closes a stream.
|
||||||
virtual void OnRemoveStream(rtc::scoped_refptr<MediaStreamInterface> stream) {
|
virtual void OnRemoveStream(
|
||||||
}
|
rtc::scoped_refptr<MediaStreamInterface> /* stream */) {}
|
||||||
|
|
||||||
// Triggered when a remote peer opens a data channel.
|
// Triggered when a remote peer opens a data channel.
|
||||||
virtual void OnDataChannel(
|
virtual void OnDataChannel(
|
||||||
@ -1282,7 +1283,7 @@ class PeerConnectionObserver {
|
|||||||
// PeerConnection::ShouldFireNegotiationNeededEvent() returns true since it is
|
// PeerConnection::ShouldFireNegotiationNeededEvent() returns true since it is
|
||||||
// possible for the event to become invalidated by operations subsequently
|
// possible for the event to become invalidated by operations subsequently
|
||||||
// chained.
|
// chained.
|
||||||
virtual void OnNegotiationNeededEvent(uint32_t event_id) {}
|
virtual void OnNegotiationNeededEvent(uint32_t /* event_id */) {}
|
||||||
|
|
||||||
// Called any time the legacy IceConnectionState changes.
|
// Called any time the legacy IceConnectionState changes.
|
||||||
//
|
//
|
||||||
@ -1293,15 +1294,15 @@ class PeerConnectionObserver {
|
|||||||
//
|
//
|
||||||
// TODO(jonasolsson): deprecate and remove this.
|
// TODO(jonasolsson): deprecate and remove this.
|
||||||
virtual void OnIceConnectionChange(
|
virtual void OnIceConnectionChange(
|
||||||
PeerConnectionInterface::IceConnectionState new_state) {}
|
PeerConnectionInterface::IceConnectionState /* new_state */) {}
|
||||||
|
|
||||||
// Called any time the standards-compliant IceConnectionState changes.
|
// Called any time the standards-compliant IceConnectionState changes.
|
||||||
virtual void OnStandardizedIceConnectionChange(
|
virtual void OnStandardizedIceConnectionChange(
|
||||||
PeerConnectionInterface::IceConnectionState new_state) {}
|
PeerConnectionInterface::IceConnectionState /* new_state */) {}
|
||||||
|
|
||||||
// Called any time the PeerConnectionState changes.
|
// Called any time the PeerConnectionState changes.
|
||||||
virtual void OnConnectionChange(
|
virtual void OnConnectionChange(
|
||||||
PeerConnectionInterface::PeerConnectionState new_state) {}
|
PeerConnectionInterface::PeerConnectionState /* new_state */) {}
|
||||||
|
|
||||||
// Called any time the IceGatheringState changes.
|
// Called any time the IceGatheringState changes.
|
||||||
virtual void OnIceGatheringChange(
|
virtual void OnIceGatheringChange(
|
||||||
@ -1312,8 +1313,8 @@ class PeerConnectionObserver {
|
|||||||
|
|
||||||
// Gathering of an ICE candidate failed.
|
// Gathering of an ICE candidate failed.
|
||||||
// See https://w3c.github.io/webrtc-pc/#event-icecandidateerror
|
// See https://w3c.github.io/webrtc-pc/#event-icecandidateerror
|
||||||
virtual void OnIceCandidateError(const std::string& address,
|
virtual void OnIceCandidateError(const std::string& /* address */,
|
||||||
int port,
|
int /* port */,
|
||||||
const std::string& url,
|
const std::string& url,
|
||||||
int error_code,
|
int error_code,
|
||||||
const std::string& error_text) {}
|
const std::string& error_text) {}
|
||||||
|
|||||||
@ -188,7 +188,7 @@ TEST_F(ChannelSendTest, FrameTransformerGetsCorrectTimestamp) {
|
|||||||
|
|
||||||
std::optional<uint32_t> sent_timestamp;
|
std::optional<uint32_t> sent_timestamp;
|
||||||
auto send_rtp = [&](rtc::ArrayView<const uint8_t> data,
|
auto send_rtp = [&](rtc::ArrayView<const uint8_t> data,
|
||||||
const PacketOptions& options) {
|
const PacketOptions& /* options */) {
|
||||||
RtpPacketReceived packet;
|
RtpPacketReceived packet;
|
||||||
packet.Parse(data);
|
packet.Parse(data);
|
||||||
if (!sent_timestamp) {
|
if (!sent_timestamp) {
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class Call {
|
|||||||
RTC_CHECK_NOTREACHED();
|
RTC_CHECK_NOTREACHED();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
virtual void SetPayloadTypeSuggester(PayloadTypeSuggester* suggester) {
|
virtual void SetPayloadTypeSuggester(PayloadTypeSuggester* /* suggester */) {
|
||||||
// TODO: https://issues.webrtc.org/360058654 - make pure virtual
|
// TODO: https://issues.webrtc.org/360058654 - make pure virtual
|
||||||
RTC_CHECK_NOTREACHED();
|
RTC_CHECK_NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,7 +150,7 @@ class VideoRtcpAndSyncObserver : public test::RtpRtcpObserver,
|
|||||||
creation_time_ms_(clock_->TimeInMilliseconds()),
|
creation_time_ms_(clock_->TimeInMilliseconds()),
|
||||||
task_queue_(task_queue) {}
|
task_queue_(task_queue) {}
|
||||||
|
|
||||||
void OnFrame(const VideoFrame& video_frame) override {
|
void OnFrame(const VideoFrame& /* video_frame */) override {
|
||||||
task_queue_->PostTask([this]() { CheckStats(); });
|
task_queue_->PostTask([this]() { CheckStats(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) {
|
|||||||
// OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink
|
// OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink
|
||||||
// is called.
|
// is called.
|
||||||
// TODO(sprang): Add integration test for maintain-framerate mode?
|
// TODO(sprang): Add integration test for maintain-framerate mode?
|
||||||
void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink,
|
void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* /* sink */,
|
||||||
const rtc::VideoSinkWants& wants) override {
|
const rtc::VideoSinkWants& wants) override {
|
||||||
RTC_LOG(LS_INFO) << "OnSinkWantsChanged fps:" << wants.max_framerate_fps
|
RTC_LOG(LS_INFO) << "OnSinkWantsChanged fps:" << wants.max_framerate_fps
|
||||||
<< " max_pixel_count " << wants.max_pixel_count
|
<< " max_pixel_count " << wants.max_pixel_count
|
||||||
@ -518,9 +518,9 @@ TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ModifyVideoConfigs(
|
void ModifyVideoConfigs(
|
||||||
VideoSendStream::Config* send_config,
|
VideoSendStream::Config* /* send_config */,
|
||||||
std::vector<VideoReceiveStreamInterface::Config>* receive_configs,
|
std::vector<VideoReceiveStreamInterface::Config>* /* receive_configs */,
|
||||||
VideoEncoderConfig* encoder_config) override {}
|
VideoEncoderConfig* /* encoder_config */) override {}
|
||||||
|
|
||||||
void PerformTest() override {
|
void PerformTest() override {
|
||||||
EXPECT_TRUE(Wait()) << "Timed out before receiving an overuse callback.";
|
EXPECT_TRUE(Wait()) << "Timed out before receiving an overuse callback.";
|
||||||
@ -569,7 +569,7 @@ void CallPerfTest::TestMinTransmitBitrate(bool pad_to_min_bitrate) {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// TODO(holmer): Run this with a timer instead of once per packet.
|
// TODO(holmer): Run this with a timer instead of once per packet.
|
||||||
Action OnSendRtp(rtc::ArrayView<const uint8_t> packet) override {
|
Action OnSendRtp(rtc::ArrayView<const uint8_t> /* packet */) override {
|
||||||
task_queue_->PostTask(SafeTask(task_safety_flag_, [this]() {
|
task_queue_->PostTask(SafeTask(task_safety_flag_, [this]() {
|
||||||
VideoSendStream::Stats stats = send_stream_->GetStats();
|
VideoSendStream::Stats stats = send_stream_->GetStats();
|
||||||
|
|
||||||
@ -594,15 +594,15 @@ void CallPerfTest::TestMinTransmitBitrate(bool pad_to_min_bitrate) {
|
|||||||
|
|
||||||
void OnVideoStreamsCreated(VideoSendStream* send_stream,
|
void OnVideoStreamsCreated(VideoSendStream* send_stream,
|
||||||
const std::vector<VideoReceiveStreamInterface*>&
|
const std::vector<VideoReceiveStreamInterface*>&
|
||||||
receive_streams) override {
|
/* receive_streams */) override {
|
||||||
send_stream_ = send_stream;
|
send_stream_ = send_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnStreamsStopped() override { task_safety_flag_->SetNotAlive(); }
|
void OnStreamsStopped() override { task_safety_flag_->SetNotAlive(); }
|
||||||
|
|
||||||
void ModifyVideoConfigs(
|
void ModifyVideoConfigs(
|
||||||
VideoSendStream::Config* send_config,
|
VideoSendStream::Config* /* send_config */,
|
||||||
std::vector<VideoReceiveStreamInterface::Config>* receive_configs,
|
std::vector<VideoReceiveStreamInterface::Config>* /* receive_configs */,
|
||||||
VideoEncoderConfig* encoder_config) override {
|
VideoEncoderConfig* encoder_config) override {
|
||||||
if (pad_to_min_bitrate_) {
|
if (pad_to_min_bitrate_) {
|
||||||
encoder_config->min_transmit_bitrate_bps = kMinTransmitBitrateBps;
|
encoder_config->min_transmit_bitrate_bps = kMinTransmitBitrateBps;
|
||||||
@ -732,7 +732,7 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
|
|||||||
|
|
||||||
void ModifyVideoConfigs(
|
void ModifyVideoConfigs(
|
||||||
VideoSendStream::Config* send_config,
|
VideoSendStream::Config* send_config,
|
||||||
std::vector<VideoReceiveStreamInterface::Config>* receive_configs,
|
std::vector<VideoReceiveStreamInterface::Config>* /* receive_configs */,
|
||||||
VideoEncoderConfig* encoder_config) override {
|
VideoEncoderConfig* encoder_config) override {
|
||||||
send_config->encoder_settings.encoder_factory = &encoder_factory_;
|
send_config->encoder_settings.encoder_factory = &encoder_factory_;
|
||||||
send_config->encoder_settings.bitrate_allocator_factory =
|
send_config->encoder_settings.bitrate_allocator_factory =
|
||||||
|
|||||||
@ -401,7 +401,7 @@ TEST(CallTest, AddAdaptationResourceAfterCreatingVideoSendStream) {
|
|||||||
CallHelper call(true);
|
CallHelper call(true);
|
||||||
// Create a VideoSendStream.
|
// Create a VideoSendStream.
|
||||||
FunctionVideoEncoderFactory fake_encoder_factory(
|
FunctionVideoEncoderFactory fake_encoder_factory(
|
||||||
[](const Environment& env, const SdpVideoFormat& format) {
|
[](const Environment& env, const SdpVideoFormat& /* format */) {
|
||||||
return std::make_unique<FakeEncoder>(env);
|
return std::make_unique<FakeEncoder>(env);
|
||||||
});
|
});
|
||||||
auto bitrate_allocator_factory = CreateBuiltinVideoBitrateAllocatorFactory();
|
auto bitrate_allocator_factory = CreateBuiltinVideoBitrateAllocatorFactory();
|
||||||
@ -467,7 +467,7 @@ TEST(CallTest, AddAdaptationResourceBeforeCreatingVideoSendStream) {
|
|||||||
call->AddAdaptationResource(fake_resource);
|
call->AddAdaptationResource(fake_resource);
|
||||||
// Create a VideoSendStream.
|
// Create a VideoSendStream.
|
||||||
FunctionVideoEncoderFactory fake_encoder_factory(
|
FunctionVideoEncoderFactory fake_encoder_factory(
|
||||||
[](const Environment& env, const SdpVideoFormat& format) {
|
[](const Environment& env, const SdpVideoFormat& /* format */) {
|
||||||
return std::make_unique<FakeEncoder>(env);
|
return std::make_unique<FakeEncoder>(env);
|
||||||
});
|
});
|
||||||
auto bitrate_allocator_factory = CreateBuiltinVideoBitrateAllocatorFactory();
|
auto bitrate_allocator_factory = CreateBuiltinVideoBitrateAllocatorFactory();
|
||||||
|
|||||||
@ -110,7 +110,7 @@ FakeNetworkPipe::FakeNetworkPipe(
|
|||||||
Clock* clock,
|
Clock* clock,
|
||||||
std::unique_ptr<NetworkBehaviorInterface> network_behavior,
|
std::unique_ptr<NetworkBehaviorInterface> network_behavior,
|
||||||
PacketReceiver* receiver,
|
PacketReceiver* receiver,
|
||||||
uint64_t seed)
|
uint64_t /* seed */)
|
||||||
: clock_(clock),
|
: clock_(clock),
|
||||||
network_behavior_(std::move(network_behavior)),
|
network_behavior_(std::move(network_behavior)),
|
||||||
receiver_(receiver),
|
receiver_(receiver),
|
||||||
@ -161,7 +161,7 @@ bool FakeNetworkPipe::SendRtcp(rtc::ArrayView<const uint8_t> packet,
|
|||||||
void FakeNetworkPipe::DeliverRtpPacket(
|
void FakeNetworkPipe::DeliverRtpPacket(
|
||||||
MediaType media_type,
|
MediaType media_type,
|
||||||
RtpPacketReceived packet,
|
RtpPacketReceived packet,
|
||||||
OnUndemuxablePacketHandler undemuxable_packet_handler) {
|
OnUndemuxablePacketHandler /* undemuxable_packet_handler */) {
|
||||||
MutexLock lock(&process_lock_);
|
MutexLock lock(&process_lock_);
|
||||||
int64_t time_now_us = clock_->TimeInMicroseconds();
|
int64_t time_now_us = clock_->TimeInMicroseconds();
|
||||||
EnqueuePacket(
|
EnqueuePacket(
|
||||||
|
|||||||
@ -54,9 +54,9 @@ class MockReceiver : public PacketReceiver {
|
|||||||
class ReorderTestReceiver : public MockReceiver {
|
class ReorderTestReceiver : public MockReceiver {
|
||||||
public:
|
public:
|
||||||
void DeliverRtpPacket(
|
void DeliverRtpPacket(
|
||||||
MediaType media_type,
|
MediaType /* media_type */,
|
||||||
RtpPacketReceived packet,
|
RtpPacketReceived packet,
|
||||||
OnUndemuxablePacketHandler undemuxable_packet_handler) override {
|
OnUndemuxablePacketHandler /* undemuxable_packet_handler */) override {
|
||||||
RTC_DCHECK_GE(packet.size(), sizeof(int));
|
RTC_DCHECK_GE(packet.size(), sizeof(int));
|
||||||
delivered_sequence_numbers_.push_back(packet.SequenceNumber());
|
delivered_sequence_numbers_.push_back(packet.SequenceNumber());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -129,7 +129,7 @@ void RampUpTester::ModifySenderBitrateConfig(
|
|||||||
|
|
||||||
void RampUpTester::OnVideoStreamsCreated(
|
void RampUpTester::OnVideoStreamsCreated(
|
||||||
VideoSendStream* send_stream,
|
VideoSendStream* send_stream,
|
||||||
const std::vector<VideoReceiveStreamInterface*>& receive_streams) {
|
const std::vector<VideoReceiveStreamInterface*>& /* receive_streams */) {
|
||||||
send_stream_ = send_stream;
|
send_stream_ = send_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +284,8 @@ void RampUpTester::ModifyFlexfecConfigs(
|
|||||||
(*receive_configs)[0].rtp.local_ssrc = video_ssrcs_[0];
|
(*receive_configs)[0].rtp.local_ssrc = video_ssrcs_[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
|
void RampUpTester::OnCallsCreated(Call* sender_call,
|
||||||
|
Call* /* receiver_call */) {
|
||||||
RTC_DCHECK(sender_call);
|
RTC_DCHECK(sender_call);
|
||||||
sender_call_ = sender_call;
|
sender_call_ = sender_call;
|
||||||
pending_task_ = RepeatingTaskHandle::Start(task_queue_, [this] {
|
pending_task_ = RepeatingTaskHandle::Start(task_queue_, [this] {
|
||||||
@ -296,8 +297,8 @@ void RampUpTester::OnCallsCreated(Call* sender_call, Call* receiver_call) {
|
|||||||
void RampUpTester::OnTransportCreated(
|
void RampUpTester::OnTransportCreated(
|
||||||
test::PacketTransport* to_receiver,
|
test::PacketTransport* to_receiver,
|
||||||
SimulatedNetworkInterface* sender_network,
|
SimulatedNetworkInterface* sender_network,
|
||||||
test::PacketTransport* to_sender,
|
test::PacketTransport* /* to_sender */,
|
||||||
SimulatedNetworkInterface* receiver_network) {
|
SimulatedNetworkInterface* /* receiver_network */) {
|
||||||
RTC_DCHECK_RUN_ON(task_queue_);
|
RTC_DCHECK_RUN_ON(task_queue_);
|
||||||
|
|
||||||
send_transport_ = to_receiver;
|
send_transport_ = to_receiver;
|
||||||
|
|||||||
@ -93,7 +93,7 @@ class EmulatedMonotoneousClock : public EmulatedClock {
|
|||||||
|
|
||||||
bool Stalled() const { return stall_recovery_time_us_ > 0; }
|
bool Stalled() const { return stall_recovery_time_us_ > 0; }
|
||||||
|
|
||||||
int64_t GetRemainingStall(int64_t time_us) const {
|
int64_t GetRemainingStall(int64_t /* time_us */) const {
|
||||||
return stall_recovery_time_us_ > 0 ? stall_recovery_time_us_ - GetClockUs()
|
return stall_recovery_time_us_ > 0 ? stall_recovery_time_us_ - GetClockUs()
|
||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -568,7 +568,7 @@ void RtpPayloadParams::Vp8ToGeneric(const CodecSpecificInfoVP8& vp8_info,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtpPayloadParams::Vp9ToGeneric(const CodecSpecificInfoVP9& vp9_info,
|
void RtpPayloadParams::Vp9ToGeneric(const CodecSpecificInfoVP9& /* vp9_info */,
|
||||||
int64_t frame_id,
|
int64_t frame_id,
|
||||||
RTPVideoHeader& rtp_video_header) {
|
RTPVideoHeader& rtp_video_header) {
|
||||||
const auto& vp9_header =
|
const auto& vp9_header =
|
||||||
@ -769,7 +769,7 @@ void RtpPayloadParams::SetDependenciesVp8New(
|
|||||||
const CodecSpecificInfoVP8& vp8_info,
|
const CodecSpecificInfoVP8& vp8_info,
|
||||||
int64_t frame_id,
|
int64_t frame_id,
|
||||||
bool is_keyframe,
|
bool is_keyframe,
|
||||||
bool layer_sync,
|
bool /* layer_sync */,
|
||||||
RTPVideoHeader::GenericDescriptorInfo* generic) {
|
RTPVideoHeader::GenericDescriptorInfo* generic) {
|
||||||
RTC_DCHECK(vp8_info.useExplicitDependencies);
|
RTC_DCHECK(vp8_info.useExplicitDependencies);
|
||||||
RTC_DCHECK(!new_version_used_.has_value() || new_version_used_.value());
|
RTC_DCHECK(!new_version_used_.has_value() || new_version_used_.value());
|
||||||
|
|||||||
@ -55,26 +55,27 @@ static NSInteger const kARDAppEngineClientErrorBadResponse = -1;
|
|||||||
RTCLog(@"Joining room:%@ on room server.", roomId);
|
RTCLog(@"Joining room:%@ on room server.", roomId);
|
||||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:roomURL];
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:roomURL];
|
||||||
request.HTTPMethod = @"POST";
|
request.HTTPMethod = @"POST";
|
||||||
[NSURLConnection sendAsyncRequest:request
|
[NSURLConnection
|
||||||
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
|
sendAsyncRequest:request
|
||||||
if (error) {
|
completionHandler:^(NSURLResponse *response __unused, NSData *data, NSError *error) {
|
||||||
if (completionHandler) {
|
if (error) {
|
||||||
completionHandler(nil, error);
|
if (completionHandler) {
|
||||||
}
|
completionHandler(nil, error);
|
||||||
return;
|
}
|
||||||
}
|
return;
|
||||||
ARDJoinResponse *joinResponse = [ARDJoinResponse responseFromJSONData:data];
|
}
|
||||||
if (!joinResponse) {
|
ARDJoinResponse *joinResponse = [ARDJoinResponse responseFromJSONData:data];
|
||||||
if (completionHandler) {
|
if (!joinResponse) {
|
||||||
NSError *error = [[self class] badResponseError];
|
if (completionHandler) {
|
||||||
completionHandler(nil, error);
|
NSError *error = [[self class] badResponseError];
|
||||||
}
|
completionHandler(nil, error);
|
||||||
return;
|
}
|
||||||
}
|
return;
|
||||||
if (completionHandler) {
|
}
|
||||||
completionHandler(joinResponse, nil);
|
if (completionHandler) {
|
||||||
}
|
completionHandler(joinResponse, nil);
|
||||||
}];
|
}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sendMessage:(ARDSignalingMessage *)message
|
- (void)sendMessage:(ARDSignalingMessage *)message
|
||||||
@ -95,29 +96,27 @@ static NSInteger const kARDAppEngineClientErrorBadResponse = -1;
|
|||||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
|
||||||
request.HTTPMethod = @"POST";
|
request.HTTPMethod = @"POST";
|
||||||
request.HTTPBody = data;
|
request.HTTPBody = data;
|
||||||
[NSURLConnection sendAsyncRequest:request
|
[NSURLConnection
|
||||||
completionHandler:^(NSURLResponse *response,
|
sendAsyncRequest:request
|
||||||
NSData *data,
|
completionHandler:^(NSURLResponse *response __unused, NSData *data, NSError *error) {
|
||||||
NSError *error) {
|
if (error) {
|
||||||
if (error) {
|
if (completionHandler) {
|
||||||
if (completionHandler) {
|
completionHandler(nil, error);
|
||||||
completionHandler(nil, error);
|
}
|
||||||
}
|
return;
|
||||||
return;
|
}
|
||||||
}
|
ARDMessageResponse *messageResponse = [ARDMessageResponse responseFromJSONData:data];
|
||||||
ARDMessageResponse *messageResponse =
|
if (!messageResponse) {
|
||||||
[ARDMessageResponse responseFromJSONData:data];
|
if (completionHandler) {
|
||||||
if (!messageResponse) {
|
NSError *error = [[self class] badResponseError];
|
||||||
if (completionHandler) {
|
completionHandler(nil, error);
|
||||||
NSError *error = [[self class] badResponseError];
|
}
|
||||||
completionHandler(nil, error);
|
return;
|
||||||
}
|
}
|
||||||
return;
|
if (completionHandler) {
|
||||||
}
|
completionHandler(messageResponse, nil);
|
||||||
if (completionHandler) {
|
}
|
||||||
completionHandler(messageResponse, nil);
|
}];
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)leaveRoomWithRoomId:(NSString *)roomId
|
- (void)leaveRoomWithRoomId:(NSString *)roomId
|
||||||
@ -138,13 +137,14 @@ static NSInteger const kARDAppEngineClientErrorBadResponse = -1;
|
|||||||
// We want a synchronous request so that we know that we've left the room on
|
// We want a synchronous request so that we know that we've left the room on
|
||||||
// room server before we do any further work.
|
// room server before we do any further work.
|
||||||
dispatch_semaphore_t sem = dispatch_semaphore_create(0);
|
dispatch_semaphore_t sem = dispatch_semaphore_create(0);
|
||||||
[NSURLConnection sendAsyncRequest:request
|
[NSURLConnection
|
||||||
completionHandler:^(NSURLResponse *response, NSData *data, NSError *e) {
|
sendAsyncRequest:request
|
||||||
if (e) {
|
completionHandler:^(NSURLResponse *response __unused, NSData *data __unused, NSError *e) {
|
||||||
error = e;
|
if (e) {
|
||||||
}
|
error = e;
|
||||||
dispatch_semaphore_signal(sem);
|
}
|
||||||
}];
|
dispatch_semaphore_signal(sem);
|
||||||
|
}];
|
||||||
|
|
||||||
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
|
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|||||||
@ -35,17 +35,18 @@ static NSInteger kARDTURNClientErrorBadResponse = -1;
|
|||||||
(void (^)(NSArray *turnServers, NSError *error))completionHandler {
|
(void (^)(NSArray *turnServers, NSError *error))completionHandler {
|
||||||
|
|
||||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:_url];
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:_url];
|
||||||
[NSURLConnection sendAsyncRequest:request
|
[NSURLConnection
|
||||||
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
|
sendAsyncRequest:request
|
||||||
if (error) {
|
completionHandler:^(NSURLResponse *response __unused, NSData *data, NSError *error) {
|
||||||
completionHandler(nil, error);
|
if (error) {
|
||||||
return;
|
completionHandler(nil, error);
|
||||||
}
|
return;
|
||||||
NSDictionary *responseDict = [NSDictionary dictionaryWithJSONData:data];
|
}
|
||||||
NSString *iceServerUrl = responseDict[@"ice_server_url"];
|
NSDictionary *responseDict = [NSDictionary dictionaryWithJSONData:data];
|
||||||
[self makeTurnServerRequestToURL:[NSURL URLWithString:iceServerUrl]
|
NSString *iceServerUrl = responseDict[@"ice_server_url"];
|
||||||
WithCompletionHandler:completionHandler];
|
[self makeTurnServerRequestToURL:[NSURL URLWithString:iceServerUrl]
|
||||||
}];
|
WithCompletionHandler:completionHandler];
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private
|
#pragma mark - Private
|
||||||
@ -56,32 +57,32 @@ static NSInteger kARDTURNClientErrorBadResponse = -1;
|
|||||||
NSMutableURLRequest *iceServerRequest = [NSMutableURLRequest requestWithURL:url];
|
NSMutableURLRequest *iceServerRequest = [NSMutableURLRequest requestWithURL:url];
|
||||||
iceServerRequest.HTTPMethod = @"POST";
|
iceServerRequest.HTTPMethod = @"POST";
|
||||||
[iceServerRequest addValue:kTURNRefererURLString forHTTPHeaderField:@"referer"];
|
[iceServerRequest addValue:kTURNRefererURLString forHTTPHeaderField:@"referer"];
|
||||||
[NSURLConnection sendAsyncRequest:iceServerRequest
|
[NSURLConnection
|
||||||
completionHandler:^(NSURLResponse *response,
|
sendAsyncRequest:iceServerRequest
|
||||||
NSData *data,
|
completionHandler:^(NSURLResponse *response __unused, NSData *data, NSError *error) {
|
||||||
NSError *error) {
|
if (error) {
|
||||||
if (error) {
|
completionHandler(nil, error);
|
||||||
completionHandler(nil, error);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
NSDictionary *turnResponseDict = [NSDictionary dictionaryWithJSONData:data];
|
||||||
NSDictionary *turnResponseDict = [NSDictionary dictionaryWithJSONData:data];
|
NSMutableArray *turnServers = [NSMutableArray array];
|
||||||
NSMutableArray *turnServers = [NSMutableArray array];
|
[turnResponseDict[@"iceServers"]
|
||||||
[turnResponseDict[@"iceServers"]
|
enumerateObjectsUsingBlock:^(
|
||||||
enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) {
|
NSDictionary *obj, NSUInteger idx __unused, BOOL *stop __unused) {
|
||||||
[turnServers addObject:[RTC_OBJC_TYPE(RTCIceServer) serverFromJSONDictionary:obj]];
|
[turnServers addObject:[RTC_OBJC_TYPE(RTCIceServer) serverFromJSONDictionary:obj]];
|
||||||
}];
|
|
||||||
if (!turnServers) {
|
|
||||||
NSError *responseError =
|
|
||||||
[[NSError alloc] initWithDomain:kARDTURNClientErrorDomain
|
|
||||||
code:kARDTURNClientErrorBadResponse
|
|
||||||
userInfo:@{
|
|
||||||
NSLocalizedDescriptionKey: @"Bad TURN response.",
|
|
||||||
}];
|
}];
|
||||||
completionHandler(nil, responseError);
|
if (!turnServers) {
|
||||||
return;
|
NSError *responseError =
|
||||||
}
|
[[NSError alloc] initWithDomain:kARDTURNClientErrorDomain
|
||||||
completionHandler(turnServers, nil);
|
code:kARDTURNClientErrorBadResponse
|
||||||
}];
|
userInfo:@{
|
||||||
|
NSLocalizedDescriptionKey : @"Bad TURN response.",
|
||||||
|
}];
|
||||||
|
completionHandler(nil, responseError);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
completionHandler(turnServers, nil);
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -115,7 +115,7 @@ constexpr uint64_t kDefaultValueWidthBits = 64;
|
|||||||
class FixedLengthEncodingParameters final {
|
class FixedLengthEncodingParameters final {
|
||||||
public:
|
public:
|
||||||
static bool ValidParameters(uint64_t delta_width_bits,
|
static bool ValidParameters(uint64_t delta_width_bits,
|
||||||
bool signed_deltas,
|
bool /* signed_deltas */,
|
||||||
uint64_t value_width_bits) {
|
uint64_t value_width_bits) {
|
||||||
return (1 <= delta_width_bits && delta_width_bits <= 64 &&
|
return (1 <= delta_width_bits && delta_width_bits <= 64 &&
|
||||||
1 <= value_width_bits && value_width_bits <= 64 &&
|
1 <= value_width_bits && value_width_bits <= 64 &&
|
||||||
|
|||||||
@ -56,15 +56,15 @@ class RtcEventAudioNetworkAdaptation final : public RtcEvent {
|
|||||||
|
|
||||||
const AudioEncoderRuntimeConfig& config() const { return *config_; }
|
const AudioEncoderRuntimeConfig& config() const { return *config_; }
|
||||||
|
|
||||||
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
|
static std::string Encode(rtc::ArrayView<const RtcEvent*> /* batch */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static RtcEventLogParseStatus Parse(
|
static RtcEventLogParseStatus Parse(
|
||||||
absl::string_view encoded_bytes,
|
absl::string_view /* encoded_bytes */,
|
||||||
bool batched,
|
bool /* batched */,
|
||||||
std::vector<LoggedAudioNetworkAdaptationEvent>& output) {
|
std::vector<LoggedAudioNetworkAdaptationEvent>& /* output */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,15 +53,15 @@ class RtcEventAudioReceiveStreamConfig final : public RtcEvent {
|
|||||||
|
|
||||||
const rtclog::StreamConfig& config() const { return *config_; }
|
const rtclog::StreamConfig& config() const { return *config_; }
|
||||||
|
|
||||||
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
|
static std::string Encode(rtc::ArrayView<const RtcEvent*> /* batch */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static RtcEventLogParseStatus Parse(
|
static RtcEventLogParseStatus Parse(
|
||||||
absl::string_view encoded_bytes,
|
absl::string_view /* encoded_bytes */,
|
||||||
bool batched,
|
bool /* batched */,
|
||||||
std::vector<LoggedAudioRecvConfig>& output) {
|
std::vector<LoggedAudioRecvConfig>& /* output */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,15 +53,15 @@ class RtcEventAudioSendStreamConfig final : public RtcEvent {
|
|||||||
|
|
||||||
const rtclog::StreamConfig& config() const { return *config_; }
|
const rtclog::StreamConfig& config() const { return *config_; }
|
||||||
|
|
||||||
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
|
static std::string Encode(rtc::ArrayView<const RtcEvent*> /* batch */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static RtcEventLogParseStatus Parse(
|
static RtcEventLogParseStatus Parse(
|
||||||
absl::string_view encoded_bytes,
|
absl::string_view /* encoded_bytes */,
|
||||||
bool batched,
|
bool /* batched */,
|
||||||
std::vector<LoggedAudioSendConfig>& output) {
|
std::vector<LoggedAudioSendConfig>& /* output */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,15 +64,15 @@ class RtcEventBweUpdateLossBased final : public RtcEvent {
|
|||||||
uint8_t fraction_loss() const { return fraction_loss_; }
|
uint8_t fraction_loss() const { return fraction_loss_; }
|
||||||
int32_t total_packets() const { return total_packets_; }
|
int32_t total_packets() const { return total_packets_; }
|
||||||
|
|
||||||
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
|
static std::string Encode(rtc::ArrayView<const RtcEvent*> /* batch */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static RtcEventLogParseStatus Parse(
|
static RtcEventLogParseStatus Parse(
|
||||||
absl::string_view encoded_bytes,
|
absl::string_view /* encoded_bytes */,
|
||||||
bool batched,
|
bool /* batched */,
|
||||||
std::vector<LoggedBweLossBasedUpdate>& output) {
|
std::vector<LoggedBweLossBasedUpdate>& /* output */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,15 +65,15 @@ class RtcEventFrameDecoded final : public RtcEvent {
|
|||||||
VideoCodecType codec() const { return codec_; }
|
VideoCodecType codec() const { return codec_; }
|
||||||
uint8_t qp() const { return qp_; }
|
uint8_t qp() const { return qp_; }
|
||||||
|
|
||||||
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
|
static std::string Encode(rtc::ArrayView<const RtcEvent*> /* batch */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static RtcEventLogParseStatus Parse(
|
static RtcEventLogParseStatus Parse(
|
||||||
absl::string_view encoded_bytes,
|
absl::string_view /* encoded_bytes */,
|
||||||
bool batched,
|
bool /* batched */,
|
||||||
std::map<uint32_t, std::vector<LoggedFrameDecoded>>& output) {
|
std::map<uint32_t, std::vector<LoggedFrameDecoded>>& /* output */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,15 +83,15 @@ class RtcEventGenericAckReceived final : public RtcEvent {
|
|||||||
return receive_acked_packet_time_ms_;
|
return receive_acked_packet_time_ms_;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
|
static std::string Encode(rtc::ArrayView<const RtcEvent*> /* batch */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static RtcEventLogParseStatus Parse(
|
static RtcEventLogParseStatus Parse(
|
||||||
absl::string_view encoded_bytes,
|
absl::string_view /* encoded_bytes */,
|
||||||
bool batched,
|
bool /* batched */,
|
||||||
std::vector<LoggedGenericAckReceived>& output) {
|
std::vector<LoggedGenericAckReceived>& /* output */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,15 +62,15 @@ class RtcEventGenericPacketReceived final : public RtcEvent {
|
|||||||
// including ICE/TURN/IP overheads.
|
// including ICE/TURN/IP overheads.
|
||||||
size_t packet_length() const { return packet_length_; }
|
size_t packet_length() const { return packet_length_; }
|
||||||
|
|
||||||
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
|
static std::string Encode(rtc::ArrayView<const RtcEvent*> /* batch */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static RtcEventLogParseStatus Parse(
|
static RtcEventLogParseStatus Parse(
|
||||||
absl::string_view encoded_bytes,
|
absl::string_view /* encoded_bytes */,
|
||||||
bool batched,
|
bool /* batched */,
|
||||||
std::vector<LoggedGenericPacketReceived>& output) {
|
std::vector<LoggedGenericPacketReceived>& /* output */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,14 +86,14 @@ class RtcEventGenericPacketSent final : public RtcEvent {
|
|||||||
|
|
||||||
size_t padding_length() const { return padding_length_; }
|
size_t padding_length() const { return padding_length_; }
|
||||||
|
|
||||||
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
|
static std::string Encode(rtc::ArrayView<const RtcEvent*> /* batch */) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static RtcEventLogParseStatus Parse(
|
static RtcEventLogParseStatus Parse(
|
||||||
absl::string_view encoded_bytes,
|
absl::string_view /* encoded_bytes */,
|
||||||
bool batched,
|
bool /* batched */,
|
||||||
std::vector<LoggedGenericPacketSent>& output) {
|
std::vector<LoggedGenericPacketSent>& output) {
|
||||||
// TODO(terelius): Implement
|
// TODO(terelius): Implement
|
||||||
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user