summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbos@webrtc.org <pbos@webrtc.org>2014-10-14 11:52:10 +0000
committerpbos@webrtc.org <pbos@webrtc.org>2014-10-14 11:52:10 +0000
commit7da30673d742075b52c63bb96b78f2c35cc93991 (patch)
tree57a5d517e374b216e1fbc0823daa7979c483c695
parent88085a10af23f94c2014653a28993a0ee2f510f5 (diff)
downloadwebrtc-7da30673d742075b52c63bb96b78f2c35cc93991.tar.gz
Remove -1 from Call::Config::start_bitrate_bps.
Instead initialize it to a good default value. The code does the same, but we don't have to check explicitly for -1. R=mflodman@webrtc.org BUG= Review URL: https://webrtc-codereview.appspot.com/23989004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@7445 4adac7df-926f-26a2-2b94-8c16560cd09d
-rw-r--r--call.h13
-rw-r--r--video/call.cc23
-rw-r--r--video/loopback.cc2
-rw-r--r--video/rampup_tests.cc2
4 files changed, 21 insertions, 19 deletions
diff --git a/call.h b/call.h
index 43ce4c18..f21425fb 100644
--- a/call.h
+++ b/call.h
@@ -66,7 +66,9 @@ class Call {
send_transport(send_transport),
voice_engine(NULL),
overuse_callback(NULL),
- start_bitrate_bps(-1) {}
+ stream_start_bitrate_bps(kDefaultStartBitrateBps) {}
+
+ static const int kDefaultStartBitrateBps;
webrtc::Config* webrtc_config;
@@ -79,10 +81,11 @@ class Call {
// captured frames. 'NULL' disables the callback.
LoadObserver* overuse_callback;
- // Start bitrate used before a valid bitrate estimate is calculated. '-1'
- // lets the call decide start bitrate.
- // Note: This currently only affects video.
- int start_bitrate_bps;
+ // Start bitrate used before a valid bitrate estimate is calculated.
+ // Note: This is currently set only for video and is per-stream rather of
+ // for the entire link.
+ // TODO(pbos): Set start bitrate for entire Call.
+ int stream_start_bitrate_bps;
};
static Call* Create(const Call::Config& config);
diff --git a/video/call.cc b/video/call.cc
index 3ca56b6d..38c3faa8 100644
--- a/video/call.cc
+++ b/video/call.cc
@@ -54,6 +54,8 @@ VideoEncoder* VideoEncoder::Create(VideoEncoder::EncoderType codec_type) {
return NULL;
}
+const int Call::Config::kDefaultStartBitrateBps = 300000;
+
namespace internal {
class CpuOveruseObserverProxy : public webrtc::CpuOveruseObserver {
@@ -153,8 +155,6 @@ Call* Call::Create(const Call::Config& config) {
namespace internal {
-const int kDefaultVideoStreamBitrateBps = 300000;
-
Call::Call(webrtc::VideoEngine* video_engine, const Call::Config& config)
: config_(config),
network_enabled_crit_(CriticalSectionWrapper::CreateCriticalSection()),
@@ -203,16 +203,15 @@ VideoSendStream* Call::CreateVideoSendStream(
// TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if
// the call has already started.
- VideoSendStream* send_stream = new VideoSendStream(
- config_.send_transport,
- overuse_observer_proxy_.get(),
- video_engine_,
- config,
- encoder_config,
- suspended_send_ssrcs_,
- base_channel_id_,
- config_.start_bitrate_bps != -1 ? config_.start_bitrate_bps
- : kDefaultVideoStreamBitrateBps);
+ VideoSendStream* send_stream =
+ new VideoSendStream(config_.send_transport,
+ overuse_observer_proxy_.get(),
+ video_engine_,
+ config,
+ encoder_config,
+ suspended_send_ssrcs_,
+ base_channel_id_,
+ config_.stream_start_bitrate_bps);
// This needs to be taken before send_crit_ as both locks need to be held
// while changing network state.
diff --git a/video/loopback.cc b/video/loopback.cc
index 488adf41..ffc5bcc5 100644
--- a/video/loopback.cc
+++ b/video/loopback.cc
@@ -104,7 +104,7 @@ void Loopback() {
pipe_config.delay_standard_deviation_ms = flags::StdPropagationDelayMs();
test::DirectTransport transport(pipe_config);
Call::Config call_config(&transport);
- call_config.start_bitrate_bps =
+ call_config.stream_start_bitrate_bps =
static_cast<int>(flags::StartBitrate()) * 1000;
scoped_ptr<Call> call(Call::Create(call_config));
diff --git a/video/rampup_tests.cc b/video/rampup_tests.cc
index 10bcb7f1..96a22763 100644
--- a/video/rampup_tests.cc
+++ b/video/rampup_tests.cc
@@ -402,7 +402,7 @@ void RampUpTest::RunRampUpTest(bool rtx,
Call::Config call_config(&stream_observer);
if (start_bitrate_bps != 0) {
- call_config.start_bitrate_bps = start_bitrate_bps;
+ call_config.stream_start_bitrate_bps = start_bitrate_bps;
stream_observer.set_start_bitrate_bps(start_bitrate_bps);
}