Removes FakeBaseEngine.
This CL removes FakeBaseEngine and the currently not used functionality of FakeMediaEngine that depends on it. Bug: webrtc:9883 Change-Id: I9daa853dedefdf4b4c64b815a7d575eb8ba63c93 Reviewed-on: https://webrtc-review.googlesource.com/c/107581 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25316}
This commit is contained in:
parent
362cb50f92
commit
7e6b528e5d
@ -450,32 +450,13 @@ bool FakeDataMediaChannel::SetMaxSendBandwidth(int bps) {
|
||||
return true;
|
||||
}
|
||||
|
||||
FakeBaseEngine::FakeBaseEngine()
|
||||
: options_changed_(false), fail_create_channel_(false) {}
|
||||
void FakeBaseEngine::set_fail_create_channel(bool fail) {
|
||||
fail_create_channel_ = fail;
|
||||
}
|
||||
void FakeBaseEngine::set_rtp_header_extensions(
|
||||
const std::vector<webrtc::RtpExtension>& extensions) {
|
||||
capabilities_.header_extensions = extensions;
|
||||
}
|
||||
void FakeBaseEngine::set_rtp_header_extensions(
|
||||
const std::vector<RtpHeaderExtension>& extensions) {
|
||||
for (const cricket::RtpHeaderExtension& ext : extensions) {
|
||||
RtpExtension webrtc_ext;
|
||||
webrtc_ext.uri = ext.uri;
|
||||
webrtc_ext.id = ext.id;
|
||||
capabilities_.header_extensions.push_back(webrtc_ext);
|
||||
}
|
||||
}
|
||||
|
||||
FakeVoiceEngine::FakeVoiceEngine() {
|
||||
FakeVoiceEngine::FakeVoiceEngine() : fail_create_channel_(false) {
|
||||
// Add a fake audio codec. Note that the name must not be "" as there are
|
||||
// sanity checks against that.
|
||||
codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1));
|
||||
}
|
||||
RtpCapabilities FakeVoiceEngine::GetCapabilities() const {
|
||||
return capabilities_;
|
||||
return RtpCapabilities();
|
||||
}
|
||||
void FakeVoiceEngine::Init() {}
|
||||
rtc::scoped_refptr<webrtc::AudioState> FakeVoiceEngine::GetAudioState() const {
|
||||
@ -523,17 +504,17 @@ bool FakeVoiceEngine::StartRtcEventLog(rtc::PlatformFile file,
|
||||
}
|
||||
void FakeVoiceEngine::StopRtcEventLog() {}
|
||||
|
||||
FakeVideoEngine::FakeVideoEngine() : capture_(false) {
|
||||
FakeVideoEngine::FakeVideoEngine()
|
||||
: capture_(false), fail_create_channel_(false) {
|
||||
// Add a fake video codec. Note that the name must not be "" as there are
|
||||
// sanity checks against that.
|
||||
codecs_.push_back(VideoCodec(0, "fake_video_codec"));
|
||||
}
|
||||
RtpCapabilities FakeVideoEngine::GetCapabilities() const {
|
||||
return capabilities_;
|
||||
return RtpCapabilities();
|
||||
}
|
||||
bool FakeVideoEngine::SetOptions(const VideoOptions& options) {
|
||||
options_ = options;
|
||||
options_changed_ = true;
|
||||
return true;
|
||||
}
|
||||
VideoMediaChannel* FakeVideoEngine::CreateChannel(
|
||||
@ -580,22 +561,7 @@ void FakeMediaEngine::SetAudioCodecs(const std::vector<AudioCodec>& codecs) {
|
||||
void FakeMediaEngine::SetVideoCodecs(const std::vector<VideoCodec>& codecs) {
|
||||
video_->SetCodecs(codecs);
|
||||
}
|
||||
void FakeMediaEngine::SetAudioRtpHeaderExtensions(
|
||||
const std::vector<webrtc::RtpExtension>& extensions) {
|
||||
voice_->set_rtp_header_extensions(extensions);
|
||||
}
|
||||
void FakeMediaEngine::SetVideoRtpHeaderExtensions(
|
||||
const std::vector<webrtc::RtpExtension>& extensions) {
|
||||
video_->set_rtp_header_extensions(extensions);
|
||||
}
|
||||
void FakeMediaEngine::SetAudioRtpHeaderExtensions(
|
||||
const std::vector<RtpHeaderExtension>& extensions) {
|
||||
voice_->set_rtp_header_extensions(extensions);
|
||||
}
|
||||
void FakeMediaEngine::SetVideoRtpHeaderExtensions(
|
||||
const std::vector<RtpHeaderExtension>& extensions) {
|
||||
video_->set_rtp_header_extensions(extensions);
|
||||
}
|
||||
|
||||
FakeVoiceMediaChannel* FakeMediaEngine::GetVoiceChannel(size_t index) {
|
||||
return voice_->GetChannel(index);
|
||||
}
|
||||
@ -603,18 +569,9 @@ FakeVideoMediaChannel* FakeMediaEngine::GetVideoChannel(size_t index) {
|
||||
return video_->GetChannel(index);
|
||||
}
|
||||
|
||||
bool FakeMediaEngine::capture() const {
|
||||
return video_->capture_;
|
||||
}
|
||||
bool FakeMediaEngine::options_changed() const {
|
||||
return video_->options_changed_;
|
||||
}
|
||||
void FakeMediaEngine::clear_options_changed() {
|
||||
video_->options_changed_ = false;
|
||||
}
|
||||
void FakeMediaEngine::set_fail_create_channel(bool fail) {
|
||||
voice_->set_fail_create_channel(fail);
|
||||
video_->set_fail_create_channel(fail);
|
||||
voice_->fail_create_channel_ = fail;
|
||||
video_->fail_create_channel_ = fail;
|
||||
}
|
||||
|
||||
DataMediaChannel* FakeDataEngine::CreateChannel(const MediaConfig& config) {
|
||||
|
||||
@ -488,26 +488,7 @@ class FakeDataMediaChannel : public RtpHelper<DataMediaChannel> {
|
||||
int max_bps_;
|
||||
};
|
||||
|
||||
// A base class for all of the shared parts between FakeVoiceEngine
|
||||
// and FakeVideoEngine.
|
||||
class FakeBaseEngine {
|
||||
public:
|
||||
FakeBaseEngine();
|
||||
void set_fail_create_channel(bool fail);
|
||||
void set_rtp_header_extensions(const std::vector<RtpExtension>& extensions);
|
||||
void set_rtp_header_extensions(
|
||||
const std::vector<cricket::RtpHeaderExtension>& extensions);
|
||||
|
||||
protected:
|
||||
// Flag used by optionsmessagehandler_unittest for checking whether any
|
||||
// relevant setting has been updated.
|
||||
// TODO(thaloun): Replace with explicit checks of before & after values.
|
||||
bool options_changed_;
|
||||
bool fail_create_channel_;
|
||||
RtpCapabilities capabilities_;
|
||||
};
|
||||
|
||||
class FakeVoiceEngine : public FakeBaseEngine {
|
||||
class FakeVoiceEngine {
|
||||
public:
|
||||
FakeVoiceEngine();
|
||||
RtpCapabilities GetCapabilities() const;
|
||||
@ -535,11 +516,12 @@ class FakeVoiceEngine : public FakeBaseEngine {
|
||||
private:
|
||||
std::vector<FakeVoiceMediaChannel*> channels_;
|
||||
std::vector<AudioCodec> codecs_;
|
||||
bool fail_create_channel_;
|
||||
|
||||
friend class FakeMediaEngine;
|
||||
};
|
||||
|
||||
class FakeVideoEngine : public FakeBaseEngine {
|
||||
class FakeVideoEngine {
|
||||
public:
|
||||
FakeVideoEngine();
|
||||
RtpCapabilities GetCapabilities() const;
|
||||
@ -559,6 +541,7 @@ class FakeVideoEngine : public FakeBaseEngine {
|
||||
std::vector<VideoCodec> codecs_;
|
||||
bool capture_;
|
||||
VideoOptions options_;
|
||||
bool fail_create_channel_;
|
||||
|
||||
friend class FakeMediaEngine;
|
||||
};
|
||||
@ -573,20 +556,9 @@ class FakeMediaEngine
|
||||
void SetAudioCodecs(const std::vector<AudioCodec>& codecs);
|
||||
void SetVideoCodecs(const std::vector<VideoCodec>& codecs);
|
||||
|
||||
void SetAudioRtpHeaderExtensions(const std::vector<RtpExtension>& extensions);
|
||||
void SetVideoRtpHeaderExtensions(const std::vector<RtpExtension>& extensions);
|
||||
|
||||
void SetAudioRtpHeaderExtensions(
|
||||
const std::vector<cricket::RtpHeaderExtension>& extensions);
|
||||
void SetVideoRtpHeaderExtensions(
|
||||
const std::vector<cricket::RtpHeaderExtension>& extensions);
|
||||
|
||||
FakeVoiceMediaChannel* GetVoiceChannel(size_t index);
|
||||
FakeVideoMediaChannel* GetVideoChannel(size_t index);
|
||||
|
||||
bool capture() const;
|
||||
bool options_changed() const;
|
||||
void clear_options_changed();
|
||||
void set_fail_create_channel(bool fail);
|
||||
|
||||
private:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user