blob: 16044de16ed9ba868e381096d2b3e6fc60b4ab31 [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"
11#include "rtc_base/checks.h"
12
13#ifdef WEBRTC_ANDROID
14#include "modules/video_coding/codecs/test/android_codec_factory_helper.h"
15#endif
16#ifdef WEBRTC_MAC
17#include "modules/video_coding/codecs/test/objc_codec_factory_helper.h"
18#endif
19
20namespace webrtc {
21namespace test {
22std::unique_ptr<VideoEncoderFactory> CreateHardwareEncoderFactory() {
23#ifdef WEBRTC_ANDROID
24 InitializeAndroidObjects();
25 return CreateAndroidEncoderFactory();
26#else
27#ifdef WEBRTC_MAC
28 return CreateObjCEncoderFactory();
29#else
30 RTC_NOTREACHED() << "Hardware encoder not implemented on this platform.";
31 return nullptr;
32#endif
33#endif
34}
35std::unique_ptr<VideoDecoderFactory> CreateHardwareDecoderFactory() {
36#ifdef WEBRTC_ANDROID
37 InitializeAndroidObjects();
38 return CreateAndroidDecoderFactory();
39#else
40#ifdef WEBRTC_MAC
41 return CreateObjCDecoderFactory();
42#else
43 RTC_NOTREACHED() << "Hardware decoder not implemented on this platform.";
44 return nullptr;
45#endif
46#endif
47}
48} // namespace test
49} // namespace webrtc