mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Declare LERROR deprecated and remove all usage in webrtc
Bug: webrtc:13362 Change-Id: I1c6c6eccd950d73be616b34f96db7832ff94377e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238804 Commit-Queue: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35416}
This commit is contained in:
parent
4e8e36c745
commit
5f34130f26
10 changed files with 28 additions and 30 deletions
|
@ -64,7 +64,7 @@ rtc::IPAddress QueryDefaultLocalAddress(int family) {
|
|||
std::unique_ptr<rtc::Socket> socket(
|
||||
thread->socketserver()->CreateSocket(family, SOCK_DGRAM));
|
||||
if (!socket) {
|
||||
RTC_LOG_ERR(LERROR) << "Socket creation failed";
|
||||
RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
|
||||
return rtc::IPAddress();
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ void AndroidVoipClient::StartSession(JNIEnv* env) {
|
|||
rtp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(),
|
||||
rtp_local_address_));
|
||||
if (!rtp_socket_) {
|
||||
RTC_LOG_ERR(LERROR) << "Socket creation failed";
|
||||
RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
|
||||
Java_VoipClient_onStartSessionCompleted(env_, j_voip_client_,
|
||||
/*isSuccessful=*/false);
|
||||
return;
|
||||
|
@ -319,7 +319,7 @@ void AndroidVoipClient::StartSession(JNIEnv* env) {
|
|||
rtcp_socket_.reset(rtc::AsyncUDPSocket::Create(voip_thread_->socketserver(),
|
||||
rtcp_local_address_));
|
||||
if (!rtcp_socket_) {
|
||||
RTC_LOG_ERR(LERROR) << "Socket creation failed";
|
||||
RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
|
||||
Java_VoipClient_onStartSessionCompleted(env_, j_voip_client_,
|
||||
/*isSuccessful=*/false);
|
||||
return;
|
||||
|
|
|
@ -269,7 +269,7 @@ void SimplePeerConnection::OnSuccess(
|
|||
}
|
||||
|
||||
void SimplePeerConnection::OnFailure(webrtc::RTCError error) {
|
||||
RTC_LOG(LERROR) << ToString(error.type()) << ": " << error.message();
|
||||
RTC_LOG(LS_ERROR) << ToString(error.type()) << ": " << error.message();
|
||||
|
||||
// TODO(hta): include error.type in the message
|
||||
if (OnFailureMessage)
|
||||
|
|
|
@ -66,14 +66,14 @@ AcmReceiver::~AcmReceiver() = default;
|
|||
int AcmReceiver::SetMinimumDelay(int delay_ms) {
|
||||
if (neteq_->SetMinimumDelay(delay_ms))
|
||||
return 0;
|
||||
RTC_LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
|
||||
RTC_LOG(LS_ERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int AcmReceiver::SetMaximumDelay(int delay_ms) {
|
||||
if (neteq_->SetMaximumDelay(delay_ms))
|
||||
return 0;
|
||||
RTC_LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
|
||||
RTC_LOG(LS_ERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -134,9 +134,9 @@ int AcmReceiver::InsertPacket(const RTPHeader& rtp_header,
|
|||
} // `mutex_` is released.
|
||||
|
||||
if (neteq_->InsertPacket(rtp_header, incoming_payload) < 0) {
|
||||
RTC_LOG(LERROR) << "AcmReceiver::InsertPacket "
|
||||
<< static_cast<int>(rtp_header.payloadType)
|
||||
<< " Failed to insert packet";
|
||||
RTC_LOG(LS_ERROR) << "AcmReceiver::InsertPacket "
|
||||
<< static_cast<int>(rtp_header.payloadType)
|
||||
<< " Failed to insert packet";
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -150,7 +150,7 @@ int AcmReceiver::GetAudio(int desired_freq_hz,
|
|||
int current_sample_rate_hz = 0;
|
||||
if (neteq_->GetAudio(audio_frame, muted, ¤t_sample_rate_hz) !=
|
||||
NetEq::kOK) {
|
||||
RTC_LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
|
||||
RTC_LOG(LS_ERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -170,8 +170,8 @@ int AcmReceiver::GetAudio(int desired_freq_hz,
|
|||
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
|
||||
temp_output);
|
||||
if (samples_per_channel_int < 0) {
|
||||
RTC_LOG(LERROR) << "AcmReceiver::GetAudio - "
|
||||
"Resampling last_audio_buffer_ failed.";
|
||||
RTC_LOG(LS_ERROR) << "AcmReceiver::GetAudio - "
|
||||
"Resampling last_audio_buffer_ failed.";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ int AcmReceiver::GetAudio(int desired_freq_hz,
|
|||
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
|
||||
audio_frame->mutable_data());
|
||||
if (samples_per_channel_int < 0) {
|
||||
RTC_LOG(LERROR)
|
||||
RTC_LOG(LS_ERROR)
|
||||
<< "AcmReceiver::GetAudio - Resampling audio_buffer_ failed.";
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ int32_t AudioDeviceModuleImpl::CheckPlatform() {
|
|||
RTC_LOG(LS_INFO) << "current platform is Mac";
|
||||
#endif
|
||||
if (platform == kPlatformNotSupported) {
|
||||
RTC_LOG(LERROR)
|
||||
RTC_LOG(LS_ERROR)
|
||||
<< "current platform is not supported => this module will self "
|
||||
"destruct!";
|
||||
return -1;
|
||||
|
@ -546,7 +546,7 @@ int32_t AudioDeviceModuleImpl::SetStereoRecording(bool enable) {
|
|||
RTC_LOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
if (audio_device_->RecordingIsInitialized()) {
|
||||
RTC_LOG(LERROR)
|
||||
RTC_LOG(LS_ERROR)
|
||||
<< "unable to set stereo mode after recording is initialized";
|
||||
return -1;
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ int32_t AudioDeviceModuleImpl::SetStereoPlayout(bool enable) {
|
|||
RTC_LOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
if (audio_device_->PlayoutIsInitialized()) {
|
||||
RTC_LOG(LERROR)
|
||||
RTC_LOG(LS_ERROR)
|
||||
<< "unable to set stereo mode while playing side is initialized";
|
||||
return -1;
|
||||
}
|
||||
|
@ -856,7 +856,7 @@ int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const {
|
|||
CHECKinitialized_();
|
||||
uint16_t delay = 0;
|
||||
if (audio_device_->PlayoutDelay(delay) == -1) {
|
||||
RTC_LOG(LERROR) << "failed to retrieve the playout delay";
|
||||
RTC_LOG(LS_ERROR) << "failed to retrieve the playout delay";
|
||||
return -1;
|
||||
}
|
||||
*delayMS = delay;
|
||||
|
|
|
@ -577,7 +577,7 @@ void UDPPort::OnSendPacket(const void* data, size_t size, StunRequest* req) {
|
|||
options.info_signaled_after_sent.packet_type = rtc::PacketType::kStunMessage;
|
||||
CopyPortInformationToPacketInfo(&options.info_signaled_after_sent);
|
||||
if (socket_->SendTo(data, size, sreq->server_addr(), options) < 0) {
|
||||
RTC_LOG_ERR_EX(LERROR, socket_->GetError())
|
||||
RTC_LOG_ERR_EX(LS_ERROR, socket_->GetError())
|
||||
<< "UDP send of " << size << " bytes to host "
|
||||
<< sreq->server_addr().ToSensitiveString() << " ("
|
||||
<< sreq->server_addr().ToResolvedSensitiveString()
|
||||
|
|
|
@ -147,9 +147,9 @@ bool StunRequestManager::CheckResponse(StunMessage* msg) {
|
|||
} else if (msg->type() == GetStunErrorResponseType(request->type())) {
|
||||
request->OnErrorResponse(msg);
|
||||
} else {
|
||||
RTC_LOG(LERROR) << "Received response with wrong type: " << msg->type()
|
||||
<< " (expecting "
|
||||
<< GetStunSuccessResponseType(request->type()) << ")";
|
||||
RTC_LOG(LS_ERROR) << "Received response with wrong type: " << msg->type()
|
||||
<< " (expecting "
|
||||
<< GetStunSuccessResponseType(request->type()) << ")";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,8 +94,7 @@ enum LoggingSeverity {
|
|||
INFO [[deprecated("Use LS_INFO")]] = LS_INFO,
|
||||
// WARNING [[deprecated("Use LS_WARNING")]] = LS_WARNING,
|
||||
WARNING = LS_WARNING,
|
||||
// LERROR [[deprecated("Use LS_ERROR")]] = LS_ERROR
|
||||
LERROR = LS_ERROR
|
||||
LERROR [[deprecated("Use LS_ERROR")]] = LS_ERROR
|
||||
};
|
||||
|
||||
// LogErrorContext assists in interpreting the meaning of an error value.
|
||||
|
|
|
@ -652,8 +652,8 @@ bool BasicNetworkManager::CreateNetworks(bool include_ignored,
|
|||
struct ifaddrs* interfaces;
|
||||
int error = getifaddrs(&interfaces);
|
||||
if (error != 0) {
|
||||
RTC_LOG_ERR(LERROR) << "getifaddrs failed to gather interface data: "
|
||||
<< error;
|
||||
RTC_LOG_ERR(LS_ERROR) << "getifaddrs failed to gather interface data: "
|
||||
<< error;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -983,7 +983,7 @@ IPAddress BasicNetworkManager::QueryDefaultLocalAddress(int family) const {
|
|||
std::unique_ptr<Socket> socket(
|
||||
socket_factory->CreateSocket(family, SOCK_DGRAM));
|
||||
if (!socket) {
|
||||
RTC_LOG_ERR(LERROR) << "Socket creation failed";
|
||||
RTC_LOG_ERR(LS_ERROR) << "Socket creation failed";
|
||||
return IPAddress();
|
||||
}
|
||||
|
||||
|
|
|
@ -939,7 +939,7 @@ class Signaler : public Dispatcher {
|
|||
std::array<int, 2> afd = {-1, -1};
|
||||
|
||||
if (pipe(afd.data()) < 0) {
|
||||
RTC_LOG(LERROR) << "pipe failed";
|
||||
RTC_LOG(LS_ERROR) << "pipe failed";
|
||||
}
|
||||
return afd;
|
||||
}()),
|
||||
|
|
|
@ -324,8 +324,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
|||
RTC_DLOG(LS_INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
if (audio_device_->PlayoutIsInitialized()) {
|
||||
RTC_LOG(LERROR)
|
||||
<< "unable to set stereo mode while playing side is initialized";
|
||||
RTC_LOG(LS_ERROR) << "unable to set stereo mode while playing side is initialized";
|
||||
return -1;
|
||||
}
|
||||
if (audio_device_->SetStereoPlayout(enable)) {
|
||||
|
@ -588,7 +587,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
|||
CHECKinitialized_();
|
||||
uint16_t delay = 0;
|
||||
if (audio_device_->PlayoutDelay(delay) == -1) {
|
||||
RTC_LOG(LERROR) << "failed to retrieve the playout delay";
|
||||
RTC_LOG(LS_ERROR) << "failed to retrieve the playout delay";
|
||||
return -1;
|
||||
}
|
||||
*delayMS = delay;
|
||||
|
|
Loading…
Reference in a new issue