Remove dead code from WebRtcVideoEngine2.
FindCodec is no longer used and can be removed. BUG= R=pthatcher@webrtc.org Review URL: https://codereview.webrtc.org/1665803003 . Cr-Commit-Position: refs/heads/master@{#11476}
This commit is contained in:
parent
e03ac51aa1
commit
cedff02e30
@ -760,14 +760,6 @@ class FakeVideoEngine : public FakeBaseEngine {
|
||||
}
|
||||
|
||||
const std::vector<VideoCodec>& codecs() const { return codecs_; }
|
||||
bool FindCodec(const VideoCodec& in) {
|
||||
for (size_t i = 0; i < codecs_.size(); ++i) {
|
||||
if (codecs_[i].Matches(in)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void SetCodecs(const std::vector<VideoCodec> codecs) { codecs_ = codecs; }
|
||||
|
||||
bool SetCaptureDevice(const Device* device) {
|
||||
|
||||
@ -583,32 +583,6 @@ void WebRtcVideoEngine2::SetExternalEncoderFactory(
|
||||
video_codecs_ = GetSupportedCodecs();
|
||||
}
|
||||
|
||||
// Checks to see whether we comprehend and could receive a particular codec
|
||||
bool WebRtcVideoEngine2::FindCodec(const VideoCodec& in) {
|
||||
// TODO(pbos): Probe encoder factory to figure out that the codec is supported
|
||||
// if supported by the encoder factory. Add a corresponding test that fails
|
||||
// with this code (that doesn't ask the factory).
|
||||
for (size_t j = 0; j < video_codecs_.size(); ++j) {
|
||||
VideoCodec codec(video_codecs_[j].id, video_codecs_[j].name, 0, 0, 0, 0);
|
||||
if (codec.Matches(in)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ignore spammy trace messages, mostly from the stats API when we haven't
|
||||
// gotten RTCP info yet from the remote side.
|
||||
bool WebRtcVideoEngine2::ShouldIgnoreTrace(const std::string& trace) {
|
||||
static const char* const kTracesToIgnore[] = {NULL};
|
||||
for (const char* const* p = kTracesToIgnore; *p; ++p) {
|
||||
if (trace.find(*p) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<VideoCodec> WebRtcVideoEngine2::GetSupportedCodecs() const {
|
||||
std::vector<VideoCodec> supported_codecs = DefaultVideoCodecList();
|
||||
|
||||
|
||||
@ -129,10 +129,6 @@ class WebRtcVideoEngine2 {
|
||||
virtual void SetExternalEncoderFactory(
|
||||
WebRtcVideoEncoderFactory* encoder_factory);
|
||||
|
||||
bool FindCodec(const VideoCodec& in);
|
||||
// Check whether the supplied trace should be ignored.
|
||||
bool ShouldIgnoreTrace(const std::string& trace);
|
||||
|
||||
private:
|
||||
std::vector<VideoCodec> GetSupportedCodecs() const;
|
||||
|
||||
|
||||
@ -165,50 +165,6 @@ class WebRtcVideoEngine2Test : public ::testing::Test {
|
||||
std::map<int, int> default_apt_rtx_types_;
|
||||
};
|
||||
|
||||
TEST_F(WebRtcVideoEngine2Test, FindCodec) {
|
||||
const std::vector<cricket::VideoCodec>& c = engine_.codecs();
|
||||
EXPECT_EQ(cricket::DefaultVideoCodecList().size(), c.size());
|
||||
|
||||
cricket::VideoCodec vp8(104, "VP8", 320, 200, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(vp8));
|
||||
|
||||
cricket::VideoCodec vp8_ci(104, "vp8", 320, 200, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(vp8));
|
||||
|
||||
cricket::VideoCodec vp8_diff_fr_diff_pref(104, "VP8", 320, 200, 50, 50);
|
||||
EXPECT_TRUE(engine_.FindCodec(vp8_diff_fr_diff_pref));
|
||||
|
||||
cricket::VideoCodec vp8_diff_id(95, "VP8", 320, 200, 30, 0);
|
||||
EXPECT_FALSE(engine_.FindCodec(vp8_diff_id));
|
||||
vp8_diff_id.id = 97;
|
||||
EXPECT_TRUE(engine_.FindCodec(vp8_diff_id));
|
||||
|
||||
// FindCodec ignores the codec size.
|
||||
// Test that FindCodec can accept uncommon codec size.
|
||||
cricket::VideoCodec vp8_diff_res(104, "VP8", 320, 111, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(vp8_diff_res));
|
||||
|
||||
// PeerConnection doesn't negotiate the resolution at this point.
|
||||
// Test that FindCodec can handle the case when width/height is 0.
|
||||
cricket::VideoCodec vp8_zero_res(104, "VP8", 0, 0, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(vp8_zero_res));
|
||||
|
||||
cricket::VideoCodec red(101, "RED", 0, 0, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(red));
|
||||
|
||||
cricket::VideoCodec red_ci(101, "red", 0, 0, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(red));
|
||||
|
||||
cricket::VideoCodec fec(102, "ULPFEC", 0, 0, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(fec));
|
||||
|
||||
cricket::VideoCodec fec_ci(102, "ulpfec", 0, 0, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(fec));
|
||||
|
||||
cricket::VideoCodec rtx(96, "rtx", 0, 0, 30, 0);
|
||||
EXPECT_TRUE(engine_.FindCodec(rtx));
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) {
|
||||
std::vector<VideoCodec> engine_codecs = engine_.codecs();
|
||||
for (size_t i = 0; i < engine_codecs.size(); ++i) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user