Sebastian Jansson | 98b07e9 | 2018-09-27 13:47:01 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 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 | #include "test/scenario/hardware_codecs.h" |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 11 | |
Sebastian Jansson | 98b07e9 | 2018-09-27 13:47:01 +0200 | [diff] [blame] | 12 | #include "rtc_base/checks.h" |
| 13 | |
| 14 | #ifdef WEBRTC_ANDROID |
| 15 | #include "modules/video_coding/codecs/test/android_codec_factory_helper.h" |
| 16 | #endif |
| 17 | #ifdef WEBRTC_MAC |
| 18 | #include "modules/video_coding/codecs/test/objc_codec_factory_helper.h" |
| 19 | #endif |
| 20 | |
| 21 | namespace webrtc { |
| 22 | namespace test { |
| 23 | std::unique_ptr<VideoEncoderFactory> CreateHardwareEncoderFactory() { |
| 24 | #ifdef WEBRTC_ANDROID |
| 25 | InitializeAndroidObjects(); |
| 26 | return CreateAndroidEncoderFactory(); |
| 27 | #else |
| 28 | #ifdef WEBRTC_MAC |
| 29 | return CreateObjCEncoderFactory(); |
| 30 | #else |
| 31 | RTC_NOTREACHED() << "Hardware encoder not implemented on this platform."; |
| 32 | return nullptr; |
| 33 | #endif |
| 34 | #endif |
| 35 | } |
| 36 | std::unique_ptr<VideoDecoderFactory> CreateHardwareDecoderFactory() { |
| 37 | #ifdef WEBRTC_ANDROID |
| 38 | InitializeAndroidObjects(); |
| 39 | return CreateAndroidDecoderFactory(); |
| 40 | #else |
| 41 | #ifdef WEBRTC_MAC |
| 42 | return CreateObjCDecoderFactory(); |
| 43 | #else |
| 44 | RTC_NOTREACHED() << "Hardware decoder not implemented on this platform."; |
| 45 | return nullptr; |
| 46 | #endif |
| 47 | #endif |
| 48 | } |
| 49 | } // namespace test |
| 50 | } // namespace webrtc |