Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tmthecoder/WebRTC-macOS
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8324
Choose a base ref
...
head repository: tmthecoder/WebRTC-macOS
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 9 commits
  • 91 files changed
  • 1 contributor

Commits on Apr 27, 2021

  1. Update README.md

    tmthecoder authored Apr 27, 2021
    Copy the full SHA
    58790c8 View commit details
  2. Add building instructions

    tmthecoder authored Apr 27, 2021
    Copy the full SHA
    ed41875 View commit details

Commits on Feb 2, 2022

  1. fix a typo

    tmthecoder authored Feb 2, 2022
    Copy the full SHA
    7636747 View commit details
  2. fix more typos

    tmthecoder authored Feb 2, 2022
    Copy the full SHA
    2c8d670 View commit details

Commits on Feb 3, 2022

  1. update webrtc's license

    tmthecoder authored Feb 3, 2022
    Copy the full SHA
    9179e2e View commit details
  2. Change lipo path

    tmthecoder authored Feb 3, 2022
    Copy the full SHA
    294b8c0 View commit details
  3. Copy the full SHA
    75db58d View commit details
  4. Copy the full SHA
    291b573 View commit details
  5. updated podspec

    tmthecoder committed Feb 3, 2022
    Copy the full SHA
    415fd67 View commit details
Showing with 4,269 additions and 2 deletions.
  1. +70 −1 README.md
  2. +1 −1 WebRTC-macOS.podspec
  3. BIN WebRTC.framework/WebRTC
  4. BIN WebRTC.framework/WebRTC
  5. +1 −0 WebRTC.framework/WebRTC.framework/Headers
  6. +1 −0 WebRTC.framework/WebRTC.framework/Modules
  7. +1 −0 WebRTC.framework/WebRTC.framework/Resources
  8. +32 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCAudioSource.h
  9. +28 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCAudioTrack.h
  10. +52 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCCVPixelBuffer.h
  11. +41 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCCallbackLogger.h
  12. +56 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCCameraVideoCapturer.h
  13. +44 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCCertificate.h
  14. +24 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCCodecSpecificInfo.h
  15. +27 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCCodecSpecificInfoH264.h
  16. +275 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCConfiguration.h
  17. +63 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCCryptoOptions.h
  18. +132 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCDataChannel.h
  19. +52 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCDataChannelConfiguration.h
  20. +26 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCDefaultVideoDecoderFactory.h
  21. +31 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCDefaultVideoEncoderFactory.h
  22. +46 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCDispatcher.h
  23. +71 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCDtmfSender.h
  24. +52 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCEncodedImage.h
  25. +33 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCFieldTrials.h
  26. +74 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCFileLogger.h
  27. +51 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCFileVideoCapturer.h
  28. +60 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCH264ProfileLevelId.h
  29. +22 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCI420Buffer.h
  30. +49 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCIceCandidate.h
  31. +114 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCIceServer.h
  32. +37 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCLegacyStatsReport.h
  33. +67 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCLogging.h
  34. +24 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMTLNSVideoView.h
  35. +62 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMacros.h
  36. +46 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMediaConstraints.h
  37. +34 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMediaSource.h
  38. +49 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMediaStream.h
  39. +50 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMediaStreamTrack.h
  40. +23 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMetrics.h
  41. +48 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMetricsSampleInfo.h
  42. +23 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMutableI420Buffer.h
  43. +28 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCMutableYUVPlanarBuffer.h
  44. +42 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCNSGLVideoView.h
  45. +23 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCNativeI420Buffer.h
  46. +24 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCNativeMutableI420Buffer.h
  47. +393 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCPeerConnection.h
  48. +89 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCPeerConnectionFactory.h
  49. +38 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCPeerConnectionFactoryOptions.h
  50. +30 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCRtcpParameters.h
  51. +73 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCRtpCodecParameters.h
  52. +76 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCRtpEncodingParameters.h
  53. +33 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCRtpHeaderExtension.h
  54. +58 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCRtpParameters.h
  55. +86 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCRtpReceiver.h
  56. +54 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCRtpSender.h
  57. +137 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCRtpTransceiver.h
  58. +20 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCSSLAdapter.h
  59. +48 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCSessionDescription.h
  60. +21 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCTracing.h
  61. +35 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoCapturer.h
  62. +36 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoCodecInfo.h
  63. +40 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoDecoder.h
  64. +27 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoDecoderAV1.h
  65. +32 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoDecoderFactory.h
  66. +18 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoDecoderFactoryH264.h
  67. +18 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoDecoderH264.h
  68. +25 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoDecoderVP8.h
  69. +27 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoDecoderVP9.h
  70. +55 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoder.h
  71. +27 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoderAV1.h
  72. +49 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoderFactory.h
  73. +18 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoderFactoryH264.h
  74. +22 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoderH264.h
  75. +28 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoderQpThresholds.h
  76. +42 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoderSettings.h
  77. +25 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoderVP8.h
  78. +27 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoEncoderVP9.h
  79. +86 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoFrame.h
  80. +32 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoFrameBuffer.h
  81. +43 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoRenderer.h
  82. +37 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoSource.h
  83. +38 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoTrack.h
  84. +39 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCVideoViewShading.h
  85. +46 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/RTCYUVPlanarBuffer.h
  86. +88 −0 WebRTC.framework/WebRTC.framework/Versions/A/Headers/WebRTC.h
  87. +6 −0 WebRTC.framework/WebRTC.framework/Versions/A/Modules/module.modulemap
  88. +36 −0 WebRTC.framework/WebRTC.framework/Versions/A/Resources/Info.plist
  89. BIN WebRTC.framework/WebRTC.framework/Versions/A/WebRTC
  90. +1 −0 WebRTC.framework/WebRTC.framework/Versions/Current
  91. +1 −0 WebRTC.framework/WebRTC.framework/WebRTC
71 changes: 70 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
## WebRTC-macOS

A WebRTC port to macOS with a FAT library for x86 and arm (Intel and Apple Silicon)
A WebRTC port for macOS consisting of a universal library for x86 and arm (Intel and Apple Silicon)

## Installation

To Install this library, you can use the `WebRTC.framework` attached in the releases section

Alternatively, you can use CocoaPods with the following addition to your podfile:

```
pod 'WebRTC-macOS', :git => 'https://github.com/tmthecoder/WebRTC-macOS.git', :tag => '8324'
```

## Usage

The guides on the WebRTC example may be followed with all functionality present.

All you need to do is add the import statement to use for Swift:

```
import WebRTC
```

## Building
To Build your own WebRTC Framework, similar to the one I have build,
the instructions are as follows:

Clone the WebRTC Source:

```
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:/path/to/depot_tools
fetch --nohooks webrtc_ios
gclient sync
```

Generate the macOS Targets (x86_64 and arm64)

```
gn gen out/mac_x64 --args='target_os="mac" target_cpu="x64" is_component_build=false is_debug=false rtc_libvpx_build_vp9=false enable_stripping=true rtc_enable_protobuf=false'
gn gen out/mac_arm64 --args='target_os="mac" target_cpu="arm64" is_component_build=false is_debug=false rtc_libvpx_build_vp9=false enable_stripping=true rtc_enable_protobuf=false'
```

Build both frameworks:

```
ninja -C out/mac_x64 mac_framework_objc
ninja -C out/mac_arm64 mac_framework_objc
```

Merge the frameworks using `lipo`:

```
cd ..
cp -R src/out/mac_x64/WebRTC.framework WebRTC.framework
lipo -create -output WebRTC.framework/WebRTC src/out/mac_x64/WebRTC.framework/WebRTC src/out/mac_arm64/WebRTC.framework/WebRTC
```
The outputted `WebRTC.framework` can be imported into an Xcode Project and will support both Intel and Apple Silicon Macs

## Licensing

- This port of WebRTC, and any changes made by me will fall under the [MIT License](https://github.com/tmthecoder/WebRTC-macOS/blob/main/LICENSE)

- WebRTC's license can be found [here](https://webrtc.org/support/license)
2 changes: 1 addition & 1 deletion WebRTC-macOS.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WebRTC-macOS"
s.version = "8324"
s.version = "4577"
s.license = { :type => 'MIT', :file => "LICENSE" }
s.homepage = "https://tmthecoder.dev"
s.authors = { "Tejas Mehta" => "tmthecoder@gmail.com" }
1 change: 0 additions & 1 deletion WebRTC.framework/WebRTC

This file was deleted.

Binary file added WebRTC.framework/WebRTC
Binary file not shown.
1 change: 1 addition & 0 deletions WebRTC.framework/WebRTC.framework/Headers
1 change: 1 addition & 0 deletions WebRTC.framework/WebRTC.framework/Modules
1 change: 1 addition & 0 deletions WebRTC.framework/WebRTC.framework/Resources
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/

#import <Foundation/Foundation.h>

#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCMediaSource.h>

NS_ASSUME_NONNULL_BEGIN

RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCAudioSource) : RTC_OBJC_TYPE(RTCMediaSource)

- (instancetype)init NS_UNAVAILABLE;

// Sets the volume for the RTCMediaSource. |volume| is a gain value in the range
// [0, 10].
// Temporary fix to be able to modify volume of remote audio tracks.
// TODO(kthelgason): Property stays here temporarily until a proper volume-api
// is available on the surface exposed by webrtc.
@property(nonatomic, assign) double volume;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/

#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCMediaStreamTrack.h>

NS_ASSUME_NONNULL_BEGIN

@class RTC_OBJC_TYPE(RTCAudioSource);

RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCAudioTrack) : RTC_OBJC_TYPE(RTCMediaStreamTrack)

- (instancetype)init NS_UNAVAILABLE;

/** The audio source for this audio track. */
@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCAudioSource) * source;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/

#import <AVFoundation/AVFoundation.h>

#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCVideoFrameBuffer.h>

NS_ASSUME_NONNULL_BEGIN

/** RTCVideoFrameBuffer containing a CVPixelBufferRef */
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCCVPixelBuffer) : NSObject <RTC_OBJC_TYPE(RTCVideoFrameBuffer)>

@property(nonatomic, readonly) CVPixelBufferRef pixelBuffer;
@property(nonatomic, readonly) int cropX;
@property(nonatomic, readonly) int cropY;
@property(nonatomic, readonly) int cropWidth;
@property(nonatomic, readonly) int cropHeight;

+ (NSSet<NSNumber *> *)supportedPixelFormats;

- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer;
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer
adaptedWidth:(int)adaptedWidth
adaptedHeight:(int)adaptedHeight
cropWidth:(int)cropWidth
cropHeight:(int)cropHeight
cropX:(int)cropX
cropY:(int)cropY;

- (BOOL)requiresCropping;
- (BOOL)requiresScalingToWidth:(int)width height:(int)height;
- (int)bufferSizeForCroppingAndScalingToWidth:(int)width height:(int)height;

/** The minimum size of the |tmpBuffer| must be the number of bytes returned from the
* bufferSizeForCroppingAndScalingToWidth:height: method.
* If that size is 0, the |tmpBuffer| may be nil.
*/
- (BOOL)cropAndScaleTo:(CVPixelBufferRef)outputPixelBuffer
withTempBuffer:(nullable uint8_t *)tmpBuffer;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/

#import <Foundation/Foundation.h>

#import <WebRTC/RTCLogging.h>
#import <WebRTC/RTCMacros.h>

NS_ASSUME_NONNULL_BEGIN

typedef void (^RTCCallbackLoggerMessageHandler)(NSString *message);
typedef void (^RTCCallbackLoggerMessageAndSeverityHandler)(NSString *message,
RTCLoggingSeverity severity);

// This class intercepts WebRTC logs and forwards them to a registered block.
// This class is not threadsafe.
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCCallbackLogger) : NSObject

// The severity level to capture. The default is kRTCLoggingSeverityInfo.
@property(nonatomic, assign) RTCLoggingSeverity severity;

// The callback handler will be called on the same thread that does the
// logging, so if the logging callback can be slow it may be a good idea
// to implement dispatching to some other queue.
- (void)start:(nullable RTCCallbackLoggerMessageHandler)handler;
- (void)startWithMessageAndSeverityHandler:
(nullable RTCCallbackLoggerMessageAndSeverityHandler)handler;

- (void)stop;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/

#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>

#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCVideoCapturer.h>

NS_ASSUME_NONNULL_BEGIN

RTC_OBJC_EXPORT
// Camera capture that implements RTCVideoCapturer. Delivers frames to a
// RTCVideoCapturerDelegate (usually RTCVideoSource).
NS_EXTENSION_UNAVAILABLE_IOS("Camera not available in app extensions.")
@interface RTC_OBJC_TYPE (RTCCameraVideoCapturer) : RTC_OBJC_TYPE(RTCVideoCapturer)

// Capture session that is used for capturing. Valid from initialization to dealloc.
@property(readonly, nonatomic) AVCaptureSession *captureSession;

// Returns list of available capture devices that support video capture.
+ (NSArray<AVCaptureDevice *> *)captureDevices;
// Returns list of formats that are supported by this class for this device.
+ (NSArray<AVCaptureDeviceFormat *> *)supportedFormatsForDevice:(AVCaptureDevice *)device;

// Returns the most efficient supported output pixel format for this capturer.
- (FourCharCode)preferredOutputPixelFormat;

// Starts the capture session asynchronously and notifies callback on completion.
// The device will capture video in the format given in the `format` parameter. If the pixel format
// in `format` is supported by the WebRTC pipeline, the same pixel format will be used for the
// output. Otherwise, the format returned by `preferredOutputPixelFormat` will be used.
- (void)startCaptureWithDevice:(AVCaptureDevice *)device
format:(AVCaptureDeviceFormat *)format
fps:(NSInteger)fps
completionHandler:(nullable void (^)(NSError *_Nullable))completionHandler;
// Stops the capture session asynchronously and notifies callback on completion.
- (void)stopCaptureWithCompletionHandler:(nullable void (^)(void))completionHandler;

// Starts the capture session asynchronously.
- (void)startCaptureWithDevice:(AVCaptureDevice *)device
format:(AVCaptureDeviceFormat *)format
fps:(NSInteger)fps;
// Stops the capture session asynchronously.
- (void)stopCapture;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/

#import <Foundation/Foundation.h>

#import <WebRTC/RTCMacros.h>

NS_ASSUME_NONNULL_BEGIN

RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCCertificate) : NSObject <NSCopying>

/** Private key in PEM. */
@property(nonatomic, readonly, copy) NSString *private_key;

/** Public key in an x509 cert encoded in PEM. */
@property(nonatomic, readonly, copy) NSString *certificate;

/**
* Initialize an RTCCertificate with PEM strings for private_key and certificate.
*/
- (instancetype)initWithPrivateKey:(NSString *)private_key
certificate:(NSString *)certificate NS_DESIGNATED_INITIALIZER;

- (instancetype)init NS_UNAVAILABLE;

/** Generate a new certificate for 're' use.
*
* Optional dictionary of parameters. Defaults to KeyType ECDSA if none are
* provided.
* - name: "ECDSA" or "RSASSA-PKCS1-v1_5"
*/
+ (nullable RTC_OBJC_TYPE(RTCCertificate) *)generateCertificateWithParams:(NSDictionary *)params;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/

#import <Foundation/Foundation.h>

#import <WebRTC/RTCMacros.h>

NS_ASSUME_NONNULL_BEGIN

/** Implement this protocol to pass codec specific info from the encoder.
* Corresponds to webrtc::CodecSpecificInfo.
*/
RTC_OBJC_EXPORT
@protocol RTC_OBJC_TYPE
(RTCCodecSpecificInfo)<NSObject> @end

NS_ASSUME_NONNULL_END
Loading