Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Unified Diff: webrtc/media/base/fakemediaengine.h

Issue 1813763005: Updated structures and functions for setting the max bitrate limit to take rtc::Optional<int> Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Code review feedback Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/fakemediaengine.h
diff --git a/webrtc/media/base/fakemediaengine.h b/webrtc/media/base/fakemediaengine.h
index 6feaf8e989f7e3e1569cfb060c816a6d651ba309..4223c85fc68d11e3b4af4e1de3f13bf32d0c454c 100644
--- a/webrtc/media/base/fakemediaengine.h
+++ b/webrtc/media/base/fakemediaengine.h
@@ -264,7 +264,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);
}
@@ -276,11 +276,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));
}
@@ -414,7 +414,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;
}
@@ -450,7 +450,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.
@@ -466,7 +466,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
public:
explicit FakeVideoMediaChannel(FakeVideoEngine* engine,
const VideoOptions& options)
- : engine_(engine), max_bps_(-1) {
+ : engine_(engine) {
SetOptions(options);
}
@@ -481,11 +481,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) &&
@@ -571,7 +571,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;
}
@@ -582,7 +582,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
@@ -592,16 +592,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);
@@ -657,7 +657,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;
}
@@ -667,7 +667,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
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698