Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Unified Diff: webrtc/voice_engine/channel.cc

Issue 3012183002: Adding time profiling support to AudioFrame
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« webrtc/modules/include/module_common_types.h ('K') | « webrtc/modules/include/module_common_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698