RTCVideoEncoderFactory.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2017 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. #import <Foundation/Foundation.h>
  11. #import <WebRTC/RTCMacros.h>
  12. #import <WebRTC/RTCVideoCodecInfo.h>
  13. #import <WebRTC/RTCVideoEncoder.h>
  14. NS_ASSUME_NONNULL_BEGIN
  15. /** RTCVideoEncoderFactory is an Objective-C version of
  16. webrtc::VideoEncoderFactory::VideoEncoderSelector.
  17. */
  18. RTC_OBJC_EXPORT
  19. @protocol RTC_OBJC_TYPE
  20. (RTCVideoEncoderSelector)<NSObject>
  21. - (void)registerCurrentEncoderInfo : (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)info;
  22. - (nullable RTC_OBJC_TYPE(RTCVideoCodecInfo) *)encoderForBitrate:(NSInteger)bitrate;
  23. - (nullable RTC_OBJC_TYPE(RTCVideoCodecInfo) *)encoderForBrokenEncoder;
  24. @optional
  25. - (nullable RTC_OBJC_TYPE(RTCVideoCodecInfo) *)encoderForResolutionChangeBySize:(CGSize)size;
  26. @end
  27. /** RTCVideoEncoderFactory is an Objective-C version of webrtc::VideoEncoderFactory.
  28. */
  29. RTC_OBJC_EXPORT
  30. @protocol RTC_OBJC_TYPE
  31. (RTCVideoEncoderFactory)<NSObject>
  32. - (nullable id<RTC_OBJC_TYPE(RTCVideoEncoder)>)createEncoder
  33. : (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)info;
  34. - (NSArray<RTC_OBJC_TYPE(RTCVideoCodecInfo) *> *)
  35. supportedCodecs; // TODO(andersc): "supportedFormats" instead?
  36. @optional
  37. - (NSArray<RTC_OBJC_TYPE(RTCVideoCodecInfo) *> *)implementations;
  38. - (nullable id<RTC_OBJC_TYPE(RTCVideoEncoderSelector)>)encoderSelector;
  39. @end
  40. NS_ASSUME_NONNULL_END