You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.4 KiB

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