xref: /aosp_15_r20/external/webrtc/api/video_codecs/test/builtin_video_encoder_factory_unittest.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #include "api/video_codecs/builtin_video_encoder_factory.h"
12 
13 #include <memory>
14 #include <string>
15 #include <vector>
16 
17 #include "api/video_codecs/sdp_video_format.h"
18 #include "test/gtest.h"
19 
20 namespace webrtc {
21 
TEST(BuiltinVideoEncoderFactoryTest,AnnouncesVp9AccordingToBuildFlags)22 TEST(BuiltinVideoEncoderFactoryTest, AnnouncesVp9AccordingToBuildFlags) {
23   std::unique_ptr<VideoEncoderFactory> factory =
24       CreateBuiltinVideoEncoderFactory();
25   bool claims_vp9_support = false;
26   for (const SdpVideoFormat& format : factory->GetSupportedFormats()) {
27     if (format.name == "VP9") {
28       claims_vp9_support = true;
29       break;
30     }
31   }
32 #if defined(RTC_ENABLE_VP9)
33   EXPECT_TRUE(claims_vp9_support);
34 #else
35   EXPECT_FALSE(claims_vp9_support);
36 #endif  // defined(RTC_ENABLE_VP9)
37 }
38 
39 }  // namespace webrtc
40