Index: webrtc/media/base/fakemediaengine.h |
diff --git a/webrtc/media/base/fakemediaengine.h b/webrtc/media/base/fakemediaengine.h |
index cc65aabcd59700ebbdd2f7a4b5a81e39a637dc43..9cd4d2134549723022f3d69ba8a1c1f27f470e24 100644 |
--- a/webrtc/media/base/fakemediaengine.h |
+++ b/webrtc/media/base/fakemediaengine.h |
@@ -52,8 +52,9 @@ class FakeVoiceEngine; |
// A common helper class that handles sending and receiving RTP/RTCP packets. |
template <class Base> class RtpHelper : public Base { |
public: |
- RtpHelper() |
- : sending_(false), |
+ RtpHelper(const MediaChannelOptions& options) |
+ : Base(options), |
+ sending_(false), |
playout_(false), |
fail_set_send_codecs_(false), |
fail_set_recv_codecs_(false), |
@@ -239,13 +240,21 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> { |
int duration; |
}; |
explicit FakeVoiceMediaChannel(FakeVoiceEngine* engine, |
- const AudioOptions& options) |
- : engine_(engine), |
+ const MediaChannelOptions& options, |
+ const AudioOptions& audio_options) |
+ : RtpHelper<VoiceMediaChannel>(options), |
+ engine_(engine), |
time_since_last_typing_(-1) { |
output_scalings_[0] = 1.0; // For default channel. |
- SetOptions(options); |
+ SetOptions(audio_options); |
} |
~FakeVoiceMediaChannel(); |
+ // TODO(nisse): Move to the VoiceMediaChannel base class? Currently |
+ // duplicated in WebRtcVoiceMediaChannel. |
+ rtc::DiffServCodePoint MediaTypeDscpValue() const override { |
+ return rtc::DSCP_EF; |
+ } |
+ |
const std::vector<AudioCodec>& recv_codecs() const { return recv_codecs_; } |
const std::vector<AudioCodec>& send_codecs() const { return send_codecs_; } |
const std::vector<AudioCodec>& codecs() const { return send_codecs(); } |
@@ -440,13 +449,20 @@ inline bool CompareDtmfInfo(const FakeVoiceMediaChannel::DtmfInfo& info, |
class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> { |
public: |
explicit FakeVideoMediaChannel(FakeVideoEngine* engine, |
- const VideoOptions& options) |
- : engine_(engine), max_bps_(-1) { |
- SetOptions(options); |
+ const MediaChannelOptions& options, |
+ const VideoOptions& video_options) |
+ : RtpHelper<VideoMediaChannel>(options), |
+ engine_(engine), |
+ max_bps_(-1) { |
+ SetOptions(video_options); |
} |
~FakeVideoMediaChannel(); |
- |
+ // TODO(nisse): Move to the VideoMediaChannel base class? Currently |
+ // duplicated in WebRtcVideoChannel2. |
+ rtc::DiffServCodePoint MediaTypeDscpValue() const override { |
+ return rtc::DSCP_AF41; |
+ } |
const std::vector<VideoCodec>& recv_codecs() const { return recv_codecs_; } |
const std::vector<VideoCodec>& send_codecs() const { return send_codecs_; } |
const std::vector<VideoCodec>& codecs() const { return send_codecs(); } |
@@ -564,8 +580,11 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> { |
class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> { |
public: |
- explicit FakeDataMediaChannel(void* unused, const DataOptions& options) |
- : send_blocked_(false), max_bps_(-1) {} |
+ explicit FakeDataMediaChannel(void* unused, |
+ const MediaChannelOptions& options, |
+ const DataOptions& data_options) |
+ : RtpHelper<DataMediaChannel>(options), |
+ send_blocked_(false), max_bps_(-1) {} |
~FakeDataMediaChannel() {} |
const std::vector<DataCodec>& recv_codecs() const { return recv_codecs_; } |
const std::vector<DataCodec>& send_codecs() const { return send_codecs_; } |
@@ -682,12 +701,14 @@ class FakeVoiceEngine : public FakeBaseEngine { |
} |
VoiceMediaChannel* CreateChannel(webrtc::Call* call, |
- const AudioOptions& options) { |
+ const MediaChannelOptions& options, |
+ const AudioOptions& audio_options) { |
if (fail_create_channel_) { |
return nullptr; |
} |
- FakeVoiceMediaChannel* ch = new FakeVoiceMediaChannel(this, options); |
+ FakeVoiceMediaChannel* ch = |
+ new FakeVoiceMediaChannel(this, options, audio_options); |
channels_.push_back(ch); |
return ch; |
} |
@@ -745,12 +766,14 @@ class FakeVideoEngine : public FakeBaseEngine { |
} |
VideoMediaChannel* CreateChannel(webrtc::Call* call, |
- const VideoOptions& options) { |
+ const MediaChannelOptions& options, |
+ const VideoOptions& video_options) { |
if (fail_create_channel_) { |
return NULL; |
} |
- FakeVideoMediaChannel* ch = new FakeVideoMediaChannel(this, options); |
+ FakeVideoMediaChannel* ch = |
+ new FakeVideoMediaChannel(this, options, video_options); |
channels_.push_back(ch); |
return ch; |
} |
@@ -860,7 +883,8 @@ class FakeDataEngine : public DataEngineInterface { |
virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type) { |
last_channel_type_ = data_channel_type; |
- FakeDataMediaChannel* ch = new FakeDataMediaChannel(this, DataOptions()); |
+ FakeDataMediaChannel* ch = |
+ new FakeDataMediaChannel(this, MediaChannelOptions(), DataOptions()); |
channels_.push_back(ch); |
return ch; |
} |