summaryrefslogtreecommitdiff
path: root/voice_engine/voe_video_sync_impl.cc
diff options
context:
space:
mode:
authorturaj@webrtc.org <turaj@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-02-12 21:42:18 +0000
committerturaj@webrtc.org <turaj@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-02-12 21:42:18 +0000
commitead8a5bbdcdf3ac429c23af04d4a91f3de334f28 (patch)
tree9c0439d7871cce435473d5aa79a135b0921c571e /voice_engine/voe_video_sync_impl.cc
parent2b9a2e092ebf292d83ed0321add619f9ecc6f75c (diff)
downloadwebrtc-ead8a5bbdcdf3ac429c23af04d4a91f3de334f28.tar.gz
Implement initial delay. This CL allows clients of VoE to set an initial delay. Playout of audio is delayed and the extra playout delay is maintained during the call. While packets are buffered (in NetEq) to acheive the desired delay. ACM will playout silence (zeros). Initial delay has to be set before any packet is pushed into ACM.
TEST=ACM unit test is added, also a manual integration test is writen. Review URL: https://webrtc-codereview.appspot.com/1097009 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3506 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/voe_video_sync_impl.cc')
-rw-r--r--voice_engine/voe_video_sync_impl.cc34
1 files changed, 29 insertions, 5 deletions
diff --git a/voice_engine/voe_video_sync_impl.cc b/voice_engine/voe_video_sync_impl.cc
index 2a7ff7d8..b0910c31 100644
--- a/voice_engine/voe_video_sync_impl.cc
+++ b/voice_engine/voe_video_sync_impl.cc
@@ -10,11 +10,11 @@
#include "voe_video_sync_impl.h"
-#include "channel.h"
-#include "critical_section_wrapper.h"
-#include "trace.h"
-#include "voe_errors.h"
-#include "voice_engine_impl.h"
+#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
+#include "webrtc/system_wrappers/interface/trace.h"
+#include "webrtc/voice_engine/channel.h"
+#include "webrtc/voice_engine/include/voe_errors.h"
+#include "webrtc/voice_engine/voice_engine_impl.h"
namespace webrtc {
@@ -144,6 +144,30 @@ int VoEVideoSyncImpl::SetMinimumPlayoutDelay(int channel,int delayMs)
return channelPtr->SetMinimumPlayoutDelay(delayMs);
}
+int VoEVideoSyncImpl::SetInitialPlayoutDelay(int channel, int delay_ms)
+{
+ WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
+ "SetInitialPlayoutDelay(channel=%d, delay_ms=%d)",
+ channel, delay_ms);
+ ANDROID_NOT_SUPPORTED(_shared->statistics());
+ 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* channel_ptr = sc.ChannelPtr();
+ if (channel_ptr == NULL)
+ {
+ _shared->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
+ "SetInitialPlayoutDelay() failed to locate channel");
+ return -1;
+ }
+ return channel_ptr->SetInitialPlayoutDelay(delay_ms);
+}
+
int VoEVideoSyncImpl::GetDelayEstimate(int channel, int& delayMs)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),