Add tracing to interesting media-related methods.
Accounts for a lot of worker-thread blocking by voice-related code or initializing SRTP. BUG= R=pthatcher@webrtc.org Review URL: https://codereview.webrtc.org/1780543003 . Cr-Commit-Position: refs/heads/master@{#11920}
This commit is contained in:
parent
13e433902d
commit
ca8b404e86
@ -1218,6 +1218,7 @@ bool WebRtcVideoChannel2::SetSink(uint32_t ssrc,
|
||||
}
|
||||
|
||||
bool WebRtcVideoChannel2::GetStats(VideoMediaInfo* info) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::GetStats");
|
||||
info->Clear();
|
||||
FillSenderStats(info);
|
||||
FillReceiverStats(info);
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
#include "webrtc/base/logging.h"
|
||||
#include "webrtc/base/stringencode.h"
|
||||
#include "webrtc/base/stringutils.h"
|
||||
#include "webrtc/base/trace_event.h"
|
||||
#include "webrtc/call/rtc_event_log.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/media/base/audioframe.h"
|
||||
@ -1395,6 +1396,7 @@ rtc::DiffServCodePoint WebRtcVoiceMediaChannel::PreferredDscp() const {
|
||||
|
||||
bool WebRtcVoiceMediaChannel::SetSendParameters(
|
||||
const AudioSendParameters& params) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::SetSendParameters");
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetSendParameters: "
|
||||
<< params.ToString();
|
||||
@ -1426,6 +1428,7 @@ bool WebRtcVoiceMediaChannel::SetSendParameters(
|
||||
|
||||
bool WebRtcVoiceMediaChannel::SetRecvParameters(
|
||||
const AudioRecvParameters& params) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::SetRecvParameters");
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetRecvParameters: "
|
||||
<< params.ToString();
|
||||
@ -1831,6 +1834,7 @@ bool WebRtcVoiceMediaChannel::ResumePlayout() {
|
||||
}
|
||||
|
||||
bool WebRtcVoiceMediaChannel::ChangePlayout(bool playout) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::ChangePlayout");
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
if (playout_ == playout) {
|
||||
return true;
|
||||
@ -1848,6 +1852,7 @@ bool WebRtcVoiceMediaChannel::ChangePlayout(bool playout) {
|
||||
}
|
||||
|
||||
void WebRtcVoiceMediaChannel::SetSend(bool send) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::SetSend");
|
||||
if (send_ == send) {
|
||||
return;
|
||||
}
|
||||
@ -1910,6 +1915,7 @@ bool WebRtcVoiceMediaChannel::DeleteVoEChannel(int channel) {
|
||||
}
|
||||
|
||||
bool WebRtcVoiceMediaChannel::AddSendStream(const StreamParams& sp) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::AddSendStream");
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
LOG(LS_INFO) << "AddSendStream: " << sp.ToString();
|
||||
|
||||
@ -1964,6 +1970,7 @@ bool WebRtcVoiceMediaChannel::AddSendStream(const StreamParams& sp) {
|
||||
}
|
||||
|
||||
bool WebRtcVoiceMediaChannel::RemoveSendStream(uint32_t ssrc) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::RemoveSendStream");
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
LOG(LS_INFO) << "RemoveSendStream: " << ssrc;
|
||||
|
||||
@ -1992,6 +1999,7 @@ bool WebRtcVoiceMediaChannel::RemoveSendStream(uint32_t ssrc) {
|
||||
}
|
||||
|
||||
bool WebRtcVoiceMediaChannel::AddRecvStream(const StreamParams& sp) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::AddRecvStream");
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
LOG(LS_INFO) << "AddRecvStream: " << sp.ToString();
|
||||
|
||||
@ -2069,6 +2077,7 @@ bool WebRtcVoiceMediaChannel::AddRecvStream(const StreamParams& sp) {
|
||||
}
|
||||
|
||||
bool WebRtcVoiceMediaChannel::RemoveRecvStream(uint32_t ssrc) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::RemoveRecvStream");
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
LOG(LS_INFO) << "RemoveRecvStream: " << ssrc;
|
||||
|
||||
@ -2407,6 +2416,7 @@ bool WebRtcVoiceMediaChannel::SetSendBitrateInternal(int bps) {
|
||||
}
|
||||
|
||||
bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) {
|
||||
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::GetStats");
|
||||
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
|
||||
RTC_DCHECK(info);
|
||||
|
||||
|
||||
@ -169,6 +169,7 @@ BaseChannel::BaseChannel(rtc::Thread* thread,
|
||||
}
|
||||
|
||||
BaseChannel::~BaseChannel() {
|
||||
TRACE_EVENT0("webrtc", "BaseChannel::~BaseChannel");
|
||||
ASSERT(worker_thread_ == rtc::Thread::Current());
|
||||
Deinit();
|
||||
StopConnectionMonitor();
|
||||
@ -1006,6 +1007,7 @@ bool BaseChannel::SetSrtp_w(const std::vector<CryptoParams>& cryptos,
|
||||
ContentAction action,
|
||||
ContentSource src,
|
||||
std::string* error_desc) {
|
||||
TRACE_EVENT0("webrtc", "BaseChannel::SetSrtp_w");
|
||||
if (action == CA_UPDATE) {
|
||||
// no crypto params.
|
||||
return true;
|
||||
@ -1317,6 +1319,7 @@ VoiceChannel::VoiceChannel(rtc::Thread* thread,
|
||||
received_media_(false) {}
|
||||
|
||||
VoiceChannel::~VoiceChannel() {
|
||||
TRACE_EVENT0("webrtc", "VoiceChannel::~VoiceChannel");
|
||||
StopAudioMonitor();
|
||||
StopMediaMonitor();
|
||||
// this can't be done in the base class, since it calls a virtual
|
||||
@ -1631,6 +1634,7 @@ bool VideoChannel::Init() {
|
||||
}
|
||||
|
||||
VideoChannel::~VideoChannel() {
|
||||
TRACE_EVENT0("webrtc", "VideoChannel::~VideoChannel");
|
||||
StopMediaMonitor();
|
||||
// this can't be done in the base class, since it calls a virtual
|
||||
DisableMedia_w();
|
||||
@ -1834,6 +1838,7 @@ DataChannel::DataChannel(rtc::Thread* thread,
|
||||
ready_to_send_data_(false) {}
|
||||
|
||||
DataChannel::~DataChannel() {
|
||||
TRACE_EVENT0("webrtc", "DataChannel::~DataChannel");
|
||||
StopMediaMonitor();
|
||||
// this can't be done in the base class, since it calls a virtual
|
||||
DisableMedia_w();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user