Obj-C SDK Cleanup

This CL separates the files under sdk/objc into logical directories, replacing
the previous file layout under Framework/.

A long term goal is to have some system set up to generate the files under
sdk/objc/api (the PeerConnection API wrappers) from the C++ code. In the shorter
term the goal is to abstract out shared concepts from these classes in order to
make them as uniform as possible.

The separation into base/, components/, and helpers/ are to differentiate between
the base layer's common protocols, various utilities and the actual platform
specific components.

The old directory layout that resembled a framework's internal layout is not
necessary, since it is generated by the framework target when building it.

Bug: webrtc:9627
Change-Id: Ib084fd83f050ae980649ca99e841f4fb0580bd8f
Reviewed-on: https://webrtc-review.googlesource.com/94142
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24493}
This commit is contained in:
Anders Carlsson
2018-08-30 09:30:29 +02:00
committed by Commit Bot
parent 9ea5765f78
commit 7bca8ca4e2
470 changed files with 7255 additions and 5258 deletions

View File

@ -320,6 +320,10 @@ config("common_config") {
config("common_objc") { config("common_objc") {
libs = [ "Foundation.framework" ] libs = [ "Foundation.framework" ]
if (rtc_use_metal_rendering) {
defines = [ "RTC_SUPPORTS_METAL" ]
}
} }
if (!build_with_chromium) { if (!build_with_chromium) {

View File

@ -205,19 +205,15 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
if (is_ios) { if (is_ios) {
# iOS must use WebRTC.framework which is dynamically linked. # iOS must use WebRTC.framework which is dynamically linked.
# 'gn check' is disabled in order to avoid confusion and
# errors caused by multiple implementations.
check_includes = false
deps = [ deps = [
"../sdk:framework_objc", "../sdk:framework_objc+link",
"../system_wrappers:field_trial_default", "../system_wrappers:field_trial_default",
"../system_wrappers:runtime_enabled_features_default", "../system_wrappers:runtime_enabled_features_default",
] ]
} else { } else {
deps = [ deps = [
"../sdk:common_objc", "../sdk:mac_framework_objc+link",
"../system_wrappers:field_trial_default", "../system_wrappers:field_trial_default",
"../system_wrappers:metrics_default",
"../system_wrappers:runtime_enabled_features_default", "../system_wrappers:runtime_enabled_features_default",
] ]
} }
@ -279,23 +275,12 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
] ]
if (is_ios) { if (is_ios) {
# iOS must use WebRTC.framework which is dynamically linked. # iOS must use WebRTC.framework which is dynamically linked.
# 'gn check' is disabled in order to avoid confusion and
# errors caused by multiple implementations.
check_includes = false
deps += [ deps += [
":AppRTCMobile_ios_frameworks", "../sdk:framework_objc+link",
"../sdk:framework_objc", "../sdk:ios_framework_bundle",
] ]
} else { } else {
deps += [ deps += [ "../sdk:mac_framework_objc+link" ]
"../sdk:common_objc",
"../sdk:mediaconstraints_objc",
"../sdk:peerconnectionfactory_base_objc",
"../sdk:videocapture_objc",
"../sdk:videocodec_objc",
"../sdk:videoframebuffer_objc",
"../sdk:videosource_objc",
]
} }
libs = [ "QuartzCore.framework" ] libs = [ "QuartzCore.framework" ]
} }
@ -303,9 +288,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
if (is_ios) { if (is_ios) {
rtc_static_library("AppRTCMobile_lib") { rtc_static_library("AppRTCMobile_lib") {
# iOS must use WebRTC.framework which is dynamically linked. # iOS must use WebRTC.framework which is dynamically linked.
# 'gn check' is disabled in order to avoid confusion and
# errors caused by multiple implementations.
check_includes = false
testonly = true testonly = true
sources = [ sources = [
"objc/AppRTCMobile/ios/ARDAppDelegate.h", "objc/AppRTCMobile/ios/ARDAppDelegate.h",
@ -331,10 +313,10 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
] ]
deps = [ deps = [
":AppRTCMobile_ios_frameworks",
":apprtc_common", ":apprtc_common",
":apprtc_signaling", ":apprtc_signaling",
"../sdk:framework_objc", "../sdk:framework_objc+link",
"../sdk:ios_framework_bundle",
] ]
} }
@ -351,9 +333,9 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
deps = [ deps = [
":AppRTCMobile_ios_bundle_data", ":AppRTCMobile_ios_bundle_data",
":AppRTCMobile_ios_frameworks",
":AppRTCMobile_lib", ":AppRTCMobile_lib",
"../sdk:framework_objc", "../sdk:framework_objc",
"../sdk:ios_framework_bundle",
] ]
if (rtc_apprtcmobile_broadcast_extension) { if (rtc_apprtcmobile_broadcast_extension) {
@ -396,7 +378,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
} }
rtc_static_library("AppRTCMobileBroadcastUpload_lib") { rtc_static_library("AppRTCMobileBroadcastUpload_lib") {
check_includes = false
testonly = true testonly = true
sources = [ sources = [
"objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h", "objc/AppRTCMobile/ios/broadcast_extension/ARDBroadcastSampleHandler.h",
@ -404,9 +385,9 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
] ]
deps = [ deps = [
":AppRTCMobile_ios_frameworks",
":apprtc_signaling", ":apprtc_signaling",
"../sdk:framework_objc", "../sdk:framework_objc+link",
"../sdk:ios_framework_bundle",
] ]
libs = [ "ReplayKit.framework" ] libs = [ "ReplayKit.framework" ]
@ -441,18 +422,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
} }
} }
bundle_data("AppRTCMobile_ios_frameworks") {
deps = [
"../sdk:framework_objc+link",
]
sources = [
"$root_build_dir/WebRTC.framework",
]
outputs = [
"{{bundle_resources_dir}}/Frameworks/{{source_file_part}}",
]
}
bundle_data("AppRTCMobile_ios_bundle_data") { bundle_data("AppRTCMobile_ios_bundle_data") {
sources = [ sources = [
"objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf", "objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf",
@ -507,10 +476,12 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
"../modules/audio_processing:audio_processing", "../modules/audio_processing:audio_processing",
"../pc:libjingle_peerconnection", "../pc:libjingle_peerconnection",
"../rtc_base:rtc_base", "../rtc_base:rtc_base",
"../sdk:base_objc",
"../sdk:default_codec_factory_objc", "../sdk:default_codec_factory_objc",
"../sdk:framework_objc", "../sdk:helpers_objc",
"../sdk:native_api", "../sdk:native_api",
"../sdk:ui_objc", "../sdk:ui_objc",
"../sdk:videocapture_objc",
"../sdk:videotoolbox_objc", "../sdk:videotoolbox_objc",
"../system_wrappers:field_trial_default", "../system_wrappers:field_trial_default",
"../system_wrappers:metrics_default", "../system_wrappers:metrics_default",
@ -557,14 +528,7 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
deps = [ deps = [
":apprtc_common", ":apprtc_common",
":apprtc_signaling", ":apprtc_signaling",
"../sdk:default_codec_factory_objc", "../sdk:mac_framework_objc+link",
"../sdk:metal_objc",
"../sdk:peerconnectionfactory_base_objc",
"../sdk:ui_objc",
"../sdk:videocapture_objc",
"../sdk:videocodec_objc",
"../sdk:videocodec_objc",
"../sdk:videotoolbox_objc",
] ]
} }
@ -584,6 +548,8 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
deps = [ deps = [
":AppRTCMobile_lib", ":AppRTCMobile_lib",
"../sdk:mac_framework_bundle",
"../sdk:mac_framework_objc+link",
] ]
} }
} }
@ -629,26 +595,22 @@ if (is_ios || (is_mac && target_cpu != "x86")) {
if (is_ios) { if (is_ios) {
rtc_source_set("apprtcmobile_test_sources") { rtc_source_set("apprtcmobile_test_sources") {
# iOS must use WebRTC.framework which is dynamically linked. # iOS must use WebRTC.framework which is dynamically linked.
# 'gn check' is disabled in order to avoid confusion and
# errors caused by multiple implementations.
check_includes = false
testonly = true testonly = true
include_dirs = [ include_dirs = [
"objc/AppRTCMobile", "objc/AppRTCMobile",
"objc/AppRTCMobile/ios", "objc/AppRTCMobile/ios",
] ]
testonly = true
sources = [ sources = [
"objc/AppRTCMobile/tests/ARDAppClient_xctest.mm", "objc/AppRTCMobile/tests/ARDAppClient_xctest.mm",
"objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm", "objc/AppRTCMobile/tests/ARDFileCaptureController_xctest.mm",
"objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm", "objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm",
] ]
deps = [ deps = [
":AppRTCMobile_ios_frameworks",
":AppRTCMobile_lib", ":AppRTCMobile_lib",
":apprtc_signaling", ":apprtc_signaling",
"../rtc_base:rtc_base", "../rtc_base:rtc_base",
"../sdk:framework_objc", "../sdk:framework_objc+link",
"../sdk:ios_framework_bundle",
"//build/config/ios:xctest", "//build/config/ios:xctest",
"//third_party/ocmock", "//third_party/ocmock",
] ]

View File

@ -1,5 +1,4 @@
include_rules = [ include_rules = [
"+WebRTC",
"+api", "+api",
"+common_video", "+common_video",
"+media", "+media",
@ -8,6 +7,6 @@ include_rules = [
"+modules/audio_processing", "+modules/audio_processing",
"+p2p", "+p2p",
"+pc", "+pc",
"+sdk/objc/Framework/Native/api", "+sdk/objc",
"+third_party/libyuv", "+third_party/libyuv",
] ]

View File

@ -10,7 +10,7 @@
#import "ARDAppClient.h" #import "ARDAppClient.h"
#import "WebRTC/RTCPeerConnection.h" #import <WebRTC/RTCPeerConnection.h>
#import "ARDRoomServerClient.h" #import "ARDRoomServerClient.h"
#import "ARDSignalingChannel.h" #import "ARDSignalingChannel.h"

View File

@ -9,8 +9,8 @@
*/ */
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "WebRTC/RTCPeerConnection.h" #import <WebRTC/RTCPeerConnection.h>
#import "WebRTC/RTCVideoTrack.h" #import <WebRTC/RTCVideoTrack.h>
typedef NS_ENUM(NSInteger, ARDAppClientState) { typedef NS_ENUM(NSInteger, ARDAppClientState) {
// Disconnected from servers. // Disconnected from servers.

View File

@ -10,22 +10,23 @@
#import "ARDAppClient+Internal.h" #import "ARDAppClient+Internal.h"
#import "WebRTC/RTCAudioTrack.h" #import <WebRTC/RTCAudioTrack.h>
#import "WebRTC/RTCCameraVideoCapturer.h" #import <WebRTC/RTCCameraVideoCapturer.h>
#import "WebRTC/RTCConfiguration.h" #import <WebRTC/RTCConfiguration.h>
#import "WebRTC/RTCFileLogger.h" #import <WebRTC/RTCDefaultVideoDecoderFactory.h>
#import "WebRTC/RTCFileVideoCapturer.h" #import <WebRTC/RTCDefaultVideoEncoderFactory.h>
#import "WebRTC/RTCIceServer.h" #import <WebRTC/RTCFileLogger.h>
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCFileVideoCapturer.h>
#import "WebRTC/RTCMediaConstraints.h" #import <WebRTC/RTCIceServer.h>
#import "WebRTC/RTCMediaStream.h" #import <WebRTC/RTCLogging.h>
#import "WebRTC/RTCPeerConnectionFactory.h" #import <WebRTC/RTCMediaConstraints.h>
#import "WebRTC/RTCRtpSender.h" #import <WebRTC/RTCMediaStream.h>
#import "WebRTC/RTCRtpTransceiver.h" #import <WebRTC/RTCPeerConnectionFactory.h>
#import "WebRTC/RTCTracing.h" #import <WebRTC/RTCRtpSender.h>
#import "WebRTC/RTCVideoCodecFactory.h" #import <WebRTC/RTCRtpTransceiver.h>
#import "WebRTC/RTCVideoSource.h" #import <WebRTC/RTCTracing.h>
#import "WebRTC/RTCVideoTrack.h" #import <WebRTC/RTCVideoSource.h>
#import <WebRTC/RTCVideoTrack.h>
#import "ARDAppEngineClient.h" #import "ARDAppEngineClient.h"
#import "ARDExternalSampleCapturer.h" #import "ARDExternalSampleCapturer.h"

View File

@ -10,7 +10,7 @@
#import "ARDAppEngineClient.h" #import "ARDAppEngineClient.h"
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCLogging.h>
#import "ARDJoinResponse.h" #import "ARDJoinResponse.h"
#import "ARDMessageResponse.h" #import "ARDMessageResponse.h"

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <WebRTC/RTCCameraVideoCapturer.h> #import <WebRTC/RTCCameraVideoCapturer.h>
@class ARDSettingsModel; @class ARDSettingsModel;

View File

@ -10,8 +10,9 @@
#import "ARDCaptureController.h" #import "ARDCaptureController.h"
#import <WebRTC/RTCLogging.h>
#import "ARDSettingsModel.h" #import "ARDSettingsModel.h"
#import "WebRTC/RTCLogging.h"
const Float64 kFramerateLimit = 30.0; const Float64 kFramerateLimit = 30.0;

View File

@ -10,7 +10,8 @@
#import "ARDExternalSampleCapturer.h" #import "ARDExternalSampleCapturer.h"
#import "WebRTC/RTCVideoFrameBuffer.h" #import <WebRTC/RTCCVPixelBuffer.h>
#import <WebRTC/RTCVideoFrameBuffer.h>
@implementation ARDExternalSampleCapturer @implementation ARDExternalSampleCapturer

View File

@ -9,6 +9,7 @@
*/ */
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "ARDSettingsModel.h" #import "ARDSettingsModel.h"
@class ARDSettingsStore; @class ARDSettingsStore;

View File

@ -10,7 +10,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "WebRTC/RTCVideoCodec.h" #import <WebRTC/RTCVideoCodecInfo.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN

View File

@ -10,9 +10,10 @@
#import "ARDSettingsModel+Private.h" #import "ARDSettingsModel+Private.h"
#import "ARDSettingsStore.h" #import "ARDSettingsStore.h"
#import "WebRTC/RTCCameraVideoCapturer.h"
#import "WebRTC/RTCMediaConstraints.h" #import <WebRTC/RTCCameraVideoCapturer.h>
#import "WebRTC/RTCVideoCodecFactory.h" #import <WebRTC/RTCDefaultVideoEncoderFactory.h>
#import <WebRTC/RTCMediaConstraints.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN

View File

@ -10,8 +10,8 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "WebRTC/RTCIceCandidate.h" #import <WebRTC/RTCIceCandidate.h>
#import "WebRTC/RTCSessionDescription.h" #import <WebRTC/RTCSessionDescription.h>
typedef enum { typedef enum {
kARDSignalingMessageTypeCandidate, kARDSignalingMessageTypeCandidate,

View File

@ -10,7 +10,7 @@
#import "ARDSignalingMessage.h" #import "ARDSignalingMessage.h"
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCLogging.h>
#import "ARDUtilities.h" #import "ARDUtilities.h"
#import "RTCIceCandidate+JSON.h" #import "RTCIceCandidate+JSON.h"

View File

@ -10,7 +10,7 @@
#import "ARDStatsBuilder.h" #import "ARDStatsBuilder.h"
#import "WebRTC/RTCLegacyStatsReport.h" #import <WebRTC/RTCLegacyStatsReport.h>
#import "ARDBitrateTracker.h" #import "ARDBitrateTracker.h"
#import "ARDUtilities.h" #import "ARDUtilities.h"

View File

@ -10,7 +10,7 @@
#import "ARDWebSocketChannel.h" #import "ARDWebSocketChannel.h"
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCLogging.h>
#import "SRWebSocket.h" #import "SRWebSocket.h"
#import "ARDSignalingMessage.h" #import "ARDSignalingMessage.h"

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCIceCandidate.h" #import <WebRTC/RTCIceCandidate.h>
@interface RTCIceCandidate (JSON) @interface RTCIceCandidate (JSON)

View File

@ -10,7 +10,7 @@
#import "RTCIceCandidate+JSON.h" #import "RTCIceCandidate+JSON.h"
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCLogging.h>
static NSString const *kRTCICECandidateTypeKey = @"type"; static NSString const *kRTCICECandidateTypeKey = @"type";
static NSString const *kRTCICECandidateTypeValue = @"candidate"; static NSString const *kRTCICECandidateTypeValue = @"candidate";

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCIceServer.h" #import <WebRTC/RTCIceServer.h>
@interface RTCIceServer (JSON) @interface RTCIceServer (JSON)

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCMediaConstraints.h" #import <WebRTC/RTCMediaConstraints.h>
@interface RTCMediaConstraints (JSON) @interface RTCMediaConstraints (JSON)

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCSessionDescription.h" #import <WebRTC/RTCSessionDescription.h>
@interface RTCSessionDescription (JSON) @interface RTCSessionDescription (JSON)

View File

@ -12,7 +12,7 @@
#import <mach/mach.h> #import <mach/mach.h>
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCLogging.h>
@implementation NSDictionary (ARDUtilites) @implementation NSDictionary (ARDUtilites)

View File

@ -10,10 +10,10 @@
#import "ARDAppDelegate.h" #import "ARDAppDelegate.h"
#import "WebRTC/RTCFieldTrials.h" #import <WebRTC/RTCFieldTrials.h>
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCLogging.h>
#import "WebRTC/RTCSSLAdapter.h" #import <WebRTC/RTCSSLAdapter.h>
#import "WebRTC/RTCTracing.h" #import <WebRTC/RTCTracing.h>
#import "ARDMainViewController.h" #import "ARDMainViewController.h"

View File

@ -10,7 +10,7 @@
#import "ARDFileCaptureController.h" #import "ARDFileCaptureController.h"
#import "WebRTC/RTCFileVideoCapturer.h" #import <WebRTC/RTCFileVideoCapturer.h>
@interface ARDFileCaptureController () @interface ARDFileCaptureController ()

View File

@ -12,11 +12,10 @@
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import "WebRTC/RTCAudioSession.h" #import <WebRTC/RTCAudioSession.h>
#import "WebRTC/RTCAudioSessionConfiguration.h" #import <WebRTC/RTCAudioSessionConfiguration.h>
#import "WebRTC/RTCDispatcher.h" #import <WebRTC/RTCDispatcher.h>
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCLogging.h>
#import "ARDAppClient.h" #import "ARDAppClient.h"
#import "ARDMainView.h" #import "ARDMainView.h"

View File

@ -10,7 +10,7 @@
#import "ARDStatsView.h" #import "ARDStatsView.h"
#import "WebRTC/RTCLegacyStatsReport.h" #import <WebRTC/RTCLegacyStatsReport.h>
#import "ARDStatsBuilder.h" #import "ARDStatsBuilder.h"

View File

@ -10,17 +10,17 @@
#import "ARDVideoCallViewController.h" #import "ARDVideoCallViewController.h"
#import "WebRTC/RTCAudioSession.h" #import <WebRTC/RTCAudioSession.h>
#import "WebRTC/RTCCameraVideoCapturer.h" #import <WebRTC/RTCCameraVideoCapturer.h>
#import <WebRTC/RTCDispatcher.h>
#import <WebRTC/RTCLogging.h>
#import <WebRTC/RTCMediaConstraints.h>
#import "ARDAppClient.h" #import "ARDAppClient.h"
#import "ARDCaptureController.h" #import "ARDCaptureController.h"
#import "ARDFileCaptureController.h" #import "ARDFileCaptureController.h"
#import "ARDSettingsModel.h" #import "ARDSettingsModel.h"
#import "ARDVideoCallView.h" #import "ARDVideoCallView.h"
#import "WebRTC/RTCDispatcher.h"
#import "WebRTC/RTCLogging.h"
#import "WebRTC/RTCMediaConstraints.h"
@interface ARDVideoCallViewController () <ARDAppClientDelegate, @interface ARDVideoCallViewController () <ARDAppClientDelegate,
ARDVideoCallViewDelegate, ARDVideoCallViewDelegate,

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCVideoCodec.h" #import <WebRTC/RTCVideoCodecInfo.h>
@interface RTCVideoCodecInfo (HumanReadable) @interface RTCVideoCodecInfo (HumanReadable)

View File

@ -9,7 +9,8 @@
*/ */
#import "RTCVideoCodecInfo+HumanReadable.h" #import "RTCVideoCodecInfo+HumanReadable.h"
#import "WebRTC/RTCVideoCodecH264.h"
#import <WebRTC/RTCH264ProfileLevelId.h>
@implementation RTCVideoCodecInfo (HumanReadable) @implementation RTCVideoCodecInfo (HumanReadable)

View File

@ -10,7 +10,7 @@
#import <ReplayKit/ReplayKit.h> #import <ReplayKit/ReplayKit.h>
#import "WebRTC/RTCLogging.h" #import <WebRTC/RTCLogging.h>
#import "ARDAppClient.h" #import "ARDAppClient.h"

View File

@ -10,7 +10,7 @@
#import "APPRTCAppDelegate.h" #import "APPRTCAppDelegate.h"
#import "APPRTCViewController.h" #import "APPRTCViewController.h"
#import "WebRTC/RTCSSLAdapter.h" #import <WebRTC/RTCSSLAdapter.h>
@interface APPRTCAppDelegate () <NSWindowDelegate> @interface APPRTCAppDelegate () <NSWindowDelegate>
@end @end

View File

@ -12,9 +12,9 @@
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import "WebRTC/RTCMTLNSVideoView.h" #import <WebRTC/RTCMTLNSVideoView.h>
#import "WebRTC/RTCNSGLVideoView.h" #import <WebRTC/RTCNSGLVideoView.h>
#import "WebRTC/RTCVideoTrack.h" #import <WebRTC/RTCVideoTrack.h>
#import "ARDAppClient.h" #import "ARDAppClient.h"
#import "ARDCaptureController.h" #import "ARDCaptureController.h"

View File

@ -15,8 +15,8 @@
#include "rtc_base/ssladapter.h" #include "rtc_base/ssladapter.h"
#import "WebRTC/RTCMediaConstraints.h" #import <WebRTC/RTCMediaConstraints.h>
#import "WebRTC/RTCPeerConnectionFactory.h" #import <WebRTC/RTCPeerConnectionFactory.h>
#import "ARDAppClient+Internal.h" #import "ARDAppClient+Internal.h"
#import "ARDJoinResponse+Internal.h" #import "ARDJoinResponse+Internal.h"

View File

@ -14,7 +14,7 @@
#import "ARDFileCaptureController.h" #import "ARDFileCaptureController.h"
#import "WebRTC/RTCFileVideoCapturer.h" #import <WebRTC/RTCFileVideoCapturer.h>
NS_CLASS_AVAILABLE_IOS(10) NS_CLASS_AVAILABLE_IOS(10)
@interface ARDFileCaptureControllerTests : XCTestCase @interface ARDFileCaptureControllerTests : XCTestCase

View File

@ -12,7 +12,7 @@
#import <OCMock/OCMock.h> #import <OCMock/OCMock.h>
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
#import "WebRTC/RTCMediaConstraints.h" #import <WebRTC/RTCMediaConstraints.h>
#import "ARDSettingsModel+Private.h" #import "ARDSettingsModel+Private.h"
#import "ARDSettingsStore.h" #import "ARDSettingsStore.h"

View File

@ -10,11 +10,14 @@
#import "NADViewController.h" #import "NADViewController.h"
#import <WebRTC/RTCCameraPreviewView.h> #import "sdk/objc/base/RTCVideoRenderer.h"
#import <WebRTC/RTCCameraVideoCapturer.h> #import "sdk/objc/components/capturer/RTCCameraVideoCapturer.h"
#import <WebRTC/RTCEAGLVideoView.h> #if defined(RTC_SUPPORTS_METAL)
#import <WebRTC/RTCMTLVideoView.h> #import "sdk/objc/components/renderer/metal/RTCMTLVideoView.h" // nogncheck
#import <WebRTC/RTCVideoRenderer.h> #endif
#import "sdk/objc/components/renderer/opengl/RTCEAGLVideoView.h"
#import "sdk/objc/helpers/RTCCameraPreviewView.h"
#include <memory> #include <memory>
#include "objccallclient.h" #include "objccallclient.h"

View File

@ -12,9 +12,10 @@
#include <utility> #include <utility>
#import <WebRTC/RTCCameraPreviewView.h> #import "sdk/objc/base/RTCVideoRenderer.h"
#import <WebRTC/RTCVideoCodecFactory.h> #import "sdk/objc/components/video_codec/RTCDefaultVideoDecoderFactory.h"
#import <WebRTC/RTCVideoRenderer.h> #import "sdk/objc/components/video_codec/RTCDefaultVideoEncoderFactory.h"
#import "sdk/objc/helpers/RTCCameraPreviewView.h"
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_decoder_factory.h"
@ -22,10 +23,10 @@
#include "api/peerconnectioninterface.h" #include "api/peerconnectioninterface.h"
#include "media/engine/webrtcmediaengine.h" #include "media/engine/webrtcmediaengine.h"
#include "modules/audio_processing/include/audio_processing.h" #include "modules/audio_processing/include/audio_processing.h"
#include "sdk/objc/Framework/Native/api/video_capturer.h" #include "sdk/objc/native/api/video_capturer.h"
#include "sdk/objc/Framework/Native/api/video_decoder_factory.h" #include "sdk/objc/native/api/video_decoder_factory.h"
#include "sdk/objc/Framework/Native/api/video_encoder_factory.h" #include "sdk/objc/native/api/video_encoder_factory.h"
#include "sdk/objc/Framework/Native/api/video_renderer.h" #include "sdk/objc/native/api/video_renderer.h"
namespace webrtc_examples { namespace webrtc_examples {

View File

@ -69,8 +69,9 @@ if (rtc_include_internal_audio_device && is_ios) {
"../../rtc_base:gtest_prod", "../../rtc_base:gtest_prod",
"../../rtc_base:rtc_base", "../../rtc_base:rtc_base",
"../../rtc_base/system:fallthrough", "../../rtc_base/system:fallthrough",
"../../sdk:audio_device",
"../../sdk:audio_objc", "../../sdk:audio_objc",
"../../sdk:common_objc", "../../sdk:base_objc",
"../../system_wrappers:metrics_api", "../../system_wrappers:metrics_api",
] ]
if (!build_with_chromium && is_clang) { if (!build_with_chromium && is_clang) {

View File

@ -25,6 +25,9 @@ specific_include_rules = {
"RTCAudioSessionDelegateAdapter\.h": [ "RTCAudioSessionDelegateAdapter\.h": [
"+sdk/objc", "+sdk/objc",
], ],
"RTCAudioSessionDelegateAdapter\.mm": [
"+sdk/objc",
],
"voice_processing_audio_unit\.mm": [ "voice_processing_audio_unit\.mm": [
"+sdk/objc", "+sdk/objc",
], ],

View File

@ -21,7 +21,7 @@
#include "rtc_base/thread.h" #include "rtc_base/thread.h"
#include "rtc_base/thread_annotations.h" #include "rtc_base/thread_annotations.h"
#include "rtc_base/thread_checker.h" #include "rtc_base/thread_checker.h"
#include "sdk/objc/Framework/Headers/WebRTC/RTCMacros.h" #include "sdk/objc/base/RTCMacros.h"
RTC_FWD_DECL_OBJC_CLASS(RTCAudioSessionDelegateAdapter); RTC_FWD_DECL_OBJC_CLASS(RTCAudioSessionDelegateAdapter);

View File

@ -25,14 +25,14 @@
#include "rtc_base/thread.h" #include "rtc_base/thread.h"
#include "rtc_base/thread_annotations.h" #include "rtc_base/thread_annotations.h"
#include "rtc_base/timeutils.h" #include "rtc_base/timeutils.h"
#include "sdk/objc/Framework/Classes/Common/helpers.h" #include "sdk/objc/native/src/audio/helpers.h"
#include "system_wrappers/include/metrics.h" #include "system_wrappers/include/metrics.h"
#import "WebRTC/RTCLogging.h"
#import "modules/audio_device/ios/objc/RTCAudioSessionDelegateAdapter.h" #import "modules/audio_device/ios/objc/RTCAudioSessionDelegateAdapter.h"
#import "sdk/objc/Framework/Classes/Audio/RTCAudioSession+Private.h" #import "sdk/objc/base/RTCLogging.h"
#import "sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h" #import "sdk/objc/components/audio/RTCAudioSession+Private.h"
#import "sdk/objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h" #import "sdk/objc/components/audio/RTCAudioSession.h"
#import "sdk/objc/components/audio/RTCAudioSessionConfiguration.h"
namespace webrtc { namespace webrtc {

View File

@ -31,8 +31,8 @@
#include "test/gtest.h" #include "test/gtest.h"
#include "test/testsupport/fileutils.h" #include "test/testsupport/fileutils.h"
#import "sdk/objc/Framework/Classes/Audio/RTCAudioSession+Private.h" #import "sdk/objc/components/audio/RTCAudioSession+Private.h"
#import "sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h" #import "sdk/objc/components/audio/RTCAudioSession.h"
using std::cout; using std::cout;
using std::endl; using std::endl;

View File

@ -8,4 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h" #import "sdk/objc/components/audio/RTCAudioSession.h"

View File

@ -8,4 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "sdk/objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h" #import "sdk/objc/components/audio/RTCAudioSessionConfiguration.h"

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "sdk/objc/Framework/Headers/WebRTC/RTCAudioSession.h" #import "sdk/objc/components/audio/RTCAudioSession.h"
namespace webrtc { namespace webrtc {
class AudioSessionObserver; class AudioSessionObserver;

View File

@ -12,7 +12,7 @@
#include "modules/audio_device/ios/audio_session_observer.h" #include "modules/audio_device/ios/audio_session_observer.h"
#import "WebRTC/RTCLogging.h" #import "sdk/objc/base/RTCLogging.h"
@implementation RTCAudioSessionDelegateAdapter { @implementation RTCAudioSessionDelegateAdapter {
webrtc::AudioSessionObserver *_observer; webrtc::AudioSessionObserver *_observer;

View File

@ -14,8 +14,8 @@
#include "rtc_base/system/fallthrough.h" #include "rtc_base/system/fallthrough.h"
#include "system_wrappers/include/metrics.h" #include "system_wrappers/include/metrics.h"
#import "WebRTC/RTCLogging.h" #import "sdk/objc/base//RTCLogging.h"
#import "sdk/objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h" #import "sdk/objc/components/audio/RTCAudioSessionConfiguration.h"
#if !defined(NDEBUG) #if !defined(NDEBUG)
static void LogStreamDescription(AudioStreamBasicDescription description) { static void LogStreamDescription(AudioStreamBasicDescription description) {

View File

@ -200,7 +200,7 @@ if (is_mac) {
"../../rtc_base:rtc_base", "../../rtc_base:rtc_base",
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../rtc_base/synchronization:rw_lock_wrapper", "../../rtc_base/synchronization:rw_lock_wrapper",
"../../sdk:common_objc", "../../sdk:helpers_objc",
"//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/memory",
] ]
libs = [ libs = [

View File

@ -16,7 +16,7 @@
#include <memory> #include <memory>
#include "modules/desktop_capture/desktop_frame.h" #include "modules/desktop_capture/desktop_frame.h"
#include "sdk/objc/Framework/Classes/Common/scoped_cftyperef.h" #include "sdk/objc/helpers/scoped_cftyperef.h"
namespace webrtc { namespace webrtc {

View File

@ -17,7 +17,7 @@
#include <memory> #include <memory>
#include "modules/desktop_capture/desktop_frame.h" #include "modules/desktop_capture/desktop_frame.h"
#include "sdk/objc/Framework/Classes/Common/scoped_cftyperef.h" #include "sdk/objc/helpers/scoped_cftyperef.h"
namespace webrtc { namespace webrtc {

View File

@ -19,7 +19,7 @@
#include "modules/desktop_capture/shared_desktop_frame.h" #include "modules/desktop_capture/shared_desktop_frame.h"
#include "rtc_base/thread_checker.h" #include "rtc_base/thread_checker.h"
#include "sdk/objc/Framework/Classes/Common/scoped_cftyperef.h" #include "sdk/objc/helpers/scoped_cftyperef.h"
namespace webrtc { namespace webrtc {

View File

@ -18,7 +18,7 @@
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
#include "rtc_base/timeutils.h" #include "rtc_base/timeutils.h"
#include "rtc_base/trace_event.h" #include "rtc_base/trace_event.h"
#include "sdk/objc/Framework/Classes/Common/scoped_cftyperef.h" #include "sdk/objc/helpers/scoped_cftyperef.h"
namespace webrtc { namespace webrtc {

View File

@ -536,7 +536,6 @@ if (rtc_include_tests) {
"../../media:rtc_media_base", "../../media:rtc_media_base",
"../../modules:module_api", "../../modules:module_api",
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../sdk:common_objc",
"../../sdk:native_api", "../../sdk:native_api",
"../../sdk:peerconnectionfactory_base_objc", "../../sdk:peerconnectionfactory_base_objc",
"../../sdk:videocodec_objc", "../../sdk:videocodec_objc",

View File

@ -10,9 +10,10 @@
#include "modules/video_coding/codecs/test/objc_codec_factory_helper.h" #include "modules/video_coding/codecs/test/objc_codec_factory_helper.h"
#import "WebRTC/RTCVideoCodecH264.h" #import "sdk/objc/components/video_codec/RTCVideoDecoderFactoryH264.h"
#include "sdk/objc/Framework/Native/api/video_decoder_factory.h" #import "sdk/objc/components/video_codec/RTCVideoEncoderFactoryH264.h"
#include "sdk/objc/Framework/Native/api/video_encoder_factory.h" #include "sdk/objc/native/api/video_decoder_factory.h"
#include "sdk/objc/native/api/video_encoder_factory.h"
namespace webrtc { namespace webrtc {
namespace test { namespace test {

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,8 @@
include_rules = [ include_rules = [
"+WebRTC", "+base",
"+Common", "+components",
"+Video", "+helpers",
"+Audio", "+sdk",
"+UI",
"+PeerConnection",
"+VideoToolbox",
"+Metal",
"+api", "+api",
"+common_video/h264", "+common_video/h264",
"+common_video/include", "+common_video/include",
@ -17,5 +13,6 @@ include_rules = [
"+system_wrappers", "+system_wrappers",
"+modules/audio_device", "+modules/audio_device",
"+modules/audio_processing", "+modules/audio_processing",
"+native",
"+third_party/libyuv", "+third_party/libyuv",
] ]

View File

@ -8,19 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "helpers/NSString+StdString.h"
#include <string>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (StdString)
@property(nonatomic, readonly) std::string stdString;
+ (std::string)stdStringForString:(NSString *)nsString;
+ (NSString *)stringForStdString:(const std::string &)stdString;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,18 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#if defined(WEBRTC_IOS) #import "helpers/RTCUIApplicationStatusObserver.h"
#import <Foundation/Foundation.h>
NS_EXTENSION_UNAVAILABLE_IOS("Application status not available in app extensions.")
@interface RTCUIApplicationStatusObserver : NSObject
+ (instancetype)sharedInstance;
+ (void)prepareForUse;
- (BOOL)isApplicationActive;
@end
#endif // WEBRTC_IOS

View File

@ -9,108 +9,4 @@
* *
*/ */
#ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_SCOPED_CFTYPEREF_H_ #import "helpers/scoped_cftyperef.h"
#define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_SCOPED_CFTYPEREF_H_
#include <CoreFoundation/CoreFoundation.h>
namespace rtc {
// RETAIN: ScopedTypeRef should retain the object when it takes
// ownership.
// ASSUME: Assume the object already has already been retained.
// ScopedTypeRef takes over ownership.
enum class RetainPolicy { RETAIN, ASSUME };
namespace internal {
template <typename T>
struct CFTypeRefTraits {
static T InvalidValue() { return nullptr; }
static void Release(T ref) { CFRelease(ref); }
static T Retain(T ref) {
CFRetain(ref);
return ref;
}
};
template <typename T, typename Traits>
class ScopedTypeRef {
public:
ScopedTypeRef() : ptr_(Traits::InvalidValue()) {}
explicit ScopedTypeRef(T ptr) : ptr_(ptr) {}
ScopedTypeRef(T ptr, RetainPolicy policy) : ScopedTypeRef(ptr) {
if (ptr_ && policy == RetainPolicy::RETAIN)
Traits::Retain(ptr_);
}
ScopedTypeRef(const ScopedTypeRef<T, Traits>& rhs) : ptr_(rhs.ptr_) {
if (ptr_)
ptr_ = Traits::Retain(ptr_);
}
~ScopedTypeRef() {
if (ptr_) {
Traits::Release(ptr_);
}
}
T get() const { return ptr_; }
T operator->() const { return ptr_; }
explicit operator bool() const { return ptr_; }
bool operator!() const { return !ptr_; }
ScopedTypeRef& operator=(const T& rhs) {
if (ptr_)
Traits::Release(ptr_);
ptr_ = rhs;
return *this;
}
ScopedTypeRef& operator=(const ScopedTypeRef<T, Traits>& rhs) {
reset(rhs.get(), RetainPolicy::RETAIN);
return *this;
}
// This is intended to take ownership of objects that are
// created by pass-by-pointer initializers.
T* InitializeInto() {
RTC_DCHECK(!ptr_);
return &ptr_;
}
void reset(T ptr, RetainPolicy policy = RetainPolicy::ASSUME) {
if (ptr && policy == RetainPolicy::RETAIN)
Traits::Retain(ptr);
if (ptr_)
Traits::Release(ptr_);
ptr_ = ptr;
}
T release() {
T temp = ptr_;
ptr_ = Traits::InvalidValue();
return temp;
}
private:
T ptr_;
};
} // namespace internal
template <typename T>
using ScopedCFTypeRef =
internal::ScopedTypeRef<T, internal::CFTypeRefTraits<T>>;
template <typename T>
static ScopedCFTypeRef<T> AdoptCF(T cftype) {
return ScopedCFTypeRef<T>(cftype, RetainPolicy::RETAIN);
}
template <typename T>
static ScopedCFTypeRef<T> ScopedCF(T cftype) {
return ScopedCFTypeRef<T>(cftype);
}
} // namespace rtc
#endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_SCOPED_CFTYPEREF_H_

View File

@ -8,21 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCConfiguration.h" #import "api/peerconnection/RTCConfiguration+Native.h"
#include "api/peerconnectioninterface.h"
NS_ASSUME_NONNULL_BEGIN
@interface RTCConfiguration ()
/** Optional TurnCustomizer.
* With this class one can modify outgoing TURN messages.
* The object passed in must remain valid until PeerConnection::Close() is
* called.
*/
@property(nonatomic, nullable) webrtc::TurnCustomizer* turnCustomizer;
@end
NS_ASSUME_NONNULL_END

View File

@ -1,83 +0,0 @@
/*
* 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 "WebRTC/RTCVideoCodec.h"
#import "RTCVideoCodec+Private.h"
#include "rtc_base/numerics/safe_conversions.h"
@implementation RTCEncodedImage
@synthesize buffer = _buffer;
@synthesize encodedWidth = _encodedWidth;
@synthesize encodedHeight = _encodedHeight;
@synthesize timeStamp = _timeStamp;
@synthesize captureTimeMs = _captureTimeMs;
@synthesize ntpTimeMs = _ntpTimeMs;
@synthesize flags = _flags;
@synthesize encodeStartMs = _encodeStartMs;
@synthesize encodeFinishMs = _encodeFinishMs;
@synthesize frameType = _frameType;
@synthesize rotation = _rotation;
@synthesize completeFrame = _completeFrame;
@synthesize qp = _qp;
@synthesize contentType = _contentType;
- (instancetype)initWithNativeEncodedImage:(webrtc::EncodedImage)encodedImage {
if (self = [super init]) {
// Wrap the buffer in NSData without copying, do not take ownership.
_buffer = [NSData dataWithBytesNoCopy:encodedImage._buffer
length:encodedImage._length
freeWhenDone:NO];
_encodedWidth = rtc::dchecked_cast<int32_t>(encodedImage._encodedWidth);
_encodedHeight = rtc::dchecked_cast<int32_t>(encodedImage._encodedHeight);
_timeStamp = encodedImage.Timestamp();
_captureTimeMs = encodedImage.capture_time_ms_;
_ntpTimeMs = encodedImage.ntp_time_ms_;
_flags = encodedImage.timing_.flags;
_encodeStartMs = encodedImage.timing_.encode_start_ms;
_encodeFinishMs = encodedImage.timing_.encode_finish_ms;
_frameType = static_cast<RTCFrameType>(encodedImage._frameType);
_rotation = static_cast<RTCVideoRotation>(encodedImage.rotation_);
_completeFrame = encodedImage._completeFrame;
_qp = @(encodedImage.qp_);
_contentType = (encodedImage.content_type_ == webrtc::VideoContentType::SCREENSHARE) ?
RTCVideoContentTypeScreenshare :
RTCVideoContentTypeUnspecified;
}
return self;
}
- (webrtc::EncodedImage)nativeEncodedImage {
// Return the pointer without copying.
webrtc::EncodedImage encodedImage(
(uint8_t *)_buffer.bytes, (size_t)_buffer.length, (size_t)_buffer.length);
encodedImage._encodedWidth = rtc::dchecked_cast<uint32_t>(_encodedWidth);
encodedImage._encodedHeight = rtc::dchecked_cast<uint32_t>(_encodedHeight);
encodedImage.SetTimestamp(_timeStamp);
encodedImage.capture_time_ms_ = _captureTimeMs;
encodedImage.ntp_time_ms_ = _ntpTimeMs;
encodedImage.timing_.flags = _flags;
encodedImage.timing_.encode_start_ms = _encodeStartMs;
encodedImage.timing_.encode_finish_ms = _encodeFinishMs;
encodedImage._frameType = webrtc::FrameType(_frameType);
encodedImage.rotation_ = webrtc::VideoRotation(_rotation);
encodedImage._completeFrame = _completeFrame;
encodedImage.qp_ = _qp ? _qp.intValue : -1;
encodedImage.content_type_ = (_contentType == RTCVideoContentTypeScreenshare) ?
webrtc::VideoContentType::SCREENSHARE :
webrtc::VideoContentType::UNSPECIFIED;
return encodedImage;
}
@end

View File

@ -8,27 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCPeerConnection.h" #import "api/peerconnection/RTCPeerConnection+Native.h"
#include <memory>
namespace rtc {
class BitrateAllocationStrategy;
} // namespace rtc
NS_ASSUME_NONNULL_BEGIN
/**
* This class extension exposes methods that work directly with injectable C++ components.
*/
@interface RTCPeerConnection ()
/** Sets current strategy. If not set default WebRTC allocator will be used. May be changed during
* an active session.
*/
- (void)setBitrateAllocationStrategy:
(std::unique_ptr<rtc::BitrateAllocationStrategy>)bitrateAllocationStrategy;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,47 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCPeerConnectionFactory.h" #import "api/peerconnection/RTCPeerConnectionFactory+Native.h"
#include "rtc_base/scoped_ref_ptr.h"
namespace webrtc {
class AudioDeviceModule;
class AudioEncoderFactory;
class AudioDecoderFactory;
class VideoEncoderFactory;
class VideoDecoderFactory;
class AudioProcessing;
} // namespace webrtc
NS_ASSUME_NONNULL_BEGIN
/**
* This class extension exposes methods that work directly with injectable C++ components.
*/
@interface RTCPeerConnectionFactory ()
- (instancetype)initNative NS_DESIGNATED_INITIALIZER;
/* Initializer used when WebRTC is compiled with no media support */
- (instancetype)initWithNoMedia;
/* Initialize object with injectable native audio/video encoder/decoder factories */
- (instancetype)initWithNativeAudioEncoderFactory:
(rtc::scoped_refptr<webrtc::AudioEncoderFactory>)audioEncoderFactory
nativeAudioDecoderFactory:
(rtc::scoped_refptr<webrtc::AudioDecoderFactory>)audioDecoderFactory
nativeVideoEncoderFactory:
(std::unique_ptr<webrtc::VideoEncoderFactory>)videoEncoderFactory
nativeVideoDecoderFactory:
(std::unique_ptr<webrtc::VideoDecoderFactory>)videoDecoderFactory
audioDeviceModule:
(nullable webrtc::AudioDeviceModule *)audioDeviceModule
audioProcessingModule:
(rtc::scoped_refptr<webrtc::AudioProcessing>)audioProcessingModule;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,51 +8,8 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCVideoCodec.h" #import "api/peerconnection/RTCEncodedImage+Private.h"
#import "api/peerconnection/RTCRtpFragmentationHeader+Private.h"
#import "WebRTC/RTCVideoCodecH264.h" #import "api/peerconnection/RTCVideoCodecInfo+Private.h"
#import "api/peerconnection/RTCVideoEncoderSettings+Private.h"
#include "api/video_codecs/sdp_video_format.h" #import "components/video_codec/RTCCodecSpecificInfoH264+Private.h"
#include "common_video/include/video_frame.h"
#include "media/base/codec.h"
#include "modules/video_coding/include/video_codec_interface.h"
NS_ASSUME_NONNULL_BEGIN
/* Interfaces for converting to/from internal C++ formats. */
@interface RTCEncodedImage ()
- (instancetype)initWithNativeEncodedImage:(webrtc::EncodedImage)encodedImage;
- (webrtc::EncodedImage)nativeEncodedImage;
@end
@interface RTCVideoEncoderSettings ()
- (instancetype)initWithNativeVideoCodec:(const webrtc::VideoCodec *__nullable)videoCodec;
- (webrtc::VideoCodec)nativeVideoCodec;
@end
@interface RTCCodecSpecificInfoH264 ()
- (webrtc::CodecSpecificInfo)nativeCodecSpecificInfo;
@end
@interface RTCRtpFragmentationHeader ()
- (instancetype)initWithNativeFragmentationHeader:
(const webrtc::RTPFragmentationHeader *__nullable)fragmentationHeader;
- (std::unique_ptr<webrtc::RTPFragmentationHeader>)createNativeFragmentationHeader;
@end
@interface RTCVideoCodecInfo ()
- (instancetype)initWithNativeSdpVideoFormat:(webrtc::SdpVideoFormat)format;
- (webrtc::SdpVideoFormat)nativeSdpVideoFormat;
@end
NS_ASSUME_NONNULL_END

View File

@ -1,167 +0,0 @@
/*
* 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 "WebRTC/RTCVideoCodec.h"
#import "NSString+StdString.h"
#import "RTCVideoCodec+Private.h"
#if defined(WEBRTC_IOS)
#import "UIDevice+H264Profile.h"
#endif
#import "WebRTC/RTCVideoCodecFactory.h"
#include "media/base/mediaconstants.h"
namespace {
NSString *MaxSupportedProfileLevelConstrainedHigh();
NSString *MaxSupportedProfileLevelConstrainedBaseline();
} // namespace
NSString *const kRTCVideoCodecVp8Name = @(cricket::kVp8CodecName);
NSString *const kRTCVideoCodecVp9Name = @(cricket::kVp9CodecName);
NSString *const kRTCVideoCodecH264Name = @(cricket::kH264CodecName);
NSString *const kRTCLevel31ConstrainedHigh = @"640c1f";
NSString *const kRTCLevel31ConstrainedBaseline = @"42e01f";
NSString *const kRTCMaxSupportedH264ProfileLevelConstrainedHigh =
MaxSupportedProfileLevelConstrainedHigh();
NSString *const kRTCMaxSupportedH264ProfileLevelConstrainedBaseline =
MaxSupportedProfileLevelConstrainedBaseline();
namespace {
#if defined(WEBRTC_IOS)
using namespace webrtc::H264;
NSString *MaxSupportedLevelForProfile(Profile profile) {
const absl::optional<ProfileLevelId> profileLevelId = [UIDevice maxSupportedH264Profile];
if (profileLevelId && profileLevelId->profile >= profile) {
const absl::optional<std::string> profileString =
ProfileLevelIdToString(ProfileLevelId(profile, profileLevelId->level));
if (profileString) {
return [NSString stringForStdString:*profileString];
}
}
return nil;
}
#endif
NSString *MaxSupportedProfileLevelConstrainedBaseline() {
#if defined(WEBRTC_IOS)
NSString *profile = MaxSupportedLevelForProfile(webrtc::H264::kProfileConstrainedBaseline);
if (profile != nil) {
return profile;
}
#endif
return kRTCLevel31ConstrainedBaseline;
}
NSString *MaxSupportedProfileLevelConstrainedHigh() {
#if defined(WEBRTC_IOS)
NSString *profile = MaxSupportedLevelForProfile(webrtc::H264::kProfileConstrainedHigh);
if (profile != nil) {
return profile;
}
#endif
return kRTCLevel31ConstrainedHigh;
}
} // namespace
@implementation RTCVideoCodecInfo
@synthesize name = _name;
@synthesize parameters = _parameters;
- (instancetype)initWithName:(NSString *)name {
return [self initWithName:name parameters:nil];
}
- (instancetype)initWithName:(NSString *)name
parameters:(nullable NSDictionary<NSString *, NSString *> *)parameters {
if (self = [super init]) {
_name = name;
_parameters = (parameters ? parameters : @{});
}
return self;
}
- (instancetype)initWithNativeSdpVideoFormat:(webrtc::SdpVideoFormat)format {
NSMutableDictionary *params = [NSMutableDictionary dictionary];
for (auto it = format.parameters.begin(); it != format.parameters.end(); ++it) {
[params setObject:[NSString stringForStdString:it->second]
forKey:[NSString stringForStdString:it->first]];
}
return [self initWithName:[NSString stringForStdString:format.name] parameters:params];
}
- (BOOL)isEqualToCodecInfo:(RTCVideoCodecInfo *)info {
if (!info ||
![self.name isEqualToString:info.name] ||
![self.parameters isEqualToDictionary:info.parameters]) {
return NO;
}
return YES;
}
- (BOOL)isEqual:(id)object {
if (self == object)
return YES;
if (![object isKindOfClass:[self class]])
return NO;
return [self isEqualToCodecInfo:object];
}
- (NSUInteger)hash {
return [self.name hash] ^ [self.parameters hash];
}
- (webrtc::SdpVideoFormat)nativeSdpVideoFormat {
std::map<std::string, std::string> parameters;
for (NSString *paramKey in _parameters.allKeys) {
std::string key = [NSString stdStringForString:paramKey];
std::string value = [NSString stdStringForString:_parameters[paramKey]];
parameters[key] = value;
}
return webrtc::SdpVideoFormat([NSString stdStringForString:_name], parameters);
}
#pragma mark - NSCoding
- (instancetype)initWithCoder:(NSCoder *)decoder {
return [self initWithName:[decoder decodeObjectForKey:@"name"]
parameters:[decoder decodeObjectForKey:@"parameters"]];
}
- (void)encodeWithCoder:(NSCoder *)encoder {
[encoder encodeObject:_name forKey:@"name"];
[encoder encodeObject:_parameters forKey:@"parameters"];
}
@end
@implementation RTCVideoEncoderQpThresholds
@synthesize low = _low;
@synthesize high = _high;
- (instancetype)initWithThresholdsLow:(NSInteger)low high:(NSInteger)high {
if (self = [super init]) {
_low = low;
_high = high;
}
return self;
}
@end

View File

@ -1,66 +0,0 @@
/*
* 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 "WebRTC/RTCVideoCodec.h"
#import "NSString+StdString.h"
#import "RTCVideoCodec+Private.h"
#import "WebRTC/RTCVideoCodecFactory.h"
@implementation RTCVideoEncoderSettings
@synthesize name = _name;
@synthesize width = _width;
@synthesize height = _height;
@synthesize startBitrate = _startBitrate;
@synthesize maxBitrate = _maxBitrate;
@synthesize minBitrate = _minBitrate;
@synthesize targetBitrate = _targetBitrate;
@synthesize maxFramerate = _maxFramerate;
@synthesize qpMax = _qpMax;
@synthesize mode = _mode;
- (instancetype)initWithNativeVideoCodec:(const webrtc::VideoCodec *)videoCodec {
if (self = [super init]) {
if (videoCodec) {
const char *codecName = CodecTypeToPayloadString(videoCodec->codecType);
_name = [NSString stringWithUTF8String:codecName];
_width = videoCodec->width;
_height = videoCodec->height;
_startBitrate = videoCodec->startBitrate;
_maxBitrate = videoCodec->maxBitrate;
_minBitrate = videoCodec->minBitrate;
_targetBitrate = videoCodec->targetBitrate;
_maxFramerate = videoCodec->maxFramerate;
_qpMax = videoCodec->qpMax;
_mode = (RTCVideoCodecMode)videoCodec->mode;
}
}
return self;
}
- (webrtc::VideoCodec)nativeVideoCodec {
webrtc::VideoCodec videoCodec;
videoCodec.width = _width;
videoCodec.height = _height;
videoCodec.startBitrate = _startBitrate;
videoCodec.maxBitrate = _maxBitrate;
videoCodec.minBitrate = _minBitrate;
videoCodec.targetBitrate = _targetBitrate;
videoCodec.maxBitrate = _maxBitrate;
videoCodec.qpMax = _qpMax;
videoCodec.mode = (webrtc::VideoCodecMode)_mode;
return videoCodec;
}
@end

View File

@ -8,16 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import "WebRTC/RTCVideoViewShading.h" #import "components/renderer/opengl/RTCDefaultShader.h"
NS_ASSUME_NONNULL_BEGIN
/** Default RTCVideoViewShading that will be used in RTCNSGLVideoView and
* RTCEAGLVideoView if no external shader is specified. This shader will render
* the video in a rectangle without any color or geometric transformations.
*/
@interface RTCDefaultShader : NSObject<RTCVideoViewShading>
@end
NS_ASSUME_NONNULL_END

View File

@ -8,24 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <GLKit/GLKit.h> #import "components/renderer/opengl/RTCNV12TextureCache.h"
@class RTCVideoFrame;
NS_ASSUME_NONNULL_BEGIN
@interface RTCNV12TextureCache : NSObject
@property(nonatomic, readonly) GLuint yTexture;
@property(nonatomic, readonly) GLuint uvTexture;
- (instancetype)init NS_UNAVAILABLE;
- (nullable instancetype)initWithContext:(EAGLContext *)context NS_DESIGNATED_INITIALIZER;
- (BOOL)uploadFrameToTextures:(RTCVideoFrame *)frame;
- (void)releaseTextures;
@end
NS_ASSUME_NONNULL_END

View File

@ -6,111 +6,6 @@
* tree. An additional intellectual property rights grant can be found * tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may * in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*
*/ */
#ifndef SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOX_NALU_REWRITER_H_ #import "components/video_codec/nalu_rewriter.h"
#define SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOX_NALU_REWRITER_H_
#include "modules/video_coding/codecs/h264/include/h264.h"
#include <CoreMedia/CoreMedia.h>
#include <vector>
#include "common_video/h264/h264_common.h"
#include "modules/include/module_common_types.h"
#include "rtc_base/buffer.h"
using webrtc::H264::NaluIndex;
namespace webrtc {
// Converts a sample buffer emitted from the VideoToolbox encoder into a buffer
// suitable for RTP. The sample buffer is in avcc format whereas the rtp buffer
// needs to be in Annex B format. Data is written directly to |annexb_buffer|
// and a new RTPFragmentationHeader is returned in |out_header|.
bool H264CMSampleBufferToAnnexBBuffer(
CMSampleBufferRef avcc_sample_buffer,
bool is_keyframe,
rtc::Buffer* annexb_buffer,
std::unique_ptr<RTPFragmentationHeader>* out_header);
// Converts a buffer received from RTP into a sample buffer suitable for the
// VideoToolbox decoder. The RTP buffer is in annex b format whereas the sample
// buffer is in avcc format.
// If |is_keyframe| is true then |video_format| is ignored since the format will
// be read from the buffer. Otherwise |video_format| must be provided.
// Caller is responsible for releasing the created sample buffer.
bool H264AnnexBBufferToCMSampleBuffer(const uint8_t* annexb_buffer,
size_t annexb_buffer_size,
CMVideoFormatDescriptionRef video_format,
CMSampleBufferRef* out_sample_buffer);
// Returns a video format description created from the sps/pps information in
// the Annex B buffer. If there is no such information, nullptr is returned.
// The caller is responsible for releasing the description.
CMVideoFormatDescriptionRef CreateVideoFormatDescription(
const uint8_t* annexb_buffer,
size_t annexb_buffer_size);
// Helper class for reading NALUs from an RTP Annex B buffer.
class AnnexBBufferReader final {
public:
AnnexBBufferReader(const uint8_t* annexb_buffer, size_t length);
~AnnexBBufferReader();
AnnexBBufferReader(const AnnexBBufferReader& other) = delete;
void operator=(const AnnexBBufferReader& other) = delete;
// Returns a pointer to the beginning of the next NALU slice without the
// header bytes and its length. Returns false if no more slices remain.
bool ReadNalu(const uint8_t** out_nalu, size_t* out_length);
// Returns the number of unread NALU bytes, including the size of the header.
// If the buffer has no remaining NALUs this will return zero.
size_t BytesRemaining() const;
// Reset the reader to start reading from the first NALU
void SeekToStart();
// Seek to the next position that holds a NALU of the desired type,
// or the end if no such NALU is found.
// Return true if a NALU of the desired type is found, false if we
// reached the end instead
bool SeekToNextNaluOfType(H264::NaluType type);
private:
// Returns the the next offset that contains NALU data.
size_t FindNextNaluHeader(const uint8_t* start,
size_t length,
size_t offset) const;
const uint8_t* const start_;
std::vector<NaluIndex> offsets_;
std::vector<NaluIndex>::iterator offset_;
const size_t length_;
};
// Helper class for writing NALUs using avcc format into a buffer.
class AvccBufferWriter final {
public:
AvccBufferWriter(uint8_t* const avcc_buffer, size_t length);
~AvccBufferWriter() {}
AvccBufferWriter(const AvccBufferWriter& other) = delete;
void operator=(const AvccBufferWriter& other) = delete;
// Writes the data slice into the buffer. Returns false if there isn't
// enough space left.
bool WriteNalu(const uint8_t* data, size_t data_size);
// Returns the unused bytes in the buffer.
size_t BytesRemaining() const;
private:
uint8_t* const start_;
size_t offset_;
const size_t length_;
};
} // namespace webrtc
#endif // SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOX_NALU_REWRITER_H_

View File

@ -8,242 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <AVFoundation/AVFoundation.h> #import "components/audio/RTCAudioSession.h"
#import <Foundation/Foundation.h>
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
extern NSString *const kRTCAudioSessionErrorDomain;
/** Method that requires lock was called without lock. */
extern NSInteger const kRTCAudioSessionErrorLockRequired;
/** Unknown configuration error occurred. */
extern NSInteger const kRTCAudioSessionErrorConfiguration;
@class RTCAudioSession;
@class RTCAudioSessionConfiguration;
// Surfaces AVAudioSession events. WebRTC will listen directly for notifications
// from AVAudioSession and handle them before calling these delegate methods,
// at which point applications can perform additional processing if required.
RTC_EXPORT
@protocol RTCAudioSessionDelegate <NSObject>
@optional
/** Called on a system notification thread when AVAudioSession starts an
* interruption event.
*/
- (void)audioSessionDidBeginInterruption:(RTCAudioSession *)session;
/** Called on a system notification thread when AVAudioSession ends an
* interruption event.
*/
- (void)audioSessionDidEndInterruption:(RTCAudioSession *)session
shouldResumeSession:(BOOL)shouldResumeSession;
/** Called on a system notification thread when AVAudioSession changes the
* route.
*/
- (void)audioSessionDidChangeRoute:(RTCAudioSession *)session
reason:(AVAudioSessionRouteChangeReason)reason
previousRoute:(AVAudioSessionRouteDescription *)previousRoute;
/** Called on a system notification thread when AVAudioSession media server
* terminates.
*/
- (void)audioSessionMediaServerTerminated:(RTCAudioSession *)session;
/** Called on a system notification thread when AVAudioSession media server
* restarts.
*/
- (void)audioSessionMediaServerReset:(RTCAudioSession *)session;
// TODO(tkchin): Maybe handle SilenceSecondaryAudioHintNotification.
- (void)audioSession:(RTCAudioSession *)session didChangeCanPlayOrRecord:(BOOL)canPlayOrRecord;
/** Called on a WebRTC thread when the audio device is notified to begin
* playback or recording.
*/
- (void)audioSessionDidStartPlayOrRecord:(RTCAudioSession *)session;
/** Called on a WebRTC thread when the audio device is notified to stop
* playback or recording.
*/
- (void)audioSessionDidStopPlayOrRecord:(RTCAudioSession *)session;
/** Called when the AVAudioSession output volume value changes. */
- (void)audioSession:(RTCAudioSession *)audioSession didChangeOutputVolume:(float)outputVolume;
/** Called when the audio device detects a playout glitch. The argument is the
* number of glitches detected so far in the current audio playout session.
*/
- (void)audioSession:(RTCAudioSession *)audioSession
didDetectPlayoutGlitch:(int64_t)totalNumberOfGlitches;
/** Called when the audio session is about to change the active state.
*/
- (void)audioSession:(RTCAudioSession *)audioSession willSetActive:(BOOL)active;
/** Called after the audio session sucessfully changed the active state.
*/
- (void)audioSession:(RTCAudioSession *)audioSession didSetActive:(BOOL)active;
/** Called after the audio session failed to change the active state.
*/
- (void)audioSession:(RTCAudioSession *)audioSession
failedToSetActive:(BOOL)active
error:(NSError *)error;
@end
/** This is a protocol used to inform RTCAudioSession when the audio session
* activation state has changed outside of RTCAudioSession. The current known use
* case of this is when CallKit activates the audio session for the application
*/
RTC_EXPORT
@protocol RTCAudioSessionActivationDelegate <NSObject>
/** Called when the audio session is activated outside of the app by iOS. */
- (void)audioSessionDidActivate:(AVAudioSession *)session;
/** Called when the audio session is deactivated outside of the app by iOS. */
- (void)audioSessionDidDeactivate:(AVAudioSession *)session;
@end
/** Proxy class for AVAudioSession that adds a locking mechanism similar to
* AVCaptureDevice. This is used to that interleaving configurations between
* WebRTC and the application layer are avoided.
*
* RTCAudioSession also coordinates activation so that the audio session is
* activated only once. See |setActive:error:|.
*/
RTC_EXPORT
@interface RTCAudioSession : NSObject <RTCAudioSessionActivationDelegate>
/** Convenience property to access the AVAudioSession singleton. Callers should
* not call setters on AVAudioSession directly, but other method invocations
* are fine.
*/
@property(nonatomic, readonly) AVAudioSession *session;
/** Our best guess at whether the session is active based on results of calls to
* AVAudioSession.
*/
@property(nonatomic, readonly) BOOL isActive;
/** Whether RTCAudioSession is currently locked for configuration. */
@property(nonatomic, readonly) BOOL isLocked;
/** If YES, WebRTC will not initialize the audio unit automatically when an
* audio track is ready for playout or recording. Instead, applications should
* call setIsAudioEnabled. If NO, WebRTC will initialize the audio unit
* as soon as an audio track is ready for playout or recording.
*/
@property(nonatomic, assign) BOOL useManualAudio;
/** This property is only effective if useManualAudio is YES.
* Represents permission for WebRTC to initialize the VoIP audio unit.
* When set to NO, if the VoIP audio unit used by WebRTC is active, it will be
* stopped and uninitialized. This will stop incoming and outgoing audio.
* When set to YES, WebRTC will initialize and start the audio unit when it is
* needed (e.g. due to establishing an audio connection).
* This property was introduced to work around an issue where if an AVPlayer is
* playing audio while the VoIP audio unit is initialized, its audio would be
* either cut off completely or played at a reduced volume. By preventing
* the audio unit from being initialized until after the audio has completed,
* we are able to prevent the abrupt cutoff.
*/
@property(nonatomic, assign) BOOL isAudioEnabled;
// Proxy properties.
@property(readonly) NSString *category;
@property(readonly) AVAudioSessionCategoryOptions categoryOptions;
@property(readonly) NSString *mode;
@property(readonly) BOOL secondaryAudioShouldBeSilencedHint;
@property(readonly) AVAudioSessionRouteDescription *currentRoute;
@property(readonly) NSInteger maximumInputNumberOfChannels;
@property(readonly) NSInteger maximumOutputNumberOfChannels;
@property(readonly) float inputGain;
@property(readonly) BOOL inputGainSettable;
@property(readonly) BOOL inputAvailable;
@property(readonly, nullable) NSArray<AVAudioSessionDataSourceDescription *> *inputDataSources;
@property(readonly, nullable) AVAudioSessionDataSourceDescription *inputDataSource;
@property(readonly, nullable) NSArray<AVAudioSessionDataSourceDescription *> *outputDataSources;
@property(readonly, nullable) AVAudioSessionDataSourceDescription *outputDataSource;
@property(readonly) double sampleRate;
@property(readonly) double preferredSampleRate;
@property(readonly) NSInteger inputNumberOfChannels;
@property(readonly) NSInteger outputNumberOfChannels;
@property(readonly) float outputVolume;
@property(readonly) NSTimeInterval inputLatency;
@property(readonly) NSTimeInterval outputLatency;
@property(readonly) NSTimeInterval IOBufferDuration;
@property(readonly) NSTimeInterval preferredIOBufferDuration;
/** Default constructor. */
+ (instancetype)sharedInstance;
- (instancetype)init NS_UNAVAILABLE;
/** Adds a delegate, which is held weakly. */
- (void)addDelegate:(id<RTCAudioSessionDelegate>)delegate;
/** Removes an added delegate. */
- (void)removeDelegate:(id<RTCAudioSessionDelegate>)delegate;
/** Request exclusive access to the audio session for configuration. This call
* will block if the lock is held by another object.
*/
- (void)lockForConfiguration;
/** Relinquishes exclusive access to the audio session. */
- (void)unlockForConfiguration;
/** If |active|, activates the audio session if it isn't already active.
* Successful calls must be balanced with a setActive:NO when activation is no
* longer required. If not |active|, deactivates the audio session if one is
* active and this is the last balanced call. When deactivating, the
* AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation option is passed to
* AVAudioSession.
*/
- (BOOL)setActive:(BOOL)active error:(NSError **)outError;
// The following methods are proxies for the associated methods on
// AVAudioSession. |lockForConfiguration| must be called before using them
// otherwise they will fail with kRTCAudioSessionErrorLockRequired.
- (BOOL)setCategory:(NSString *)category
withOptions:(AVAudioSessionCategoryOptions)options
error:(NSError **)outError;
- (BOOL)setMode:(NSString *)mode error:(NSError **)outError;
- (BOOL)setInputGain:(float)gain error:(NSError **)outError;
- (BOOL)setPreferredSampleRate:(double)sampleRate error:(NSError **)outError;
- (BOOL)setPreferredIOBufferDuration:(NSTimeInterval)duration error:(NSError **)outError;
- (BOOL)setPreferredInputNumberOfChannels:(NSInteger)count error:(NSError **)outError;
- (BOOL)setPreferredOutputNumberOfChannels:(NSInteger)count error:(NSError **)outError;
- (BOOL)overrideOutputAudioPort:(AVAudioSessionPortOverride)portOverride error:(NSError **)outError;
- (BOOL)setPreferredInput:(AVAudioSessionPortDescription *)inPort error:(NSError **)outError;
- (BOOL)setInputDataSource:(AVAudioSessionDataSourceDescription *)dataSource
error:(NSError **)outError;
- (BOOL)setOutputDataSource:(AVAudioSessionDataSourceDescription *)dataSource
error:(NSError **)outError;
@end
@interface RTCAudioSession (Configuration)
/** Applies the configuration to the current session. Attempts to set all
* properties even if previous ones fail. Only the last error will be
* returned.
* |lockForConfiguration| must be called first.
*/
- (BOOL)setConfiguration:(RTCAudioSessionConfiguration *)configuration error:(NSError **)outError;
/** Convenience method that calls both setConfiguration and setActive.
* |lockForConfiguration| must be called first.
*/
- (BOOL)setConfiguration:(RTCAudioSessionConfiguration *)configuration
active:(BOOL)active
error:(NSError **)outError;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,41 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <AVFoundation/AVFoundation.h> #import "components/audio/RTCAudioSessionConfiguration.h"
#import <Foundation/Foundation.h>
#import "WebRTC/RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_EXTERN const int kRTCAudioSessionPreferredNumberOfChannels;
RTC_EXTERN const double kRTCAudioSessionHighPerformanceSampleRate;
RTC_EXTERN const double kRTCAudioSessionLowComplexitySampleRate;
RTC_EXTERN const double kRTCAudioSessionHighPerformanceIOBufferDuration;
RTC_EXTERN const double kRTCAudioSessionLowComplexityIOBufferDuration;
// Struct to hold configuration values.
RTC_EXPORT
@interface RTCAudioSessionConfiguration : NSObject
@property(nonatomic, strong) NSString *category;
@property(nonatomic, assign) AVAudioSessionCategoryOptions categoryOptions;
@property(nonatomic, strong) NSString *mode;
@property(nonatomic, assign) double sampleRate;
@property(nonatomic, assign) NSTimeInterval ioBufferDuration;
@property(nonatomic, assign) NSInteger inputNumberOfChannels;
@property(nonatomic, assign) NSInteger outputNumberOfChannels;
/** Initializes configuration to defaults. */
- (instancetype)init NS_DESIGNATED_INITIALIZER;
/** Returns the current configuration of the audio session. */
+ (instancetype)currentConfiguration;
/** Returns the configuration that WebRTC needs. */
+ (instancetype)webRTCConfiguration;
/** Provide a way to override the default configuration. */
+ (void)setWebRTCConfiguration:(RTCAudioSessionConfiguration *)configuration;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,25 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCAudioSource.h"
#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCMediaSource.h>
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@interface RTCAudioSource : 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

View File

@ -8,21 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <WebRTC/RTCMacros.h> #import "api/peerconnection/RTCAudioTrack.h"
#import <WebRTC/RTCMediaStreamTrack.h>
NS_ASSUME_NONNULL_BEGIN
@class RTCAudioSource;
RTC_EXPORT
@interface RTCAudioTrack : RTCMediaStreamTrack
- (instancetype)init NS_UNAVAILABLE;
/** The audio source for this audio track. */
@property(nonatomic, readonly) RTCAudioSource *source;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,11 @@
/*
* 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 "components/video_frame_buffer/RTCCVPixelBuffer.h"

View File

@ -8,28 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/logging/RTCCallbackLogger.h"
#import <WebRTC/RTCLogging.h>
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
// This class intercepts WebRTC logs and forwards them to a registered block.
// This class is not threadsafe.
RTC_EXPORT
@interface RTCCallbackLogger : NSObject
// The severity level to capture. The default is kRTCLoggingSeverityInfo.
@property(nonatomic, assign) RTCLoggingSeverity severity;
// The callback 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 void (^)(NSString*))callback;
- (void)stop;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,23 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "helpers/RTCCameraPreviewView.h"
#import <UIKit/UIKit.h>
#import <WebRTC/RTCMacros.h>
@class AVCaptureSession;
/** RTCCameraPreviewView is a view that renders local video from an
* AVCaptureSession.
*/
RTC_EXPORT
@interface RTCCameraPreviewView : UIView
/** The capture session being rendered in the view. Capture session
* is assigned to AVCaptureVideoPreviewLayer async in the same
* queue that the AVCaptureSession is started/stopped.
*/
@property(nonatomic, strong) AVCaptureSession* captureSession;
@end

View File

@ -8,49 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <AVFoundation/AVFoundation.h> #import "components/capturer/RTCCameraVideoCapturer.h"
#import <Foundation/Foundation.h>
#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCVideoCapturer.h>
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
// Camera capture that implements RTCVideoCapturer. Delivers frames to a RTCVideoCapturerDelegate
// (usually RTCVideoSource).
NS_EXTENSION_UNAVAILABLE_IOS("Camera not available in app extensions.")
@interface RTCCameraVideoCapturer : 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 *))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

View File

@ -8,37 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCCertificate.h"
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@interface 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 RTCCertificate *)generateCertificateWithParams:(NSDictionary *)params;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,167 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCConfiguration.h"
#import <WebRTC/RTCCertificate.h>
#import <WebRTC/RTCMacros.h>
@class RTCIceServer;
@class RTCIntervalRange;
/**
* Represents the ice transport policy. This exposes the same states in C++,
* which include one more state than what exists in the W3C spec.
*/
typedef NS_ENUM(NSInteger, RTCIceTransportPolicy) {
RTCIceTransportPolicyNone,
RTCIceTransportPolicyRelay,
RTCIceTransportPolicyNoHost,
RTCIceTransportPolicyAll
};
/** Represents the bundle policy. */
typedef NS_ENUM(NSInteger, RTCBundlePolicy) {
RTCBundlePolicyBalanced,
RTCBundlePolicyMaxCompat,
RTCBundlePolicyMaxBundle
};
/** Represents the rtcp mux policy. */
typedef NS_ENUM(NSInteger, RTCRtcpMuxPolicy) { RTCRtcpMuxPolicyNegotiate, RTCRtcpMuxPolicyRequire };
/** Represents the tcp candidate policy. */
typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) {
RTCTcpCandidatePolicyEnabled,
RTCTcpCandidatePolicyDisabled
};
/** Represents the candidate network policy. */
typedef NS_ENUM(NSInteger, RTCCandidateNetworkPolicy) {
RTCCandidateNetworkPolicyAll,
RTCCandidateNetworkPolicyLowCost
};
/** Represents the continual gathering policy. */
typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) {
RTCContinualGatheringPolicyGatherOnce,
RTCContinualGatheringPolicyGatherContinually
};
/** Represents the encryption key type. */
typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) {
RTCEncryptionKeyTypeRSA,
RTCEncryptionKeyTypeECDSA,
};
/** Represents the chosen SDP semantics for the RTCPeerConnection. */
typedef NS_ENUM(NSInteger, RTCSdpSemantics) {
RTCSdpSemanticsPlanB,
RTCSdpSemanticsUnifiedPlan,
};
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@interface RTCConfiguration : NSObject
/** An array of Ice Servers available to be used by ICE. */
@property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;
/** An RTCCertificate for 're' use. */
@property(nonatomic, nullable) RTCCertificate *certificate;
/** Which candidates the ICE agent is allowed to use. The W3C calls it
* |iceTransportPolicy|, while in C++ it is called |type|. */
@property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy;
/** The media-bundling policy to use when gathering ICE candidates. */
@property(nonatomic, assign) RTCBundlePolicy bundlePolicy;
/** The rtcp-mux policy to use when gathering ICE candidates. */
@property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy;
@property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy;
@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy;
@property(nonatomic, assign) RTCContinualGatheringPolicy continualGatheringPolicy;
/** By default, the PeerConnection will use a limited number of IPv6 network
* interfaces, in order to avoid too many ICE candidate pairs being created
* and delaying ICE completion.
*
* Can be set to INT_MAX to effectively disable the limit.
*/
@property(nonatomic, assign) int maxIPv6Networks;
/** Exclude link-local network interfaces
* from considertaion for gathering ICE candidates.
* Defaults to NO.
*/
@property(nonatomic, assign) BOOL disableLinkLocalNetworks;
@property(nonatomic, assign) int audioJitterBufferMaxPackets;
@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate;
@property(nonatomic, assign) int iceConnectionReceivingTimeout;
@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
/** Key type used to generate SSL identity. Default is ECDSA. */
@property(nonatomic, assign) RTCEncryptionKeyType keyType;
/** ICE candidate pool size as defined in JSEP. Default is 0. */
@property(nonatomic, assign) int iceCandidatePoolSize;
/** Prune turn ports on the same network to the same turn server.
* Default is NO.
*/
@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
/** If set to YES, this means the ICE transport should presume TURN-to-TURN
* candidate pairs will succeed, even before a binding response is received.
*/
@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
/** If set to non-nil, controls the minimal interval between consecutive ICE
* check packets.
*/
@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
/** ICE Periodic Regathering
* If set, WebRTC will periodically create and propose candidates without
* starting a new ICE generation. The regathering happens continuously with
* interval specified in milliseconds by the uniform distribution [a, b].
*/
@property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange;
/** Configure the SDP semantics used by this PeerConnection. Note that the
* WebRTC 1.0 specification requires UnifiedPlan semantics. The
* RTCRtpTransceiver API is only available with UnifiedPlan semantics.
*
* PlanB will cause RTCPeerConnection to create offers and answers with at
* most one audio and one video m= section with multiple RTCRtpSenders and
* RTCRtpReceivers specified as multiple a=ssrc lines within the section. This
* will also cause RTCPeerConnection to ignore all but the first m= section of
* the same media type.
*
* UnifiedPlan will cause RTCPeerConnection to create offers and answers with
* multiple m= sections where each m= section maps to one RTCRtpSender and one
* RTCRtpReceiver (an RTCRtpTransceiver), either both audio or both video. This
* will also cause RTCPeerConnection to ignore all but the first a=ssrc lines
* that form a Plan B stream.
*
* For users who wish to send multiple audio/video streams and need to stay
* interoperable with legacy WebRTC implementations or use legacy APIs,
* specify PlanB.
*
* For all other users, specify UnifiedPlan.
*/
@property(nonatomic, assign) RTCSdpSemantics sdpSemantics;
/** Actively reset the SRTP parameters when the DTLS transports underneath are
* changed after offer/answer negotiation. This is only intended to be a
* workaround for crbug.com/835958
*/
@property(nonatomic, assign) BOOL activeResetSrtpParams;
- (instancetype)init;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,123 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <AvailabilityMacros.h> #import "api/peerconnection/RTCDataChannel.h"
#import <Foundation/Foundation.h>
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@interface RTCDataBuffer : NSObject
/** NSData representation of the underlying buffer. */
@property(nonatomic, readonly) NSData *data;
/** Indicates whether |data| contains UTF-8 or binary data. */
@property(nonatomic, readonly) BOOL isBinary;
- (instancetype)init NS_UNAVAILABLE;
/**
* Initialize an RTCDataBuffer from NSData. |isBinary| indicates whether |data|
* contains UTF-8 or binary data.
*/
- (instancetype)initWithData:(NSData *)data isBinary:(BOOL)isBinary;
@end
@class RTCDataChannel;
RTC_EXPORT
@protocol RTCDataChannelDelegate <NSObject>
/** The data channel state changed. */
- (void)dataChannelDidChangeState:(RTCDataChannel *)dataChannel;
/** The data channel successfully received a data buffer. */
- (void)dataChannel:(RTCDataChannel *)dataChannel
didReceiveMessageWithBuffer:(RTCDataBuffer *)buffer;
@optional
/** The data channel's |bufferedAmount| changed. */
- (void)dataChannel:(RTCDataChannel *)dataChannel didChangeBufferedAmount:(uint64_t)amount;
@end
/** Represents the state of the data channel. */
typedef NS_ENUM(NSInteger, RTCDataChannelState) {
RTCDataChannelStateConnecting,
RTCDataChannelStateOpen,
RTCDataChannelStateClosing,
RTCDataChannelStateClosed,
};
RTC_EXPORT
@interface RTCDataChannel : NSObject
/**
* A label that can be used to distinguish this data channel from other data
* channel objects.
*/
@property(nonatomic, readonly) NSString *label;
/** Whether the data channel can send messages in unreliable mode. */
@property(nonatomic, readonly) BOOL isReliable DEPRECATED_ATTRIBUTE;
/** Returns whether this data channel is ordered or not. */
@property(nonatomic, readonly) BOOL isOrdered;
/** Deprecated. Use maxPacketLifeTime. */
@property(nonatomic, readonly) NSUInteger maxRetransmitTime DEPRECATED_ATTRIBUTE;
/**
* The length of the time window (in milliseconds) during which transmissions
* and retransmissions may occur in unreliable mode.
*/
@property(nonatomic, readonly) uint16_t maxPacketLifeTime;
/**
* The maximum number of retransmissions that are attempted in unreliable mode.
*/
@property(nonatomic, readonly) uint16_t maxRetransmits;
/**
* The name of the sub-protocol used with this data channel, if any. Otherwise
* this returns an empty string.
*/
@property(nonatomic, readonly) NSString *protocol;
/**
* Returns whether this data channel was negotiated by the application or not.
*/
@property(nonatomic, readonly) BOOL isNegotiated;
/** Deprecated. Use channelId. */
@property(nonatomic, readonly) NSInteger streamId DEPRECATED_ATTRIBUTE;
/** The identifier for this data channel. */
@property(nonatomic, readonly) int channelId;
/** The state of the data channel. */
@property(nonatomic, readonly) RTCDataChannelState readyState;
/**
* The number of bytes of application data that have been queued using
* |sendData:| but that have not yet been transmitted to the network.
*/
@property(nonatomic, readonly) uint64_t bufferedAmount;
/** The delegate for this data channel. */
@property(nonatomic, weak) id<RTCDataChannelDelegate> delegate;
- (instancetype)init NS_UNAVAILABLE;
/** Closes the data channel. */
- (void)close;
/** Attempt to send |data| on this data channel's underlying data transport. */
- (BOOL)sendData:(RTCDataBuffer *)data;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,45 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <AvailabilityMacros.h> #import "api/peerconnection/RTCDataChannelConfiguration.h"
#import <Foundation/Foundation.h>
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@interface RTCDataChannelConfiguration : NSObject
/** Set to YES if ordered delivery is required. */
@property(nonatomic, assign) BOOL isOrdered;
/** Deprecated. Use maxPacketLifeTime. */
@property(nonatomic, assign) NSInteger maxRetransmitTimeMs DEPRECATED_ATTRIBUTE;
/**
* Max period in milliseconds in which retransmissions will be sent. After this
* time, no more retransmissions will be sent. -1 if unset.
*/
@property(nonatomic, assign) int maxPacketLifeTime;
/** The max number of retransmissions. -1 if unset. */
@property(nonatomic, assign) int maxRetransmits;
/** Set to YES if the channel has been externally negotiated and we do not send
* an in-band signalling in the form of an "open" message.
*/
@property(nonatomic, assign) BOOL isNegotiated;
/** Deprecated. Use channelId. */
@property(nonatomic, assign) int streamId DEPRECATED_ATTRIBUTE;
/** The id of the data channel. */
@property(nonatomic, assign) int channelId;
/** Set by the application and opaque to the WebRTC implementation. */
@property(nonatomic) NSString* protocol;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,11 @@
/*
* 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 "components/video_codec/RTCDefaultVideoDecoderFactory.h"

View File

@ -0,0 +1,11 @@
/*
* 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 "components/video_codec/RTCDefaultVideoEncoderFactory.h"

View File

@ -8,37 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "helpers/RTCDispatcher.h"
#import <WebRTC/RTCMacros.h>
typedef NS_ENUM(NSInteger, RTCDispatcherQueueType) {
// Main dispatcher queue.
RTCDispatcherTypeMain,
// Used for starting/stopping AVCaptureSession, and assigning
// capture session to AVCaptureVideoPreviewLayer.
RTCDispatcherTypeCaptureSession,
// Used for operations on AVAudioSession.
RTCDispatcherTypeAudioSession,
};
/** Dispatcher that asynchronously dispatches blocks to a specific
* shared dispatch queue.
*/
RTC_EXPORT
@interface RTCDispatcher : NSObject
- (instancetype)init NS_UNAVAILABLE;
/** Dispatch the block asynchronously on the queue for dispatchType.
* @param dispatchType The queue type to dispatch on.
* @param block The block to dispatch asynchronously.
*/
+ (void)dispatchAsyncOnType:(RTCDispatcherQueueType)dispatchType block:(dispatch_block_t)block;
/** Returns YES if run on queue for the dispatchType otherwise NO.
* Useful for asserting that a method is run on a correct queue.
*/
+ (BOOL)isOnQueueForType:(RTCDispatcherQueueType)dispatchType;
@end

View File

@ -8,63 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCDtmfSender.h"
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@protocol RTCDtmfSender <NSObject>
/**
* Returns true if this RTCDtmfSender is capable of sending DTMF. Otherwise
* returns false. To be able to send DTMF, the associated RTCRtpSender must be
* able to send packets, and a "telephone-event" codec must be negotiated.
*/
@property(nonatomic, readonly) BOOL canInsertDtmf;
/**
* Queues a task that sends the DTMF tones. The tones parameter is treated
* as a series of characters. The characters 0 through 9, A through D, #, and *
* generate the associated DTMF tones. The characters a to d are equivalent
* to A to D. The character ',' indicates a delay of 2 seconds before
* processing the next character in the tones parameter.
*
* Unrecognized characters are ignored.
*
* @param duration The parameter indicates the duration to use for each
* character passed in the tones parameter. The duration cannot be more
* than 6000 or less than 70 ms.
*
* @param interToneGap The parameter indicates the gap between tones.
* This parameter must be at least 50 ms but should be as short as
* possible.
*
* If InsertDtmf is called on the same object while an existing task for this
* object to generate DTMF is still running, the previous task is canceled.
* Returns true on success and false on failure.
*/
- (BOOL)insertDtmf:(nonnull NSString *)tones
duration:(NSTimeInterval)duration
interToneGap:(NSTimeInterval)interToneGap;
/** The tones remaining to be played out */
- (nonnull NSString *)remainingTones;
/**
* The current tone duration value. This value will be the value last set via the
* insertDtmf method, or the default value of 100 ms if insertDtmf was never called.
*/
- (NSTimeInterval)duration;
/**
* The current value of the between-tone gap. This value will be the value last set
* via the insertDtmf() method, or the default value of 50 ms if insertDtmf() was never
* called.
*/
- (NSTimeInterval)interToneGap;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,37 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "components/renderer/opengl/RTCEAGLVideoView.h"
#import <UIKit/UIKit.h>
#import <WebRTC/RTCMacros.h>
#import <WebRTC/RTCVideoRenderer.h>
#import <WebRTC/RTCVideoViewShading.h>
NS_ASSUME_NONNULL_BEGIN
@class RTCEAGLVideoView;
RTC_EXPORT
@protocol RTCEAGLVideoViewDelegate <RTCVideoViewDelegate>
@end
/**
* RTCEAGLVideoView is an RTCVideoRenderer which renders video frames in its
* bounds using OpenGLES 2.0 or OpenGLES 3.0.
*/
RTC_EXPORT
NS_EXTENSION_UNAVAILABLE_IOS("Rendering not available in app extensions.")
@interface RTCEAGLVideoView : UIView <RTCVideoRenderer>
@property(nonatomic, weak) id<RTCVideoViewDelegate> delegate;
- (instancetype)initWithFrame:(CGRect)frame
shader:(id<RTCVideoViewShading>)shader NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)aDecoder
shader:(id<RTCVideoViewShading>)shader NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,39 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCFieldTrials.h"
#import <WebRTC/RTCMacros.h>
/** The only valid value for the following if set is kRTCFieldTrialEnabledValue. */
RTC_EXTERN NSString * const kRTCFieldTrialAudioSendSideBweKey;
RTC_EXTERN NSString * const kRTCFieldTrialAudioSendSideBweForVideoKey;
RTC_EXTERN NSString * const kRTCFieldTrialAudioForceNoTWCCKey;
RTC_EXTERN NSString * const kRTCFieldTrialAudioForceABWENoTWCCKey;
RTC_EXTERN NSString * const kRTCFieldTrialSendSideBweWithOverheadKey;
RTC_EXTERN NSString * const kRTCFieldTrialFlexFec03AdvertisedKey;
RTC_EXTERN NSString * const kRTCFieldTrialFlexFec03Key;
RTC_EXTERN NSString * const kRTCFieldTrialImprovedBitrateEstimateKey;
RTC_EXTERN NSString * const kRTCFieldTrialH264HighProfileKey;
RTC_EXTERN NSString * const kRTCFieldTrialMinimizeResamplingOnMobileKey;
/** The valid value for field trials above. */
RTC_EXTERN NSString * const kRTCFieldTrialEnabledValue;
/** Use a string returned by RTCFieldTrialMedianSlopeFilterValue as the value. */
RTC_EXTERN NSString * const kRTCFieldTrialMedianSlopeFilterKey;
RTC_EXTERN NSString *RTCFieldTrialMedianSlopeFilterValue(
size_t windowSize, double thresholdGain);
/** Use a string returned by RTCFieldTrialTrendlineFilterValue as the value. */
RTC_EXTERN NSString * const kRTCFieldTrialTrendlineFilterKey;
/** Returns a valid value for kRTCFieldTrialTrendlineFilterKey. */
RTC_EXTERN NSString *RTCFieldTrialTrendlineFilterValue(
size_t windowSize, double smoothingCoeff, double thresholdGain);
/** Initialize field trials using a dictionary mapping field trial keys to their values. See above
* for valid keys and values.
* Must be called before any other call into WebRTC. See:
* webrtc/system_wrappers/include/field_trial_default.h
*/
RTC_EXTERN void RTCInitFieldTrialDictionary(NSDictionary<NSString *, NSString *> *fieldTrials);

View File

@ -8,67 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCFileLogger.h"
#import <WebRTC/RTCMacros.h>
typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) {
RTCFileLoggerSeverityVerbose,
RTCFileLoggerSeverityInfo,
RTCFileLoggerSeverityWarning,
RTCFileLoggerSeverityError
};
typedef NS_ENUM(NSUInteger, RTCFileLoggerRotationType) {
RTCFileLoggerTypeCall,
RTCFileLoggerTypeApp,
};
NS_ASSUME_NONNULL_BEGIN
// This class intercepts WebRTC logs and saves them to a file. The file size
// will not exceed the given maximum bytesize. When the maximum bytesize is
// reached, logs are rotated according to the rotationType specified.
// For kRTCFileLoggerTypeCall, logs from the beginning and the end
// are preserved while the middle section is overwritten instead.
// For kRTCFileLoggerTypeApp, the oldest log is overwritten.
// This class is not threadsafe.
RTC_EXPORT
@interface RTCFileLogger : NSObject
// The severity level to capture. The default is kRTCFileLoggerSeverityInfo.
@property(nonatomic, assign) RTCFileLoggerSeverity severity;
// The rotation type for this file logger. The default is
// kRTCFileLoggerTypeCall.
@property(nonatomic, readonly) RTCFileLoggerRotationType rotationType;
// Disables buffering disk writes. Should be set before |start|. Buffering
// is enabled by default for performance.
@property(nonatomic, assign) BOOL shouldDisableBuffering;
// Default constructor provides default settings for dir path, file size and
// rotation type.
- (instancetype)init;
// Create file logger with default rotation type.
- (instancetype)initWithDirPath:(NSString *)dirPath maxFileSize:(NSUInteger)maxFileSize;
- (instancetype)initWithDirPath:(NSString *)dirPath
maxFileSize:(NSUInteger)maxFileSize
rotationType:(RTCFileLoggerRotationType)rotationType NS_DESIGNATED_INITIALIZER;
// Starts writing WebRTC logs to disk if not already started. Overwrites any
// existing file(s).
- (void)start;
// Stops writing WebRTC logs to disk. This method is also called on dealloc.
- (void)stop;
// Returns the current contents of the logs, or nil if start has been called
// without a stop.
- (nullable NSData *)logData;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,43 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "components/capturer/RTCFileVideoCapturer.h"
#import <WebRTC/RTCVideoCapturer.h>
NS_ASSUME_NONNULL_BEGIN
/**
* Error passing block.
*/
typedef void (^RTCFileVideoCapturerErrorBlock)(NSError *error);
/**
* Captures buffers from bundled video file.
*
* See @c RTCVideoCapturer for more info on capturers.
*/
RTC_EXPORT
NS_CLASS_AVAILABLE_IOS(10)
@interface RTCFileVideoCapturer : RTCVideoCapturer
/**
* Starts asynchronous capture of frames from video file.
*
* Capturing is not started if error occurs. Underlying error will be
* relayed in the errorBlock if one is provided.
* Successfully captured video frames will be passed to the delegate.
*
* @param nameOfFile The name of the bundled video file to be read.
* @errorBlock block to be executed upon error.
*/
- (void)startCapturingFromFileNamed:(NSString *)nameOfFile
onError:(__nullable RTCFileVideoCapturerErrorBlock)errorBlock;
/**
* Immediately stops capture.
*/
- (void)stopCapture;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,11 @@
/*
* 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 "components/video_codec/RTCH264ProfileLevelId.h"

View File

@ -8,42 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCIceCandidate.h"
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@interface RTCIceCandidate : NSObject
/**
* If present, the identifier of the "media stream identification" for the media
* component this candidate is associated with.
*/
@property(nonatomic, readonly, nullable) NSString *sdpMid;
/**
* The index (starting at zero) of the media description this candidate is
* associated with in the SDP.
*/
@property(nonatomic, readonly) int sdpMLineIndex;
/** The SDP string for this candidate. */
@property(nonatomic, readonly) NSString *sdp;
/** The URL of the ICE server which this candidate is gathered from. */
@property(nonatomic, readonly, nullable) NSString *serverUrl;
- (instancetype)init NS_UNAVAILABLE;
/**
* Initialize an RTCIceCandidate from SDP.
*/
- (instancetype)initWithSdp:(NSString *)sdp
sdpMLineIndex:(int)sdpMLineIndex
sdpMid:(nullable NSString *)sdpMid NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,107 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCIceServer.h"
#import <WebRTC/RTCMacros.h>
typedef NS_ENUM(NSUInteger, RTCTlsCertPolicy) {
RTCTlsCertPolicySecure,
RTCTlsCertPolicyInsecureNoCheck
};
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@interface RTCIceServer : NSObject
/** URI(s) for this server represented as NSStrings. */
@property(nonatomic, readonly) NSArray<NSString *> *urlStrings;
/** Username to use if this RTCIceServer object is a TURN server. */
@property(nonatomic, readonly, nullable) NSString *username;
/** Credential to use if this RTCIceServer object is a TURN server. */
@property(nonatomic, readonly, nullable) NSString *credential;
/**
* TLS certificate policy to use if this RTCIceServer object is a TURN server.
*/
@property(nonatomic, readonly) RTCTlsCertPolicy tlsCertPolicy;
/**
If the URIs in |urls| only contain IP addresses, this field can be used
to indicate the hostname, which may be necessary for TLS (using the SNI
extension). If |urls| itself contains the hostname, this isn't necessary.
*/
@property(nonatomic, readonly, nullable) NSString *hostname;
/** List of protocols to be used in the TLS ALPN extension. */
@property(nonatomic, readonly) NSArray<NSString *> *tlsAlpnProtocols;
/**
List elliptic curves to be used in the TLS elliptic curves extension.
Only curve names supported by OpenSSL should be used (eg. "P-256","X25519").
*/
@property(nonatomic, readonly) NSArray<NSString *> *tlsEllipticCurves;
- (nonnull instancetype)init NS_UNAVAILABLE;
/** Convenience initializer for a server with no authentication (e.g. STUN). */
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, and credentialType.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, and TLS cert policy.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential
tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, TLS cert policy and hostname.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential
tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
hostname:(nullable NSString *)hostname;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, TLS cert policy, hostname and ALPN protocols.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential
tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
hostname:(nullable NSString *)hostname
tlsAlpnProtocols:(NSArray<NSString *> *)tlsAlpnProtocols;
/**
* Initialize an RTCIceServer with its associated URLs, optional username,
* optional credential, TLS cert policy, hostname, ALPN protocols and
* elliptic curves.
*/
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
username:(nullable NSString *)username
credential:(nullable NSString *)credential
tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
hostname:(nullable NSString *)hostname
tlsAlpnProtocols:(nullable NSArray<NSString *> *)tlsAlpnProtocols
tlsEllipticCurves:(nullable NSArray<NSString *> *)tlsEllipticCurves
NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,18 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCIntervalRange.h"
NS_ASSUME_NONNULL_BEGIN
@interface RTCIntervalRange : NSObject
@property(nonatomic, readonly) NSInteger min;
@property(nonatomic, readonly) NSInteger max;
- (instancetype)init;
- (instancetype)initWithMin:(NSInteger)min max:(NSInteger)max NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,30 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCLegacyStatsReport.h"
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
/** This does not currently conform to the spec. */
RTC_EXPORT
@interface RTCLegacyStatsReport : NSObject
/** Time since 1970-01-01T00:00:00Z in milliseconds. */
@property(nonatomic, readonly) CFTimeInterval timestamp;
/** The type of stats held by this object. */
@property(nonatomic, readonly) NSString *type;
/** The identifier for this object. */
@property(nonatomic, readonly) NSString *reportId;
/** A dictionary holding the actual stats. */
@property(nonatomic, readonly) NSDictionary<NSString *, NSString *> *values;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,59 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "base/RTCLogging.h"
#import <WebRTC/RTCMacros.h>
// Subset of rtc::LoggingSeverity.
typedef NS_ENUM(NSInteger, RTCLoggingSeverity) {
RTCLoggingSeverityVerbose,
RTCLoggingSeverityInfo,
RTCLoggingSeverityWarning,
RTCLoggingSeverityError,
};
// Wrapper for C++ RTC_LOG(sev) macros.
// Logs the log string to the webrtc logstream for the given severity.
RTC_EXTERN void RTCLogEx(RTCLoggingSeverity severity, NSString* log_string);
// Wrapper for rtc::LogMessage::LogToDebug.
// Sets the minimum severity to be logged to console.
RTC_EXTERN void RTCSetMinDebugLogLevel(RTCLoggingSeverity severity);
// Returns the filename with the path prefix removed.
RTC_EXTERN NSString* RTCFileName(const char* filePath);
// Some convenience macros.
#define RTCLogString(format, ...) \
[NSString stringWithFormat:@"(%@:%d %s): " format, RTCFileName(__FILE__), \
__LINE__, __FUNCTION__, ##__VA_ARGS__]
#define RTCLogFormat(severity, format, ...) \
do { \
NSString* log_string = RTCLogString(format, ##__VA_ARGS__); \
RTCLogEx(severity, log_string); \
} while (false)
#define RTCLogVerbose(format, ...) \
RTCLogFormat(RTCLoggingSeverityVerbose, format, ##__VA_ARGS__)
#define RTCLogInfo(format, ...) \
RTCLogFormat(RTCLoggingSeverityInfo, format, ##__VA_ARGS__)
#define RTCLogWarning(format, ...) \
RTCLogFormat(RTCLoggingSeverityWarning, format, ##__VA_ARGS__)
#define RTCLogError(format, ...) \
RTCLogFormat(RTCLoggingSeverityError, format, ##__VA_ARGS__)
#if !defined(NDEBUG)
#define RTCLogDebug(format, ...) RTCLogInfo(format, ##__VA_ARGS__)
#else
#define RTCLogDebug(format, ...) \
do { \
} while (false)
#endif
#define RTCLog(format, ...) RTCLogInfo(format, ##__VA_ARGS__)

View File

@ -8,13 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Cocoa/Cocoa.h> #import "components/renderer/metal/RTCMTLNSVideoView.h"
#import "WebRTC/RTCVideoRenderer.h"
NS_AVAILABLE_MAC(10.11)
@interface RTCMTLNSVideoView : NSView <RTCVideoRenderer>
@property(nonatomic, weak) id<RTCVideoViewDelegate> delegate;
+ (BOOL)isMetalAvailable;
@end

View File

@ -8,44 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "components/renderer/metal/RTCMTLVideoView.h"
#import "WebRTC/RTCVideoFrame.h"
#import "WebRTC/RTCVideoRenderer.h"
// Check if metal is supported in WebRTC.
// NOTE: Currently arm64 == Metal.
#if defined(__aarch64__)
#define RTC_SUPPORTS_METAL
#endif
NS_ASSUME_NONNULL_BEGIN
/**
* RTCMTLVideoView is thin wrapper around MTKView.
*
* It has id<RTCVideoRenderer> property that renders video frames in the view's
* bounds using Metal.
* NOTE: always check if metal is available on the running device via
* RTC_SUPPORTS_METAL macro before initializing this class.
*/
NS_CLASS_AVAILABLE_IOS(9)
RTC_EXPORT
@interface RTCMTLVideoView : UIView<RTCVideoRenderer>
@property(nonatomic, weak) id<RTCVideoViewDelegate> delegate;
@property(nonatomic) UIViewContentMode videoContentMode;
/** @abstract Enables/disables rendering.
*/
@property(nonatomic, getter=isEnabled) BOOL enabled;
/** @abstract Wrapped RTCVideoRotation, or nil.
*/
@property(nonatomic, nullable) NSValue* rotationOverride;
@end
NS_ASSUME_NONNULL_END

View File

@ -8,21 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef SDK_OBJC_FRAMEWORK_HEADERS_WEBRTC_RTCMACROS_H_ #import "base/RTCMacros.h"
#define SDK_OBJC_FRAMEWORK_HEADERS_WEBRTC_RTCMACROS_H_
#define RTC_EXPORT __attribute__((visibility("default")))
#if defined(__cplusplus)
#define RTC_EXTERN extern "C" RTC_EXPORT
#else
#define RTC_EXTERN extern RTC_EXPORT
#endif
#ifdef __OBJC__
#define RTC_FWD_DECL_OBJC_CLASS(classname) @class classname
#else
#define RTC_FWD_DECL_OBJC_CLASS(classname) typedef struct objc_object classname
#endif
#endif // SDK_OBJC_FRAMEWORK_HEADERS_WEBRTC_RTCMACROS_H_

View File

@ -8,47 +8,4 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#import <Foundation/Foundation.h> #import "api/peerconnection/RTCMediaConstraints.h"
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
/** Constraint keys for media sources. */
RTC_EXTERN NSString *const kRTCMediaConstraintsMinAspectRatio;
RTC_EXTERN NSString *const kRTCMediaConstraintsMaxAspectRatio;
RTC_EXTERN NSString *const kRTCMediaConstraintsMaxWidth;
RTC_EXTERN NSString *const kRTCMediaConstraintsMinWidth;
RTC_EXTERN NSString *const kRTCMediaConstraintsMaxHeight;
RTC_EXTERN NSString *const kRTCMediaConstraintsMinHeight;
RTC_EXTERN NSString *const kRTCMediaConstraintsMaxFrameRate;
RTC_EXTERN NSString *const kRTCMediaConstraintsMinFrameRate;
/** The value for this key should be a base64 encoded string containing
* the data from the serialized configuration proto.
*/
RTC_EXTERN NSString *const kRTCMediaConstraintsAudioNetworkAdaptorConfig;
/** Constraint keys for generating offers and answers. */
RTC_EXTERN NSString *const kRTCMediaConstraintsIceRestart;
RTC_EXTERN NSString *const kRTCMediaConstraintsOfferToReceiveAudio;
RTC_EXTERN NSString *const kRTCMediaConstraintsOfferToReceiveVideo;
RTC_EXTERN NSString *const kRTCMediaConstraintsVoiceActivityDetection;
/** Constraint values for Boolean parameters. */
RTC_EXTERN NSString *const kRTCMediaConstraintsValueTrue;
RTC_EXTERN NSString *const kRTCMediaConstraintsValueFalse;
RTC_EXPORT
@interface RTCMediaConstraints : NSObject
- (instancetype)init NS_UNAVAILABLE;
/** Initialize with mandatory and/or optional constraints. */
- (instancetype)
initWithMandatoryConstraints:(nullable NSDictionary<NSString *, NSString *> *)mandatory
optionalConstraints:(nullable NSDictionary<NSString *, NSString *> *)optional
NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END

Some files were not shown because too many files have changed in this diff Show More