From f2724977323ae0d162fa0b33135046701f3eba66 Mon Sep 17 00:00:00 2001 From: "pwestin@webrtc.org" Date: Thu, 11 Apr 2013 20:23:35 +0000 Subject: Adding playout buffer status to the voe video sync Review URL: https://webrtc-codereview.appspot.com/1311004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3835 4adac7df-926f-26a2-2b94-8c16560cd09d --- voice_engine/voe_video_sync_impl.cc | 43 ++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'voice_engine/voe_video_sync_impl.cc') diff --git a/voice_engine/voe_video_sync_impl.cc b/voice_engine/voe_video_sync_impl.cc index 4ef1228a..3796c5e0 100644 --- a/voice_engine/voe_video_sync_impl.cc +++ b/voice_engine/voe_video_sync_impl.cc @@ -164,26 +164,29 @@ int VoEVideoSyncImpl::SetInitialPlayoutDelay(int channel, int delay_ms) return channel_ptr->SetInitialPlayoutDelay(delay_ms); } -int VoEVideoSyncImpl::GetDelayEstimate(int channel, int& delayMs) -{ - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), - "GetDelayEstimate(channel=%d, delayMs=?)", channel); - IPHONE_NOT_SUPPORTED(_shared->statistics()); - - if (!_shared->statistics().Initialized()) - { - _shared->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ScopedChannel sc(_shared->channel_manager(), channel); - voe::Channel* channelPtr = sc.ChannelPtr(); - if (channelPtr == NULL) - { - _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, - "GetDelayEstimate() failed to locate channel"); - return -1; - } - return channelPtr->GetDelayEstimate(delayMs); +int VoEVideoSyncImpl::GetDelayEstimate(int channel, + int* jitter_buffer_delay_ms, + int* playout_buffer_delay_ms) { + WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), + "GetDelayEstimate(channel=%d, delayMs=?)", channel); + IPHONE_NOT_SUPPORTED(_shared->statistics()); + + if (!_shared->statistics().Initialized()) { + _shared->SetLastError(VE_NOT_INITED, kTraceError); + return -1; + } + voe::ScopedChannel sc(_shared->channel_manager(), channel); + voe::Channel* channelPtr = sc.ChannelPtr(); + if (channelPtr == NULL) { + _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, + "GetDelayEstimate() failed to locate channel"); + return -1; + } + if (!channelPtr->GetDelayEstimate(jitter_buffer_delay_ms, + playout_buffer_delay_ms)) { + return -1; + } + return 0; } int VoEVideoSyncImpl::GetPlayoutBufferSize(int& bufferMs) -- cgit v1.2.3