Index: webrtc/voice_engine/channel.cc |
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc |
index 746db8114c600ab0d7afa7c0e2b4007d78b4b8da..d2790199fdd39c6e08fb36ca926e2ee914aac13a 100644 |
--- a/webrtc/voice_engine/channel.cc |
+++ b/webrtc/voice_engine/channel.cc |
@@ -2725,6 +2725,10 @@ void Channel::ProcessAndEncodeAudio(const AudioFrame& audio_input) { |
// either into pool of frames or into the task itself. |
audio_frame->CopyFrom(audio_input); |
audio_frame->id_ = ChannelId(); |
+ // Profile time between when the audio frame is added to the task queue (t0) |
+ // and when the task is actually executed (t1). Goal is to keep track of |
+ // unwanted extra latency added by the queue. |
+ audio_frame->UpdateProfileTime(); |
encoder_queue_->PostTask(std::unique_ptr<rtc::QueuedTask>( |
new ProcessAndEncodeAudioTask(std::move(audio_frame), this))); |
} |
@@ -2764,6 +2768,10 @@ void Channel::ProcessAndEncodeAudioOnTaskQueue(AudioFrame* audio_input) { |
RTC_DCHECK_LE(audio_input->num_channels_, 2); |
RTC_DCHECK_EQ(audio_input->id_, ChannelId()); |
+ // TODO(henrika): add comment and histogram here... |
+ // dT = t1 - t0. |
+ int64_t dT = audio_input->TimeSinceLastProfile(); |
+ |
if (channel_state_.Get().input_file_playing) { |
MixOrReplaceAudioWithFile(audio_input); |
} |