(Auto)update libjingle 77263371-> 77296420
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7400 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -281,7 +281,6 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
|
||||
}
|
||||
return set_sending(flag != SEND_NOTHING);
|
||||
}
|
||||
virtual bool SetStartSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetMaxSendBandwidth(int bps) { return true; }
|
||||
virtual bool AddRecvStream(const StreamParams& sp) {
|
||||
if (!RtpHelper<VoiceMediaChannel>::AddRecvStream(sp))
|
||||
@@ -477,7 +476,6 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
||||
: engine_(engine),
|
||||
sent_intra_frame_(false),
|
||||
requested_intra_frame_(false),
|
||||
start_bps_(-1),
|
||||
max_bps_(-1) {}
|
||||
~FakeVideoMediaChannel();
|
||||
|
||||
@@ -489,7 +487,6 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
||||
const std::map<uint32, VideoRenderer*>& renderers() const {
|
||||
return renderers_;
|
||||
}
|
||||
int start_bps() const { return start_bps_; }
|
||||
int max_bps() const { return max_bps_; }
|
||||
bool GetSendStreamFormat(uint32 ssrc, VideoFormat* format) {
|
||||
if (send_formats_.find(ssrc) == send_formats_.end()) {
|
||||
@@ -568,10 +565,6 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
||||
bool HasCapturer(uint32 ssrc) const {
|
||||
return capturers_.find(ssrc) != capturers_.end();
|
||||
}
|
||||
virtual bool SetStartSendBandwidth(int bps) {
|
||||
start_bps_ = bps;
|
||||
return true;
|
||||
}
|
||||
virtual bool SetMaxSendBandwidth(int bps) {
|
||||
max_bps_ = bps;
|
||||
return true;
|
||||
@@ -633,7 +626,6 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
||||
bool sent_intra_frame_;
|
||||
bool requested_intra_frame_;
|
||||
VideoOptions options_;
|
||||
int start_bps_;
|
||||
int max_bps_;
|
||||
};
|
||||
|
||||
@@ -673,7 +665,6 @@ class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {
|
||||
set_playout(receive);
|
||||
return true;
|
||||
}
|
||||
virtual bool SetStartSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetMaxSendBandwidth(int bps) {
|
||||
max_bps_ = bps;
|
||||
return true;
|
||||
|
||||
@@ -241,7 +241,6 @@ class FileVoiceChannel : public VoiceMediaChannel {
|
||||
virtual bool AddRecvStream(const StreamParams& sp) { return true; }
|
||||
virtual bool RemoveRecvStream(uint32 ssrc) { return true; }
|
||||
virtual bool MuteStream(uint32 ssrc, bool on) { return false; }
|
||||
virtual bool SetStartSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetMaxSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetOptions(const AudioOptions& options) {
|
||||
options_ = options;
|
||||
@@ -312,7 +311,6 @@ class FileVideoChannel : public VideoMediaChannel {
|
||||
virtual bool AddRecvStream(const StreamParams& sp) { return true; }
|
||||
virtual bool RemoveRecvStream(uint32 ssrc) { return true; }
|
||||
virtual bool MuteStream(uint32 ssrc, bool on) { return false; }
|
||||
virtual bool SetStartSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetMaxSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetOptions(const VideoOptions& options) {
|
||||
options_ = options;
|
||||
|
||||
@@ -606,8 +606,6 @@ class MediaChannel : public sigslot::has_slots<> {
|
||||
virtual int GetRtpSendTimeExtnId() const {
|
||||
return -1;
|
||||
}
|
||||
// Sets the initial bandwidth to use when sending starts.
|
||||
virtual bool SetStartSendBandwidth(int bps) = 0;
|
||||
// Sets the maximum allowed bandwidth to use when sending data.
|
||||
virtual bool SetMaxSendBandwidth(int bps) = 0;
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ class RtpDataMediaChannel : public DataMediaChannel {
|
||||
timing_ = timing;
|
||||
}
|
||||
|
||||
virtual bool SetStartSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetMaxSendBandwidth(int bps);
|
||||
virtual bool SetRecvRtpHeaderExtensions(
|
||||
const std::vector<RtpHeaderExtension>& extensions) { return true; }
|
||||
|
||||
@@ -1010,7 +1010,6 @@ class VideoMediaChannelTest : public testing::Test,
|
||||
|
||||
// Test that we can set the bandwidth.
|
||||
void SetSendBandwidth() {
|
||||
EXPECT_TRUE(channel_->SetStartSendBandwidth(64 * 1024));
|
||||
EXPECT_TRUE(channel_->SetMaxSendBandwidth(-1)); // <= 0 means unlimited.
|
||||
EXPECT_TRUE(channel_->SetMaxSendBandwidth(128 * 1024));
|
||||
}
|
||||
|
||||
@@ -143,7 +143,6 @@ class LinphoneVoiceChannel : public VoiceMediaChannel {
|
||||
virtual void SetSendSsrc(uint32 id) {} // TODO: change RTP packet?
|
||||
virtual bool SetRtcpCName(const std::string& cname) { return true; }
|
||||
virtual bool Mute(bool on) { return mute_; }
|
||||
virtual bool SetStartSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetMaxSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetOptions(int options) { return true; }
|
||||
virtual bool SetRecvRtpHeaderExtensions(
|
||||
|
||||
@@ -172,7 +172,6 @@ class SctpDataMediaChannel : public DataMediaChannel,
|
||||
// TODO(pthatcher): Cleanup MediaChannel interface, or at least
|
||||
// don't try calling these and return false. Right now, things
|
||||
// don't work if we return false.
|
||||
virtual bool SetStartSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetMaxSendBandwidth(int bps) { return true; }
|
||||
virtual bool SetRecvRtpHeaderExtensions(
|
||||
const std::vector<RtpHeaderExtension>& extensions) { return true; }
|
||||
|
||||
@@ -2904,25 +2904,6 @@ int WebRtcVideoMediaChannel::GetRtpSendTimeExtnId() const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool WebRtcVideoMediaChannel::SetStartSendBandwidth(int bps) {
|
||||
LOG(LS_INFO) << "WebRtcVideoMediaChannel::SetStartSendBandwidth";
|
||||
|
||||
if (!send_codec_) {
|
||||
LOG(LS_INFO) << "The send codec has not been set up yet";
|
||||
return true;
|
||||
}
|
||||
|
||||
// On success, SetSendCodec() will reset |send_start_bitrate_| to |bps/1000|,
|
||||
// by calling SanitizeBitrates. That method will also clamp the
|
||||
// start bitrate between min and max, consistent with the override behavior
|
||||
// in SetMaxSendBandwidth.
|
||||
webrtc::VideoCodec new_codec = *send_codec_;
|
||||
if (BitrateIsSet(bps)) {
|
||||
new_codec.startBitrate = bps / 1000;
|
||||
}
|
||||
return SetSendCodec(new_codec);
|
||||
}
|
||||
|
||||
bool WebRtcVideoMediaChannel::SetMaxSendBandwidth(int bps) {
|
||||
LOG(LS_INFO) << "WebRtcVideoMediaChannel::SetMaxSendBandwidth";
|
||||
|
||||
|
||||
@@ -278,7 +278,6 @@ class WebRtcVideoMediaChannel : public rtc::MessageHandler,
|
||||
virtual bool SetSendRtpHeaderExtensions(
|
||||
const std::vector<RtpHeaderExtension>& extensions);
|
||||
virtual int GetRtpSendTimeExtnId() const;
|
||||
virtual bool SetStartSendBandwidth(int bps);
|
||||
virtual bool SetMaxSendBandwidth(int bps);
|
||||
virtual bool SetOptions(const VideoOptions &options);
|
||||
virtual bool GetOptions(VideoOptions *options) const {
|
||||
|
||||
@@ -1230,12 +1230,6 @@ bool WebRtcVideoChannel2::SetSendRtpHeaderExtensions(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WebRtcVideoChannel2::SetStartSendBandwidth(int bps) {
|
||||
// TODO(pbos): Implement.
|
||||
LOG(LS_VERBOSE) << "SetStartSendBandwidth: " << bps;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WebRtcVideoChannel2::SetMaxSendBandwidth(int bps) {
|
||||
// TODO(pbos): Implement.
|
||||
LOG(LS_VERBOSE) << "SetMaxSendBandwidth: " << bps;
|
||||
|
||||
@@ -259,7 +259,6 @@ class WebRtcVideoChannel2 : public rtc::MessageHandler,
|
||||
const std::vector<RtpHeaderExtension>& extensions) OVERRIDE;
|
||||
virtual bool SetSendRtpHeaderExtensions(
|
||||
const std::vector<RtpHeaderExtension>& extensions) OVERRIDE;
|
||||
virtual bool SetStartSendBandwidth(int bps) OVERRIDE;
|
||||
virtual bool SetMaxSendBandwidth(int bps) OVERRIDE;
|
||||
virtual bool SetOptions(const VideoOptions& options) OVERRIDE;
|
||||
virtual bool GetOptions(VideoOptions* options) const OVERRIDE {
|
||||
|
||||
@@ -1488,44 +1488,24 @@ TEST_F(WebRtcVideoEngineTestFake, SetMaxBandwidthBelowMin) {
|
||||
max_bandwidth_kbps, max_bandwidth_kbps, max_bandwidth_kbps);
|
||||
}
|
||||
|
||||
// Test that the start bandwidth can be controlled separately from the max
|
||||
// bandwidth.
|
||||
TEST_F(WebRtcVideoEngineTestFake, SetStartBandwidth) {
|
||||
EXPECT_TRUE(SetupEngine());
|
||||
int channel_num = vie_.GetLastChannel();
|
||||
EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
|
||||
int start_bandwidth_kbps = kStartBandwidthKbps + 1;
|
||||
EXPECT_TRUE(channel_->SetStartSendBandwidth(start_bandwidth_kbps * 1000));
|
||||
VerifyVP8SendCodec(channel_num, kVP8Codec.width, kVP8Codec.height, 0,
|
||||
kMaxBandwidthKbps, kMinBandwidthKbps, start_bandwidth_kbps);
|
||||
|
||||
// Check that SetMaxSendBandwidth doesn't overwrite the start bandwidth.
|
||||
int max_bandwidth_kbps = kMaxBandwidthKbps + 1;
|
||||
EXPECT_TRUE(channel_->SetMaxSendBandwidth(max_bandwidth_kbps * 1000));
|
||||
VerifyVP8SendCodec(channel_num, kVP8Codec.width, kVP8Codec.height, 0,
|
||||
max_bandwidth_kbps, kMinBandwidthKbps, start_bandwidth_kbps);
|
||||
}
|
||||
|
||||
// Test that the start bandwidth can be controlled by experiment.
|
||||
// Test that the start bandwidth can be controlled by VideoOptions.
|
||||
TEST_F(WebRtcVideoEngineTestFake, SetStartBandwidthOption) {
|
||||
EXPECT_TRUE(SetupEngine());
|
||||
int channel_num = vie_.GetLastChannel();
|
||||
EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
|
||||
int start_bandwidth_kbps = kStartBandwidthKbps;
|
||||
EXPECT_TRUE(channel_->SetStartSendBandwidth(start_bandwidth_kbps * 1000));
|
||||
VerifyVP8SendCodec(channel_num, kVP8Codec.width, kVP8Codec.height, 0,
|
||||
kMaxBandwidthKbps, kMinBandwidthKbps, start_bandwidth_kbps);
|
||||
kMaxBandwidthKbps, kMinBandwidthKbps, kStartBandwidthKbps);
|
||||
|
||||
// Set the start bitrate option.
|
||||
start_bandwidth_kbps = 1000;
|
||||
int kBoostedStartBandwidthKbps = 1000;
|
||||
ASSERT_NE(kStartBandwidthKbps, kBoostedStartBandwidthKbps);
|
||||
cricket::VideoOptions options;
|
||||
options.video_start_bitrate.Set(
|
||||
start_bandwidth_kbps);
|
||||
options.video_start_bitrate.Set(kBoostedStartBandwidthKbps);
|
||||
EXPECT_TRUE(channel_->SetOptions(options));
|
||||
|
||||
// Check that start bitrate has changed to the new value.
|
||||
VerifyVP8SendCodec(channel_num, kVP8Codec.width, kVP8Codec.height, 0,
|
||||
kMaxBandwidthKbps, kMinBandwidthKbps, start_bandwidth_kbps);
|
||||
kMaxBandwidthKbps, kMinBandwidthKbps, kBoostedStartBandwidthKbps);
|
||||
}
|
||||
|
||||
// Test that SetMaxSendBandwidth works as expected in conference mode.
|
||||
|
||||
@@ -3206,12 +3206,6 @@ bool WebRtcVoiceMediaChannel::MuteStream(uint32 ssrc, bool muted) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WebRtcVoiceMediaChannel::SetStartSendBandwidth(int bps) {
|
||||
// TODO(andresp): Add support for setting an independent start bandwidth when
|
||||
// bandwidth estimation is enabled for voice engine.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WebRtcVoiceMediaChannel::SetMaxSendBandwidth(int bps) {
|
||||
LOG(LS_INFO) << "WebRtcVoiceMediaChanne::SetSendBandwidth.";
|
||||
|
||||
|
||||
@@ -374,7 +374,6 @@ class WebRtcVoiceMediaChannel
|
||||
const rtc::PacketTime& packet_time);
|
||||
virtual void OnReadyToSend(bool ready) {}
|
||||
virtual bool MuteStream(uint32 ssrc, bool on);
|
||||
virtual bool SetStartSendBandwidth(int bps);
|
||||
virtual bool SetMaxSendBandwidth(int bps);
|
||||
virtual bool GetStats(VoiceMediaInfo* info);
|
||||
// Gets last reported error from WebRtc voice engine. This should be only
|
||||
|
||||
Reference in New Issue
Block a user