diff options
author | Frank Galligan <fgalligan@google.com> | 2015-03-18 09:51:07 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2015-03-18 09:51:07 -0700 |
commit | 8a192ce7efa461ff15886e60a8e9752a6bc2e105 (patch) | |
tree | 309d05151a522e659d9ee8de3ff9aab1581d3a65 /test | |
parent | 4640a0c4804b49f1870d5a2d17df0c7d0a77af2f (diff) | |
parent | 6a4e85a1d6c47133065fc148ce2c82ec8d569987 (diff) | |
download | libvpx-8a192ce7efa461ff15886e60a8e9752a6bc2e105.tar libvpx-8a192ce7efa461ff15886e60a8e9752a6bc2e105.tar.gz libvpx-8a192ce7efa461ff15886e60a8e9752a6bc2e105.tar.bz2 libvpx-8a192ce7efa461ff15886e60a8e9752a6bc2e105.zip |
Merge "Add protection for codec interface name change."
Diffstat (limited to 'test')
-rw-r--r-- | test/encode_test_driver.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/encode_test_driver.cc b/test/encode_test_driver.cc index f3d8e31da..bdd71c6fe 100644 --- a/test/encode_test_driver.cc +++ b/test/encode_test_driver.cc @@ -29,18 +29,26 @@ void Encoder::InitEncoder(VideoSource *video) { cfg_.g_timebase = video->timebase(); cfg_.rc_twopass_stats_in = stats_->buf(); - // Default to 1 thread and 1 tile column. + // Default to 1 thread. cfg_.g_threads = 1; res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_, init_flags_); ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); - std::string codec_name(encoder_.name); - if (codec_name.find("WebM Project VP9 Encoder") != std::string::npos) { +#if CONFIG_VP9_ENCODER + if (CodecInterface() == &vpx_codec_vp9_cx_algo) { + // Default to 1 tile column for VP9. const int log2_tile_columns = 0; res = vpx_codec_control_(&encoder_, VP9E_SET_TILE_COLUMNS, log2_tile_columns); ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError(); + } else +#endif + { +#if CONFIG_VP8_ENCODER + ASSERT_EQ(&vpx_codec_vp8_cx_algo, CodecInterface()) + << "Unknown Codec Interface"; +#endif } } } |