Switch from RTC_DISABLE_VP9 to RTC_ENABLE_VP9.

RTC_ENABLE_VP9 is more natural to deal with then RTC_DISABLE_VP9.
In all the places this macro is used, WebRTC needs to do more things
so it is easier to "do more if RTC_ENABLE_VP9 is defined" than
"do more if RTC_DISABLE_VP9 is not defined".

Bug: None
Change-Id: If992e5c554173e6af3f030f6e0fd21bd82acf9eb
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/c/111242
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25679}
This commit is contained in:
Mirko Bonadei 2018-11-16 14:38:03 +01:00 committed by Commit Bot
parent bd6ffaf73b
commit 8ef57932b1
10 changed files with 32 additions and 32 deletions

View File

@ -223,8 +223,8 @@ config("common_config") {
defines += [ "WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE" ]
}
if (!rtc_libvpx_build_vp9) {
defines += [ "RTC_DISABLE_VP9" ]
if (rtc_libvpx_build_vp9) {
defines += [ "RTC_ENABLE_VP9" ]
}
if (rtc_enable_sctp) {

View File

@ -27,11 +27,11 @@ TEST(BuiltinVideoEncoderFactoryTest, AnnouncesVp9AccordingToBuildFlags) {
break;
}
}
#if defined(RTC_DISABLE_VP9)
EXPECT_FALSE(claims_vp9_support);
#else
#if defined(RTC_ENABLE_VP9)
EXPECT_TRUE(claims_vp9_support);
#endif // defined(RTC_DISABLE_VP9)
#else
EXPECT_FALSE(claims_vp9_support);
#endif // defined(RTC_ENABLE_VP9)
}
} // namespace webrtc

View File

@ -554,7 +554,7 @@ TEST_F(WebRtcVideoEngineTest, RtxCodecAddedForH264Codec) {
codecs, FindMatchingCodec(codecs, cricket::VideoCodec(h264_high))->id));
}
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
TEST_F(WebRtcVideoEngineTest, CanConstructDecoderForVp9EncoderFactory) {
encoder_factory_->AddSupportedVideoCodecType("VP9");
@ -564,7 +564,7 @@ TEST_F(WebRtcVideoEngineTest, CanConstructDecoderForVp9EncoderFactory) {
EXPECT_TRUE(
channel->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc)));
}
#endif // !defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
TEST_F(WebRtcVideoEngineTest, PropagatesInputFrameTimestamp) {
encoder_factory_->AddSupportedVideoCodecType("VP8");

View File

@ -90,7 +90,7 @@ void PrintRdPerf(std::map<size_t, std::vector<VideoStatistics>> rd_stats) {
}
} // namespace
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
TEST(VideoCodecTestLibvpx, HighBitrateVP9) {
auto config = CreateConfig();
config.SetCodecSettings(cricket::kVp9CodecName, 1, 1, 1, false, true, false,
@ -200,7 +200,7 @@ TEST(VideoCodecTestLibvpx, VeryLowBitrateVP9) {
// TODO(marpan): Add temporal layer test for VP9, once changes are in
// vp9 wrapper for this.
#endif // !defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
TEST(VideoCodecTestLibvpx, HighBitrateVP8) {
auto config = CreateConfig();

View File

@ -9,9 +9,9 @@
*
*/
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
#error
#endif // !defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
#include "modules/video_coding/codecs/vp9/include/vp9.h"

View File

@ -15,7 +15,7 @@
#import "api/video_codec/RTCVideoCodecConstants.h"
#import "api/video_codec/RTCVideoDecoderVP8.h"
#import "base/RTCVideoCodecInfo.h"
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
#import "api/video_codec/RTCVideoDecoderVP9.h"
#endif
@ -26,7 +26,7 @@
return [[RTCVideoDecoderH264 alloc] init];
} else if ([info.name isEqualToString:kRTCVideoCodecVp8Name]) {
return [RTCVideoDecoderVP8 vp8Decoder];
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
} else if ([info.name isEqualToString:kRTCVideoCodecVp9Name]) {
return [RTCVideoDecoderVP9 vp9Decoder];
#endif
@ -39,7 +39,7 @@
return @[
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecH264Name],
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp8Name],
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
[[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name],
#endif
];

View File

@ -15,7 +15,7 @@
#import "api/video_codec/RTCVideoCodecConstants.h"
#import "api/video_codec/RTCVideoEncoderVP8.h"
#import "base/RTCVideoCodecInfo.h"
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
#import "api/video_codec/RTCVideoEncoderVP9.h"
#endif
@ -44,7 +44,7 @@
RTCVideoCodecInfo *vp8Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp8Name];
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
RTCVideoCodecInfo *vp9Info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp9Name];
#endif
@ -52,7 +52,7 @@
constrainedHighInfo,
constrainedBaselineInfo,
vp8Info,
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
vp9Info,
#endif
];
@ -63,7 +63,7 @@
return [[RTCVideoEncoderH264 alloc] initWithCodecInfo:info];
} else if ([info.name isEqualToString:kRTCVideoCodecVp8Name]) {
return [RTCVideoEncoderVP8 vp8Encoder];
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
} else if ([info.name isEqualToString:kRTCVideoCodecVp9Name]) {
return [RTCVideoEncoderVP9 vp9Encoder];
#endif

View File

@ -118,7 +118,7 @@ TEST_P(CodecEndToEndTest, SendsAndReceivesVP8Rotation90) {
RunBaseTest(&test);
}
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
TEST_P(CodecEndToEndTest, SendsAndReceivesVP9) {
test::FunctionVideoEncoderFactory encoder_factory(
[]() { return VP9Encoder::Create(); });
@ -177,7 +177,7 @@ TEST_P(CodecEndToEndTest, SendsAndReceivesMultiplexVideoRotation90) {
RunBaseTest(&test);
}
#endif // !defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
#if defined(WEBRTC_USE_H264)
class EndToEndTestH264 : public test::CallTest,

View File

@ -109,7 +109,7 @@ class GenericDescriptorTest : public ::testing::TestWithParam<std::string> {
bool generic_descriptor_enabled_;
};
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
TEST(FullStackTest, ForemanCifWithoutPacketLossVp9) {
auto fixture = CreateVideoQualityTestFixture();
ParamsWithLogging foreman_cif;
@ -190,7 +190,7 @@ TEST(FullStackTest, GeneratorWithoutPacketLossMultiplexI420AFrame) {
fixture->RunWithAnalyzer(generator);
}
#endif // !defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
#if defined(WEBRTC_LINUX)
// Crashes on the linux trusty perf bot: bugs.webrtc.org/9129.
@ -660,7 +660,7 @@ TEST(FullStackTest,
fixture->RunWithAnalyzer(conf_motion_hd);
}
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
TEST(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueueVP9) {
auto fixture = CreateVideoQualityTestFixture();
ParamsWithLogging conf_motion_hd;
@ -828,7 +828,7 @@ const ParamsWithLogging::Video kSimulcastVp8VideoLow = {
150000, 200000, false, "VP8", 3,
2, 400000, false, false, false, "ConferenceMotion_1280_720_50"};
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
TEST(FullStackTest, ScreenshareSlidesVP9_2SL) {
auto fixture = CreateVideoQualityTestFixture();
ParamsWithLogging screenshare;
@ -969,7 +969,7 @@ TEST(FullStackTest, VP9KSVC_3SL_Medium_Network_Restricted_Trusted_Rate) {
}
#endif // !defined(WEBRTC_MAC)
#endif // !defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
// Android bots can't handle FullHD, so disable the test.
// TODO(bugs.webrtc.org/9220): Investigate source of flakiness on Mac.

View File

@ -654,7 +654,7 @@ TEST_P(VideoSendStreamTest, DISABLED_DoesUtilizeUlpfecForVp8WithNackEnabled) {
RunBaseTest(&test);
}
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
// Disabled as flaky, see https://crbug.com/webrtc/7285 for details.
TEST_P(VideoSendStreamTest, DISABLED_DoesUtilizeUlpfecForVp9WithNackEnabled) {
test::FunctionVideoEncoderFactory encoder_factory(
@ -662,7 +662,7 @@ TEST_P(VideoSendStreamTest, DISABLED_DoesUtilizeUlpfecForVp9WithNackEnabled) {
UlpfecObserver test(false, true, true, true, "VP9", &encoder_factory);
RunBaseTest(&test);
}
#endif // !defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
TEST_P(VideoSendStreamTest, SupportsUlpfecWithMultithreadedH264) {
test::FunctionVideoEncoderFactory encoder_factory([]() {
@ -805,7 +805,7 @@ TEST_P(VideoSendStreamTest, SupportsFlexfecWithRtpExtensionsVp8) {
RunBaseTest(&test);
}
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
TEST_P(VideoSendStreamTest, SupportsFlexfecVp9) {
test::FunctionVideoEncoderFactory encoder_factory(
[]() { return VP9Encoder::Create(); });
@ -819,7 +819,7 @@ TEST_P(VideoSendStreamTest, SupportsFlexfecWithNackVp9) {
FlexfecObserver test(false, true, "VP9", &encoder_factory, 1);
RunBaseTest(&test);
}
#endif // defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
TEST_P(VideoSendStreamTest, SupportsFlexfecH264) {
test::FunctionVideoEncoderFactory encoder_factory([]() {
@ -3083,7 +3083,7 @@ TEST_P(VideoSendStreamTest, ReportsSentResolution) {
RunBaseTest(&test);
}
#if !defined(RTC_DISABLE_VP9)
#if defined(RTC_ENABLE_VP9)
class Vp9HeaderObserver : public test::SendTest {
public:
Vp9HeaderObserver()
@ -3576,7 +3576,7 @@ TEST_P(VideoSendStreamTest, MAYBE_Vp9FlexModeRefCount) {
RunBaseTest(&test);
}
#endif // !defined(RTC_DISABLE_VP9)
#endif // defined(RTC_ENABLE_VP9)
void VideoSendStreamTest::TestRequestSourceRotateVideo(
bool support_orientation_ext) {