Added API to get receive side video delay.
BUG=1222
Review URL: https://webrtc-codereview.appspot.com/997004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3294 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/video_engine/vie_codec_impl.cc b/video_engine/vie_codec_impl.cc
index 27559d5..712bbf8 100644
--- a/video_engine/vie_codec_impl.cc
+++ b/video_engine/vie_codec_impl.cc
@@ -14,6 +14,7 @@
#include "engine_configurations.h" // NOLINT
#include "modules/video_coding/main/interface/video_coding.h"
+#include "system_wrappers/interface/logging.h"
#include "system_wrappers/interface/trace.h"
#include "video_engine/include/vie_errors.h"
#include "video_engine/vie_capturer.h"
@@ -446,7 +447,7 @@
unsigned int& delta_frames) const {
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
ViEId(shared_data_->instance_id(), video_channel),
- "%s(video_channel: %d, codec_type: %d)", __FUNCTION__,
+ "%s(video_channel: %d)", __FUNCTION__,
video_channel);
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
@@ -465,6 +466,33 @@
return 0;
}
+int ViECodecImpl::GetReceiveSideDelay(const int video_channel,
+ int* delay_ms) const {
+ WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
+ ViEId(shared_data_->instance_id(), video_channel),
+ "%s(video_channel: %d)", __FUNCTION__, video_channel);
+ if (delay_ms == NULL) {
+ LOG_F(LS_ERROR) << "NULL pointer argument.";
+ return -1;
+ }
+
+ ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
+ ViEChannel* vie_channel = cs.Channel(video_channel);
+ if (!vie_channel) {
+ WEBRTC_TRACE(kTraceError, kTraceVideo,
+ ViEId(shared_data_->instance_id(), video_channel),
+ "%s: No channel %d", __FUNCTION__, video_channel);
+ shared_data_->SetLastError(kViECodecInvalidChannelId);
+ return -1;
+ }
+ *delay_ms = vie_channel->ReceiveDelay();
+ if (*delay_ms < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+
int ViECodecImpl::GetCodecTargetBitrate(const int video_channel,
unsigned int* bitrate) const {
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,