blob: 5267e89d5bd75acad02bad579257398e935d7e32 [file] [log] [blame]
Sebastian Jansson98b07e92018-09-27 13:47:01 +02001/*
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 Olssona4d87372019-07-05 19:08:33 +020011
Sebastian Jansson98b07e92018-09-27 13:47:01 +020012#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
21namespace webrtc {
22namespace test {
23std::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}
36std::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