diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc index c2a6a564f4..110e28be88 100644 --- a/call/rtp_video_sender.cc +++ b/call/rtp_video_sender.cc @@ -31,6 +31,7 @@ #include "rtc_base/location.h" #include "rtc_base/logging.h" #include "rtc_base/task_queue.h" +#include "rtc_base/trace_event.h" namespace webrtc { @@ -461,6 +462,7 @@ RtpVideoSender::~RtpVideoSender() { void RtpVideoSender::RegisterProcessThread( ProcessThread* module_process_thread) { + TRACE_EVENT0("webrtc", "RtpVideoSender::RegisterProcessThread"); RTC_DCHECK_RUN_ON(&module_process_thread_checker_); RTC_DCHECK(!module_process_thread_); module_process_thread_ = module_process_thread; diff --git a/modules/utility/source/process_thread_impl.cc b/modules/utility/source/process_thread_impl.cc index cdc2fa1005..73fc23400b 100644 --- a/modules/utility/source/process_thread_impl.cc +++ b/modules/utility/source/process_thread_impl.cc @@ -180,6 +180,7 @@ void ProcessThreadImpl::PostDelayedTask(std::unique_ptr task, void ProcessThreadImpl::RegisterModule(Module* module, const rtc::Location& from) { + TRACE_EVENT0("webrtc", "ProcessThreadImpl::RegisterModule"); RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(module) << from.ToString(); diff --git a/modules/video_coding/codecs/h264/h264.cc b/modules/video_coding/codecs/h264/h264.cc index 016d0aa538..14e1691153 100644 --- a/modules/video_coding/codecs/h264/h264.cc +++ b/modules/video_coding/codecs/h264/h264.cc @@ -17,6 +17,7 @@ #include "absl/types/optional.h" #include "api/video_codecs/sdp_video_format.h" #include "media/base/media_constants.h" +#include "rtc_base/trace_event.h" #if defined(WEBRTC_USE_H264) #include "modules/video_coding/codecs/h264/h264_decoder_impl.h" @@ -65,6 +66,7 @@ void DisableRtcUseH264() { } std::vector SupportedH264Codecs() { + TRACE_EVENT0("webrtc", __func__); if (!IsH264CodecSupported()) return std::vector(); // We only support encoding Constrained Baseline Profile (CBP), but the diff --git a/video/adaptation/video_stream_encoder_resource_manager.cc b/video/adaptation/video_stream_encoder_resource_manager.cc index 1c2e5839f2..036ee901cd 100644 --- a/video/adaptation/video_stream_encoder_resource_manager.cc +++ b/video/adaptation/video_stream_encoder_resource_manager.cc @@ -32,6 +32,7 @@ #include "rtc_base/ref_counted_object.h" #include "rtc_base/strings/string_builder.h" #include "rtc_base/time_utils.h" +#include "rtc_base/trace_event.h" #include "system_wrappers/include/field_trial.h" #include "video/adaptation/quality_scaler_resource.h" @@ -257,6 +258,9 @@ VideoStreamEncoderResourceManager::VideoStreamEncoderResourceManager( quality_rampup_experiment_( QualityRampUpExperimentHelper::CreateIfEnabled(this, clock_)), encoder_settings_(absl::nullopt) { + TRACE_EVENT0( + "webrtc", + "VideoStreamEncoderResourceManager::VideoStreamEncoderResourceManager"); RTC_CHECK(degradation_preference_provider_); RTC_CHECK(encoder_stats_observer_); } diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc index 627a29110b..c929f07616 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -466,6 +466,8 @@ void VideoReceiveStream2::Stop() { void VideoReceiveStream2::CreateAndRegisterExternalDecoder( const Decoder& decoder) { + TRACE_EVENT0("webrtc", + "VideoReceiveStream2::CreateAndRegisterExternalDecoder"); std::unique_ptr video_decoder = config_.decoder_factory->CreateVideoDecoder(decoder.video_format); // If we still have no valid decoder, we have to create a "Null" decoder diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc index 191918a591..39409a302b 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -660,6 +660,7 @@ VideoStreamEncoder::VideoStreamEncoder( encoder_queue_(task_queue_factory->CreateTaskQueue( "EncoderQueue", TaskQueueFactory::Priority::NORMAL)) { + TRACE_EVENT0("webrtc", "VideoStreamEncoder::VideoStreamEncoder"); RTC_DCHECK(main_queue_); RTC_DCHECK(encoder_stats_observer); RTC_DCHECK_GE(number_of_cores, 1); @@ -742,11 +743,16 @@ void VideoStreamEncoder::SetFecControllerOverride( void VideoStreamEncoder::AddAdaptationResource( rtc::scoped_refptr resource) { RTC_DCHECK_RUN_ON(main_queue_); + TRACE_EVENT0("webrtc", "VideoStreamEncoder::AddAdaptationResource"); // Map any externally added resources as kCpu for the sake of stats reporting. // TODO(hbos): Make the manager map any unknown resources to kCpu and get rid // of this MapResourceToReason() call. + TRACE_EVENT_ASYNC_BEGIN0( + "webrtc", "VideoStreamEncoder::AddAdaptationResource(latency)", this); rtc::Event map_resource_event; encoder_queue_.PostTask([this, resource, &map_resource_event] { + TRACE_EVENT_ASYNC_END0( + "webrtc", "VideoStreamEncoder::AddAdaptationResource(latency)", this); RTC_DCHECK_RUN_ON(&encoder_queue_); additional_resources_.push_back(resource); stream_resource_manager_.AddResource(resource, VideoAdaptationReason::kCpu);