(Auto)update libjingle 69278008-> 69291002

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6448 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
buildbot@webrtc.org 2014-06-16 13:39:40 +00:00
parent d6e2213edd
commit 27626a6256
6 changed files with 104 additions and 2 deletions

View File

@ -106,6 +106,10 @@ const char MediaConstraintsInterface::kCpuUnderuseThreshold[] =
"googCpuUnderuseThreshold";
const char MediaConstraintsInterface::kCpuOveruseThreshold[] =
"googCpuOveruseThreshold";
const char MediaConstraintsInterface::kCpuUnderuseEncodeRsdThreshold[] =
"googCpuUnderuseEncodeRsdThreshold";
const char MediaConstraintsInterface::kCpuOveruseEncodeRsdThreshold[] =
"googCpuOveruseEncodeRsdThreshold";
const char MediaConstraintsInterface::kCpuOveruseEncodeUsage[] =
"googCpuOveruseEncodeUsage";
const char MediaConstraintsInterface::kHighStartBitrate[] =

View File

@ -122,6 +122,12 @@ class MediaConstraintsInterface {
static const char kCpuOveruseDetection[]; // googCpuOveruseDetection
static const char kCpuUnderuseThreshold[]; // googCpuUnderuseThreshold
static const char kCpuOveruseThreshold[]; // googCpuOveruseThreshold
// Low cpu adaptation threshold for relative standard deviation of encode
// time.
static const char kCpuUnderuseEncodeRsdThreshold[];
// High cpu adaptation threshold for relative standard deviation of encode
// time.
static const char kCpuOveruseEncodeRsdThreshold[];
static const char kCpuOveruseEncodeUsage[]; // googCpuOveruseEncodeUsage
static const char kHighStartBitrate[]; // googHighStartBitrate
static const char kHighBitrate[]; // googHighBitrate

View File

@ -564,6 +564,12 @@ bool WebRtcSession::Initialize(
SetOptionFromOptionalConstraint(constraints,
MediaConstraintsInterface::kCpuOveruseThreshold,
&video_options_.cpu_overuse_threshold);
SetOptionFromOptionalConstraint(constraints,
MediaConstraintsInterface::kCpuUnderuseEncodeRsdThreshold,
&video_options_.cpu_underuse_encode_rsd_threshold);
SetOptionFromOptionalConstraint(constraints,
MediaConstraintsInterface::kCpuOveruseEncodeRsdThreshold,
&video_options_.cpu_overuse_encode_rsd_threshold);
if (FindConstraint(
constraints,

View File

@ -314,6 +314,10 @@ struct VideoOptions {
cpu_overuse_detection.SetFrom(change.cpu_overuse_detection);
cpu_underuse_threshold.SetFrom(change.cpu_underuse_threshold);
cpu_overuse_threshold.SetFrom(change.cpu_overuse_threshold);
cpu_underuse_encode_rsd_threshold.SetFrom(
change.cpu_underuse_encode_rsd_threshold);
cpu_overuse_encode_rsd_threshold.SetFrom(
change.cpu_overuse_encode_rsd_threshold);
cpu_overuse_encode_usage.SetFrom(change.cpu_overuse_encode_usage);
conference_mode.SetFrom(change.conference_mode);
process_adaptation_threshhold.SetFrom(change.process_adaptation_threshhold);
@ -350,6 +354,10 @@ struct VideoOptions {
cpu_overuse_detection == o.cpu_overuse_detection &&
cpu_underuse_threshold == o.cpu_underuse_threshold &&
cpu_overuse_threshold == o.cpu_overuse_threshold &&
cpu_underuse_encode_rsd_threshold ==
o.cpu_underuse_encode_rsd_threshold &&
cpu_overuse_encode_rsd_threshold ==
o.cpu_overuse_encode_rsd_threshold &&
cpu_overuse_encode_usage == o.cpu_overuse_encode_usage &&
conference_mode == o.conference_mode &&
process_adaptation_threshhold == o.process_adaptation_threshhold &&
@ -390,6 +398,10 @@ struct VideoOptions {
ost << ToStringIfSet("cpu overuse detection", cpu_overuse_detection);
ost << ToStringIfSet("cpu underuse threshold", cpu_underuse_threshold);
ost << ToStringIfSet("cpu overuse threshold", cpu_overuse_threshold);
ost << ToStringIfSet("cpu underuse encode rsd threshold",
cpu_underuse_encode_rsd_threshold);
ost << ToStringIfSet("cpu overuse encode rsd threshold",
cpu_overuse_encode_rsd_threshold);
ost << ToStringIfSet("cpu overuse encode usage",
cpu_overuse_encode_usage);
ost << ToStringIfSet("conference mode", conference_mode);
@ -443,10 +455,22 @@ struct VideoOptions {
// adaptation algorithm. So this option will override the
// |adapt_input_to_cpu_usage|.
Settable<bool> cpu_overuse_detection;
// Low threshold for cpu overuse adaptation in ms. (Adapt up)
// Low threshold (t1) for cpu overuse adaptation. (Adapt up)
// Metric: encode usage (m1). m1 < t1 => underuse.
Settable<int> cpu_underuse_threshold;
// High threshold for cpu overuse adaptation in ms. (Adapt down)
// High threshold (t1) for cpu overuse adaptation. (Adapt down)
// Metric: encode usage (m1). m1 > t1 => overuse.
Settable<int> cpu_overuse_threshold;
// Low threshold (t2) for cpu overuse adaptation. (Adapt up)
// Metric: relative standard deviation of encode time (m2).
// Optional threshold. If set, (m1 < t1 && m2 < t2) => underuse.
// Note: t2 will have no effect if t1 is not set.
Settable<int> cpu_underuse_encode_rsd_threshold;
// High threshold (t2) for cpu overuse adaptation. (Adapt down)
// Metric: relative standard deviation of encode time (m2).
// Optional threshold. If set, (m1 > t1 || m2 > t2) => overuse.
// Note: t2 will have no effect if t1 is not set.
Settable<int> cpu_overuse_encode_rsd_threshold;
// Use encode usage for cpu detection.
Settable<bool> cpu_overuse_encode_usage;
// Use conference mode?

View File

@ -886,6 +886,18 @@ static bool GetCpuOveruseOptions(const VideoOptions& options,
// Use method based on encode usage.
overuse_options->low_encode_usage_threshold_percent = underuse_threshold;
overuse_options->high_encode_usage_threshold_percent = overuse_threshold;
#ifdef USE_WEBRTC_DEV_BRANCH
// Set optional thresholds, if configured.
int underuse_rsd_threshold = 0;
if (options.cpu_underuse_encode_rsd_threshold.Get(
&underuse_rsd_threshold)) {
overuse_options->low_encode_time_rsd_threshold = underuse_rsd_threshold;
}
int overuse_rsd_threshold = 0;
if (options.cpu_overuse_encode_rsd_threshold.Get(&overuse_rsd_threshold)) {
overuse_options->high_encode_time_rsd_threshold = overuse_rsd_threshold;
}
#endif
} else {
// Use default method based on capture jitter.
overuse_options->low_capture_jitter_threshold_ms =

View File

@ -1186,6 +1186,11 @@ TEST_F(WebRtcVideoEngineTestFake, SetCpuOveruseOptionsWithEncodeUsageMethod) {
EXPECT_EQ(20, cpu_option.high_encode_usage_threshold_percent);
EXPECT_FALSE(cpu_option.enable_capture_jitter_method);
EXPECT_TRUE(cpu_option.enable_encode_usage_method);
#ifdef USE_WEBRTC_DEV_BRANCH
// Verify that optional encode rsd thresholds are not set.
EXPECT_EQ(-1, cpu_option.low_encode_time_rsd_threshold);
EXPECT_EQ(-1, cpu_option.high_encode_time_rsd_threshold);
#endif
// Add a new send stream and verify that cpu options are set from start.
EXPECT_TRUE(channel_->AddSendStream(cricket::StreamParams::CreateLegacy(3)));
@ -1196,6 +1201,51 @@ TEST_F(WebRtcVideoEngineTestFake, SetCpuOveruseOptionsWithEncodeUsageMethod) {
EXPECT_EQ(20, cpu_option.high_encode_usage_threshold_percent);
EXPECT_FALSE(cpu_option.enable_capture_jitter_method);
EXPECT_TRUE(cpu_option.enable_encode_usage_method);
#ifdef USE_WEBRTC_DEV_BRANCH
// Verify that optional encode rsd thresholds are not set.
EXPECT_EQ(-1, cpu_option.low_encode_time_rsd_threshold);
EXPECT_EQ(-1, cpu_option.high_encode_time_rsd_threshold);
#endif
}
TEST_F(WebRtcVideoEngineTestFake, SetCpuOveruseOptionsWithEncodeRsdThresholds) {
EXPECT_TRUE(SetupEngine());
EXPECT_TRUE(channel_->AddSendStream(cricket::StreamParams::CreateLegacy(1)));
int first_send_channel = vie_.GetLastChannel();
// Set optional encode rsd thresholds and verify cpu options.
cricket::VideoOptions options;
options.conference_mode.Set(true);
options.cpu_underuse_threshold.Set(10);
options.cpu_overuse_threshold.Set(20);
options.cpu_underuse_encode_rsd_threshold.Set(30);
options.cpu_overuse_encode_rsd_threshold.Set(40);
options.cpu_overuse_encode_usage.Set(true);
EXPECT_TRUE(channel_->SetOptions(options));
webrtc::CpuOveruseOptions cpu_option =
vie_.GetCpuOveruseOptions(first_send_channel);
EXPECT_EQ(10, cpu_option.low_encode_usage_threshold_percent);
EXPECT_EQ(20, cpu_option.high_encode_usage_threshold_percent);
EXPECT_FALSE(cpu_option.enable_capture_jitter_method);
EXPECT_TRUE(cpu_option.enable_encode_usage_method);
#ifdef USE_WEBRTC_DEV_BRANCH
EXPECT_EQ(30, cpu_option.low_encode_time_rsd_threshold);
EXPECT_EQ(40, cpu_option.high_encode_time_rsd_threshold);
#endif
// Add a new send stream and verify that cpu options are set from start.
EXPECT_TRUE(channel_->AddSendStream(cricket::StreamParams::CreateLegacy(3)));
int second_send_channel = vie_.GetLastChannel();
EXPECT_NE(first_send_channel, second_send_channel);
cpu_option = vie_.GetCpuOveruseOptions(second_send_channel);
EXPECT_EQ(10, cpu_option.low_encode_usage_threshold_percent);
EXPECT_EQ(20, cpu_option.high_encode_usage_threshold_percent);
EXPECT_FALSE(cpu_option.enable_capture_jitter_method);
EXPECT_TRUE(cpu_option.enable_encode_usage_method);
#ifdef USE_WEBRTC_DEV_BRANCH
EXPECT_EQ(30, cpu_option.low_encode_time_rsd_threshold);
EXPECT_EQ(40, cpu_option.high_encode_time_rsd_threshold);
#endif
}
// Test that AddRecvStream doesn't create new channel for 1:1 call.