| Index: webrtc/media/base/fakemediaengine.h
|
| diff --git a/webrtc/media/base/fakemediaengine.h b/webrtc/media/base/fakemediaengine.h
|
| index 7f9561d25e319e4e26b4abb0c261e3d686f1d69f..a526ee84d8f472796c2096fc7d5f439e7547314e 100644
|
| --- a/webrtc/media/base/fakemediaengine.h
|
| +++ b/webrtc/media/base/fakemediaengine.h
|
| @@ -250,7 +250,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
|
| };
|
| explicit FakeVoiceMediaChannel(FakeVoiceEngine* engine,
|
| const AudioOptions& options)
|
| - : engine_(engine), time_since_last_typing_(-1), max_bps_(-1) {
|
| + : engine_(engine), time_since_last_typing_(-1) {
|
| output_scalings_[0] = 1.0; // For default channel.
|
| SetOptions(options);
|
| }
|
| @@ -262,11 +262,11 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
|
| return dtmf_info_queue_;
|
| }
|
| const AudioOptions& options() const { return options_; }
|
| - int max_bps() const { return max_bps_; }
|
| + rtc::Optional<int> max_bps() const { return max_bps_; }
|
| virtual bool SetSendParameters(const AudioSendParameters& params) {
|
| return (SetSendCodecs(params.codecs) &&
|
| SetSendRtpHeaderExtensions(params.extensions) &&
|
| - SetMaxSendBandwidth(params.max_bandwidth_bps) &&
|
| + SetMaxSendBitrate(params.max_bitrate_bps) &&
|
| SetOptions(params.options));
|
| }
|
|
|
| @@ -400,7 +400,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
|
| send_codecs_ = codecs;
|
| return true;
|
| }
|
| - bool SetMaxSendBandwidth(int bps) {
|
| + bool SetMaxSendBitrate(rtc::Optional<int> bps) {
|
| max_bps_ = bps;
|
| return true;
|
| }
|
| @@ -436,7 +436,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
|
| AudioOptions options_;
|
| std::map<uint32_t, VoiceChannelAudioSink*> local_sinks_;
|
| std::unique_ptr<webrtc::AudioSinkInterface> sink_;
|
| - int max_bps_;
|
| + rtc::Optional<int> max_bps_;
|
| };
|
|
|
| // A helper function to compare the FakeVoiceMediaChannel::DtmfInfo.
|
| @@ -452,7 +452,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
| public:
|
| explicit FakeVideoMediaChannel(FakeVideoEngine* engine,
|
| const VideoOptions& options)
|
| - : engine_(engine), max_bps_(-1) {
|
| + : engine_(engine) {
|
| SetOptions(options);
|
| }
|
|
|
| @@ -467,11 +467,11 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
| const {
|
| return sinks_;
|
| }
|
| - int max_bps() const { return max_bps_; }
|
| + rtc::Optional<int> max_bps() const { return max_bps_; }
|
| virtual bool SetSendParameters(const VideoSendParameters& params) {
|
| return (SetSendCodecs(params.codecs) &&
|
| SetSendRtpHeaderExtensions(params.extensions) &&
|
| - SetMaxSendBandwidth(params.max_bandwidth_bps));
|
| + SetMaxSendBitrate(params.max_bitrate_bps));
|
| }
|
| virtual bool SetRecvParameters(const VideoRecvParameters& params) {
|
| return (SetRecvCodecs(params.codecs) &&
|
| @@ -557,7 +557,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
| options_ = options;
|
| return true;
|
| }
|
| - bool SetMaxSendBandwidth(int bps) {
|
| + bool SetMaxSendBitrate(rtc::Optional<int> bps) {
|
| max_bps_ = bps;
|
| return true;
|
| }
|
| @@ -568,7 +568,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
| std::map<uint32_t, rtc::VideoSinkInterface<VideoFrame>*> sinks_;
|
| std::map<uint32_t, VideoCapturer*> capturers_;
|
| VideoOptions options_;
|
| - int max_bps_;
|
| + rtc::Optional<int> max_bps_;
|
| };
|
|
|
| // Dummy option class, needed for the DataTraits abstraction in
|
| @@ -578,16 +578,16 @@ class DataOptions {};
|
| class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {
|
| public:
|
| explicit FakeDataMediaChannel(void* unused, const DataOptions& options)
|
| - : send_blocked_(false), max_bps_(-1) {}
|
| + : send_blocked_(false) {}
|
| ~FakeDataMediaChannel() {}
|
| const std::vector<DataCodec>& recv_codecs() const { return recv_codecs_; }
|
| const std::vector<DataCodec>& send_codecs() const { return send_codecs_; }
|
| const std::vector<DataCodec>& codecs() const { return send_codecs(); }
|
| - int max_bps() const { return max_bps_; }
|
| + rtc::Optional<int> max_bps() const { return max_bps_; }
|
|
|
| virtual bool SetSendParameters(const DataSendParameters& params) {
|
| return (SetSendCodecs(params.codecs) &&
|
| - SetMaxSendBandwidth(params.max_bandwidth_bps));
|
| + SetMaxSendBitrate(params.max_bitrate_bps));
|
| }
|
| virtual bool SetRecvParameters(const DataRecvParameters& params) {
|
| return SetRecvCodecs(params.codecs);
|
| @@ -643,7 +643,7 @@ class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {
|
| send_codecs_ = codecs;
|
| return true;
|
| }
|
| - bool SetMaxSendBandwidth(int bps) {
|
| + bool SetMaxSendBitrate(rtc::Optional<int> bps) {
|
| max_bps_ = bps;
|
| return true;
|
| }
|
| @@ -653,7 +653,7 @@ class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {
|
| SendDataParams last_sent_data_params_;
|
| std::string last_sent_data_;
|
| bool send_blocked_;
|
| - int max_bps_;
|
| + rtc::Optional<int> max_bps_;
|
| };
|
|
|
| // A base class for all of the shared parts between FakeVoiceEngine
|
|
|