Merge commit 'upstream-main' into master
Bug: 261600888 Test: none, build files to be updated in follow up cl Change-Id: Ib520938290c6bbdee4a9f73b6419b6c947a96ec4
This commit is contained in:
@ -1,15 +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 "api/peerconnection/RTCEncodedImage+Private.h"
|
||||
#import "api/peerconnection/RTCRtpFragmentationHeader+Private.h"
|
||||
#import "api/peerconnection/RTCVideoCodecInfo+Private.h"
|
||||
#import "api/peerconnection/RTCVideoEncoderSettings+Private.h"
|
||||
#import "components/video_codec/RTCCodecSpecificInfoH264+Private.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "components/audio/RTCAudioSession.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "components/audio/RTCAudioSessionConfiguration.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCAudioSource.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCAudioTrack.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* 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"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* 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 "api/logging/RTCCallbackLogger.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "helpers/RTCCameraPreviewView.h"
|
||||
@ -1,11 +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 "components/capturer/RTCCameraVideoCapturer.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* 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 "api/peerconnection/RTCCertificate.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCConfiguration.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCDataChannel.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCDataChannelConfiguration.h"
|
||||
@ -1,11 +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 "components/video_codec/RTCDefaultVideoEncoderFactory.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "helpers/RTCDispatcher.h"
|
||||
@ -1,11 +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 "api/peerconnection/RTCDtmfSender.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "components/renderer/opengl/RTCEAGLVideoView.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCFieldTrials.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCFileLogger.h"
|
||||
@ -1,11 +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 "components/capturer/RTCFileVideoCapturer.h"
|
||||
@ -1,11 +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 "components/video_codec/RTCH264ProfileLevelId.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCIceCandidate.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCIceServer.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCLegacyStatsReport.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "base/RTCLogging.h"
|
||||
@ -1,11 +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 "components/renderer/metal/RTCMTLNSVideoView.h"
|
||||
@ -1,11 +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 "components/renderer/metal/RTCMTLVideoView.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "base/RTCMacros.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCMediaConstraints.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCMediaSource.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCMediaStream.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCMediaStreamTrack.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCMetrics.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCMetricsSampleInfo.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "components/renderer/opengl/RTCNSGLVideoView.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCPeerConnection.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCPeerConnectionFactory.h"
|
||||
@ -1,11 +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 "api/peerconnection/RTCPeerConnectionFactoryOptions.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* 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 "api/peerconnection/RTCRtcpParameters.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCRtpCodecParameters.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCRtpEncodingParameters.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* 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 "api/peerconnection/RTCRtpHeaderExtension.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCRtpParameters.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCRtpReceiver.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCRtpSender.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* 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 "api/peerconnection/RTCRtpTransceiver.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCSSLAdapter.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCSessionDescription.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCTracing.h"
|
||||
@ -1,11 +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 "base/RTCVideoCapturer.h"
|
||||
@ -1,20 +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 "api/video_codec/RTCVideoCodecConstants.h"
|
||||
#import "base/RTCCodecSpecificInfo.h"
|
||||
#import "base/RTCEncodedImage.h"
|
||||
#import "base/RTCRtpFragmentationHeader.h"
|
||||
#import "base/RTCVideoCodecInfo.h"
|
||||
#import "base/RTCVideoDecoder.h"
|
||||
#import "base/RTCVideoEncoder.h"
|
||||
#import "base/RTCVideoEncoderQpThresholds.h"
|
||||
#import "base/RTCVideoEncoderSettings.h"
|
||||
#import "components/video_codec/RTCH264ProfileLevelId.h"
|
||||
@ -1,16 +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 "components/video_codec/RTCCodecSpecificInfoH264.h"
|
||||
#import "components/video_codec/RTCH264ProfileLevelId.h"
|
||||
#import "components/video_codec/RTCVideoDecoderFactoryH264.h"
|
||||
#import "components/video_codec/RTCVideoDecoderH264.h"
|
||||
#import "components/video_codec/RTCVideoEncoderFactoryH264.h"
|
||||
#import "components/video_codec/RTCVideoEncoderH264.h"
|
||||
@ -1,11 +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 "base/RTCVideoCodecInfo.h"
|
||||
@ -1,11 +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 "api/video_codec/RTCVideoDecoderVP8.h"
|
||||
@ -1,11 +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 "api/video_codec/RTCVideoDecoderVP9.h"
|
||||
@ -1,11 +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 "api/video_codec/RTCVideoEncoderVP8.h"
|
||||
@ -1,11 +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 "api/video_codec/RTCVideoEncoderVP9.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "base/RTCVideoFrame.h"
|
||||
@ -1,18 +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 "api/video_frame_buffer/RTCNativeI420Buffer.h"
|
||||
#import "api/video_frame_buffer/RTCNativeMutableI420Buffer.h"
|
||||
#import "base/RTCI420Buffer.h"
|
||||
#import "base/RTCMutableI420Buffer.h"
|
||||
#import "base/RTCMutableYUVPlanarBuffer.h"
|
||||
#import "base/RTCVideoFrameBuffer.h"
|
||||
#import "base/RTCYUVPlanarBuffer.h"
|
||||
#import "components/video_frame_buffer/RTCCVPixelBuffer.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "base/RTCVideoRenderer.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCVideoSource.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "api/peerconnection/RTCVideoTrack.h"
|
||||
@ -1,11 +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 "components/renderer/opengl/RTCVideoViewShading.h"
|
||||
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "helpers/UIDevice+RTCDevice.h"
|
||||
@ -10,20 +10,29 @@
|
||||
|
||||
#import "RTCCallbackLogger.h"
|
||||
|
||||
#import "helpers/NSString+StdString.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/log_sinks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
|
||||
class CallbackLogSink : public rtc::LogSink {
|
||||
namespace {
|
||||
|
||||
class CallbackLogSink final : public rtc::LogSink {
|
||||
public:
|
||||
CallbackLogSink(RTCCallbackLoggerMessageHandler callbackHandler)
|
||||
: callback_handler_(callbackHandler) {}
|
||||
|
||||
void OnLogMessage(const std::string &message) override {
|
||||
void OnLogMessage(const std::string& message) override {
|
||||
OnLogMessage(absl::string_view(message));
|
||||
}
|
||||
|
||||
void OnLogMessage(absl::string_view message) override {
|
||||
if (callback_handler_) {
|
||||
callback_handler_([NSString stringWithUTF8String:message.c_str()]);
|
||||
callback_handler_([NSString stringForAbslStringView:message]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,17 +40,21 @@ class CallbackLogSink : public rtc::LogSink {
|
||||
RTCCallbackLoggerMessageHandler callback_handler_;
|
||||
};
|
||||
|
||||
class CallbackWithSeverityLogSink : public rtc::LogSink {
|
||||
class CallbackWithSeverityLogSink final : public rtc::LogSink {
|
||||
public:
|
||||
CallbackWithSeverityLogSink(RTCCallbackLoggerMessageAndSeverityHandler callbackHandler)
|
||||
: callback_handler_(callbackHandler) {}
|
||||
|
||||
void OnLogMessage(const std::string& message) override { RTC_NOTREACHED(); }
|
||||
void OnLogMessage(const std::string& message) override { RTC_DCHECK_NOTREACHED(); }
|
||||
|
||||
void OnLogMessage(const std::string& message, rtc::LoggingSeverity severity) override {
|
||||
OnLogMessage(absl::string_view(message), severity);
|
||||
}
|
||||
|
||||
void OnLogMessage(absl::string_view message, rtc::LoggingSeverity severity) override {
|
||||
if (callback_handler_) {
|
||||
RTCLoggingSeverity loggingSeverity = NativeSeverityToObjcSeverity(severity);
|
||||
callback_handler_([NSString stringWithUTF8String:message.c_str()], loggingSeverity);
|
||||
callback_handler_([NSString stringForAbslStringView:message], loggingSeverity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,6 +77,8 @@ class CallbackWithSeverityLogSink : public rtc::LogSink {
|
||||
RTCCallbackLoggerMessageAndSeverityHandler callback_handler_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@implementation RTC_OBJC_TYPE (RTCCallbackLogger) {
|
||||
BOOL _hasStarted;
|
||||
std::unique_ptr<rtc::LogSink> _logSink;
|
||||
|
||||
@ -20,7 +20,7 @@ RTC_OBJC_EXPORT
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
// Sets the volume for the RTCMediaSource. |volume| is a gain value in the range
|
||||
// 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
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
- (instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
nativeMediaSource:(rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
|
||||
type:(RTCMediaSourceType)type {
|
||||
RTC_NOTREACHED();
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
std::string nativeId = [NSString stdStringForString:trackId];
|
||||
rtc::scoped_refptr<webrtc::AudioTrackInterface> track =
|
||||
factory.nativeFactory->CreateAudioTrack(nativeId, source.nativeAudioSource);
|
||||
factory.nativeFactory->CreateAudioTrack(nativeId, source.nativeAudioSource.get());
|
||||
if (self = [self initWithFactory:factory nativeTrack:track type:RTCMediaStreamTrackTypeAudio]) {
|
||||
_source = source;
|
||||
}
|
||||
@ -48,11 +48,10 @@
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCAudioSource) *)source {
|
||||
if (!_source) {
|
||||
rtc::scoped_refptr<webrtc::AudioSourceInterface> source =
|
||||
self.nativeAudioTrack->GetSource();
|
||||
rtc::scoped_refptr<webrtc::AudioSourceInterface> source(self.nativeAudioTrack->GetSource());
|
||||
if (source) {
|
||||
_source = [[RTC_OBJC_TYPE(RTCAudioSource) alloc] initWithFactory:self.factory
|
||||
nativeAudioSource:source.get()];
|
||||
nativeAudioSource:source];
|
||||
}
|
||||
}
|
||||
return _source;
|
||||
@ -61,7 +60,8 @@
|
||||
#pragma mark - Private
|
||||
|
||||
- (rtc::scoped_refptr<webrtc::AudioTrackInterface>)nativeAudioTrack {
|
||||
return static_cast<webrtc::AudioTrackInterface *>(self.nativeTrack.get());
|
||||
return rtc::scoped_refptr<webrtc::AudioTrackInterface>(
|
||||
static_cast<webrtc::AudioTrackInterface *>(self.nativeTrack.get()));
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -63,6 +63,7 @@ typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) {
|
||||
|
||||
/** Represents the chosen SDP semantics for the RTCPeerConnection. */
|
||||
typedef NS_ENUM(NSInteger, RTCSdpSemantics) {
|
||||
// TODO(https://crbug.com/webrtc/13528): Remove support for Plan B.
|
||||
RTCSdpSemanticsPlanB,
|
||||
RTCSdpSemanticsUnifiedPlan,
|
||||
};
|
||||
@ -84,7 +85,7 @@ RTC_OBJC_EXPORT
|
||||
@property(nonatomic, nullable) RTC_OBJC_TYPE(RTCCertificate) * certificate;
|
||||
|
||||
/** Which candidates the ICE agent is allowed to use. The W3C calls it
|
||||
* |iceTransportPolicy|, while in C++ it is called |type|. */
|
||||
* `iceTransportPolicy`, while in C++ it is called `type`. */
|
||||
@property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy;
|
||||
|
||||
/** The media-bundling policy to use when gathering ICE candidates. */
|
||||
@ -96,11 +97,6 @@ RTC_OBJC_EXPORT
|
||||
@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy;
|
||||
@property(nonatomic, assign) RTCContinualGatheringPolicy continualGatheringPolicy;
|
||||
|
||||
/** If set to YES, don't gather IPv6 ICE candidates.
|
||||
* Default is NO.
|
||||
*/
|
||||
@property(nonatomic, assign) BOOL disableIPV6;
|
||||
|
||||
/** If set to YES, don't gather IPv6 ICE candidates on Wi-Fi.
|
||||
* Only intended to be used on specific devices. Certain phones disable IPv6
|
||||
* when the screen is turned off and it would be better to just disable the
|
||||
@ -144,7 +140,7 @@ RTC_OBJC_EXPORT
|
||||
*/
|
||||
@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
|
||||
|
||||
/* This flag is only effective when |continualGatheringPolicy| is
|
||||
/* This flag is only effective when `continualGatheringPolicy` is
|
||||
* RTCContinualGatheringPolicyGatherContinually.
|
||||
*
|
||||
* If YES, after the ICE transport type is changed such that new types of
|
||||
@ -161,27 +157,24 @@ RTC_OBJC_EXPORT
|
||||
*/
|
||||
@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
|
||||
|
||||
/** 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.
|
||||
/**
|
||||
* Configure the SDP semantics used by this PeerConnection. By default, this
|
||||
* is RTCSdpSemanticsUnifiedPlan which is compliant to the WebRTC 1.0
|
||||
* specification. It is possible to overrwite this to the deprecated
|
||||
* RTCSdpSemanticsPlanB SDP format, but note that RTCSdpSemanticsPlanB will be
|
||||
* deleted at some future date, see https://crbug.com/webrtc/13528.
|
||||
*
|
||||
* 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.
|
||||
* RTCSdpSemanticsUnifiedPlan 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.
|
||||
*
|
||||
* 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.
|
||||
* RTCSdpSemanticsPlanB 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.
|
||||
*/
|
||||
@property(nonatomic, assign) RTCSdpSemantics sdpSemantics;
|
||||
|
||||
@ -204,6 +197,12 @@ RTC_OBJC_EXPORT
|
||||
*/
|
||||
@property(nonatomic, nullable) RTC_OBJC_TYPE(RTCCryptoOptions) * cryptoOptions;
|
||||
|
||||
/**
|
||||
* An optional string that will be attached to the TURN_ALLOCATE_REQUEST which
|
||||
* which can be used to correlate client logs with backend logs.
|
||||
*/
|
||||
@property(nonatomic, nullable, copy) NSString *turnLoggingId;
|
||||
|
||||
/**
|
||||
* Time interval between audio RTCP reports.
|
||||
*/
|
||||
@ -214,6 +213,54 @@ RTC_OBJC_EXPORT
|
||||
*/
|
||||
@property(nonatomic, assign) int rtcpVideoReportIntervalMs;
|
||||
|
||||
/**
|
||||
* Allow implicit rollback of local description when remote description
|
||||
* conflicts with local description.
|
||||
* See: https://w3c.github.io/webrtc-pc/#dom-peerconnection-setremotedescription
|
||||
*/
|
||||
@property(nonatomic, assign) BOOL enableImplicitRollback;
|
||||
|
||||
/**
|
||||
* Control if "a=extmap-allow-mixed" is included in the offer.
|
||||
* See: https://www.chromestatus.com/feature/6269234631933952
|
||||
*/
|
||||
@property(nonatomic, assign) BOOL offerExtmapAllowMixed;
|
||||
|
||||
/**
|
||||
* Defines the interval applied to ALL candidate pairs
|
||||
* when ICE is strongly connected, and it overrides the
|
||||
* default value of this interval in the ICE implementation;
|
||||
*/
|
||||
@property(nonatomic, copy, nullable) NSNumber *iceCheckIntervalStrongConnectivity;
|
||||
|
||||
/**
|
||||
* Defines the counterpart for ALL pairs when ICE is
|
||||
* weakly connected, and it overrides the default value of
|
||||
* this interval in the ICE implementation
|
||||
*/
|
||||
@property(nonatomic, copy, nullable) NSNumber *iceCheckIntervalWeakConnectivity;
|
||||
|
||||
/**
|
||||
* The min time period for which a candidate pair must wait for response to
|
||||
* connectivity checks before it becomes unwritable. This parameter
|
||||
* overrides the default value in the ICE implementation if set.
|
||||
*/
|
||||
@property(nonatomic, copy, nullable) NSNumber *iceUnwritableTimeout;
|
||||
|
||||
/**
|
||||
* The min number of connectivity checks that a candidate pair must sent
|
||||
* without receiving response before it becomes unwritable. This parameter
|
||||
* overrides the default value in the ICE implementation if set.
|
||||
*/
|
||||
@property(nonatomic, copy, nullable) NSNumber *iceUnwritableMinChecks;
|
||||
|
||||
/**
|
||||
* The min time period for which a candidate pair must wait for response to
|
||||
* connectivity checks it becomes inactive. This parameter overrides the
|
||||
* default value in the ICE implementation if set.
|
||||
*/
|
||||
@property(nonatomic, copy, nullable) NSNumber *iceInactiveTimeout;
|
||||
|
||||
- (instancetype)init;
|
||||
|
||||
@end
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#import "RTCIceServer+Private.h"
|
||||
#import "base/RTCLogging.h"
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/rtc_certificate_generator.h"
|
||||
#include "rtc_base/ssl_identity.h"
|
||||
|
||||
@ -31,7 +32,6 @@
|
||||
@synthesize tcpCandidatePolicy = _tcpCandidatePolicy;
|
||||
@synthesize candidateNetworkPolicy = _candidateNetworkPolicy;
|
||||
@synthesize continualGatheringPolicy = _continualGatheringPolicy;
|
||||
@synthesize disableIPV6 = _disableIPV6;
|
||||
@synthesize disableIPV6OnWiFi = _disableIPV6OnWiFi;
|
||||
@synthesize maxIPv6Networks = _maxIPv6Networks;
|
||||
@synthesize disableLinkLocalNetworks = _disableLinkLocalNetworks;
|
||||
@ -53,12 +53,21 @@
|
||||
@synthesize activeResetSrtpParams = _activeResetSrtpParams;
|
||||
@synthesize allowCodecSwitching = _allowCodecSwitching;
|
||||
@synthesize cryptoOptions = _cryptoOptions;
|
||||
@synthesize turnLoggingId = _turnLoggingId;
|
||||
@synthesize rtcpAudioReportIntervalMs = _rtcpAudioReportIntervalMs;
|
||||
@synthesize rtcpVideoReportIntervalMs = _rtcpVideoReportIntervalMs;
|
||||
@synthesize enableImplicitRollback = _enableImplicitRollback;
|
||||
@synthesize offerExtmapAllowMixed = _offerExtmapAllowMixed;
|
||||
@synthesize iceCheckIntervalStrongConnectivity = _iceCheckIntervalStrongConnectivity;
|
||||
@synthesize iceCheckIntervalWeakConnectivity = _iceCheckIntervalWeakConnectivity;
|
||||
@synthesize iceUnwritableTimeout = _iceUnwritableTimeout;
|
||||
@synthesize iceUnwritableMinChecks = _iceUnwritableMinChecks;
|
||||
@synthesize iceInactiveTimeout = _iceInactiveTimeout;
|
||||
|
||||
- (instancetype)init {
|
||||
// Copy defaults.
|
||||
webrtc::PeerConnectionInterface::RTCConfiguration config;
|
||||
config.sdp_semantics = webrtc::SdpSemantics::kUnifiedPlan;
|
||||
return [self initWithNativeConfiguration:config];
|
||||
}
|
||||
|
||||
@ -93,9 +102,7 @@
|
||||
candidateNetworkPolicyForNativePolicy:config.candidate_network_policy];
|
||||
webrtc::PeerConnectionInterface::ContinualGatheringPolicy nativePolicy =
|
||||
config.continual_gathering_policy;
|
||||
_continualGatheringPolicy =
|
||||
[[self class] continualGatheringPolicyForNativePolicy:nativePolicy];
|
||||
_disableIPV6 = config.disable_ipv6;
|
||||
_continualGatheringPolicy = [[self class] continualGatheringPolicyForNativePolicy:nativePolicy];
|
||||
_disableIPV6OnWiFi = config.disable_ipv6_on_wifi;
|
||||
_maxIPv6Networks = config.max_ipv6_networks;
|
||||
_disableLinkLocalNetworks = config.disable_link_local_networks;
|
||||
@ -129,9 +136,28 @@
|
||||
sframeRequireFrameEncryption:config.crypto_options->sframe
|
||||
.require_frame_encryption];
|
||||
}
|
||||
_turnLoggingId = [NSString stringWithUTF8String:config.turn_logging_id.c_str()];
|
||||
_rtcpAudioReportIntervalMs = config.audio_rtcp_report_interval_ms();
|
||||
_rtcpVideoReportIntervalMs = config.video_rtcp_report_interval_ms();
|
||||
_allowCodecSwitching = config.allow_codec_switching.value_or(false);
|
||||
_enableImplicitRollback = config.enable_implicit_rollback;
|
||||
_offerExtmapAllowMixed = config.offer_extmap_allow_mixed;
|
||||
_iceCheckIntervalStrongConnectivity =
|
||||
config.ice_check_interval_strong_connectivity.has_value() ?
|
||||
[NSNumber numberWithInt:*config.ice_check_interval_strong_connectivity] :
|
||||
nil;
|
||||
_iceCheckIntervalWeakConnectivity = config.ice_check_interval_weak_connectivity.has_value() ?
|
||||
[NSNumber numberWithInt:*config.ice_check_interval_weak_connectivity] :
|
||||
nil;
|
||||
_iceUnwritableTimeout = config.ice_unwritable_timeout.has_value() ?
|
||||
[NSNumber numberWithInt:*config.ice_unwritable_timeout] :
|
||||
nil;
|
||||
_iceUnwritableMinChecks = config.ice_unwritable_min_checks.has_value() ?
|
||||
[NSNumber numberWithInt:*config.ice_unwritable_min_checks] :
|
||||
nil;
|
||||
_iceInactiveTimeout = config.ice_inactive_timeout.has_value() ?
|
||||
[NSNumber numberWithInt:*config.ice_inactive_timeout] :
|
||||
nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@ -139,7 +165,7 @@
|
||||
- (NSString *)description {
|
||||
static NSString *formatString = @"RTC_OBJC_TYPE(RTCConfiguration): "
|
||||
@"{\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n"
|
||||
@"%d\n%@\n%d\n%d\n%d\n%d\n%d\n%@\n}\n";
|
||||
@"%d\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n}\n";
|
||||
|
||||
return [NSString
|
||||
stringWithFormat:formatString,
|
||||
@ -161,11 +187,11 @@
|
||||
_shouldSurfaceIceCandidatesOnIceTransportTypeChanged,
|
||||
_iceCheckMinInterval,
|
||||
_disableLinkLocalNetworks,
|
||||
_disableIPV6,
|
||||
_disableIPV6OnWiFi,
|
||||
_maxIPv6Networks,
|
||||
_activeResetSrtpParams,
|
||||
_enableDscp];
|
||||
_enableDscp,
|
||||
_enableImplicitRollback];
|
||||
}
|
||||
|
||||
#pragma mark - Private
|
||||
@ -190,9 +216,8 @@
|
||||
[[self class] nativeTcpCandidatePolicyForPolicy:_tcpCandidatePolicy];
|
||||
nativeConfig->candidate_network_policy = [[self class]
|
||||
nativeCandidateNetworkPolicyForPolicy:_candidateNetworkPolicy];
|
||||
nativeConfig->continual_gathering_policy = [[self class]
|
||||
nativeContinualGatheringPolicyForPolicy:_continualGatheringPolicy];
|
||||
nativeConfig->disable_ipv6 = _disableIPV6;
|
||||
nativeConfig->continual_gathering_policy =
|
||||
[[self class] nativeContinualGatheringPolicyForPolicy:_continualGatheringPolicy];
|
||||
nativeConfig->disable_ipv6_on_wifi = _disableIPV6OnWiFi;
|
||||
nativeConfig->max_ipv6_networks = _maxIPv6Networks;
|
||||
nativeConfig->disable_link_local_networks = _disableLinkLocalNetworks;
|
||||
@ -258,9 +283,29 @@
|
||||
_cryptoOptions.sframeRequireFrameEncryption ? true : false;
|
||||
nativeConfig->crypto_options = absl::optional<webrtc::CryptoOptions>(nativeCryptoOptions);
|
||||
}
|
||||
nativeConfig->turn_logging_id = [_turnLoggingId UTF8String];
|
||||
nativeConfig->set_audio_rtcp_report_interval_ms(_rtcpAudioReportIntervalMs);
|
||||
nativeConfig->set_video_rtcp_report_interval_ms(_rtcpVideoReportIntervalMs);
|
||||
nativeConfig->allow_codec_switching = _allowCodecSwitching;
|
||||
nativeConfig->enable_implicit_rollback = _enableImplicitRollback;
|
||||
nativeConfig->offer_extmap_allow_mixed = _offerExtmapAllowMixed;
|
||||
if (_iceCheckIntervalStrongConnectivity != nil) {
|
||||
nativeConfig->ice_check_interval_strong_connectivity =
|
||||
absl::optional<int>(_iceCheckIntervalStrongConnectivity.intValue);
|
||||
}
|
||||
if (_iceCheckIntervalWeakConnectivity != nil) {
|
||||
nativeConfig->ice_check_interval_weak_connectivity =
|
||||
absl::optional<int>(_iceCheckIntervalWeakConnectivity.intValue);
|
||||
}
|
||||
if (_iceUnwritableTimeout != nil) {
|
||||
nativeConfig->ice_unwritable_timeout = absl::optional<int>(_iceUnwritableTimeout.intValue);
|
||||
}
|
||||
if (_iceUnwritableMinChecks != nil) {
|
||||
nativeConfig->ice_unwritable_min_checks = absl::optional<int>(_iceUnwritableMinChecks.intValue);
|
||||
}
|
||||
if (_iceInactiveTimeout != nil) {
|
||||
nativeConfig->ice_inactive_timeout = absl::optional<int>(_iceInactiveTimeout.intValue);
|
||||
}
|
||||
return nativeConfig.release();
|
||||
}
|
||||
|
||||
@ -472,7 +517,7 @@
|
||||
+ (webrtc::SdpSemantics)nativeSdpSemanticsForSdpSemantics:(RTCSdpSemantics)sdpSemantics {
|
||||
switch (sdpSemantics) {
|
||||
case RTCSdpSemanticsPlanB:
|
||||
return webrtc::SdpSemantics::kPlanB;
|
||||
return webrtc::SdpSemantics::kPlanB_DEPRECATED;
|
||||
case RTCSdpSemanticsUnifiedPlan:
|
||||
return webrtc::SdpSemantics::kUnifiedPlan;
|
||||
}
|
||||
@ -480,7 +525,7 @@
|
||||
|
||||
+ (RTCSdpSemantics)sdpSemanticsForNativeSdpSemantics:(webrtc::SdpSemantics)sdpSemantics {
|
||||
switch (sdpSemantics) {
|
||||
case webrtc::SdpSemantics::kPlanB:
|
||||
case webrtc::SdpSemantics::kPlanB_DEPRECATED:
|
||||
return RTCSdpSemanticsPlanB;
|
||||
case webrtc::SdpSemantics::kUnifiedPlan:
|
||||
return RTCSdpSemanticsUnifiedPlan;
|
||||
|
||||
@ -28,7 +28,7 @@ RTC_OBJC_EXPORT
|
||||
@property(nonatomic, assign) BOOL srtpEnableGcmCryptoSuites;
|
||||
/**
|
||||
* If set to true, the (potentially insecure) crypto cipher
|
||||
* SRTP_AES128_CM_SHA1_32 will be included in the list of supported ciphers
|
||||
* kSrtpAes128CmSha1_32 will be included in the list of supported ciphers
|
||||
* during negotiation. It will only be used if both peers support it and no
|
||||
* other ciphers get preferred.
|
||||
*/
|
||||
|
||||
@ -21,13 +21,13 @@ RTC_OBJC_EXPORT
|
||||
/** NSData representation of the underlying buffer. */
|
||||
@property(nonatomic, readonly) NSData *data;
|
||||
|
||||
/** Indicates whether |data| contains UTF-8 or binary 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|
|
||||
* Initialize an RTCDataBuffer from NSData. `isBinary` indicates whether `data`
|
||||
* contains UTF-8 or binary data.
|
||||
*/
|
||||
- (instancetype)initWithData:(NSData *)data isBinary:(BOOL)isBinary;
|
||||
@ -47,7 +47,7 @@ RTC_OBJC_EXPORT
|
||||
didReceiveMessageWithBuffer:(RTC_OBJC_TYPE(RTCDataBuffer) *)buffer;
|
||||
|
||||
@optional
|
||||
/** The data channel's |bufferedAmount| changed. */
|
||||
/** The data channel's `bufferedAmount` changed. */
|
||||
- (void)dataChannel:(RTC_OBJC_TYPE(RTCDataChannel) *)dataChannel
|
||||
didChangeBufferedAmount:(uint64_t)amount;
|
||||
|
||||
@ -112,7 +112,7 @@ RTC_OBJC_EXPORT
|
||||
|
||||
/**
|
||||
* The number of bytes of application data that have been queued using
|
||||
* |sendData:| but that have not yet been transmitted to the network.
|
||||
* `sendData:` but that have not yet been transmitted to the network.
|
||||
*/
|
||||
@property(nonatomic, readonly) uint64_t bufferedAmount;
|
||||
|
||||
@ -124,7 +124,7 @@ RTC_OBJC_EXPORT
|
||||
/** Closes the data channel. */
|
||||
- (void)close;
|
||||
|
||||
/** Attempt to send |data| on this data channel's underlying data transport. */
|
||||
/** Attempt to send `data` on this data channel's underlying data transport. */
|
||||
- (BOOL)sendData:(RTC_OBJC_TYPE(RTCDataBuffer) *)data;
|
||||
|
||||
@end
|
||||
|
||||
@ -13,14 +13,13 @@
|
||||
#import <objc/runtime.h>
|
||||
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
|
||||
namespace {
|
||||
// An implementation of EncodedImageBufferInterface that doesn't perform any copies.
|
||||
class ObjCEncodedImageBuffer : public webrtc::EncodedImageBufferInterface {
|
||||
public:
|
||||
static rtc::scoped_refptr<ObjCEncodedImageBuffer> Create(NSData *data) {
|
||||
return new rtc::RefCountedObject<ObjCEncodedImageBuffer>(data);
|
||||
return rtc::make_ref_counted<ObjCEncodedImageBuffer>(data);
|
||||
}
|
||||
const uint8_t *data() const override { return static_cast<const uint8_t *>(data_.bytes); }
|
||||
// TODO(bugs.webrtc.org/9378): delete this non-const data method.
|
||||
@ -92,7 +91,6 @@ class ObjCEncodedImageBuffer : public webrtc::EncodedImageBufferInterface {
|
||||
self.encodeFinishMs = encodedImage.timing_.encode_finish_ms;
|
||||
self.frameType = static_cast<RTCFrameType>(encodedImage._frameType);
|
||||
self.rotation = static_cast<RTCVideoRotation>(encodedImage.rotation_);
|
||||
self.completeFrame = encodedImage._completeFrame;
|
||||
self.qp = @(encodedImage.qp_);
|
||||
self.contentType = (encodedImage.content_type_ == webrtc::VideoContentType::SCREENSHARE) ?
|
||||
RTCVideoContentTypeScreenshare :
|
||||
@ -121,7 +119,6 @@ class ObjCEncodedImageBuffer : public webrtc::EncodedImageBufferInterface {
|
||||
encodedImage.timing_.encode_finish_ms = self.encodeFinishMs;
|
||||
encodedImage._frameType = webrtc::VideoFrameType(self.frameType);
|
||||
encodedImage.rotation_ = webrtc::VideoRotation(self.rotation);
|
||||
encodedImage._completeFrame = self.completeFrame;
|
||||
encodedImage.qp_ = self.qp ? self.qp.intValue : -1;
|
||||
encodedImage.content_type_ = (self.contentType == RTCVideoContentTypeScreenshare) ?
|
||||
webrtc::VideoContentType::SCREENSHARE :
|
||||
|
||||
@ -13,14 +13,12 @@
|
||||
#import "RTCMacros.h"
|
||||
|
||||
/** The only valid value for the following if set is kRTCFieldTrialEnabledValue. */
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialAudioSendSideBweKey;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialAudioForceNoTWCCKey;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialAudioForceABWENoTWCCKey;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialSendSideBweWithOverheadKey;
|
||||
RTC_EXTERN NSString *const kRTCFieldTrialAudioForceABWENoTWCCKey;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialFlexFec03AdvertisedKey;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialFlexFec03Key;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialH264HighProfileKey;
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialMinimizeResamplingOnMobileKey;
|
||||
RTC_EXTERN NSString *const kRTCFieldTrialUseNWPathMonitor;
|
||||
|
||||
/** The valid value for field trials above. */
|
||||
RTC_EXTERN NSString * const kRTCFieldTrialEnabledValue;
|
||||
|
||||
@ -16,18 +16,18 @@
|
||||
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
|
||||
NSString * const kRTCFieldTrialAudioSendSideBweKey = @"WebRTC-Audio-SendSideBwe";
|
||||
NSString * const kRTCFieldTrialAudioForceNoTWCCKey = @"WebRTC-Audio-ForceNoTWCC";
|
||||
NSString * const kRTCFieldTrialAudioForceABWENoTWCCKey = @"WebRTC-Audio-ABWENoTWCC";
|
||||
NSString * const kRTCFieldTrialSendSideBweWithOverheadKey = @"WebRTC-SendSideBwe-WithOverhead";
|
||||
NSString *const kRTCFieldTrialAudioForceABWENoTWCCKey = @"WebRTC-Audio-ABWENoTWCC";
|
||||
NSString * const kRTCFieldTrialFlexFec03AdvertisedKey = @"WebRTC-FlexFEC-03-Advertised";
|
||||
NSString * const kRTCFieldTrialFlexFec03Key = @"WebRTC-FlexFEC-03";
|
||||
NSString * const kRTCFieldTrialH264HighProfileKey = @"WebRTC-H264HighProfile";
|
||||
NSString * const kRTCFieldTrialMinimizeResamplingOnMobileKey =
|
||||
@"WebRTC-Audio-MinimizeResamplingOnMobile";
|
||||
NSString *const kRTCFieldTrialUseNWPathMonitor = @"WebRTC-Network-UseNWPathMonitor";
|
||||
NSString * const kRTCFieldTrialEnabledValue = @"Enabled";
|
||||
|
||||
static std::unique_ptr<char[]> gFieldTrialInitString;
|
||||
// InitFieldTrialsFromString stores the char*, so the char array must outlive
|
||||
// the application.
|
||||
static char *gFieldTrialInitString = nullptr;
|
||||
|
||||
void RTCInitFieldTrialDictionary(NSDictionary<NSString *, NSString *> *fieldTrials) {
|
||||
if (!fieldTrials) {
|
||||
@ -42,12 +42,15 @@ void RTCInitFieldTrialDictionary(NSDictionary<NSString *, NSString *> *fieldTria
|
||||
[fieldTrialInitString appendString:fieldTrialEntry];
|
||||
}
|
||||
size_t len = fieldTrialInitString.length + 1;
|
||||
gFieldTrialInitString.reset(new char[len]);
|
||||
if (![fieldTrialInitString getCString:gFieldTrialInitString.get()
|
||||
if (gFieldTrialInitString != nullptr) {
|
||||
delete[] gFieldTrialInitString;
|
||||
}
|
||||
gFieldTrialInitString = new char[len];
|
||||
if (![fieldTrialInitString getCString:gFieldTrialInitString
|
||||
maxLength:len
|
||||
encoding:NSUTF8StringEncoding]) {
|
||||
RTCLogError(@"Failed to convert field trial string.");
|
||||
return;
|
||||
}
|
||||
webrtc::field_trial::InitFieldTrialsFromString(gFieldTrialInitString.get());
|
||||
webrtc::field_trial::InitFieldTrialsFromString(gFieldTrialInitString);
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ RTC_OBJC_EXPORT
|
||||
// kRTCFileLoggerTypeCall.
|
||||
@property(nonatomic, readonly) RTCFileLoggerRotationType rotationType;
|
||||
|
||||
// Disables buffering disk writes. Should be set before |start|. Buffering
|
||||
// Disables buffering disk writes. Should be set before `start`. Buffering
|
||||
// is enabled by default for performance.
|
||||
@property(nonatomic, assign) BOOL shouldDisableBuffering;
|
||||
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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 "RTCIceCandidateErrorEvent.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RTC_OBJC_TYPE (RTCIceCandidateErrorEvent)
|
||||
()
|
||||
|
||||
- (instancetype)initWithAddress : (const std::string&)address port : (const int)port url
|
||||
: (const std::string&)url errorCode : (const int)errorCode errorText
|
||||
: (const std::string&)errorText;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
42
sdk/objc/api/peerconnection/RTCIceCandidateErrorEvent.h
Normal file
42
sdk/objc/api/peerconnection/RTCIceCandidateErrorEvent.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RTCMacros.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
RTC_OBJC_EXPORT
|
||||
@interface RTC_OBJC_TYPE (RTCIceCandidateErrorEvent) : NSObject
|
||||
|
||||
/** The local IP address used to communicate with the STUN or TURN server. */
|
||||
@property(nonatomic, readonly) NSString *address;
|
||||
|
||||
/** The port used to communicate with the STUN or TURN server. */
|
||||
@property(nonatomic, readonly) int port;
|
||||
|
||||
/** The STUN or TURN URL that identifies the STUN or TURN server for which the failure occurred. */
|
||||
@property(nonatomic, readonly) NSString *url;
|
||||
|
||||
/** The numeric STUN error code returned by the STUN or TURN server. If no host candidate can reach
|
||||
* the server, errorCode will be set to the value 701 which is outside the STUN error code range.
|
||||
* This error is only fired once per server URL while in the RTCIceGatheringState of "gathering". */
|
||||
@property(nonatomic, readonly) int errorCode;
|
||||
|
||||
/** The STUN reason text returned by the STUN or TURN server. If the server could not be reached,
|
||||
* errorText will be set to an implementation-specific value providing details about the error. */
|
||||
@property(nonatomic, readonly) NSString *errorText;
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
42
sdk/objc/api/peerconnection/RTCIceCandidateErrorEvent.mm
Normal file
42
sdk/objc/api/peerconnection/RTCIceCandidateErrorEvent.mm
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2021 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 "RTCIceCandidateErrorEvent+Private.h"
|
||||
|
||||
#import "helpers/NSString+StdString.h"
|
||||
|
||||
@implementation RTC_OBJC_TYPE (RTCIceCandidateErrorEvent)
|
||||
|
||||
@synthesize address = _address;
|
||||
@synthesize port = _port;
|
||||
@synthesize url = _url;
|
||||
@synthesize errorCode = _errorCode;
|
||||
@synthesize errorText = _errorText;
|
||||
|
||||
- (instancetype)init {
|
||||
return [super init];
|
||||
}
|
||||
|
||||
- (instancetype)initWithAddress:(const std::string&)address
|
||||
port:(const int)port
|
||||
url:(const std::string&)url
|
||||
errorCode:(const int)errorCode
|
||||
errorText:(const std::string&)errorText {
|
||||
if (self = [self init]) {
|
||||
_address = [NSString stringForStdString:address];
|
||||
_port = port;
|
||||
_url = [NSString stringForStdString:url];
|
||||
_errorCode = errorCode;
|
||||
_errorText = [NSString stringForStdString:errorText];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@ -37,9 +37,9 @@ RTC_OBJC_EXPORT
|
||||
@property(nonatomic, readonly) RTCTlsCertPolicy tlsCertPolicy;
|
||||
|
||||
/**
|
||||
If the URIs in |urls| only contain IP addresses, this field can be used
|
||||
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.
|
||||
extension). If `urls` itself contains the hostname, this isn't necessary.
|
||||
*/
|
||||
@property(nonatomic, readonly, nullable) NSString *hostname;
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#import "RTCLegacyStatsReport.h"
|
||||
|
||||
#include "api/stats_types.h"
|
||||
#include "api/legacy_stats_types.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@ -10,8 +10,6 @@
|
||||
|
||||
#import "RTCMediaStream+Private.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#import "RTCAudioTrack+Private.h"
|
||||
#import "RTCMediaStreamTrack+Private.h"
|
||||
#import "RTCPeerConnectionFactory+Private.h"
|
||||
@ -20,8 +18,9 @@
|
||||
|
||||
@implementation RTC_OBJC_TYPE (RTCMediaStream) {
|
||||
RTC_OBJC_TYPE(RTCPeerConnectionFactory) * _factory;
|
||||
NSMutableArray *_audioTracks;
|
||||
NSMutableArray *_videoTracks;
|
||||
rtc::Thread *_signalingThread;
|
||||
NSMutableArray *_audioTracks /* accessed on _signalingThread */;
|
||||
NSMutableArray *_videoTracks /* accessed on _signalingThread */;
|
||||
rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream;
|
||||
}
|
||||
|
||||
@ -36,10 +35,16 @@
|
||||
}
|
||||
|
||||
- (NSArray<RTC_OBJC_TYPE(RTCAudioTrack) *> *)audioTracks {
|
||||
if (!_signalingThread->IsCurrent()) {
|
||||
return _signalingThread->BlockingCall([self]() { return self.audioTracks; });
|
||||
}
|
||||
return [_audioTracks copy];
|
||||
}
|
||||
|
||||
- (NSArray<RTC_OBJC_TYPE(RTCVideoTrack) *> *)videoTracks {
|
||||
if (!_signalingThread->IsCurrent()) {
|
||||
return _signalingThread->BlockingCall([self]() { return self.videoTracks; });
|
||||
}
|
||||
return [_videoTracks copy];
|
||||
}
|
||||
|
||||
@ -48,33 +53,52 @@
|
||||
}
|
||||
|
||||
- (void)addAudioTrack:(RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrack {
|
||||
if (!_signalingThread->IsCurrent()) {
|
||||
return _signalingThread->BlockingCall(
|
||||
[audioTrack, self]() { return [self addAudioTrack:audioTrack]; });
|
||||
}
|
||||
if (_nativeMediaStream->AddTrack(audioTrack.nativeAudioTrack)) {
|
||||
[_audioTracks addObject:audioTrack];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)addVideoTrack:(RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrack {
|
||||
if (!_signalingThread->IsCurrent()) {
|
||||
return _signalingThread->BlockingCall(
|
||||
[videoTrack, self]() { return [self addVideoTrack:videoTrack]; });
|
||||
}
|
||||
if (_nativeMediaStream->AddTrack(videoTrack.nativeVideoTrack)) {
|
||||
[_videoTracks addObject:videoTrack];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeAudioTrack:(RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrack {
|
||||
if (!_signalingThread->IsCurrent()) {
|
||||
return _signalingThread->BlockingCall(
|
||||
[audioTrack, self]() { return [self removeAudioTrack:audioTrack]; });
|
||||
}
|
||||
NSUInteger index = [_audioTracks indexOfObjectIdenticalTo:audioTrack];
|
||||
NSAssert(index != NSNotFound,
|
||||
@"|removeAudioTrack| called on unexpected RTC_OBJC_TYPE(RTCAudioTrack)");
|
||||
if (index != NSNotFound &&
|
||||
_nativeMediaStream->RemoveTrack(audioTrack.nativeAudioTrack)) {
|
||||
if (index == NSNotFound) {
|
||||
RTC_LOG(LS_INFO) << "|removeAudioTrack| called on unexpected RTC_OBJC_TYPE(RTCAudioTrack)";
|
||||
return;
|
||||
}
|
||||
if (_nativeMediaStream->RemoveTrack(audioTrack.nativeAudioTrack)) {
|
||||
[_audioTracks removeObjectAtIndex:index];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeVideoTrack:(RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrack {
|
||||
if (!_signalingThread->IsCurrent()) {
|
||||
return _signalingThread->BlockingCall(
|
||||
[videoTrack, self]() { return [self removeVideoTrack:videoTrack]; });
|
||||
}
|
||||
NSUInteger index = [_videoTracks indexOfObjectIdenticalTo:videoTrack];
|
||||
NSAssert(index != NSNotFound,
|
||||
@"|removeVideoTrack| called on unexpected RTC_OBJC_TYPE(RTCVideoTrack)");
|
||||
if (index != NSNotFound &&
|
||||
_nativeMediaStream->RemoveTrack(videoTrack.nativeVideoTrack)) {
|
||||
if (index == NSNotFound) {
|
||||
RTC_LOG(LS_INFO) << "|removeVideoTrack| called on unexpected RTC_OBJC_TYPE(RTCVideoTrack)";
|
||||
return;
|
||||
}
|
||||
|
||||
if (_nativeMediaStream->RemoveTrack(videoTrack.nativeVideoTrack)) {
|
||||
[_videoTracks removeObjectAtIndex:index];
|
||||
}
|
||||
}
|
||||
@ -98,6 +122,7 @@
|
||||
NSParameterAssert(nativeMediaStream);
|
||||
if (self = [super init]) {
|
||||
_factory = factory;
|
||||
_signalingThread = factory.signalingThread;
|
||||
|
||||
webrtc::AudioTrackVector audioTracks = nativeMediaStream->GetAudioTracks();
|
||||
webrtc::VideoTrackVector videoTracks = nativeMediaStream->GetVideoTracks();
|
||||
|
||||
@ -12,12 +12,14 @@
|
||||
|
||||
#import "RTCMetricsSampleInfo+Private.h"
|
||||
|
||||
#include "rtc_base/string_utils.h"
|
||||
|
||||
void RTCEnableMetrics(void) {
|
||||
webrtc::metrics::Enable();
|
||||
}
|
||||
|
||||
NSArray<RTC_OBJC_TYPE(RTCMetricsSampleInfo) *> *RTCGetAndResetMetrics(void) {
|
||||
std::map<std::string, std::unique_ptr<webrtc::metrics::SampleInfo>>
|
||||
std::map<std::string, std::unique_ptr<webrtc::metrics::SampleInfo>, rtc::AbslStringViewCmp>
|
||||
histograms;
|
||||
webrtc::metrics::GetAndReset(&histograms);
|
||||
|
||||
|
||||
@ -23,14 +23,12 @@
|
||||
std::string labelString = [NSString stdStringForString:label];
|
||||
const webrtc::DataChannelInit nativeInit =
|
||||
configuration.nativeDataChannelInit;
|
||||
rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel =
|
||||
self.nativePeerConnection->CreateDataChannel(labelString,
|
||||
&nativeInit);
|
||||
if (!dataChannel) {
|
||||
auto result = self.nativePeerConnection->CreateDataChannelOrError(labelString, &nativeInit);
|
||||
if (!result.ok()) {
|
||||
return nil;
|
||||
}
|
||||
return [[RTC_OBJC_TYPE(RTCDataChannel) alloc] initWithFactory:self.factory
|
||||
nativeDataChannel:dataChannel];
|
||||
nativeDataChannel:result.MoveValue()];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -48,6 +48,12 @@ class PeerConnectionDelegateAdapter : public PeerConnectionObserver {
|
||||
|
||||
void OnIceCandidate(const IceCandidateInterface *candidate) override;
|
||||
|
||||
void OnIceCandidateError(const std::string &address,
|
||||
int port,
|
||||
const std::string &url,
|
||||
int error_code,
|
||||
const std::string &error_text) override;
|
||||
|
||||
void OnIceCandidatesRemoved(const std::vector<cricket::Candidate> &candidates) override;
|
||||
|
||||
void OnIceSelectedCandidatePairChanged(const cricket::CandidatePairChangeEvent &event) override;
|
||||
@ -62,6 +68,8 @@ class PeerConnectionDelegateAdapter : public PeerConnectionObserver {
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
@protocol RTC_OBJC_TYPE
|
||||
(RTCSSLCertificateVerifier);
|
||||
|
||||
@interface RTC_OBJC_TYPE (RTCPeerConnection)
|
||||
()
|
||||
@ -77,20 +85,22 @@ class PeerConnectionDelegateAdapter : public PeerConnectionObserver {
|
||||
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
||||
* delegate.
|
||||
*/
|
||||
- (instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
|
||||
- (nullable instancetype)
|
||||
initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
certificateVerifier:(nullable id<RTC_OBJC_TYPE(RTCSSLCertificateVerifier)>)certificateVerifier
|
||||
delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
|
||||
|
||||
/** Initialize an RTCPeerConnection with a configuration, constraints,
|
||||
* delegate and PeerConnectionDependencies.
|
||||
*/
|
||||
- (instancetype)initWithDependencies:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
dependencies:
|
||||
(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
|
||||
delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate
|
||||
- (nullable instancetype)
|
||||
initWithDependencies:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
|
||||
delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
+ (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState:
|
||||
|
||||
@ -69,35 +69,34 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
|
||||
- (void)statisticsForSender : (RTC_OBJC_TYPE(RTCRtpSender) *)sender completionHandler
|
||||
: (RTCStatisticsCompletionHandler)completionHandler {
|
||||
rtc::scoped_refptr<webrtc::StatsCollectorCallbackAdapter> collector(
|
||||
new rtc::RefCountedObject<webrtc::StatsCollectorCallbackAdapter>(completionHandler));
|
||||
rtc::scoped_refptr<webrtc::StatsCollectorCallbackAdapter> collector =
|
||||
rtc::make_ref_counted<webrtc::StatsCollectorCallbackAdapter>(completionHandler);
|
||||
self.nativePeerConnection->GetStats(sender.nativeRtpSender, collector);
|
||||
}
|
||||
|
||||
- (void)statisticsForReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)receiver
|
||||
completionHandler:(RTCStatisticsCompletionHandler)completionHandler {
|
||||
rtc::scoped_refptr<webrtc::StatsCollectorCallbackAdapter> collector(
|
||||
new rtc::RefCountedObject<webrtc::StatsCollectorCallbackAdapter>(completionHandler));
|
||||
rtc::scoped_refptr<webrtc::StatsCollectorCallbackAdapter> collector =
|
||||
rtc::make_ref_counted<webrtc::StatsCollectorCallbackAdapter>(completionHandler);
|
||||
self.nativePeerConnection->GetStats(receiver.nativeRtpReceiver, collector);
|
||||
}
|
||||
|
||||
- (void)statisticsWithCompletionHandler:(RTCStatisticsCompletionHandler)completionHandler {
|
||||
rtc::scoped_refptr<webrtc::StatsCollectorCallbackAdapter> collector(
|
||||
new rtc::RefCountedObject<webrtc::StatsCollectorCallbackAdapter>(completionHandler));
|
||||
self.nativePeerConnection->GetStats(collector);
|
||||
rtc::scoped_refptr<webrtc::StatsCollectorCallbackAdapter> collector =
|
||||
rtc::make_ref_counted<webrtc::StatsCollectorCallbackAdapter>(completionHandler);
|
||||
self.nativePeerConnection->GetStats(collector.get());
|
||||
}
|
||||
|
||||
- (void)statsForTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)mediaStreamTrack
|
||||
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel
|
||||
completionHandler:
|
||||
(void (^)(NSArray<RTC_OBJC_TYPE(RTCLegacyStatsReport) *> *stats))completionHandler {
|
||||
rtc::scoped_refptr<webrtc::StatsObserverAdapter> observer(
|
||||
new rtc::RefCountedObject<webrtc::StatsObserverAdapter>
|
||||
(completionHandler));
|
||||
rtc::scoped_refptr<webrtc::StatsObserverAdapter> observer =
|
||||
rtc::make_ref_counted<webrtc::StatsObserverAdapter>(completionHandler);
|
||||
webrtc::PeerConnectionInterface::StatsOutputLevel nativeOutputLevel =
|
||||
[[self class] nativeStatsOutputLevelForLevel:statsOutputLevel];
|
||||
self.nativePeerConnection->GetStats(
|
||||
observer, mediaStreamTrack.nativeTrack, nativeOutputLevel);
|
||||
observer.get(), mediaStreamTrack.nativeTrack.get(), nativeOutputLevel);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
@class RTC_OBJC_TYPE(RTCDataChannel);
|
||||
@class RTC_OBJC_TYPE(RTCDataChannelConfiguration);
|
||||
@class RTC_OBJC_TYPE(RTCIceCandidate);
|
||||
@class RTC_OBJC_TYPE(RTCIceCandidateErrorEvent);
|
||||
@class RTC_OBJC_TYPE(RTCMediaConstraints);
|
||||
@class RTC_OBJC_TYPE(RTCMediaStream);
|
||||
@class RTC_OBJC_TYPE(RTCMediaStreamTrack);
|
||||
@ -81,6 +82,12 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
|
||||
RTCStatsOutputLevelDebug,
|
||||
};
|
||||
|
||||
typedef void (^RTCCreateSessionDescriptionCompletionHandler)(RTC_OBJC_TYPE(RTCSessionDescription) *
|
||||
_Nullable sdp,
|
||||
NSError *_Nullable error);
|
||||
|
||||
typedef void (^RTCSetSessionDescriptionCompletionHandler)(NSError *_Nullable error);
|
||||
|
||||
@class RTC_OBJC_TYPE(RTCPeerConnection);
|
||||
|
||||
RTC_OBJC_EXPORT
|
||||
@ -158,6 +165,10 @@ RTC_OBJC_EXPORT
|
||||
lastReceivedMs:(int)lastDataReceivedMs
|
||||
changeReason:(NSString *)reason;
|
||||
|
||||
/** Called when gathering of an ICE candidate failed. */
|
||||
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
|
||||
didFailToGatherIceCandidate:(RTC_OBJC_TYPE(RTCIceCandidateErrorEvent) *)event;
|
||||
|
||||
@end
|
||||
|
||||
RTC_OBJC_EXPORT
|
||||
@ -168,7 +179,7 @@ RTC_OBJC_EXPORT
|
||||
*/
|
||||
@property(nonatomic, weak, nullable) id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)> delegate;
|
||||
/** This property is not available with RTCSdpSemanticsUnifiedPlan. Please use
|
||||
* |senders| instead.
|
||||
* `senders` instead.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCMediaStream) *> *localStreams;
|
||||
@property(nonatomic, readonly, nullable) RTC_OBJC_TYPE(RTCSessionDescription) * localDescription;
|
||||
@ -201,7 +212,7 @@ RTC_OBJC_EXPORT
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/** Sets the PeerConnection's global configuration to |configuration|.
|
||||
/** Sets the PeerConnection's global configuration to `configuration`.
|
||||
* Any changes to STUN/TURN servers or ICE candidate policy will affect the
|
||||
* next gathering phase, and cause the next call to createOffer to generate
|
||||
* new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies
|
||||
@ -213,7 +224,12 @@ RTC_OBJC_EXPORT
|
||||
- (void)close;
|
||||
|
||||
/** Provide a remote candidate to the ICE Agent. */
|
||||
- (void)addIceCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate;
|
||||
- (void)addIceCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate
|
||||
DEPRECATED_MSG_ATTRIBUTE("Please use addIceCandidate:completionHandler: instead");
|
||||
|
||||
/** Provide a remote candidate to the ICE Agent. */
|
||||
- (void)addIceCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate
|
||||
completionHandler:(void (^)(NSError *_Nullable error))completionHandler;
|
||||
|
||||
/** Remove a group of remote candidates from the ICE Agent. */
|
||||
- (void)removeIceCandidates:(NSArray<RTC_OBJC_TYPE(RTCIceCandidate) *> *)candidates;
|
||||
@ -232,14 +248,14 @@ RTC_OBJC_EXPORT
|
||||
|
||||
/** Add a new media stream track to be sent on this peer connection, and return
|
||||
* the newly created RTCRtpSender. The RTCRtpSender will be
|
||||
* associated with the streams specified in the |streamIds| list.
|
||||
* associated with the streams specified in the `streamIds` list.
|
||||
*
|
||||
* Errors: If an error occurs, returns nil. An error can occur if:
|
||||
* - A sender already exists for the track.
|
||||
* - The peer connection is closed.
|
||||
*/
|
||||
- (RTC_OBJC_TYPE(RTCRtpSender) *)addTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track
|
||||
streamIds:(NSArray<NSString *> *)streamIds;
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpSender) *)addTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track
|
||||
streamIds:(NSArray<NSString *> *)streamIds;
|
||||
|
||||
/** With PlanB semantics, removes an RTCRtpSender from this peer connection.
|
||||
*
|
||||
@ -254,7 +270,7 @@ RTC_OBJC_EXPORT
|
||||
* transceivers. Adding a transceiver will cause future calls to CreateOffer
|
||||
* to add a media description for the corresponding transceiver.
|
||||
*
|
||||
* The initial value of |mid| in the returned transceiver is nil. Setting a
|
||||
* The initial value of `mid` in the returned transceiver is nil. Setting a
|
||||
* new session description may change it to a non-nil value.
|
||||
*
|
||||
* https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver
|
||||
@ -271,42 +287,50 @@ RTC_OBJC_EXPORT
|
||||
* of the transceiver (and sender/receiver) will be derived from the kind of
|
||||
* the track.
|
||||
*/
|
||||
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverWithTrack:
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverWithTrack:
|
||||
(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track;
|
||||
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)
|
||||
addTransceiverWithTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track
|
||||
init:(RTC_OBJC_TYPE(RTCRtpTransceiverInit) *)init;
|
||||
|
||||
/** Adds a transceiver with the given kind. Can either be RTCRtpMediaTypeAudio
|
||||
* or RTCRtpMediaTypeVideo.
|
||||
*/
|
||||
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverOfType:(RTCRtpMediaType)mediaType;
|
||||
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverOfType:(RTCRtpMediaType)mediaType
|
||||
init:(RTC_OBJC_TYPE(RTCRtpTransceiverInit) *)
|
||||
init;
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverOfType:(RTCRtpMediaType)mediaType;
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)
|
||||
addTransceiverOfType:(RTCRtpMediaType)mediaType
|
||||
init:(RTC_OBJC_TYPE(RTCRtpTransceiverInit) *)init;
|
||||
|
||||
/** Tells the PeerConnection that ICE should be restarted. This triggers a need
|
||||
* for negotiation and subsequent offerForConstraints:completionHandler call will act as if
|
||||
* RTCOfferAnswerOptions::ice_restart is true.
|
||||
*/
|
||||
- (void)restartIce;
|
||||
|
||||
/** Generate an SDP offer. */
|
||||
- (void)offerForConstraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
completionHandler:(nullable void (^)(RTC_OBJC_TYPE(RTCSessionDescription) * _Nullable sdp,
|
||||
NSError *_Nullable error))completionHandler;
|
||||
completionHandler:(RTCCreateSessionDescriptionCompletionHandler)completionHandler;
|
||||
|
||||
/** Generate an SDP answer. */
|
||||
- (void)answerForConstraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
completionHandler:
|
||||
(nullable void (^)(RTC_OBJC_TYPE(RTCSessionDescription) * _Nullable sdp,
|
||||
NSError *_Nullable error))completionHandler;
|
||||
completionHandler:(RTCCreateSessionDescriptionCompletionHandler)completionHandler;
|
||||
|
||||
/** Apply the supplied RTCSessionDescription as the local description. */
|
||||
- (void)setLocalDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)sdp
|
||||
completionHandler:(nullable void (^)(NSError *_Nullable error))completionHandler;
|
||||
completionHandler:(RTCSetSessionDescriptionCompletionHandler)completionHandler;
|
||||
|
||||
/** Creates an offer or answer (depending on current signaling state) and sets
|
||||
* it as the local session description. */
|
||||
- (void)setLocalDescriptionWithCompletionHandler:
|
||||
(RTCSetSessionDescriptionCompletionHandler)completionHandler;
|
||||
|
||||
/** Apply the supplied RTCSessionDescription as the remote description. */
|
||||
- (void)setRemoteDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)sdp
|
||||
completionHandler:(nullable void (^)(NSError *_Nullable error))completionHandler;
|
||||
completionHandler:(RTCSetSessionDescriptionCompletionHandler)completionHandler;
|
||||
|
||||
/** Limits the bandwidth allocated for all RTP streams sent by this
|
||||
* PeerConnection. Nil parameters will be unchanged. Setting
|
||||
* |currentBitrateBps| will force the available bitrate estimate to the given
|
||||
* `currentBitrateBps` will force the available bitrate estimate to the given
|
||||
* value. Returns YES if the parameters were successfully updated.
|
||||
*/
|
||||
- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps
|
||||
@ -346,7 +370,7 @@ typedef void (^RTCStatisticsCompletionHandler)(RTC_OBJC_TYPE(RTCStatisticsReport
|
||||
@interface RTC_OBJC_TYPE (RTCPeerConnection)
|
||||
(Stats)
|
||||
|
||||
/** Gather stats for the given RTCMediaStreamTrack. If |mediaStreamTrack| is nil
|
||||
/** Gather stats for the given RTCMediaStreamTrack. If `mediaStreamTrack` is nil
|
||||
* statistics are gathered for all tracks.
|
||||
*/
|
||||
- (void)statsForTrack
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#import "RTCConfiguration+Private.h"
|
||||
#import "RTCDataChannel+Private.h"
|
||||
#import "RTCIceCandidate+Private.h"
|
||||
#import "RTCIceCandidateErrorEvent+Private.h"
|
||||
#import "RTCLegacyStatsReport+Private.h"
|
||||
#import "RTCMediaConstraints+Private.h"
|
||||
#import "RTCMediaStream+Private.h"
|
||||
@ -29,12 +30,52 @@
|
||||
|
||||
#include "api/jsep_ice_candidate.h"
|
||||
#include "api/rtc_event_log_output_file.h"
|
||||
#include "api/set_local_description_observer_interface.h"
|
||||
#include "api/set_remote_description_observer_interface.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "sdk/objc/native/api/ssl_certificate_verifier.h"
|
||||
|
||||
NSString *const kRTCPeerConnectionErrorDomain = @"org.webrtc.RTC_OBJC_TYPE(RTCPeerConnection)";
|
||||
int const kRTCPeerConnnectionSessionDescriptionError = -1;
|
||||
|
||||
namespace {
|
||||
|
||||
class SetSessionDescriptionObserver : public webrtc::SetLocalDescriptionObserverInterface,
|
||||
public webrtc::SetRemoteDescriptionObserverInterface {
|
||||
public:
|
||||
SetSessionDescriptionObserver(RTCSetSessionDescriptionCompletionHandler completionHandler) {
|
||||
completion_handler_ = completionHandler;
|
||||
}
|
||||
|
||||
virtual void OnSetLocalDescriptionComplete(webrtc::RTCError error) override {
|
||||
OnCompelete(error);
|
||||
}
|
||||
|
||||
virtual void OnSetRemoteDescriptionComplete(webrtc::RTCError error) override {
|
||||
OnCompelete(error);
|
||||
}
|
||||
|
||||
private:
|
||||
void OnCompelete(webrtc::RTCError error) {
|
||||
RTC_DCHECK(completion_handler_ != nil);
|
||||
if (error.ok()) {
|
||||
completion_handler_(nil);
|
||||
} else {
|
||||
// TODO(hta): Add handling of error.type()
|
||||
NSString *str = [NSString stringForStdString:error.message()];
|
||||
NSError *err = [NSError errorWithDomain:kRTCPeerConnectionErrorDomain
|
||||
code:kRTCPeerConnnectionSessionDescriptionError
|
||||
userInfo:@{NSLocalizedDescriptionKey : str}];
|
||||
completion_handler_(err);
|
||||
}
|
||||
completion_handler_ = nil;
|
||||
}
|
||||
RTCSetSessionDescriptionCompletionHandler completion_handler_;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class CreateSessionDescriptionObserverAdapter
|
||||
@ -74,38 +115,6 @@ class CreateSessionDescriptionObserverAdapter
|
||||
NSError *error);
|
||||
};
|
||||
|
||||
class SetSessionDescriptionObserverAdapter :
|
||||
public SetSessionDescriptionObserver {
|
||||
public:
|
||||
SetSessionDescriptionObserverAdapter(void (^completionHandler)
|
||||
(NSError *error)) {
|
||||
completion_handler_ = completionHandler;
|
||||
}
|
||||
|
||||
~SetSessionDescriptionObserverAdapter() override { completion_handler_ = nil; }
|
||||
|
||||
void OnSuccess() override {
|
||||
RTC_DCHECK(completion_handler_);
|
||||
completion_handler_(nil);
|
||||
completion_handler_ = nil;
|
||||
}
|
||||
|
||||
void OnFailure(RTCError error) override {
|
||||
RTC_DCHECK(completion_handler_);
|
||||
// TODO(hta): Add handling of error.type()
|
||||
NSString *str = [NSString stringForStdString:error.message()];
|
||||
NSError* err =
|
||||
[NSError errorWithDomain:kRTCPeerConnectionErrorDomain
|
||||
code:kRTCPeerConnnectionSessionDescriptionError
|
||||
userInfo:@{ NSLocalizedDescriptionKey : str }];
|
||||
completion_handler_(err);
|
||||
completion_handler_ = nil;
|
||||
}
|
||||
|
||||
private:
|
||||
void (^completion_handler_)(NSError *error);
|
||||
};
|
||||
|
||||
PeerConnectionDelegateAdapter::PeerConnectionDelegateAdapter(RTC_OBJC_TYPE(RTCPeerConnection) *
|
||||
peerConnection) {
|
||||
peer_connection_ = peerConnection;
|
||||
@ -219,6 +228,24 @@ void PeerConnectionDelegateAdapter::OnIceCandidate(
|
||||
didGenerateIceCandidate:iceCandidate];
|
||||
}
|
||||
|
||||
void PeerConnectionDelegateAdapter::OnIceCandidateError(const std::string &address,
|
||||
int port,
|
||||
const std::string &url,
|
||||
int error_code,
|
||||
const std::string &error_text) {
|
||||
RTC_OBJC_TYPE(RTCPeerConnection) *peer_connection = peer_connection_;
|
||||
RTC_OBJC_TYPE(RTCIceCandidateErrorEvent) *event =
|
||||
[[RTC_OBJC_TYPE(RTCIceCandidateErrorEvent) alloc] initWithAddress:address
|
||||
port:port
|
||||
url:url
|
||||
errorCode:error_code
|
||||
errorText:error_text];
|
||||
if ([peer_connection.delegate respondsToSelector:@selector(peerConnection:
|
||||
didFailToGatherIceCandidate:)]) {
|
||||
[peer_connection.delegate peerConnection:peer_connection didFailToGatherIceCandidate:event];
|
||||
}
|
||||
}
|
||||
|
||||
void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved(
|
||||
const std::vector<cricket::Candidate>& candidates) {
|
||||
NSMutableArray* ice_candidates =
|
||||
@ -307,13 +334,18 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
@synthesize delegate = _delegate;
|
||||
@synthesize factory = _factory;
|
||||
|
||||
- (instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
delegate:(id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate {
|
||||
- (nullable instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
certificateVerifier:
|
||||
(nullable id<RTC_OBJC_TYPE(RTCSSLCertificateVerifier)>)certificateVerifier
|
||||
delegate:(id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate {
|
||||
NSParameterAssert(factory);
|
||||
std::unique_ptr<webrtc::PeerConnectionDependencies> dependencies =
|
||||
std::make_unique<webrtc::PeerConnectionDependencies>(nullptr);
|
||||
if (certificateVerifier != nil) {
|
||||
dependencies->tls_cert_verifier = webrtc::ObjCToNativeCertificateVerifier(certificateVerifier);
|
||||
}
|
||||
return [self initWithDependencies:factory
|
||||
configuration:configuration
|
||||
constraints:constraints
|
||||
@ -321,12 +353,12 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
delegate:delegate];
|
||||
}
|
||||
|
||||
- (instancetype)initWithDependencies:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
dependencies:
|
||||
(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
|
||||
delegate:(id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate {
|
||||
- (nullable instancetype)
|
||||
initWithDependencies:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
|
||||
configuration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
|
||||
delegate:(id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate {
|
||||
NSParameterAssert(factory);
|
||||
NSParameterAssert(dependencies.get());
|
||||
std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config(
|
||||
@ -341,11 +373,12 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
|
||||
webrtc::PeerConnectionDependencies deps = std::move(*dependencies.release());
|
||||
deps.observer = _observer.get();
|
||||
_peerConnection = factory.nativeFactory->CreatePeerConnection(*config, std::move(deps));
|
||||
auto result = factory.nativeFactory->CreatePeerConnectionOrError(*config, std::move(deps));
|
||||
|
||||
if (!_peerConnection) {
|
||||
if (!result.ok()) {
|
||||
return nil;
|
||||
}
|
||||
_peerConnection = result.MoveValue();
|
||||
_factory = factory;
|
||||
_localStreams = [[NSMutableArray alloc] init];
|
||||
_delegate = delegate;
|
||||
@ -358,19 +391,23 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCSessionDescription) *)localDescription {
|
||||
const webrtc::SessionDescriptionInterface *description =
|
||||
_peerConnection->local_description();
|
||||
return description ?
|
||||
[[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithNativeDescription:description] :
|
||||
nil;
|
||||
// It's only safe to operate on SessionDescriptionInterface on the signaling thread.
|
||||
return _peerConnection->signaling_thread()->BlockingCall([self] {
|
||||
const webrtc::SessionDescriptionInterface *description = _peerConnection->local_description();
|
||||
return description ?
|
||||
[[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithNativeDescription:description] :
|
||||
nil;
|
||||
});
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCSessionDescription) *)remoteDescription {
|
||||
const webrtc::SessionDescriptionInterface *description =
|
||||
_peerConnection->remote_description();
|
||||
return description ?
|
||||
[[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithNativeDescription:description] :
|
||||
nil;
|
||||
// It's only safe to operate on SessionDescriptionInterface on the signaling thread.
|
||||
return _peerConnection->signaling_thread()->BlockingCall([self] {
|
||||
const webrtc::SessionDescriptionInterface *description = _peerConnection->remote_description();
|
||||
return description ?
|
||||
[[RTC_OBJC_TYPE(RTCSessionDescription) alloc] initWithNativeDescription:description] :
|
||||
nil;
|
||||
});
|
||||
}
|
||||
|
||||
- (RTCSignalingState)signalingState {
|
||||
@ -418,7 +455,22 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
candidate.nativeCandidate);
|
||||
_peerConnection->AddIceCandidate(iceCandidate.get());
|
||||
}
|
||||
|
||||
- (void)addIceCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate
|
||||
completionHandler:(void (^)(NSError *_Nullable error))completionHandler {
|
||||
RTC_DCHECK(completionHandler != nil);
|
||||
_peerConnection->AddIceCandidate(
|
||||
candidate.nativeCandidate, [completionHandler](const auto &error) {
|
||||
if (error.ok()) {
|
||||
completionHandler(nil);
|
||||
} else {
|
||||
NSString *str = [NSString stringForStdString:error.message()];
|
||||
NSError *err = [NSError errorWithDomain:kRTCPeerConnectionErrorDomain
|
||||
code:static_cast<NSInteger>(error.type())
|
||||
userInfo:@{NSLocalizedDescriptionKey : str}];
|
||||
completionHandler(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
- (void)removeIceCandidates:(NSArray<RTC_OBJC_TYPE(RTCIceCandidate) *> *)iceCandidates {
|
||||
std::vector<cricket::Candidate> candidates;
|
||||
for (RTC_OBJC_TYPE(RTCIceCandidate) * iceCandidate in iceCandidates) {
|
||||
@ -436,7 +488,7 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
}
|
||||
|
||||
- (void)addStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream {
|
||||
if (!_peerConnection->AddStream(stream.nativeMediaStream)) {
|
||||
if (!_peerConnection->AddStream(stream.nativeMediaStream.get())) {
|
||||
RTCLogError(@"Failed to add stream: %@", stream);
|
||||
return;
|
||||
}
|
||||
@ -444,12 +496,12 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
}
|
||||
|
||||
- (void)removeStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream {
|
||||
_peerConnection->RemoveStream(stream.nativeMediaStream);
|
||||
_peerConnection->RemoveStream(stream.nativeMediaStream.get());
|
||||
[_localStreams removeObject:stream];
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCRtpSender) *)addTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track
|
||||
streamIds:(NSArray<NSString *> *)streamIds {
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpSender) *)addTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track
|
||||
streamIds:(NSArray<NSString *> *)streamIds {
|
||||
std::vector<std::string> nativeStreamIds;
|
||||
for (NSString *streamId in streamIds) {
|
||||
nativeStreamIds.push_back([streamId UTF8String]);
|
||||
@ -465,20 +517,20 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
}
|
||||
|
||||
- (BOOL)removeTrack:(RTC_OBJC_TYPE(RTCRtpSender) *)sender {
|
||||
bool result = _peerConnection->RemoveTrack(sender.nativeRtpSender);
|
||||
bool result = _peerConnection->RemoveTrackOrError(sender.nativeRtpSender).ok();
|
||||
if (!result) {
|
||||
RTCLogError(@"Failed to remote track %@", sender);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverWithTrack:
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverWithTrack:
|
||||
(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track {
|
||||
return [self addTransceiverWithTrack:track
|
||||
init:[[RTC_OBJC_TYPE(RTCRtpTransceiverInit) alloc] init]];
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)
|
||||
addTransceiverWithTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track
|
||||
init:(RTC_OBJC_TYPE(RTCRtpTransceiverInit) *)init {
|
||||
webrtc::RTCErrorOr<rtc::scoped_refptr<webrtc::RtpTransceiverInterface>> nativeTransceiverOrError =
|
||||
@ -493,14 +545,14 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
nativeRtpTransceiver:nativeTransceiverOrError.MoveValue()];
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverOfType:(RTCRtpMediaType)mediaType {
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverOfType:(RTCRtpMediaType)mediaType {
|
||||
return [self addTransceiverOfType:mediaType
|
||||
init:[[RTC_OBJC_TYPE(RTCRtpTransceiverInit) alloc] init]];
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverOfType:(RTCRtpMediaType)mediaType
|
||||
init:(RTC_OBJC_TYPE(RTCRtpTransceiverInit) *)
|
||||
init {
|
||||
- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)
|
||||
addTransceiverOfType:(RTCRtpMediaType)mediaType
|
||||
init:(RTC_OBJC_TYPE(RTCRtpTransceiverInit) *)init {
|
||||
webrtc::RTCErrorOr<rtc::scoped_refptr<webrtc::RtpTransceiverInterface>> nativeTransceiverOrError =
|
||||
_peerConnection->AddTransceiver(
|
||||
[RTC_OBJC_TYPE(RTCRtpReceiver) nativeMediaTypeForMediaType:mediaType], init.nativeInit);
|
||||
@ -515,44 +567,54 @@ void PeerConnectionDelegateAdapter::OnRemoveTrack(
|
||||
nativeRtpTransceiver:nativeTransceiverOrError.MoveValue()];
|
||||
}
|
||||
|
||||
- (void)restartIce {
|
||||
_peerConnection->RestartIce();
|
||||
}
|
||||
|
||||
- (void)offerForConstraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
completionHandler:(void (^)(RTC_OBJC_TYPE(RTCSessionDescription) * sessionDescription,
|
||||
NSError *error))completionHandler {
|
||||
rtc::scoped_refptr<webrtc::CreateSessionDescriptionObserverAdapter>
|
||||
observer(new rtc::RefCountedObject
|
||||
<webrtc::CreateSessionDescriptionObserverAdapter>(completionHandler));
|
||||
completionHandler:(RTCCreateSessionDescriptionCompletionHandler)completionHandler {
|
||||
RTC_DCHECK(completionHandler != nil);
|
||||
rtc::scoped_refptr<webrtc::CreateSessionDescriptionObserverAdapter> observer =
|
||||
rtc::make_ref_counted<webrtc::CreateSessionDescriptionObserverAdapter>(completionHandler);
|
||||
webrtc::PeerConnectionInterface::RTCOfferAnswerOptions options;
|
||||
CopyConstraintsIntoOfferAnswerOptions(constraints.nativeConstraints.get(), &options);
|
||||
|
||||
_peerConnection->CreateOffer(observer, options);
|
||||
_peerConnection->CreateOffer(observer.get(), options);
|
||||
}
|
||||
|
||||
- (void)answerForConstraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
completionHandler:(void (^)(RTC_OBJC_TYPE(RTCSessionDescription) * sessionDescription,
|
||||
NSError *error))completionHandler {
|
||||
rtc::scoped_refptr<webrtc::CreateSessionDescriptionObserverAdapter>
|
||||
observer(new rtc::RefCountedObject
|
||||
<webrtc::CreateSessionDescriptionObserverAdapter>(completionHandler));
|
||||
completionHandler:(RTCCreateSessionDescriptionCompletionHandler)completionHandler {
|
||||
RTC_DCHECK(completionHandler != nil);
|
||||
rtc::scoped_refptr<webrtc::CreateSessionDescriptionObserverAdapter> observer =
|
||||
rtc::make_ref_counted<webrtc::CreateSessionDescriptionObserverAdapter>(completionHandler);
|
||||
webrtc::PeerConnectionInterface::RTCOfferAnswerOptions options;
|
||||
CopyConstraintsIntoOfferAnswerOptions(constraints.nativeConstraints.get(), &options);
|
||||
|
||||
_peerConnection->CreateAnswer(observer, options);
|
||||
_peerConnection->CreateAnswer(observer.get(), options);
|
||||
}
|
||||
|
||||
- (void)setLocalDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)sdp
|
||||
completionHandler:(void (^)(NSError *error))completionHandler {
|
||||
rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer(
|
||||
new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>(
|
||||
completionHandler));
|
||||
_peerConnection->SetLocalDescription(observer, sdp.nativeDescription);
|
||||
completionHandler:(RTCSetSessionDescriptionCompletionHandler)completionHandler {
|
||||
RTC_DCHECK(completionHandler != nil);
|
||||
rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface> observer =
|
||||
rtc::make_ref_counted<::SetSessionDescriptionObserver>(completionHandler);
|
||||
_peerConnection->SetLocalDescription(sdp.nativeDescription, observer);
|
||||
}
|
||||
|
||||
- (void)setLocalDescriptionWithCompletionHandler:
|
||||
(RTCSetSessionDescriptionCompletionHandler)completionHandler {
|
||||
RTC_DCHECK(completionHandler != nil);
|
||||
rtc::scoped_refptr<webrtc::SetLocalDescriptionObserverInterface> observer =
|
||||
rtc::make_ref_counted<::SetSessionDescriptionObserver>(completionHandler);
|
||||
_peerConnection->SetLocalDescription(observer);
|
||||
}
|
||||
|
||||
- (void)setRemoteDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)sdp
|
||||
completionHandler:(void (^)(NSError *error))completionHandler {
|
||||
rtc::scoped_refptr<webrtc::SetSessionDescriptionObserverAdapter> observer(
|
||||
new rtc::RefCountedObject<webrtc::SetSessionDescriptionObserverAdapter>(
|
||||
completionHandler));
|
||||
_peerConnection->SetRemoteDescription(observer, sdp.nativeDescription);
|
||||
completionHandler:(RTCSetSessionDescriptionCompletionHandler)completionHandler {
|
||||
RTC_DCHECK(completionHandler != nil);
|
||||
rtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface> observer =
|
||||
rtc::make_ref_counted<::SetSessionDescriptionObserver>(completionHandler);
|
||||
_peerConnection->SetRemoteDescription(sdp.nativeDescription, observer);
|
||||
}
|
||||
|
||||
- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps
|
||||
|
||||
@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
||||
* dependencies.
|
||||
*/
|
||||
- (RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
peerConnectionWithDependencies:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "rtc_base/thread.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@ -26,6 +27,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic,
|
||||
readonly) rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> nativeFactory;
|
||||
|
||||
@property(nonatomic, readonly) rtc::Thread* signalingThread;
|
||||
@property(nonatomic, readonly) rtc::Thread* workerThread;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@ -29,18 +29,28 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
(RTCVideoDecoderFactory);
|
||||
@protocol RTC_OBJC_TYPE
|
||||
(RTCVideoEncoderFactory);
|
||||
@protocol RTC_OBJC_TYPE
|
||||
(RTCSSLCertificateVerifier);
|
||||
@protocol RTC_OBJC_TYPE
|
||||
(RTCAudioDevice);
|
||||
|
||||
RTC_OBJC_EXPORT
|
||||
@interface RTC_OBJC_TYPE (RTCPeerConnectionFactory) : NSObject
|
||||
|
||||
/* Initialize object with default H264 video encoder/decoder factories */
|
||||
/* Initialize object with default H264 video encoder/decoder factories and default ADM */
|
||||
- (instancetype)init;
|
||||
|
||||
/* Initialize object with injectable video encoder/decoder factories */
|
||||
/* Initialize object with injectable video encoder/decoder factories and default ADM */
|
||||
- (instancetype)
|
||||
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
||||
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory;
|
||||
|
||||
/* Initialize object with injectable video encoder/decoder factories and injectable ADM */
|
||||
- (instancetype)
|
||||
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
||||
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory
|
||||
audioDevice:(nullable id<RTC_OBJC_TYPE(RTCAudioDevice)>)audioDevice;
|
||||
|
||||
/** Initialize an RTCAudioSource with constraints. */
|
||||
- (RTC_OBJC_TYPE(RTCAudioSource) *)audioSourceWithConstraints:
|
||||
(nullable RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints;
|
||||
@ -60,6 +70,13 @@ RTC_OBJC_EXPORT
|
||||
*/
|
||||
- (RTC_OBJC_TYPE(RTCVideoSource) *)videoSource;
|
||||
|
||||
/** Initialize a generic RTCVideoSource with he posibility of marking
|
||||
* it as usable for screen sharing. The RTCVideoSource should be
|
||||
* passed to a RTCVideoCapturer implementation, e.g.
|
||||
* RTCCameraVideoCapturer, in order to produce frames.
|
||||
*/
|
||||
- (RTC_OBJC_TYPE(RTCVideoSource) *)videoSourceForScreenCast:(BOOL)forScreenCast;
|
||||
|
||||
/** Initialize an RTCVideoTrack with a source and an id. */
|
||||
- (RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrackWithSource:(RTC_OBJC_TYPE(RTCVideoSource) *)source
|
||||
trackId:(NSString *)trackId;
|
||||
@ -70,11 +87,18 @@ RTC_OBJC_EXPORT
|
||||
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
||||
* delegate.
|
||||
*/
|
||||
- (RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
|
||||
|
||||
- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
certificateVerifier:
|
||||
(id<RTC_OBJC_TYPE(RTCSSLCertificateVerifier)>)certificateVerifier
|
||||
delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
|
||||
|
||||
/** Set the options to be used for subsequently created RTCPeerConnections */
|
||||
- (void)setOptions:(nonnull RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions) *)options;
|
||||
|
||||
|
||||
@ -25,35 +25,32 @@
|
||||
#import "base/RTCVideoDecoderFactory.h"
|
||||
#import "base/RTCVideoEncoderFactory.h"
|
||||
#import "helpers/NSString+StdString.h"
|
||||
#ifndef HAVE_NO_MEDIA
|
||||
#import "components/video_codec/RTCVideoDecoderFactoryH264.h"
|
||||
#import "components/video_codec/RTCVideoEncoderFactoryH264.h"
|
||||
// The no-media version PeerConnectionFactory doesn't depend on these files, but the gn check tool
|
||||
// is not smart enough to take the #ifdef into account.
|
||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h" // nogncheck
|
||||
#include "api/audio_codecs/builtin_audio_encoder_factory.h" // nogncheck
|
||||
#include "rtc_base/checks.h"
|
||||
#include "sdk/objc/native/api/network_monitor_factory.h"
|
||||
#include "sdk/objc/native/api/ssl_certificate_verifier.h"
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
|
||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
||||
#include "api/rtc_event_log/rtc_event_log_factory.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "modules/audio_device/include/audio_device.h" // nogncheck
|
||||
#include "modules/audio_processing/include/audio_processing.h" // nogncheck
|
||||
#include "api/transport/field_trial_based_config.h"
|
||||
#import "components/video_codec/RTCVideoDecoderFactoryH264.h"
|
||||
#import "components/video_codec/RTCVideoEncoderFactoryH264.h"
|
||||
#include "media/engine/webrtc_media_engine.h"
|
||||
#include "modules/audio_device/include/audio_device.h"
|
||||
#include "modules/audio_processing/include/audio_processing.h"
|
||||
|
||||
#include "sdk/objc/native/api/objc_audio_device_module.h"
|
||||
#include "sdk/objc/native/api/video_decoder_factory.h"
|
||||
#include "sdk/objc/native/api/video_encoder_factory.h"
|
||||
#include "sdk/objc/native/src/objc_video_decoder_factory.h"
|
||||
#include "sdk/objc/native/src/objc_video_encoder_factory.h"
|
||||
#endif
|
||||
|
||||
#if defined(WEBRTC_IOS)
|
||||
#import "sdk/objc/native/api/audio_device_module.h"
|
||||
#endif
|
||||
|
||||
// Adding the nogncheck to disable the including header check.
|
||||
// The no-media version PeerConnectionFactory doesn't depend on media related
|
||||
// C++ target.
|
||||
// TODO(zhihuang): Remove nogncheck once MediaEngineInterface is moved to C++
|
||||
// API layer.
|
||||
#include "media/engine/webrtc_media_engine.h" // nogncheck
|
||||
|
||||
@implementation RTC_OBJC_TYPE (RTCPeerConnectionFactory) {
|
||||
std::unique_ptr<rtc::Thread> _networkThread;
|
||||
std::unique_ptr<rtc::Thread> _workerThread;
|
||||
@ -72,9 +69,6 @@
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
#ifdef HAVE_NO_MEDIA
|
||||
return [self initWithNoMedia];
|
||||
#else
|
||||
return [self
|
||||
initWithNativeAudioEncoderFactory:webrtc::CreateBuiltinAudioEncoderFactory()
|
||||
nativeAudioDecoderFactory:webrtc::CreateBuiltinAudioDecoderFactory()
|
||||
@ -82,14 +76,20 @@
|
||||
RTCVideoEncoderFactoryH264) alloc] init])
|
||||
nativeVideoDecoderFactory:webrtc::ObjCToNativeVideoDecoderFactory([[RTC_OBJC_TYPE(
|
||||
RTCVideoDecoderFactoryH264) alloc] init])
|
||||
audioDeviceModule:[self audioDeviceModule]
|
||||
audioDeviceModule:[self audioDeviceModule].get()
|
||||
audioProcessingModule:nullptr];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (instancetype)
|
||||
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
||||
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory {
|
||||
return [self initWithEncoderFactory:encoderFactory decoderFactory:decoderFactory audioDevice:nil];
|
||||
}
|
||||
|
||||
- (instancetype)
|
||||
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
|
||||
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory
|
||||
audioDevice:(nullable id<RTC_OBJC_TYPE(RTCAudioDevice)>)audioDevice {
|
||||
#ifdef HAVE_NO_MEDIA
|
||||
return [self initWithNoMedia];
|
||||
#else
|
||||
@ -101,30 +101,37 @@
|
||||
if (decoderFactory) {
|
||||
native_decoder_factory = webrtc::ObjCToNativeVideoDecoderFactory(decoderFactory);
|
||||
}
|
||||
rtc::scoped_refptr<webrtc::AudioDeviceModule> audio_device_module;
|
||||
if (audioDevice) {
|
||||
audio_device_module = webrtc::CreateAudioDeviceModule(audioDevice);
|
||||
} else {
|
||||
audio_device_module = [self audioDeviceModule];
|
||||
}
|
||||
return [self initWithNativeAudioEncoderFactory:webrtc::CreateBuiltinAudioEncoderFactory()
|
||||
nativeAudioDecoderFactory:webrtc::CreateBuiltinAudioDecoderFactory()
|
||||
nativeVideoEncoderFactory:std::move(native_encoder_factory)
|
||||
nativeVideoDecoderFactory:std::move(native_decoder_factory)
|
||||
audioDeviceModule:[self audioDeviceModule]
|
||||
audioDeviceModule:audio_device_module.get()
|
||||
audioProcessingModule:nullptr];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (instancetype)initNative {
|
||||
if (self = [super init]) {
|
||||
_networkThread = rtc::Thread::CreateWithSocketServer();
|
||||
_networkThread->SetName("network_thread", _networkThread.get());
|
||||
BOOL result = _networkThread->Start();
|
||||
NSAssert(result, @"Failed to start network thread.");
|
||||
RTC_DCHECK(result) << "Failed to start network thread.";
|
||||
|
||||
_workerThread = rtc::Thread::Create();
|
||||
_workerThread->SetName("worker_thread", _workerThread.get());
|
||||
result = _workerThread->Start();
|
||||
NSAssert(result, @"Failed to start worker thread.");
|
||||
RTC_DCHECK(result) << "Failed to start worker thread.";
|
||||
|
||||
_signalingThread = rtc::Thread::Create();
|
||||
_signalingThread->SetName("signaling_thread", _signalingThread.get());
|
||||
result = _signalingThread->Start();
|
||||
NSAssert(result, @"Failed to start signaling thread.");
|
||||
RTC_DCHECK(result) << "Failed to start signaling thread.";
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@ -135,6 +142,9 @@
|
||||
dependencies.network_thread = _networkThread.get();
|
||||
dependencies.worker_thread = _workerThread.get();
|
||||
dependencies.signaling_thread = _signalingThread.get();
|
||||
if (webrtc::field_trial::IsEnabled("WebRTC-Network-UseNWPathMonitor")) {
|
||||
dependencies.network_monitor_factory = webrtc::CreateNetworkMonitorFactory();
|
||||
}
|
||||
_nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
|
||||
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
|
||||
}
|
||||
@ -179,8 +189,12 @@
|
||||
dependencies.network_thread = _networkThread.get();
|
||||
dependencies.worker_thread = _workerThread.get();
|
||||
dependencies.signaling_thread = _signalingThread.get();
|
||||
#ifndef HAVE_NO_MEDIA
|
||||
dependencies.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory();
|
||||
if (webrtc::field_trial::IsEnabled("WebRTC-Network-UseNWPathMonitor")) {
|
||||
dependencies.network_monitor_factory = webrtc::CreateNetworkMonitorFactory();
|
||||
}
|
||||
dependencies.trials = std::make_unique<webrtc::FieldTrialBasedConfig>();
|
||||
dependencies.task_queue_factory =
|
||||
webrtc::CreateDefaultTaskQueueFactory(dependencies.trials.get());
|
||||
cricket::MediaEngineDependencies media_deps;
|
||||
media_deps.adm = std::move(audioDeviceModule);
|
||||
media_deps.task_queue_factory = dependencies.task_queue_factory.get();
|
||||
@ -193,12 +207,12 @@
|
||||
} else {
|
||||
media_deps.audio_processing = webrtc::AudioProcessingBuilder().Create();
|
||||
}
|
||||
media_deps.trials = dependencies.trials.get();
|
||||
dependencies.media_engine = cricket::CreateMediaEngine(std::move(media_deps));
|
||||
dependencies.call_factory = webrtc::CreateCallFactory();
|
||||
dependencies.event_log_factory =
|
||||
std::make_unique<webrtc::RtcEventLogFactory>(dependencies.task_queue_factory.get());
|
||||
dependencies.network_controller_factory = std::move(networkControllerFactory);
|
||||
#endif
|
||||
_nativeFactory = webrtc::CreateModularPeerConnectionFactory(std::move(dependencies));
|
||||
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
|
||||
}
|
||||
@ -235,6 +249,13 @@
|
||||
workerThread:_workerThread.get()];
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCVideoSource) *)videoSourceForScreenCast:(BOOL)forScreenCast {
|
||||
return [[RTC_OBJC_TYPE(RTCVideoSource) alloc] initWithFactory:self
|
||||
signalingThread:_signalingThread.get()
|
||||
workerThread:_workerThread.get()
|
||||
isScreenCast:forScreenCast];
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrackWithSource:(RTC_OBJC_TYPE(RTCVideoSource) *)source
|
||||
trackId:(NSString *)trackId {
|
||||
return [[RTC_OBJC_TYPE(RTCVideoTrack) alloc] initWithFactory:self source:source trackId:trackId];
|
||||
@ -244,7 +265,7 @@
|
||||
return [[RTC_OBJC_TYPE(RTCMediaStream) alloc] initWithFactory:self streamId:streamId];
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
delegate:
|
||||
@ -252,10 +273,25 @@
|
||||
return [[RTC_OBJC_TYPE(RTCPeerConnection) alloc] initWithFactory:self
|
||||
configuration:configuration
|
||||
constraints:constraints
|
||||
certificateVerifier:nil
|
||||
delegate:delegate];
|
||||
}
|
||||
|
||||
- (RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
certificateVerifier:
|
||||
(id<RTC_OBJC_TYPE(RTCSSLCertificateVerifier)>)certificateVerifier
|
||||
delegate:
|
||||
(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate {
|
||||
return [[RTC_OBJC_TYPE(RTCPeerConnection) alloc] initWithFactory:self
|
||||
configuration:configuration
|
||||
constraints:constraints
|
||||
certificateVerifier:certificateVerifier
|
||||
delegate:delegate];
|
||||
}
|
||||
|
||||
- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *)
|
||||
peerConnectionWithDependencies:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
|
||||
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
|
||||
dependencies:(std::unique_ptr<webrtc::PeerConnectionDependencies>)dependencies
|
||||
@ -295,4 +331,12 @@
|
||||
_hasStartedAecDump = NO;
|
||||
}
|
||||
|
||||
- (rtc::Thread *)signalingThread {
|
||||
return _signalingThread.get();
|
||||
}
|
||||
|
||||
- (rtc::Thread *)workerThread {
|
||||
return _workerThread.get();
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
nativeAudioDecoderFactory:_audioDecoderFactory
|
||||
nativeVideoEncoderFactory:std::move(_videoEncoderFactory)
|
||||
nativeVideoDecoderFactory:std::move(_videoDecoderFactory)
|
||||
audioDeviceModule:_audioDeviceModule
|
||||
audioDeviceModule:_audioDeviceModule.get()
|
||||
audioProcessingModule:_audioProcessingModule];
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, readonly) webrtc::RtcpParameters nativeParameters;
|
||||
|
||||
/** Initialize the object with a native RtcpParameters structure. */
|
||||
- (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters;
|
||||
- (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ RTC_OBJC_EXPORT
|
||||
/** Whether reduced size RTCP is configured or compound RTCP. */
|
||||
@property(nonatomic, assign) BOOL isReducedSize;
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
- (instancetype)init;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -18,11 +18,12 @@
|
||||
@synthesize isReducedSize = _isReducedSize;
|
||||
|
||||
- (instancetype)init {
|
||||
return [super init];
|
||||
webrtc::RtcpParameters nativeParameters;
|
||||
return [self initWithNativeParameters:nativeParameters];
|
||||
}
|
||||
|
||||
- (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters {
|
||||
if (self = [self init]) {
|
||||
if (self = [super init]) {
|
||||
_cname = [NSString stringForStdString:nativeParameters.cname];
|
||||
_isReducedSize = nativeParameters.reduced_size;
|
||||
}
|
||||
|
||||
@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, readonly) webrtc::RtpCodecParameters nativeParameters;
|
||||
|
||||
/** Initialize the object with a native RtpCodecParameters structure. */
|
||||
- (instancetype)initWithNativeParameters:(const webrtc::RtpCodecParameters &)nativeParameters;
|
||||
- (instancetype)initWithNativeParameters:(const webrtc::RtpCodecParameters &)nativeParameters
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ RTC_EXTERN const NSString *const kRTCVp8CodecName;
|
||||
RTC_EXTERN const NSString *const kRTCVp9CodecName;
|
||||
RTC_EXTERN const NSString *const kRTCH264CodecName;
|
||||
|
||||
/** Defined in http://w3c.github.io/webrtc-pc/#idl-def-RTC_OBJC_TYPE(RTCRtpCodecParameters) */
|
||||
/** Defined in https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcodecparameters */
|
||||
RTC_OBJC_EXPORT
|
||||
@interface RTC_OBJC_TYPE (RTCRtpCodecParameters) : NSObject
|
||||
|
||||
@ -66,7 +66,7 @@ RTC_OBJC_EXPORT
|
||||
/** The "format specific parameters" field from the "a=fmtp" line in the SDP */
|
||||
@property(nonatomic, readonly, nonnull) NSDictionary *parameters;
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
- (instancetype)init;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -44,12 +44,13 @@ const NSString * const kRTCH264CodecName = @(cricket::kH264CodecName);
|
||||
@synthesize parameters = _parameters;
|
||||
|
||||
- (instancetype)init {
|
||||
return [super init];
|
||||
webrtc::RtpCodecParameters nativeParameters;
|
||||
return [self initWithNativeParameters:nativeParameters];
|
||||
}
|
||||
|
||||
- (instancetype)initWithNativeParameters:
|
||||
(const webrtc::RtpCodecParameters &)nativeParameters {
|
||||
if (self = [self init]) {
|
||||
if (self = [super init]) {
|
||||
_payloadType = nativeParameters.payload_type;
|
||||
_name = [NSString stringForStdString:nativeParameters.name];
|
||||
switch (nativeParameters.kind) {
|
||||
@ -60,7 +61,10 @@ const NSString * const kRTCH264CodecName = @(cricket::kH264CodecName);
|
||||
_kind = kRTCMediaStreamTrackKindVideo;
|
||||
break;
|
||||
case cricket::MEDIA_TYPE_DATA:
|
||||
RTC_NOTREACHED();
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
break;
|
||||
case cricket::MEDIA_TYPE_UNSUPPORTED:
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
break;
|
||||
}
|
||||
if (nativeParameters.clock_rate) {
|
||||
@ -90,7 +94,7 @@ const NSString * const kRTCH264CodecName = @(cricket::kH264CodecName);
|
||||
} else if (_kind == kRTCMediaStreamTrackKindVideo) {
|
||||
parameters.kind = cricket::MEDIA_TYPE_VIDEO;
|
||||
} else {
|
||||
RTC_NOTREACHED();
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
}
|
||||
if (_clockRate != nil) {
|
||||
parameters.clock_rate = absl::optional<int>(_clockRate.intValue);
|
||||
|
||||
@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, readonly) webrtc::RtpEncodingParameters nativeParameters;
|
||||
|
||||
/** Initialize the object with a native RtpEncodingParameters structure. */
|
||||
- (instancetype)initWithNativeParameters:(const webrtc::RtpEncodingParameters &)nativeParameters;
|
||||
- (instancetype)initWithNativeParameters:(const webrtc::RtpEncodingParameters &)nativeParameters
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user