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

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

Issue 1788583004: Enable setting the maximum bitrate limit in RtpSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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
Index: webrtc/media/base/fakemediaengine.h
diff --git a/webrtc/media/base/fakemediaengine.h b/webrtc/media/base/fakemediaengine.h
index afd262bb5e92263951cc85e7be3256e5d867801c..78530ed919f61b5c022e4f4223e1086e7b3da550 100644
--- a/webrtc/media/base/fakemediaengine.h
+++ b/webrtc/media/base/fakemediaengine.h
@@ -225,7 +225,9 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
explicit FakeVoiceMediaChannel(FakeVoiceEngine* engine,
const AudioOptions& options)
: engine_(engine),
- time_since_last_typing_(-1) {
+ time_since_last_typing_(-1),
+ max_bps_(-1),
+ rtp_parameters_(webrtc::RTCRtpParameters::CreateDefault()) {
pthatcher1 2016/03/12 01:21:03 It seems like building a one-encoding parameters s
Taylor Brandstetter 2016/03/12 01:57:06 To answer the question: If you call GetParameters
output_scalings_[0] = 1.0; // For default channel.
SetOptions(options);
}
@@ -237,7 +239,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
return dtmf_info_queue_;
}
const AudioOptions& options() const { return options_; }
-
+ int max_bps() const { return max_bps_; }
virtual bool SetSendParameters(const AudioSendParameters& params) {
return (SetSendCodecs(params.codecs) &&
SetSendRtpHeaderExtensions(params.extensions) &&
@@ -249,6 +251,16 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
return (SetRecvCodecs(params.codecs) &&
SetRecvRtpHeaderExtensions(params.extensions));
}
+
+ virtual webrtc::RTCRtpParameters GetRtpParameters(uint32_t ssrc) {
+ return rtp_parameters_;
+ }
+ virtual bool SetRtpParameters(uint32_t ssrc,
+ const webrtc::RTCRtpParameters& parameters) {
+ rtp_parameters_ = parameters;
Taylor Brandstetter 2016/03/12 01:57:06 I know this is just a stub class, but for consiste
skvlad 2016/03/15 21:18:18 Done.
+ return true;
+ }
+
virtual bool SetPlayout(bool playout) {
set_playout(playout);
return true;
@@ -377,7 +389,10 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
send_codecs_ = codecs;
return true;
}
- bool SetMaxSendBandwidth(int bps) { return true; }
+ bool SetMaxSendBandwidth(int bps) {
+ max_bps_ = bps;
+ return true;
+ }
bool SetOptions(const AudioOptions& options) {
// Does a "merge" of current options and set options.
options_.SetAll(options);
@@ -410,6 +425,8 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
AudioOptions options_;
std::map<uint32_t, VoiceChannelAudioSink*> local_renderers_;
std::unique_ptr<webrtc::AudioSinkInterface> sink_;
+ int max_bps_;
+ webrtc::RTCRtpParameters rtp_parameters_;
};
// A helper function to compare the FakeVoiceMediaChannel::DtmfInfo.
@@ -425,7 +442,9 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
public:
explicit FakeVideoMediaChannel(FakeVideoEngine* engine,
const VideoOptions& options)
- : engine_(engine), max_bps_(-1) {
+ : engine_(engine),
+ max_bps_(-1),
+ rtp_parameters_(webrtc::RTCRtpParameters::CreateDefault()) {
SetOptions(options);
}
@@ -448,6 +467,14 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
SetOptions(params.options));
}
+ virtual webrtc::RTCRtpParameters GetRtpParameters(uint32_t ssrc) {
+ return rtp_parameters_;
+ }
+ virtual bool SetRtpParameters(uint32_t ssrc,
+ const webrtc::RTCRtpParameters& parameters) {
+ rtp_parameters_ = parameters;
+ return true;
+ }
virtual bool SetRecvParameters(const VideoRecvParameters& params) {
return (SetRecvCodecs(params.codecs) &&
SetRecvRtpHeaderExtensions(params.extensions));
@@ -544,6 +571,7 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
std::map<uint32_t, VideoCapturer*> capturers_;
VideoOptions options_;
int max_bps_;
+ webrtc::RTCRtpParameters rtp_parameters_;
};
class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {

Powered by Google App Engine
This is Rietveld 408576698