From 8af997b5d85f197fab51d2c34eacf9ed8d50255b Mon Sep 17 00:00:00 2001 From: Chen Date: Fri, 8 May 2026 00:47:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(webrtc):=20=E6=8E=A5=E5=85=A5=20WebRTC=2014?= =?UTF-8?q?7=20header=20overlay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用本地 WebRTC wrapper target 绑定 147 binary artifact - 新增 M147 header overlay 来源说明与 checksum 校验 - 收紧 static gate 和 release smoke 架构验证 --- .../xcshareddata/swiftpm/Package.resolved | 11 +- Package.resolved | 11 +- Package.swift | 19 +- Vendor/WebRTCHeaders/M147/SHA256SUMS | 85 ++++ Vendor/WebRTCHeaders/M147/SOURCES.md | 45 ++ .../M147/WebRTCHeaderOverlayAnchor.c | 1 + .../M147/include/WebRTC/RTCAudioSource.h | 32 ++ .../M147/include/WebRTC/RTCAudioTrack.h | 28 ++ .../M147/include/WebRTC/RTCCVPixelBuffer.h | 52 +++ .../M147/include/WebRTC/RTCCallbackLogger.h | 41 ++ .../include/WebRTC/RTCCameraVideoCapturer.h | 60 +++ .../M147/include/WebRTC/RTCCertificate.h | 47 ++ .../include/WebRTC/RTCCodecSpecificInfo.h | 24 + .../include/WebRTC/RTCCodecSpecificInfoH264.h | 28 ++ .../M147/include/WebRTC/RTCConfiguration.h | 268 +++++++++++ .../M147/include/WebRTC/RTCCryptoOptions.h | 66 +++ .../M147/include/WebRTC/RTCDataChannel.h | 134 ++++++ .../WebRTC/RTCDataChannelConfiguration.h | 52 +++ .../WebRTC/RTCDefaultVideoDecoderFactory.h | 26 ++ .../WebRTC/RTCDefaultVideoEncoderFactory.h | 31 ++ .../M147/include/WebRTC/RTCDispatcher.h | 47 ++ .../M147/include/WebRTC/RTCDtmfSender.h | 73 +++ .../M147/include/WebRTC/RTCEncodedImage.h | 52 +++ .../M147/include/WebRTC/RTCFieldTrials.h | 34 ++ .../M147/include/WebRTC/RTCFileLogger.h | 76 ++++ .../include/WebRTC/RTCFileVideoCapturer.h | 51 +++ .../include/WebRTC/RTCH264ProfileLevelId.h | 61 +++ .../M147/include/WebRTC/RTCI420Buffer.h | 22 + .../M147/include/WebRTC/RTCIceCandidate.h | 50 +++ .../WebRTC/RTCIceCandidateErrorEvent.h | 45 ++ .../M147/include/WebRTC/RTCIceServer.h | 115 +++++ .../include/WebRTC/RTCLegacyStatsReport.h | 37 ++ .../M147/include/WebRTC/RTCLogging.h | 70 +++ .../M147/include/WebRTC/RTCMTLNSVideoView.h | 22 + .../M147/include/WebRTC/RTCMacros.h | 67 +++ .../M147/include/WebRTC/RTCMediaConstraints.h | 47 ++ .../M147/include/WebRTC/RTCMediaSource.h | 34 ++ .../M147/include/WebRTC/RTCMediaStream.h | 50 +++ .../M147/include/WebRTC/RTCMediaStreamTrack.h | 50 +++ .../M147/include/WebRTC/RTCMetrics.h | 24 + .../include/WebRTC/RTCMetricsSampleInfo.h | 48 ++ .../include/WebRTC/RTCMutableI420Buffer.h | 24 + .../WebRTC/RTCMutableYUVPlanarBuffer.h | 28 ++ .../M147/include/WebRTC/RTCNativeI420Buffer.h | 23 + .../WebRTC/RTCNativeMutableI420Buffer.h | 24 + .../M147/include/WebRTC/RTCPeerConnection.h | 422 ++++++++++++++++++ .../include/WebRTC/RTCPeerConnectionFactory.h | 147 ++++++ .../WebRTC/RTCPeerConnectionFactoryOptions.h | 38 ++ .../M147/include/WebRTC/RTCRtcpParameters.h | 30 ++ .../M147/include/WebRTC/RTCRtpCapabilities.h | 31 ++ .../include/WebRTC/RTCRtpCodecCapability.h | 58 +++ .../include/WebRTC/RTCRtpCodecParameters.h | 72 +++ .../include/WebRTC/RTCRtpEncodingParameters.h | 77 ++++ .../include/WebRTC/RTCRtpHeaderExtension.h | 33 ++ .../WebRTC/RTCRtpHeaderExtensionCapability.h | 39 ++ .../M147/include/WebRTC/RTCRtpParameters.h | 65 +++ .../M147/include/WebRTC/RTCRtpReceiver.h | 105 +++++ .../M147/include/WebRTC/RTCRtpSender.h | 55 +++ .../M147/include/WebRTC/RTCRtpSource.h | 66 +++ .../M147/include/WebRTC/RTCRtpTransceiver.h | 177 ++++++++ .../M147/include/WebRTC/RTCSSLAdapter.h | 20 + .../WebRTC/RTCSSLCertificateVerifier.h | 25 ++ .../include/WebRTC/RTCSessionDescription.h | 49 ++ .../M147/include/WebRTC/RTCStatisticsReport.h | 58 +++ .../M147/include/WebRTC/RTCTracing.h | 21 + .../M147/include/WebRTC/RTCVideoCapturer.h | 37 ++ .../M147/include/WebRTC/RTCVideoCodecInfo.h | 43 ++ .../M147/include/WebRTC/RTCVideoDecoder.h | 41 ++ .../M147/include/WebRTC/RTCVideoDecoderAV1.h | 25 ++ .../include/WebRTC/RTCVideoDecoderFactory.h | 33 ++ .../WebRTC/RTCVideoDecoderFactoryH264.h | 18 + .../M147/include/WebRTC/RTCVideoDecoderH264.h | 18 + .../M147/include/WebRTC/RTCVideoDecoderVP8.h | 25 ++ .../M147/include/WebRTC/RTCVideoDecoderVP9.h | 27 ++ .../M147/include/WebRTC/RTCVideoEncoder.h | 62 +++ .../M147/include/WebRTC/RTCVideoEncoderAV1.h | 32 ++ .../include/WebRTC/RTCVideoEncoderFactory.h | 78 ++++ .../WebRTC/RTCVideoEncoderFactoryH264.h | 18 + .../M147/include/WebRTC/RTCVideoEncoderH264.h | 22 + .../WebRTC/RTCVideoEncoderQpThresholds.h | 29 ++ .../include/WebRTC/RTCVideoEncoderSettings.h | 42 ++ .../M147/include/WebRTC/RTCVideoEncoderVP8.h | 30 ++ .../M147/include/WebRTC/RTCVideoEncoderVP9.h | 32 ++ .../M147/include/WebRTC/RTCVideoFrame.h | 64 +++ .../M147/include/WebRTC/RTCVideoFrameBuffer.h | 40 ++ .../M147/include/WebRTC/RTCVideoRenderer.h | 44 ++ .../M147/include/WebRTC/RTCVideoSource.h | 37 ++ .../M147/include/WebRTC/RTCVideoTrack.h | 38 ++ .../M147/include/WebRTC/RTCVideoViewShading.h | 39 ++ .../M147/include/WebRTC/RTCYUVPlanarBuffer.h | 46 ++ .../M147/include/WebRTC/WebRTC.h | 94 ++++ .../xcshareddata/swiftpm/Package.resolved | 11 +- scripts/ci/release_smoke.sh | 3 + scripts/ci/static.sh | 149 ++++++- 94 files changed, 4965 insertions(+), 35 deletions(-) create mode 100644 Vendor/WebRTCHeaders/M147/SHA256SUMS create mode 100644 Vendor/WebRTCHeaders/M147/SOURCES.md create mode 100644 Vendor/WebRTCHeaders/M147/WebRTCHeaderOverlayAnchor.c create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCAudioSource.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCAudioTrack.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCVPixelBuffer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCallbackLogger.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCameraVideoCapturer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCertificate.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCodecSpecificInfo.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCodecSpecificInfoH264.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCConfiguration.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCryptoOptions.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDataChannel.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDataChannelConfiguration.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDefaultVideoDecoderFactory.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDefaultVideoEncoderFactory.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDispatcher.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDtmfSender.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCEncodedImage.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFieldTrials.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFileLogger.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFileVideoCapturer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCH264ProfileLevelId.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCI420Buffer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceCandidate.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceCandidateErrorEvent.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceServer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCLegacyStatsReport.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCLogging.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMTLNSVideoView.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMacros.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaConstraints.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaSource.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaStream.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaStreamTrack.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMetrics.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMetricsSampleInfo.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMutableI420Buffer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMutableYUVPlanarBuffer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCNativeI420Buffer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCNativeMutableI420Buffer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnection.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnectionFactory.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnectionFactoryOptions.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtcpParameters.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCapabilities.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCodecCapability.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCodecParameters.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpEncodingParameters.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpHeaderExtension.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpHeaderExtensionCapability.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpParameters.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpReceiver.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpSender.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpSource.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpTransceiver.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSSLAdapter.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSSLCertificateVerifier.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSessionDescription.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCStatisticsReport.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCTracing.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoCapturer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoCodecInfo.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoder.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderAV1.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderFactory.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderFactoryH264.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderH264.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderVP8.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderVP9.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoder.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderAV1.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderFactory.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderFactoryH264.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderH264.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderQpThresholds.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderSettings.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderVP8.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderVP9.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoFrame.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoFrameBuffer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoRenderer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoSource.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoTrack.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoViewShading.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/RTCYUVPlanarBuffer.h create mode 100644 Vendor/WebRTCHeaders/M147/include/WebRTC/WebRTC.h diff --git a/Apps/VoidDisplay/VoidDisplay.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Apps/VoidDisplay/VoidDisplay.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index f38b2fc..3096497 100644 --- a/Apps/VoidDisplay/VoidDisplay.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Apps/VoidDisplay/VoidDisplay.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,15 +1,6 @@ { - "originHash" : "7ca243407a3b132834ec3b117a3aea85a8f743151ef868a872c8bbf8082921f6", "pins" : [ - { - "identity" : "webrtc", - "kind" : "remoteSourceControl", - "location" : "https://github.com/stasel/WebRTC.git", - "state" : { - "revision" : "86dbb5cb57e4da009b859a6245b1c10d610f215a", - "version" : "140.0.0" - } - } + ], "version" : 3 } diff --git a/Package.resolved b/Package.resolved index 1d4cbfe..3096497 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,15 +1,6 @@ { - "originHash" : "b97be1a57e13296157ed53d85b5322a5ff7a72112c7386369386b1fba5341ef8", "pins" : [ - { - "identity" : "webrtc", - "kind" : "remoteSourceControl", - "location" : "https://github.com/stasel/WebRTC.git", - "state" : { - "revision" : "86dbb5cb57e4da009b859a6245b1c10d610f215a", - "version" : "140.0.0" - } - } + ], "version" : 3 } diff --git a/Package.swift b/Package.swift index 0bd8564..e20f818 100644 --- a/Package.swift +++ b/Package.swift @@ -11,10 +11,21 @@ let package = Package( products: [ .library(name: "VoidDisplayApp", targets: ["VoidDisplayApp"]) ], - dependencies: [ - .package(url: "https://github.com/stasel/WebRTC.git", from: "140.0.0") - ], + dependencies: [], targets: [ + .binaryTarget( + name: "WebRTCBinary", + url: "https://github.com/stasel/WebRTC/releases/download/147.0.0/WebRTC-M147.xcframework.zip", + checksum: "49f9b1713432c19f408e3218fc8526c7692fafca5869f7ec5f5991614276ed40" + ), + .target( + name: "WebRTC", + dependencies: [ + "WebRTCBinary" + ], + path: "Vendor/WebRTCHeaders/M147", + publicHeadersPath: "include" + ), .target( name: "VoidDisplayApp", dependencies: [ @@ -61,7 +72,7 @@ let package = Package( "VoidDisplayDesignSystem", "VoidDisplayFoundation", "VoidDisplayObservability", - .product(name: "WebRTC", package: "WebRTC") + "WebRTC" ], resources: [ .process("Resources") diff --git a/Vendor/WebRTCHeaders/M147/SHA256SUMS b/Vendor/WebRTCHeaders/M147/SHA256SUMS new file mode 100644 index 0000000..1a8add3 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/SHA256SUMS @@ -0,0 +1,85 @@ +a6f779223cf65891bd5964e516a340e32bba285147b8311691dfca008a724450 include/WebRTC/RTCAudioSource.h +443c3655c59902748f77299f32ab674aa9bea68928a0767e38ca73c1aea049cd include/WebRTC/RTCAudioTrack.h +bf4c5513bf9ad31a59d1896ecf2e9e2721d239ceea9a5ab28fbb96cced326c48 include/WebRTC/RTCCVPixelBuffer.h +2f9d7f7af93170e993bfc7872d0b0ed167418c86bf64c708fa2235d21c8bd451 include/WebRTC/RTCCallbackLogger.h +73a4d02c4a5a50e4faa8aa166c0c34b1a10ee234fd48a6dbe10f4cc9e929cef5 include/WebRTC/RTCCameraVideoCapturer.h +79fbb55d58fdea833e880bbacd9bb118ddb9aa545735730c5888606d6f02dcca include/WebRTC/RTCCertificate.h +2c0bfc54566e8c833a0b8641be5005ea4e2646cae863d0ff09d4052cc6790104 include/WebRTC/RTCCodecSpecificInfo.h +05fdff6dc23149c2096f0fe04f7b152be8c61e08f2e8f08def64b24de0ad790d include/WebRTC/RTCCodecSpecificInfoH264.h +da7b60c5c2532d3c9e1dc3a511567dc6c330437a296358eabfc11e14ca2fb35e include/WebRTC/RTCConfiguration.h +66b7c4047fd24c21eeef88326c9a05cf76d8e9873ab4f41aa51bf50df2af82ff include/WebRTC/RTCCryptoOptions.h +3c35ce615ce97bcb0d8cdd7d034f54b4295fc213826cd7f0f4744cbbd89d2cb0 include/WebRTC/RTCDataChannel.h +6ffb6928167fac2ca4460e1bf76e6f60048fcf5e0b2204082f63e138fc800251 include/WebRTC/RTCDataChannelConfiguration.h +217eac5c461c1cb285d2b8a477ff3b54cf8fe749db1081a8bc1518a685a46428 include/WebRTC/RTCDefaultVideoDecoderFactory.h +e95ef53e8a59fd1a0428bdee4349025ec0131658c546060ec06bc80fda0b64e4 include/WebRTC/RTCDefaultVideoEncoderFactory.h +e76921ca0a07064c9c00964d16b67c646a33c03aa004a55d1b3eb9b495993958 include/WebRTC/RTCDispatcher.h +f9cb67acb1efa1b999b79fe037a619728f31ea30fe2c525ee50ab746b8d75b97 include/WebRTC/RTCDtmfSender.h +aeaf4bb44898ce40e4fd81dadeeef48be01787b18959d713754d11a476035160 include/WebRTC/RTCEncodedImage.h +a834f3813a97283bb76b023c59c92cd6e33ebe8b94a956df9bdcdbdd623f15e6 include/WebRTC/RTCFieldTrials.h +88ef582e8976220a3513d9f837e194dc70e956c668019d172bb60f4d06733f1a include/WebRTC/RTCFileLogger.h +94232da252ed518b48209b115ab427c8b2b5e357e431348225249abc72267d9f include/WebRTC/RTCFileVideoCapturer.h +6ab2e0a76bc535aca7f340880e66826dec241c3f845e528c622028daca70e87b include/WebRTC/RTCH264ProfileLevelId.h +d868eea0c89fedc2666629b987b24852fe8603c4a131cb42572dbae0ad982389 include/WebRTC/RTCI420Buffer.h +991cafef402701603fe1bd9571e1126f1cb3ad8f5e299292d415e0000ec724fc include/WebRTC/RTCIceCandidate.h +a261299c4410bfdcf24a29289f18bb7106cd68bae20b90c3df8a87a64c7a8dd2 include/WebRTC/RTCIceCandidateErrorEvent.h +96ac29518d75b96f71c4c498843496510b8fbb297f9667921ff3bd98299dc42b include/WebRTC/RTCIceServer.h +d4e84adb391d69d0f120e1a4e3be4900ef9ae4d855fca3e824bc22cd93226f80 include/WebRTC/RTCLegacyStatsReport.h +736f070aa6eee94fd93e09a8b13b03a6ceb23950c56f1f42675899acab36b612 include/WebRTC/RTCLogging.h +85b9d39b38a2c24f4919cb9e25df254943db10458db3421c222d6e27a0113c6f include/WebRTC/RTCMTLNSVideoView.h +c5a1630f4bb0188ee5fc1eefef149af73ab666e98178252d9d3bcebf9a291094 include/WebRTC/RTCMacros.h +8f93f4f2016d48d947fab6dd64033dd12aec22eaae7f3a297f5c76f02cade1e1 include/WebRTC/RTCMediaConstraints.h +5f21eb276df3158df35a68d0e475c05708b8b0f3f5b878366269421a43ff45c5 include/WebRTC/RTCMediaSource.h +a5be4d0ce7aca440af069a6b37375ace6ac9f5a55e18be596d85c6aaf3865f4b include/WebRTC/RTCMediaStream.h +82f57eb0d0943e58f1c2de7deef19563b8705cba33d26ed37a2d33113233c827 include/WebRTC/RTCMediaStreamTrack.h +8345c18b6de97bbc55a4f6e1d9ff3cff7efe19910cf6d97f90e0f9d9ab2d0700 include/WebRTC/RTCMetrics.h +f42400721f2fc2958243d7fe67cef0f217519501d8fe9de26683691d59409c7c include/WebRTC/RTCMetricsSampleInfo.h +39acd5d401f942c0c1f4991b66cc3e103f20bb583d9b0e774791af822dcb3b7c include/WebRTC/RTCMutableI420Buffer.h +51c4d3703a10e689c8fabe099c6e7090f6d186584c52caad2b593b9fc914d354 include/WebRTC/RTCMutableYUVPlanarBuffer.h +a871e4d03b9b28a2f244cf8f44844b7d6d632feaddcc86404ab69550e203436d include/WebRTC/RTCNativeI420Buffer.h +a0402a848a3bd265fe4d837f2ad29f449efae6ea3c110c291c41ea8a3c103c34 include/WebRTC/RTCNativeMutableI420Buffer.h +98aa93523ed702e0676f76b729d8408b55f21be6ad8c266198704b35a705e765 include/WebRTC/RTCPeerConnection.h +115c2e18db5160de4b2a07559824c77eed16fa85373d48b025786bc3b9056bd5 include/WebRTC/RTCPeerConnectionFactory.h +5efecc02e6c460c420e94dcb6ba0663f594dc2d417ae749893931d7b68f55c5e include/WebRTC/RTCPeerConnectionFactoryOptions.h +20aa72bc1a0547faffa70a19026eab9b9346f08e564fd1ed0adda7c641fd4c3f include/WebRTC/RTCRtcpParameters.h +4adf327a3709926d19dc87619a55abe7a501d7eac977db49ed7029934d2a541c include/WebRTC/RTCRtpCapabilities.h +b309fb5642a1ec8e4bfda94a82c61d3ef66150606fb5bcdf30d4e3a7461b8287 include/WebRTC/RTCRtpCodecCapability.h +fe9e502253b333d8913d4e20768f63ad208aaba68bfe799f4b740cca70fe462d include/WebRTC/RTCRtpCodecParameters.h +de797b97cdc9b7b62a850cbacaca0218ec8275855e0e7d40ed9db7fd4e860642 include/WebRTC/RTCRtpEncodingParameters.h +16f4e2e0619babf6c8c06fca5e915235e27b7d754a74400fdd26dfc72c091369 include/WebRTC/RTCRtpHeaderExtension.h +a25b7cc46e39ae5ef3e0a0cbfba753efa57d5daf3329511eafc69c58a60b7475 include/WebRTC/RTCRtpHeaderExtensionCapability.h +9000c5878cef70dcf2adcd355ee1bf9634f448489bab266c2cdf4b37a555e56a include/WebRTC/RTCRtpParameters.h +c557abbd58565cb1078d8db921891655160d3a94c4f1d2f50b8bf06c02c2e770 include/WebRTC/RTCRtpReceiver.h +2dcbf3ba00dcbd5450e79a68998d082516eb96e36707d64aab0da5eeb2b9bb20 include/WebRTC/RTCRtpSender.h +e21473bc2e3e7839ce8108537575027d5e2c99f7f78ba5b890dd1de25dfd62e5 include/WebRTC/RTCRtpSource.h +817c34b07234b2c5ded843d2763a7a3eb405f8a41d58b9a2f6e68ca03ff92866 include/WebRTC/RTCRtpTransceiver.h +3c3e17c93efc321012da8d2e91f4f503433c86fa66dbca842dd2e7b115448501 include/WebRTC/RTCSSLAdapter.h +67e9ca71f36cf0dadda6f65ebcc08c0e6cc22c57d147bacc5e00450f46509f7d include/WebRTC/RTCSSLCertificateVerifier.h +e2eda0df572420144c66f517349504071ba6e31b500796c57bdcab2d115a8123 include/WebRTC/RTCSessionDescription.h +32f000f670b4ba423af55bed9f59c0e7dc59ce9c1be548233a1225093c1b706c include/WebRTC/RTCStatisticsReport.h +fb04c6178b892f3169a9750880a3a65adf696806533467943a92e0a1563998ab include/WebRTC/RTCTracing.h +4f2dd94d5e2665d8b550d6b5b31511621a7702947c59196d60244e013f147264 include/WebRTC/RTCVideoCapturer.h +433a01fce61a6ff3c617d393fcd2787a6c5bbc4e2522f923eed1ddb3baeb48e9 include/WebRTC/RTCVideoCodecInfo.h +e20a9ed8af02b17bbe5862681a89183570a3112ff29c78198b121b5552eec234 include/WebRTC/RTCVideoDecoder.h +cbeeb6b242777955a817b15c195105eac06a8769259b846c493660055d7279ef include/WebRTC/RTCVideoDecoderAV1.h +5be7d305d903c5e03d08bb7a5d2429359c262461af2936086f010c4b66fafd84 include/WebRTC/RTCVideoDecoderFactory.h +174b3f684ddeffa9ae598f56814181717ba4c6c0c166c85a3ffcfb86e33bfd4f include/WebRTC/RTCVideoDecoderFactoryH264.h +40bf172757cb04d975eac4938e3ed0b65e643550aa7f7544889b7c6b240c10e3 include/WebRTC/RTCVideoDecoderH264.h +e6499ae3ed9563d4fe11168df4280c75f38b205a8e6d3973d21a0337f0e62a45 include/WebRTC/RTCVideoDecoderVP8.h +84cb03a848022e94dd4f16f85536fb11765181127aa8e8ffc79ee6170669a45f include/WebRTC/RTCVideoDecoderVP9.h +332713da4cf565f0bda8d051448df5ddfd9602a2e90214b7f092363750430bba include/WebRTC/RTCVideoEncoder.h +b1924b25586fe281913f538f28a502d6dc02bc3261889ba7031a5d4ab11553df include/WebRTC/RTCVideoEncoderAV1.h +29ec7fff2875acd6ac1448ba2bdbb53051f732e743ffe3b5971a27be15ee8932 include/WebRTC/RTCVideoEncoderFactory.h +fd2a1f7896d370de56f764beb08eea00d96d38d0469785ccf473b2441cbb986c include/WebRTC/RTCVideoEncoderFactoryH264.h +f52d9b2d1b0343100457892fb8f56c551c1f1ca23b21e774a9945b85cd80ee40 include/WebRTC/RTCVideoEncoderH264.h +168446386b4a60e9ce12a983ac5bfe02e6b520809baa2cd47f8c90c05d1756d7 include/WebRTC/RTCVideoEncoderQpThresholds.h +9cee87a96f62bdec65cf2687c65e3105aaecbc0d67ec0c310309083d7d4b8850 include/WebRTC/RTCVideoEncoderSettings.h +5b737a7be33c396c0ed6b0e9d36356028ded87c8849ace65a0a962df934fbd38 include/WebRTC/RTCVideoEncoderVP8.h +d4855da9933266ded97924d00bb6e2dfe8f7f8b3a953135ea672a2912fc63647 include/WebRTC/RTCVideoEncoderVP9.h +f1e92e545812a09b1195649ad468360f7d9dc74fe153d97880aa54e70cd823b7 include/WebRTC/RTCVideoFrame.h +4de08bf0f0c4c0edb395922ca3f66591eb6c5ea32db716bf0016a22946832e4a include/WebRTC/RTCVideoFrameBuffer.h +3a38ff991169a6ac49026c05893f3803d48fcd12f776052f02498b025f57cc82 include/WebRTC/RTCVideoRenderer.h +f25afe454fb27aa47b37048315aa4d9fcf00fb05115715fac678e969a026fbbf include/WebRTC/RTCVideoSource.h +f6fc16b716bebd86cbe238a9e9095a30cbc9eca60504d338f5f7fcedeb39f39c include/WebRTC/RTCVideoTrack.h +547455720fa05b753fa969480ef044ac05beb66a79f4331727ad7859615f3515 include/WebRTC/RTCVideoViewShading.h +bb04f014c83e3129cf2d1e02355b5966e3966f362baa97593a37a7508b1c9350 include/WebRTC/RTCYUVPlanarBuffer.h +56011ec518b1da9aad5a0370a32d80b26f27ab371303b11ba4ab798692924d39 include/WebRTC/WebRTC.h diff --git a/Vendor/WebRTCHeaders/M147/SOURCES.md b/Vendor/WebRTCHeaders/M147/SOURCES.md new file mode 100644 index 0000000..056a3a8 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/SOURCES.md @@ -0,0 +1,45 @@ +# WebRTC M147 header overlay + +This directory contains the local `WebRTC` wrapper target used to import the +macOS WebRTC M147 framework from `stasel/WebRTC` 147.0.0. + +The binary framework is supplied by the `WebRTCBinary` SwiftPM binary target +from: + +`https://github.com/stasel/WebRTC/releases/download/147.0.0/WebRTC-M147.xcframework.zip` + +Expected asset SHA-256: + +`49f9b1713432c19f408e3218fc8526c7692fafca5869f7ec5f5991614276ed40` + +Official WebRTC source branch used for macOS-only headers: + +`refs/branch-heads/7727` + +## Header sources + +- `include/WebRTC/WebRTC.h` comes from the M147 macOS slice: + `macos-x86_64_arm64/WebRTC.framework/Versions/A/Headers/WebRTC.h`. +- Headers directly imported by `WebRTC.h` come from the M147 iOS device slice when + the same file exists there. +- `include/WebRTC/RTCMTLNSVideoView.h` comes from official WebRTC source at + `refs/branch-heads/7727/sdk/objc/components/renderer/metal/RTCMTLNSVideoView.h`. + Its local include was normalized from `"RTCVideoRenderer.h"` to + ``. + +## Regeneration outline + +1. Download the 147.0.0 release zip and verify the SHA-256 listed above. +2. Copy the macOS `WebRTC.h` into `include/WebRTC/`. +3. For every `` import in that umbrella header, copy the matching + iOS header into `include/WebRTC/`. +4. Replace `RTCMTLNSVideoView.h` with the official branch-heads/7727 source file + and normalize its WebRTC-local include. +5. Regenerate `SHA256SUMS` from `include/WebRTC/*.h`. + +The static gate validates recursive imports, iOS-only header exclusions, guarded +UIKit usage, and checksum coverage. + +`WebRTCHeaderOverlayAnchor.c` is an empty compilation unit that lets SwiftPM +model this directory as a C target while all public API surface comes from the +headers under `include/WebRTC/`. diff --git a/Vendor/WebRTCHeaders/M147/WebRTCHeaderOverlayAnchor.c b/Vendor/WebRTCHeaders/M147/WebRTCHeaderOverlayAnchor.c new file mode 100644 index 0000000..33f5d7e --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/WebRTCHeaderOverlayAnchor.c @@ -0,0 +1 @@ +void WebRTCHeaderOverlayAnchor(void) {} diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCAudioSource.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCAudioSource.h new file mode 100644 index 0000000..784864a --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCAudioSource.h @@ -0,0 +1,32 @@ +/* + * Copyright 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCAudioSource) : RTC_OBJC_TYPE(RTCMediaSource) + +- (instancetype)init NS_UNAVAILABLE; + +// Sets the volume for the RTCMediaSource. `volume` is a gain value in the range +// [0, 10]. +// Temporary fix to be able to modify volume of remote audio tracks. +// TODO(kthelgason): Property stays here temporarily until a proper volume-api +// is available on the surface exposed by webrtc. +@property(nonatomic, assign) double volume; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCAudioTrack.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCAudioTrack.h new file mode 100644 index 0000000..3c6d1dc --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCAudioTrack.h @@ -0,0 +1,28 @@ +/* + * Copyright 2015 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RTC_OBJC_TYPE(RTCAudioSource); + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCAudioTrack) : RTC_OBJC_TYPE(RTCMediaStreamTrack) + +- (instancetype)init NS_UNAVAILABLE; + +/** The audio source for this audio track. */ +@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCAudioSource) * source; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCVPixelBuffer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCVPixelBuffer.h new file mode 100644 index 0000000..dd112b4 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCVPixelBuffer.h @@ -0,0 +1,52 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** RTCVideoFrameBuffer containing a CVPixelBufferRef */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCCVPixelBuffer) : NSObject + +@property(nonatomic, readonly) CVPixelBufferRef pixelBuffer; +@property(nonatomic, readonly) int cropX; +@property(nonatomic, readonly) int cropY; +@property(nonatomic, readonly) int cropWidth; +@property(nonatomic, readonly) int cropHeight; + ++ (NSSet *)supportedPixelFormats; + +- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer; +- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer + adaptedWidth:(int)adaptedWidth + adaptedHeight:(int)adaptedHeight + cropWidth:(int)cropWidth + cropHeight:(int)cropHeight + cropX:(int)cropX + cropY:(int)cropY; + +- (BOOL)requiresCropping; +- (BOOL)requiresScalingToWidth:(int)width height:(int)height; +- (int)bufferSizeForCroppingAndScalingToWidth:(int)width height:(int)height; + +/** The minimum size of the `tmpBuffer` must be the number of bytes returned + * from the bufferSizeForCroppingAndScalingToWidth:height: method. If that size + * is 0, the `tmpBuffer` may be nil. + */ +- (BOOL)cropAndScaleTo:(CVPixelBufferRef)outputPixelBuffer + withTempBuffer:(nullable uint8_t *)tmpBuffer; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCallbackLogger.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCallbackLogger.h new file mode 100644 index 0000000..7e2745b --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCallbackLogger.h @@ -0,0 +1,41 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^RTCCallbackLoggerMessageHandler)(NSString *message); +typedef void (^RTCCallbackLoggerMessageAndSeverityHandler)( + NSString *message, RTCLoggingSeverity severity); + +// This class intercepts WebRTC logs and forwards them to a registered block. +// This class is not threadsafe. +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCCallbackLogger) : NSObject + +// The severity level to capture. The default is kRTCLoggingSeverityInfo. +@property(nonatomic, assign) RTCLoggingSeverity severity; + +// The callback handler will be called on the same thread that does the +// logging, so if the logging callback can be slow it may be a good idea +// to implement dispatching to some other queue. +- (void)start:(nullable RTCCallbackLoggerMessageHandler)handler; +- (void)startWithMessageAndSeverityHandler: + (nullable RTCCallbackLoggerMessageAndSeverityHandler)handler; + +- (void)stop; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCameraVideoCapturer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCameraVideoCapturer.h new file mode 100644 index 0000000..de69c5d --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCameraVideoCapturer.h @@ -0,0 +1,60 @@ +/* + * 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 +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +// Camera capture that implements RTCVideoCapturer. Delivers frames to a +// RTCVideoCapturerDelegate (usually RTCVideoSource). +NS_EXTENSION_UNAVAILABLE_IOS("Camera not available in app extensions.") +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCCameraVideoCapturer) : RTC_OBJC_TYPE(RTCVideoCapturer) + +// Capture session that is used for capturing. Valid from initialization to dealloc. +@property(readonly, nonatomic) AVCaptureSession *captureSession; + +// Returns list of available capture devices that support video capture. ++ (NSArray *)captureDevices; +// Returns list of formats that are supported by this class for this device. ++ (NSArray *)supportedFormatsForDevice: + (AVCaptureDevice *)device; + +// Returns the most efficient supported output pixel format for this capturer. +- (FourCharCode)preferredOutputPixelFormat; + +// Starts the capture session asynchronously and notifies callback on +// completion. The device will capture video in the format given in the `format` +// parameter. If the pixel format in `format` is supported by the WebRTC +// pipeline, the same pixel format will be used for the output. Otherwise, the +// format returned by `preferredOutputPixelFormat` will be used. +- (void)startCaptureWithDevice:(AVCaptureDevice *)device + format:(AVCaptureDeviceFormat *)format + fps:(NSInteger)fps + completionHandler: + (nullable void (^)(NSError *_Nullable))completionHandler; +// Stops the capture session asynchronously and notifies callback on completion. +- (void)stopCaptureWithCompletionHandler: + (nullable void (^)(void))completionHandler; + +// Starts the capture session asynchronously. +- (void)startCaptureWithDevice:(AVCaptureDevice *)device + format:(AVCaptureDeviceFormat *)format + fps:(NSInteger)fps; +// Stops the capture session asynchronously. +- (void)stopCapture; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCertificate.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCertificate.h new file mode 100644 index 0000000..e300feb --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCertificate.h @@ -0,0 +1,47 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCCertificate) : NSObject + +/** Private key in PEM. */ +@property(nonatomic, readonly, copy) NSString *private_key; + +/** Public key in an x509 cert encoded in PEM. */ +@property(nonatomic, readonly, copy) NSString *certificate; + +/** + * Initialize an RTCCertificate with PEM strings for private_key and + * certificate. + */ +- (instancetype)initWithPrivateKey:(NSString *)private_key + certificate:(NSString *)certificate + NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; + +/** Generate a new certificate for 're' use. + * + * Optional dictionary of parameters. Defaults to KeyType ECDSA if none are + * provided. + * - name: "ECDSA" or "RSASSA-PKCS1-v1_5" + */ ++ (nullable RTC_OBJC_TYPE(RTCCertificate) *)generateCertificateWithParams: + (NSDictionary *)params; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCodecSpecificInfo.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCodecSpecificInfo.h new file mode 100644 index 0000000..39f7c18 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCodecSpecificInfo.h @@ -0,0 +1,24 @@ +/* + * Copyright 2017 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Implement this protocol to pass codec specific info from the encoder. + * Corresponds to webrtc::CodecSpecificInfo. + */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCCodecSpecificInfo) @end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCodecSpecificInfoH264.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCodecSpecificInfoH264.h new file mode 100644 index 0000000..b6f34a5 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCodecSpecificInfoH264.h @@ -0,0 +1,28 @@ +/* + * 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 + +#import +#import + +/** Class for H264 specific config. */ +typedef NS_ENUM(NSUInteger, RTCH264PacketizationMode) { + RTCH264PacketizationModeNonInterleaved = + 0, // Mode 1 - STAP-A, FU-A is allowed + RTCH264PacketizationModeSingleNalUnit // Mode 0 - only single NALU allowed +}; + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCCodecSpecificInfoH264) : NSObject + +@property(nonatomic, assign) RTCH264PacketizationMode packetizationMode; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCConfiguration.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCConfiguration.h new file mode 100644 index 0000000..21f12fc --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCConfiguration.h @@ -0,0 +1,268 @@ +/* + * 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 + +#import +#import +#import + +@class RTC_OBJC_TYPE(RTCIceServer); + +/** + * Represents the ice transport policy. This exposes the same states in C++, + * which include one more state than what exists in the W3C spec. + */ +typedef NS_ENUM(NSInteger, RTCIceTransportPolicy) { + RTCIceTransportPolicyNone, + RTCIceTransportPolicyRelay, + RTCIceTransportPolicyNoHost, + RTCIceTransportPolicyAll +}; + +/** Represents the bundle policy. */ +typedef NS_ENUM(NSInteger, RTCBundlePolicy) { + RTCBundlePolicyBalanced, + RTCBundlePolicyMaxCompat, + RTCBundlePolicyMaxBundle +}; + +/** Represents the rtcp mux policy. */ +typedef NS_ENUM(NSInteger, RTCRtcpMuxPolicy) { + RTCRtcpMuxPolicyNegotiate, + RTCRtcpMuxPolicyRequire +}; + +/** Represents the tcp candidate policy. */ +typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) { + RTCTcpCandidatePolicyEnabled, + RTCTcpCandidatePolicyDisabled +}; + +/** Represents the candidate network policy. */ +typedef NS_ENUM(NSInteger, RTCCandidateNetworkPolicy) { + RTCCandidateNetworkPolicyAll, + RTCCandidateNetworkPolicyLowCost +}; + +/** Represents the continual gathering policy. */ +typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) { + RTCContinualGatheringPolicyGatherOnce, + RTCContinualGatheringPolicyGatherContinually +}; + +/** Represents the encryption key type. */ +typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) { + RTCEncryptionKeyTypeRSA, + RTCEncryptionKeyTypeECDSA, +}; + +/** Represents the chosen SDP semantics for the RTCPeerConnection. */ +typedef NS_ENUM(NSInteger, RTCSdpSemantics) { + // TODO(https://crbug.com/webrtc/13528): Remove support for Plan B. + RTCSdpSemanticsPlanB, + RTCSdpSemanticsUnifiedPlan, +}; + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCConfiguration) : NSObject + +/** If true, allows DSCP codes to be set on outgoing packets, configured using + * networkPriority field of RTCRtpEncodingParameters. Defaults to false. + */ +@property(nonatomic, assign) BOOL enableDscp; + +/** An array of Ice Servers available to be used by ICE. */ +@property(nonatomic, copy) NSArray *iceServers; + +/** An RTCCertificate for 're' use. */ +@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`. */ +@property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy; + +/** The media-bundling policy to use when gathering ICE candidates. */ +@property(nonatomic, assign) RTCBundlePolicy bundlePolicy; + +/** The rtcp-mux policy to use when gathering ICE candidates. */ +@property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy; +@property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy; +@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy; +@property(nonatomic, assign) + RTCContinualGatheringPolicy continualGatheringPolicy; + +/** 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 + * IPv6 ICE candidates on Wi-Fi in those cases. + * Default is NO. + */ +@property(nonatomic, assign) BOOL disableIPV6OnWiFi; + +/** By default, the PeerConnection will use a limited number of IPv6 network + * interfaces, in order to avoid too many ICE candidate pairs being created + * and delaying ICE completion. + * + * Can be set to INT_MAX to effectively disable the limit. + */ +@property(nonatomic, assign) int maxIPv6Networks; + +/** Exclude link-local network interfaces + * from considertaion for gathering ICE candidates. + * Defaults to NO. + */ +@property(nonatomic, assign) BOOL disableLinkLocalNetworks; + +@property(nonatomic, assign) int audioJitterBufferMaxPackets; +@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate; +@property(nonatomic, assign) int iceConnectionReceivingTimeout; +@property(nonatomic, assign) int iceBackupCandidatePairPingInterval; + +/** Key type used to generate SSL identity. Default is ECDSA. */ +@property(nonatomic, assign) RTCEncryptionKeyType keyType; + +/** ICE candidate pool size as defined in JSEP. Default is 0. */ +@property(nonatomic, assign) int iceCandidatePoolSize; + +/** Prune turn ports on the same network to the same turn server. + * Default is NO. + */ +@property(nonatomic, assign) BOOL shouldPruneTurnPorts; + +/** If set to YES, this means the ICE transport should presume TURN-to-TURN + * candidate pairs will succeed, even before a binding response is received. + */ +@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed; + +/* This flag is only effective when `continualGatheringPolicy` is + * RTCContinualGatheringPolicyGatherContinually. + * + * If YES, after the ICE transport type is changed such that new types of + * ICE candidates are allowed by the new transport type, e.g. from + * RTCIceTransportPolicyRelay to RTCIceTransportPolicyAll, candidates that + * have been gathered by the ICE transport but not matching the previous + * transport type and as a result not observed by PeerConnectionDelegateAdapter, + * will be surfaced to the delegate. + */ +@property(nonatomic, assign) + BOOL shouldSurfaceIceCandidatesOnIceTransportTypeChanged; + +/** If set to non-nil, controls the minimal interval between consecutive ICE + * check packets. + */ +@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval; + +/** + * 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. + * + * 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. + * + * 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; + +/** Actively reset the SRTP parameters when the DTLS transports underneath are + * changed after offer/answer negotiation. This is only intended to be a + * workaround for crbug.com/835958 + */ +@property(nonatomic, assign) BOOL activeResetSrtpParams; + +/** + * Defines advanced optional cryptographic settings related to SRTP and + * frame encryption for native WebRTC. Setting this will overwrite any + * options set through the PeerConnectionFactory (which is deprecated). + */ +@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. + */ +@property(nonatomic, assign) int rtcpAudioReportIntervalMs; + +/** + * Time interval between video RTCP reports. + */ +@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 + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCryptoOptions.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCryptoOptions.h new file mode 100644 index 0000000..a4c85d7 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCCryptoOptions.h @@ -0,0 +1,66 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Objective-C bindings for webrtc::CryptoOptions. This API had to be flattened + * as Objective-C doesn't support nested structures. + */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCCryptoOptions) : NSObject + +/** + * Enable GCM crypto suites from RFC 7714 for SRTP. GCM will only be used + * if both sides enable it + */ +@property(nonatomic, assign) BOOL srtpEnableGcmCryptoSuites; +/** + * If set to true, the (potentially insecure) crypto cipher + * 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. + */ +@property(nonatomic, assign) BOOL srtpEnableAes128Sha1_32CryptoCipher; +/** + * If set to true, encrypted RTP header extensions as defined in RFC 6904 + * will be negotiated. They will only be used if both peers support them. + */ +@property(nonatomic, assign) BOOL srtpEnableEncryptedRtpHeaderExtensions; + +/** + * If set all RtpSenders must have an FrameEncryptor attached to them before + * they are allowed to send packets. All RtpReceivers must have a + * FrameDecryptor attached to them before they are able to receive packets. + */ +@property(nonatomic, assign) BOOL sframeRequireFrameEncryption; + +/** + * Initializes CryptoOptions with all possible options set explicitly. This + * is done when converting from a native RTCConfiguration.crypto_options. + */ +- (instancetype) + initWithSrtpEnableGcmCryptoSuites:(BOOL)srtpEnableGcmCryptoSuites + srtpEnableAes128Sha1_32CryptoCipher: + (BOOL)srtpEnableAes128Sha1_32CryptoCipher + srtpEnableEncryptedRtpHeaderExtensions: + (BOOL)srtpEnableEncryptedRtpHeaderExtensions + sframeRequireFrameEncryption:(BOOL)sframeRequireFrameEncryption + NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDataChannel.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDataChannel.h new file mode 100644 index 0000000..c5c2c9a --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDataChannel.h @@ -0,0 +1,134 @@ +/* + * 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 +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCDataBuffer) : NSObject + +/** NSData representation of the underlying buffer. */ +@property(nonatomic, readonly) NSData *data; + +/** Indicates whether `data` contains UTF-8 or binary data. */ +@property(nonatomic, readonly) BOOL isBinary; + +- (instancetype)init NS_UNAVAILABLE; + +/** + * Initialize an RTCDataBuffer from NSData. `isBinary` indicates whether `data` + * contains UTF-8 or binary data. + */ +- (instancetype)initWithData:(NSData *)data isBinary:(BOOL)isBinary; + +@end + +@class RTC_OBJC_TYPE(RTCDataChannel); +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCDataChannelDelegate) + + /** The data channel state changed. */ + - (void)dataChannelDidChangeState + : (RTC_OBJC_TYPE(RTCDataChannel) *)dataChannel; + +/** The data channel successfully received a data buffer. */ +- (void)dataChannel:(RTC_OBJC_TYPE(RTCDataChannel) *)dataChannel + didReceiveMessageWithBuffer:(RTC_OBJC_TYPE(RTCDataBuffer) *)buffer; + +@optional +/** The data channel's `bufferedAmount` changed. */ +- (void)dataChannel:(RTC_OBJC_TYPE(RTCDataChannel) *)dataChannel + didChangeBufferedAmount:(uint64_t)amount; + +@end + +/** Represents the state of the data channel. */ +typedef NS_ENUM(NSInteger, RTCDataChannelState) { + RTCDataChannelStateConnecting, + RTCDataChannelStateOpen, + RTCDataChannelStateClosing, + RTCDataChannelStateClosed, +}; + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCDataChannel) : NSObject + +/** + * A label that can be used to distinguish this data channel from other data + * channel objects. + */ +@property(nonatomic, readonly) NSString *label; + +/** Whether the data channel can send messages in unreliable mode. */ +@property(nonatomic, readonly) BOOL isReliable DEPRECATED_ATTRIBUTE; + +/** Returns whether this data channel is ordered or not. */ +@property(nonatomic, readonly) BOOL isOrdered; + +/** Deprecated. Use maxPacketLifeTime. */ +@property(nonatomic, readonly) + NSUInteger maxRetransmitTime DEPRECATED_ATTRIBUTE; + +/** + * The length of the time window (in milliseconds) during which transmissions + * and retransmissions may occur in unreliable mode. + */ +@property(nonatomic, readonly) uint16_t maxPacketLifeTime; + +/** + * The maximum number of retransmissions that are attempted in unreliable mode. + */ +@property(nonatomic, readonly) uint16_t maxRetransmits; + +/** + * The name of the sub-protocol used with this data channel, if any. Otherwise + * this returns an empty string. + */ +@property(nonatomic, readonly) NSString *protocol; + +/** + * Returns whether this data channel was negotiated by the application or not. + */ +@property(nonatomic, readonly) BOOL isNegotiated; + +/** Deprecated. Use channelId. */ +@property(nonatomic, readonly) NSInteger streamId DEPRECATED_ATTRIBUTE; + +/** The identifier for this data channel. */ +@property(nonatomic, readonly) int channelId; + +/** The state of the data channel. */ +@property(nonatomic, readonly) RTCDataChannelState readyState; + +/** + * The number of bytes of application data that have been queued using + * `sendData:` but that have not yet been transmitted to the network. + */ +@property(nonatomic, readonly) uint64_t bufferedAmount; + +/** The delegate for this data channel. */ +@property(nonatomic, weak) id delegate; + +- (instancetype)init NS_UNAVAILABLE; + +/** Closes the data channel. */ +- (void)close; + +/** Attempt to send `data` on this data channel's underlying data transport. */ +- (BOOL)sendData:(RTC_OBJC_TYPE(RTCDataBuffer) *)data; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDataChannelConfiguration.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDataChannelConfiguration.h new file mode 100644 index 0000000..b1d8d77 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDataChannelConfiguration.h @@ -0,0 +1,52 @@ +/* + * 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 +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCDataChannelConfiguration) : NSObject + +/** Set to YES if ordered delivery is required. */ +@property(nonatomic, assign) BOOL isOrdered; + +/** Deprecated. Use maxPacketLifeTime. */ +@property(nonatomic, assign) NSInteger maxRetransmitTimeMs DEPRECATED_ATTRIBUTE; + +/** + * Max period in milliseconds in which retransmissions will be sent. After this + * time, no more retransmissions will be sent. -1 if unset. + */ +@property(nonatomic, assign) int maxPacketLifeTime; + +/** The max number of retransmissions. -1 if unset. */ +@property(nonatomic, assign) int maxRetransmits; + +/** Set to YES if the channel has been externally negotiated and we do not send + * an in-band signalling in the form of an "open" message. + */ +@property(nonatomic, assign) BOOL isNegotiated; + +/** Deprecated. Use channelId. */ +@property(nonatomic, assign) int streamId DEPRECATED_ATTRIBUTE; + +/** The id of the data channel. */ +@property(nonatomic, assign) int channelId; + +/** Set by the application and opaque to the WebRTC implementation. */ +@property(nonatomic) NSString* protocol; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDefaultVideoDecoderFactory.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDefaultVideoDecoderFactory.h new file mode 100644 index 0000000..88b1d9c --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDefaultVideoDecoderFactory.h @@ -0,0 +1,26 @@ +/* + * 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 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** This decoder factory include support for all codecs bundled with WebRTC. If + * using custom codecs, create custom implementations of RTCVideoEncoderFactory + * and RTCVideoDecoderFactory. + */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCDefaultVideoDecoderFactory) : NSObject +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDefaultVideoEncoderFactory.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDefaultVideoEncoderFactory.h new file mode 100644 index 0000000..6defc80 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDefaultVideoEncoderFactory.h @@ -0,0 +1,31 @@ +/* + * 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 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** This encoder factory include support for all codecs bundled with WebRTC. If + * using custom codecs, create custom implementations of RTCVideoEncoderFactory + * and RTCVideoDecoderFactory. + */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCDefaultVideoEncoderFactory) : NSObject + +@property(nonatomic, retain) RTC_OBJC_TYPE(RTCVideoCodecInfo) *preferredCodec; + ++ (NSArray *)supportedCodecs; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDispatcher.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDispatcher.h new file mode 100644 index 0000000..bc44b47 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDispatcher.h @@ -0,0 +1,47 @@ +/* + * 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 + +#import + +typedef NS_ENUM(NSInteger, RTCDispatcherQueueType) { + // Main dispatcher queue. + RTCDispatcherTypeMain, + // Used for starting/stopping AVCaptureSession, and assigning + // capture session to AVCaptureVideoPreviewLayer. + RTCDispatcherTypeCaptureSession, + // Used for operations on AVAudioSession. + RTCDispatcherTypeAudioSession, + // Used for operations on NWPathMonitor. + RTCDispatcherTypeNetworkMonitor, +}; + +/** Dispatcher that asynchronously dispatches blocks to a specific + * shared dispatch queue. + */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCDispatcher) : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +/** Dispatch the block asynchronously on the queue for dispatchType. + * @param dispatchType The queue type to dispatch on. + * @param block The block to dispatch asynchronously. + */ ++ (void)dispatchAsyncOnType:(RTCDispatcherQueueType)dispatchType + block:(dispatch_block_t)block; + +/** Returns YES if run on queue for the dispatchType otherwise NO. + * Useful for asserting that a method is run on a correct queue. + */ ++ (BOOL)isOnQueueForType:(RTCDispatcherQueueType)dispatchType; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDtmfSender.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDtmfSender.h new file mode 100644 index 0000000..33d98c5 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCDtmfSender.h @@ -0,0 +1,73 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCDtmfSender) + + /** + * Returns true if this RTCDtmfSender is capable of sending DTMF. Otherwise + * returns false. To be able to send DTMF, the associated RTCRtpSender must + * be able to send packets, and a "telephone-event" codec must be + * negotiated. + */ + @property(nonatomic, readonly) BOOL canInsertDtmf; + +/** + * Queues a task that sends the DTMF tones. The tones parameter is treated + * as a series of characters. The characters 0 through 9, A through D, #, and * + * generate the associated DTMF tones. The characters a to d are equivalent + * to A to D. The character ',' indicates a delay of 2 seconds before + * processing the next character in the tones parameter. + * + * Unrecognized characters are ignored. + * + * @param duration The parameter indicates the duration to use for each + * character passed in the tones parameter. The duration cannot be more + * than 6000 or less than 70 ms. + * + * @param interToneGap The parameter indicates the gap between tones. + * This parameter must be at least 50 ms but should be as short as + * possible. + * + * If InsertDtmf is called on the same object while an existing task for this + * object to generate DTMF is still running, the previous task is canceled. + * Returns true on success and false on failure. + */ +- (BOOL)insertDtmf:(nonnull NSString *)tones + duration:(NSTimeInterval)duration + interToneGap:(NSTimeInterval)interToneGap; + +/** The tones remaining to be played out */ +- (nonnull NSString *)remainingTones; + +/** + * The current tone duration value. This value will be the value last set via + * the insertDtmf method, or the default value of 100 ms if insertDtmf was never + * called. + */ +- (NSTimeInterval)duration; + +/** + * The current value of the between-tone gap. This value will be the value last + * set via the insertDtmf() method, or the default value of 50 ms if + * insertDtmf() was never called. + */ +- (NSTimeInterval)interToneGap; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCEncodedImage.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCEncodedImage.h new file mode 100644 index 0000000..97f29ed --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCEncodedImage.h @@ -0,0 +1,52 @@ +/* + * 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 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Represents an encoded frame's type. */ +typedef NS_ENUM(NSUInteger, RTCFrameType) { + RTCFrameTypeEmptyFrame = 0, + RTCFrameTypeAudioFrameSpeech = 1, + RTCFrameTypeAudioFrameCN = 2, + RTCFrameTypeVideoFrameKey = 3, + RTCFrameTypeVideoFrameDelta = 4, +}; + +typedef NS_ENUM(NSUInteger, RTCVideoContentType) { + RTCVideoContentTypeUnspecified, + RTCVideoContentTypeScreenshare, +}; + +/** Represents an encoded frame. Corresponds to webrtc::EncodedImage. */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCEncodedImage) : NSObject + +@property(nonatomic, strong) NSData *buffer; +@property(nonatomic, assign) int32_t encodedWidth; +@property(nonatomic, assign) int32_t encodedHeight; +@property(nonatomic, assign) uint32_t timeStamp; +@property(nonatomic, assign) int64_t captureTimeMs; +@property(nonatomic, assign) int64_t ntpTimeMs; +@property(nonatomic, assign) uint8_t flags; +@property(nonatomic, assign) int64_t encodeStartMs; +@property(nonatomic, assign) int64_t encodeFinishMs; +@property(nonatomic, assign) RTCFrameType frameType; +@property(nonatomic, assign) RTCVideoRotation rotation; +@property(nonatomic, strong) NSNumber *qp; +@property(nonatomic, assign) RTCVideoContentType contentType; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFieldTrials.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFieldTrials.h new file mode 100644 index 0000000..fa27322 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFieldTrials.h @@ -0,0 +1,34 @@ +/* + * 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 + +#import + +/** The only valid value for the following if set is kRTCFieldTrialEnabledValue. + */ +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; + +/** Initialize field trials using a dictionary mapping field trial keys to their + * values. See above for valid keys and values. Must be called before any other + * call into WebRTC. See: webrtc/system_wrappers/include/field_trial.h + */ +// TODO: bugs.webrtc.org/42220378 - Delete after January 1, 2026. +RTC_OBJC_DEPRECATED("Pass field trials when building PeerConnectionFactory") +RTC_EXTERN void RTCInitFieldTrialDictionary( + NSDictionary *fieldTrials); diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFileLogger.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFileLogger.h new file mode 100644 index 0000000..551a895 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFileLogger.h @@ -0,0 +1,76 @@ +/* + * 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 + +#import + +typedef NS_ENUM(NSUInteger, RTCFileLoggerSeverity) { + RTCFileLoggerSeverityVerbose, + RTCFileLoggerSeverityInfo, + RTCFileLoggerSeverityWarning, + RTCFileLoggerSeverityError +}; + +typedef NS_ENUM(NSUInteger, RTCFileLoggerRotationType) { + RTCFileLoggerTypeCall, + RTCFileLoggerTypeApp, +}; + +NS_ASSUME_NONNULL_BEGIN + +// This class intercepts WebRTC logs and saves them to a file. The file size +// will not exceed the given maximum bytesize. When the maximum bytesize is +// reached, logs are rotated according to the rotationType specified. +// For kRTCFileLoggerTypeCall, logs from the beginning and the end +// are preserved while the middle section is overwritten instead. +// For kRTCFileLoggerTypeApp, the oldest log is overwritten. +// This class is not threadsafe. +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCFileLogger) : NSObject + +// The severity level to capture. The default is kRTCFileLoggerSeverityInfo. +@property(nonatomic, assign) RTCFileLoggerSeverity severity; + +// The rotation type for this file logger. The default is +// kRTCFileLoggerTypeCall. +@property(nonatomic, readonly) RTCFileLoggerRotationType rotationType; + +// Disables buffering disk writes. Should be set before `start`. Buffering +// is enabled by default for performance. +@property(nonatomic, assign) BOOL shouldDisableBuffering; + +// Default constructor provides default settings for dir path, file size and +// rotation type. +- (instancetype)init; + +// Create file logger with default rotation type. +- (instancetype)initWithDirPath:(NSString *)dirPath + maxFileSize:(NSUInteger)maxFileSize; + +- (instancetype)initWithDirPath:(NSString *)dirPath + maxFileSize:(NSUInteger)maxFileSize + rotationType:(RTCFileLoggerRotationType)rotationType + NS_DESIGNATED_INITIALIZER; + +// Starts writing WebRTC logs to disk if not already started. Overwrites any +// existing file(s). +- (void)start; + +// Stops writing WebRTC logs to disk. This method is also called on dealloc. +- (void)stop; + +// Returns the current contents of the logs, or nil if start has been called +// without a stop. +- (nullable NSData *)logData; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFileVideoCapturer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFileVideoCapturer.h new file mode 100644 index 0000000..38f65f8 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCFileVideoCapturer.h @@ -0,0 +1,51 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Error passing block. + */ +typedef void (^RTCFileVideoCapturerErrorBlock)(NSError *error); + +/** + * Captures buffers from bundled video file. + * + * See @c RTCVideoCapturer for more info on capturers. + */ +RTC_OBJC_EXPORT + +NS_CLASS_AVAILABLE_IOS(10) +@interface RTC_OBJC_TYPE (RTCFileVideoCapturer) : RTC_OBJC_TYPE(RTCVideoCapturer) + +/** + * Starts asynchronous capture of frames from video file. + * + * Capturing is not started if error occurs. Underlying error will be + * relayed in the errorBlock if one is provided. + * Successfully captured video frames will be passed to the delegate. + * + * @param nameOfFile The name of the bundled video file to be read. + * @errorBlock block to be executed upon error. + */ +- (void)startCapturingFromFileNamed:(NSString *)nameOfFile + onError:(__nullable RTCFileVideoCapturerErrorBlock)errorBlock; + +/** + * Immediately stops capture. + */ +- (void)stopCapture; +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCH264ProfileLevelId.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCH264ProfileLevelId.h new file mode 100644 index 0000000..67bcae1 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCH264ProfileLevelId.h @@ -0,0 +1,61 @@ +/* + * 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 + +#import + +RTC_EXTERN NSString *const kRTCVideoCodecH264Name; +RTC_EXTERN NSString *const kRTCLevel31ConstrainedHigh; +RTC_EXTERN NSString *const kRTCLevel31ConstrainedBaseline; +RTC_EXTERN NSString *const kRTCMaxSupportedH264ProfileLevelConstrainedHigh; +RTC_EXTERN NSString *const kRTCMaxSupportedH264ProfileLevelConstrainedBaseline; + +/** H264 Profiles and levels. */ +typedef NS_ENUM(NSUInteger, RTCH264Profile) { + RTCH264ProfileConstrainedBaseline, + RTCH264ProfileBaseline, + RTCH264ProfileMain, + RTCH264ProfileConstrainedHigh, + RTCH264ProfileHigh, +}; + +typedef NS_ENUM(NSUInteger, RTCH264Level) { + RTCH264Level1_b = 0, + RTCH264Level1 = 10, + RTCH264Level1_1 = 11, + RTCH264Level1_2 = 12, + RTCH264Level1_3 = 13, + RTCH264Level2 = 20, + RTCH264Level2_1 = 21, + RTCH264Level2_2 = 22, + RTCH264Level3 = 30, + RTCH264Level3_1 = 31, + RTCH264Level3_2 = 32, + RTCH264Level4 = 40, + RTCH264Level4_1 = 41, + RTCH264Level4_2 = 42, + RTCH264Level5 = 50, + RTCH264Level5_1 = 51, + RTCH264Level5_2 = 52 +}; + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCH264ProfileLevelId) : NSObject + +@property(nonatomic, readonly) RTCH264Profile profile; +@property(nonatomic, readonly) RTCH264Level level; +@property(nonatomic, readonly) NSString *hexString; + +- (instancetype)initWithHexString:(NSString *)hexString; +- (instancetype)initWithProfile:(RTCH264Profile)profile + level:(RTCH264Level)level; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCI420Buffer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCI420Buffer.h new file mode 100644 index 0000000..54c3240 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCI420Buffer.h @@ -0,0 +1,22 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Protocol for RTCYUVPlanarBuffers containing I420 data */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCI420Buffer) @end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceCandidate.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceCandidate.h new file mode 100644 index 0000000..23b4fec --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceCandidate.h @@ -0,0 +1,50 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCIceCandidate) : NSObject + +/** + * If present, the identifier of the "media stream identification" for the media + * component this candidate is associated with. + */ +@property(nonatomic, readonly, nullable) NSString *sdpMid; + +/** + * The index (starting at zero) of the media description this candidate is + * associated with in the SDP. + */ +@property(nonatomic, readonly) int sdpMLineIndex; + +/** The SDP string for this candidate. */ +@property(nonatomic, readonly) NSString *sdp; + +/** The URL of the ICE server which this candidate is gathered from. */ +@property(nonatomic, readonly, nullable) NSString *serverUrl; + +- (instancetype)init NS_UNAVAILABLE; + +/** + * Initialize an RTCIceCandidate from SDP. + */ +- (instancetype)initWithSdp:(NSString *)sdp + sdpMLineIndex:(int)sdpMLineIndex + sdpMid:(nullable NSString *)sdpMid + NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceCandidateErrorEvent.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceCandidateErrorEvent.h new file mode 100644 index 0000000..fb8e853 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceCandidateErrorEvent.h @@ -0,0 +1,45 @@ +/* + * 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 + +#import + +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 diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceServer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceServer.h new file mode 100644 index 0000000..6f6c7ea --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCIceServer.h @@ -0,0 +1,115 @@ +/* + * 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 + +#import + +typedef NS_ENUM(NSUInteger, RTCTlsCertPolicy) { + RTCTlsCertPolicySecure, + RTCTlsCertPolicyInsecureNoCheck +}; + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCIceServer) : NSObject + +/** URI(s) for this server represented as NSStrings. */ +@property(nonatomic, readonly) NSArray *urlStrings; + +/** Username to use if this RTCIceServer object is a TURN server. */ +@property(nonatomic, readonly, nullable) NSString *username; + +/** Credential to use if this RTCIceServer object is a TURN server. */ +@property(nonatomic, readonly, nullable) NSString *credential; + +/** + * TLS certificate policy to use if this RTCIceServer object is a TURN server. + */ +@property(nonatomic, readonly) RTCTlsCertPolicy tlsCertPolicy; + +/** + If the URIs in `urls` only contain IP addresses, this field can be used + to indicate the hostname, which may be necessary for TLS (using the SNI + extension). If `urls` itself contains the hostname, this isn't necessary. + */ +@property(nonatomic, readonly, nullable) NSString *hostname; + +/** List of protocols to be used in the TLS ALPN extension. */ +@property(nonatomic, readonly) NSArray *tlsAlpnProtocols; + +/** + List elliptic curves to be used in the TLS elliptic curves extension. + Only curve names supported by OpenSSL should be used (eg. "P-256","X25519"). + */ +@property(nonatomic, readonly) NSArray *tlsEllipticCurves; + +- (nonnull instancetype)init NS_UNAVAILABLE; + +/** Convenience initializer for a server with no authentication (e.g. STUN). */ +- (instancetype)initWithURLStrings:(NSArray *)urlStrings; + +/** + * Initialize an RTCIceServer with its associated URLs, optional username, + * optional credential, and credentialType. + */ +- (instancetype)initWithURLStrings:(NSArray *)urlStrings + username:(nullable NSString *)username + credential:(nullable NSString *)credential; + +/** + * Initialize an RTCIceServer with its associated URLs, optional username, + * optional credential, and TLS cert policy. + */ +- (instancetype)initWithURLStrings:(NSArray *)urlStrings + username:(nullable NSString *)username + credential:(nullable NSString *)credential + tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy; + +/** + * Initialize an RTCIceServer with its associated URLs, optional username, + * optional credential, TLS cert policy and hostname. + */ +- (instancetype)initWithURLStrings:(NSArray *)urlStrings + username:(nullable NSString *)username + credential:(nullable NSString *)credential + tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy + hostname:(nullable NSString *)hostname; + +/** + * Initialize an RTCIceServer with its associated URLs, optional username, + * optional credential, TLS cert policy, hostname and ALPN protocols. + */ +- (instancetype)initWithURLStrings:(NSArray *)urlStrings + username:(nullable NSString *)username + credential:(nullable NSString *)credential + tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy + hostname:(nullable NSString *)hostname + tlsAlpnProtocols:(NSArray *)tlsAlpnProtocols; + +/** + * Initialize an RTCIceServer with its associated URLs, optional username, + * optional credential, TLS cert policy, hostname, ALPN protocols and + * elliptic curves. + */ +- (instancetype) + initWithURLStrings:(NSArray *)urlStrings + username:(nullable NSString *)username + credential:(nullable NSString *)credential + tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy + hostname:(nullable NSString *)hostname + tlsAlpnProtocols:(nullable NSArray *)tlsAlpnProtocols + tlsEllipticCurves:(nullable NSArray *)tlsEllipticCurves + NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCLegacyStatsReport.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCLegacyStatsReport.h new file mode 100644 index 0000000..c9ce8e3 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCLegacyStatsReport.h @@ -0,0 +1,37 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** This does not currently conform to the spec. */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCLegacyStatsReport) : NSObject + +/** Time since 1970-01-01T00:00:00Z in milliseconds. */ +@property(nonatomic, readonly) CFTimeInterval timestamp; + +/** The type of stats held by this object. */ +@property(nonatomic, readonly) NSString *type; + +/** The identifier for this object. */ +@property(nonatomic, readonly) NSString *reportId; + +/** A dictionary holding the actual stats. */ +@property(nonatomic, readonly) NSDictionary *values; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCLogging.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCLogging.h new file mode 100644 index 0000000..4cc2901 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCLogging.h @@ -0,0 +1,70 @@ +/* + * 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 + +#import + +// Subset of webrtc::LoggingSeverity. +typedef NS_ENUM(NSInteger, RTCLoggingSeverity) { + RTCLoggingSeverityVerbose, + RTCLoggingSeverityInfo, + RTCLoggingSeverityWarning, + RTCLoggingSeverityError, + RTCLoggingSeverityNone, +}; + +// Wrapper for C++ RTC_LOG(sev) macros. +// Logs the log string to the webrtc logstream for the given severity. +RTC_EXTERN void RTCLogEx(RTCLoggingSeverity severity, NSString* log_string); + +// Wrapper for webrtc::LogMessage::LogToDebug. +// Sets the minimum severity to be logged to console. +RTC_EXTERN void RTCSetMinDebugLogLevel(RTCLoggingSeverity severity); + +// Returns the filename with the path prefix removed. +RTC_EXTERN NSString* RTCFileName(const char* filePath); + +// Some convenience macros. + +#define RTCLogString(format, ...) \ + [NSString stringWithFormat:@"(%@:%d %s): " format, \ + RTCFileName(__FILE__), \ + __LINE__, \ + __FUNCTION__, \ + ##__VA_ARGS__] + +#define RTCLogFormat(severity, format, ...) \ + do { \ + NSString* log_string = RTCLogString(format, ##__VA_ARGS__); \ + RTCLogEx(severity, log_string); \ + } while (false) + +#define RTCLogVerbose(format, ...) \ + RTCLogFormat(RTCLoggingSeverityVerbose, format, ##__VA_ARGS__) + +#define RTCLogInfo(format, ...) \ + RTCLogFormat(RTCLoggingSeverityInfo, format, ##__VA_ARGS__) + +#define RTCLogWarning(format, ...) \ + RTCLogFormat(RTCLoggingSeverityWarning, format, ##__VA_ARGS__) + +#define RTCLogError(format, ...) \ + RTCLogFormat(RTCLoggingSeverityError, format, ##__VA_ARGS__) + +#if !defined(NDEBUG) +#define RTCLogDebug(format, ...) RTCLogInfo(format, ##__VA_ARGS__) +#else +#define RTCLogDebug(format, ...) \ + do { \ + } while (false) +#endif + +#define RTCLog(format, ...) RTCLogInfo(format, ##__VA_ARGS__) diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMTLNSVideoView.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMTLNSVideoView.h new file mode 100644 index 0000000..114bb4a --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMTLNSVideoView.h @@ -0,0 +1,22 @@ +/* + * 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 + +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCMTLNSVideoView) : NSView + +@property(nonatomic, weak) id delegate; + ++ (BOOL)isMetalAvailable; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMacros.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMacros.h new file mode 100644 index 0000000..cb943b4 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMacros.h @@ -0,0 +1,67 @@ +/* + * 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. + */ + +#ifndef SDK_OBJC_BASE_RTCMACROS_H_ +#define SDK_OBJC_BASE_RTCMACROS_H_ + +#ifdef WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT + +#if defined(WEBRTC_LIBRARY_IMPL) +#define RTC_OBJC_EXPORT __attribute__((visibility("default"))) +#endif + +#endif // WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT + +#ifndef RTC_OBJC_EXPORT +#define RTC_OBJC_EXPORT +#endif + +// Macro used to mark a function as deprecated. +#define RTC_OBJC_DEPRECATED(msg) __attribute__((deprecated(msg))) + +// Internal macros used to correctly concatenate symbols. +#define RTC_SYMBOL_CONCAT_HELPER(a, b) a##b +#define RTC_SYMBOL_CONCAT(a, b) RTC_SYMBOL_CONCAT_HELPER(a, b) + +// RTC_OBJC_TYPE_PREFIX +// +// Macro used to prepend a prefix to the API types that are exported with +// RTC_OBJC_EXPORT. +// +// Clients can patch the definition of this macro locally and build +// WebRTC.framework with their own prefix in case symbol clashing is a +// problem. +// +// This macro must be defined uniformily across all the translation units. +#ifndef RTC_OBJC_TYPE_PREFIX +#define RTC_OBJC_TYPE_PREFIX +#endif + +// RCT_OBJC_TYPE +// +// Macro used internally to declare API types. Declaring an API type without +// using this macro will not include the declared type in the set of types +// that will be affected by the configurable RTC_OBJC_TYPE_PREFIX. +#define RTC_OBJC_TYPE(type_name) \ + RTC_SYMBOL_CONCAT(RTC_OBJC_TYPE_PREFIX, type_name) + +#if defined(__cplusplus) +#define RTC_EXTERN extern "C" RTC_OBJC_EXPORT +#else +#define RTC_EXTERN extern RTC_OBJC_EXPORT +#endif + +#ifdef __OBJC__ +#define RTC_FWD_DECL_OBJC_CLASS(classname) @class classname +#else +#define RTC_FWD_DECL_OBJC_CLASS(classname) typedef struct objc_object classname +#endif + +#endif // SDK_OBJC_BASE_RTCMACROS_H_ diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaConstraints.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaConstraints.h new file mode 100644 index 0000000..8d002b9 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaConstraints.h @@ -0,0 +1,47 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Constraint keys for media sources. */ +/** The value for this key should be a base64 encoded string containing + * the data from the serialized configuration proto. + */ +RTC_EXTERN NSString *const kRTCMediaConstraintsAudioNetworkAdaptorConfig; + +/** Constraint keys for generating offers and answers. */ +RTC_EXTERN NSString *const kRTCMediaConstraintsIceRestart; +RTC_EXTERN NSString *const kRTCMediaConstraintsOfferToReceiveAudio; +RTC_EXTERN NSString *const kRTCMediaConstraintsOfferToReceiveVideo; +RTC_EXTERN NSString *const kRTCMediaConstraintsVoiceActivityDetection; + +/** Constraint values for Boolean parameters. */ +RTC_EXTERN NSString *const kRTCMediaConstraintsValueTrue; +RTC_EXTERN NSString *const kRTCMediaConstraintsValueFalse; + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCMediaConstraints) : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +/** Initialize with mandatory and/or optional constraints. */ +- (instancetype)initWithMandatoryConstraints: + (nullable NSDictionary *)mandatory + optionalConstraints: + (nullable NSDictionary *) + optional NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaSource.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaSource.h new file mode 100644 index 0000000..51ceb60 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaSource.h @@ -0,0 +1,34 @@ +/* + * 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 + +#import + +typedef NS_ENUM(NSInteger, RTCSourceState) { + RTCSourceStateInitializing, + RTCSourceStateLive, + RTCSourceStateEnded, + RTCSourceStateMuted, +}; + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCMediaSource) : NSObject + +/** The current state of the RTCMediaSource. */ +@property(nonatomic, readonly) RTCSourceState state; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaStream.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaStream.h new file mode 100644 index 0000000..ce3eec5 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaStream.h @@ -0,0 +1,50 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RTC_OBJC_TYPE(RTCAudioTrack); +@class RTC_OBJC_TYPE(RTCPeerConnectionFactory); +@class RTC_OBJC_TYPE(RTCVideoTrack); + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCMediaStream) : NSObject + +/** The audio tracks in this stream. */ +@property(nonatomic, strong, readonly) NSArray *audioTracks; + +/** The video tracks in this stream. */ +@property(nonatomic, strong, readonly) + NSArray *videoTracks; + +/** An identifier for this media stream. */ +@property(nonatomic, readonly) NSString *streamId; + +- (instancetype)init NS_UNAVAILABLE; + +/** Adds the given audio track to this media stream. */ +- (void)addAudioTrack:(RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrack; + +/** Adds the given video track to this media stream. */ +- (void)addVideoTrack:(RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrack; + +/** Removes the given audio track to this media stream. */ +- (void)removeAudioTrack:(RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrack; + +/** Removes the given video track to this media stream. */ +- (void)removeVideoTrack:(RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrack; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaStreamTrack.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaStreamTrack.h new file mode 100644 index 0000000..5265879 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMediaStreamTrack.h @@ -0,0 +1,50 @@ +/* + * 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 + +#import + +/** + * Represents the state of the track. This exposes the same states in C++. + */ +typedef NS_ENUM(NSInteger, RTCMediaStreamTrackState) { + RTCMediaStreamTrackStateLive, + RTCMediaStreamTrackStateEnded +}; + +NS_ASSUME_NONNULL_BEGIN + +RTC_EXTERN NSString *const kRTCMediaStreamTrackKindAudio; +RTC_EXTERN NSString *const kRTCMediaStreamTrackKindVideo; + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCMediaStreamTrack) : NSObject + +/** + * The kind of track. For example, "audio" if this track represents an audio + * track and "video" if this track represents a video track. + */ +@property(nonatomic, readonly) NSString *kind; + +/** An identifier string. */ +@property(nonatomic, readonly) NSString *trackId; + +/** The enabled state of the track. */ +@property(nonatomic, assign) BOOL isEnabled; + +/** The state of the track. */ +@property(nonatomic, readonly) RTCMediaStreamTrackState readyState; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMetrics.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMetrics.h new file mode 100644 index 0000000..fffb451 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMetrics.h @@ -0,0 +1,24 @@ +/* + * 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 + +#import +#import + +/** + * Enables gathering of metrics (which can be fetched with + * RTCGetAndResetMetrics). Must be called before any other call into WebRTC. + */ +RTC_EXTERN void RTCEnableMetrics(void); + +/** Gets and clears native histograms. */ +RTC_EXTERN NSArray* + RTCGetAndResetMetrics(void); diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMetricsSampleInfo.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMetricsSampleInfo.h new file mode 100644 index 0000000..18afdc0 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMetricsSampleInfo.h @@ -0,0 +1,48 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCMetricsSampleInfo) : NSObject + +/** + * Example of RTCMetricsSampleInfo: + * name: "WebRTC.Video.InputFramesPerSecond" + * min: 1 + * max: 100 + * bucketCount: 50 + * samples: [29]:2 [30]:1 + */ + +/** The name of the histogram. */ +@property(nonatomic, readonly) NSString *name; + +/** The minimum bucket value. */ +@property(nonatomic, readonly) int min; + +/** The maximum bucket value. */ +@property(nonatomic, readonly) int max; + +/** The number of buckets. */ +@property(nonatomic, readonly) int bucketCount; + +/** A dictionary holding the samples . */ +@property(nonatomic, readonly) NSDictionary *samples; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMutableI420Buffer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMutableI420Buffer.h new file mode 100644 index 0000000..7685234 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMutableI420Buffer.h @@ -0,0 +1,24 @@ +/* + * 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 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Extension of the I420 buffer with mutable data access */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCMutableI420Buffer) @end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMutableYUVPlanarBuffer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMutableYUVPlanarBuffer.h new file mode 100644 index 0000000..feb7417 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCMutableYUVPlanarBuffer.h @@ -0,0 +1,28 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Extension of the YUV planar data buffer with mutable data access */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCMutableYUVPlanarBuffer) + + @property(nonatomic, readonly) uint8_t *mutableDataY; +@property(nonatomic, readonly) uint8_t *mutableDataU; +@property(nonatomic, readonly) uint8_t *mutableDataV; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCNativeI420Buffer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCNativeI420Buffer.h new file mode 100644 index 0000000..c5a0ddf --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCNativeI420Buffer.h @@ -0,0 +1,23 @@ +/* + * 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 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** RTCI420Buffer implements the RTCI420Buffer protocol */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCI420Buffer) : NSObject +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCNativeMutableI420Buffer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCNativeMutableI420Buffer.h new file mode 100644 index 0000000..b300731 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCNativeMutableI420Buffer.h @@ -0,0 +1,24 @@ +/* + * 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 + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Mutable version of RTCI420Buffer */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCMutableI420Buffer) : RTC_OBJC_TYPE(RTCI420Buffer) +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnection.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnection.h new file mode 100644 index 0000000..7ddb5ba --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnection.h @@ -0,0 +1,422 @@ +/* + * 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 + +#import + +@class RTC_OBJC_TYPE(RTCConfiguration); +@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); +@class RTC_OBJC_TYPE(RTCPeerConnectionFactory); +@class RTC_OBJC_TYPE(RTCRtpReceiver); +@class RTC_OBJC_TYPE(RTCRtpSender); +@class RTC_OBJC_TYPE(RTCRtpTransceiver); +@class RTC_OBJC_TYPE(RTCRtpTransceiverInit); +@class RTC_OBJC_TYPE(RTCSessionDescription); +@class RTC_OBJC_TYPE(RTCStatisticsReport); +@class RTC_OBJC_TYPE(RTCLegacyStatsReport); + +typedef NS_ENUM(NSInteger, RTCRtpMediaType); + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const kRTCPeerConnectionErrorDomain; +extern int const kRTCSessionDescriptionErrorCode; + +/** Represents the signaling state of the peer connection. */ +typedef NS_ENUM(NSInteger, RTCSignalingState) { + RTCSignalingStateStable, + RTCSignalingStateHaveLocalOffer, + RTCSignalingStateHaveLocalPrAnswer, + RTCSignalingStateHaveRemoteOffer, + RTCSignalingStateHaveRemotePrAnswer, + // Not an actual state, represents the total number of states. + RTCSignalingStateClosed, +}; + +/** Represents the ice connection state of the peer connection. */ +typedef NS_ENUM(NSInteger, RTCIceConnectionState) { + RTCIceConnectionStateNew, + RTCIceConnectionStateChecking, + RTCIceConnectionStateConnected, + RTCIceConnectionStateCompleted, + RTCIceConnectionStateFailed, + RTCIceConnectionStateDisconnected, + RTCIceConnectionStateClosed, + RTCIceConnectionStateCount, +}; + +/** Represents the combined ice+dtls connection state of the peer connection. */ +typedef NS_ENUM(NSInteger, RTCPeerConnectionState) { + RTCPeerConnectionStateNew, + RTCPeerConnectionStateConnecting, + RTCPeerConnectionStateConnected, + RTCPeerConnectionStateDisconnected, + RTCPeerConnectionStateFailed, + RTCPeerConnectionStateClosed, +}; + +/** Represents the ice gathering state of the peer connection. */ +typedef NS_ENUM(NSInteger, RTCIceGatheringState) { + RTCIceGatheringStateNew, + RTCIceGatheringStateGathering, + RTCIceGatheringStateComplete, +}; + +/** Represents the stats output level. */ +typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) { + RTCStatsOutputLevelStandard, + 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 +@protocol RTC_OBJC_TYPE +(RTCPeerConnectionDelegate) + + /** Called when the SignalingState changed. */ + - (void)peerConnection + : (RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection didChangeSignalingState + : (RTCSignalingState)stateChanged; + +/** Called when media is received on a new stream from remote peer. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didAddStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream; + +/** Called when a remote peer closes a stream. + * This is not called when RTCSdpSemanticsUnifiedPlan is specified. + */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didRemoveStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream; + +/** Called when negotiation is needed, for example ICE has restarted. */ +- (void)peerConnectionShouldNegotiate: + (RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection; + +/** Called any time the IceConnectionState changes. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didChangeIceConnectionState:(RTCIceConnectionState)newState; + +/** Called any time the IceGatheringState changes. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didChangeIceGatheringState:(RTCIceGatheringState)newState; + +/** New ice candidate has been found. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didGenerateIceCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate; + +/** Called when a group of local Ice candidates have been removed. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didRemoveIceCandidates: + (NSArray *)candidates; + +/** New data channel has been opened. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didOpenDataChannel:(RTC_OBJC_TYPE(RTCDataChannel) *)dataChannel; + +/** Called when signaling indicates a transceiver will be receiving media from + * the remote endpoint. + * This is only called with RTCSdpSemanticsUnifiedPlan specified. + */ +@optional +/** Called any time the IceConnectionState changes following standardized + * transition. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didChangeStandardizedIceConnectionState:(RTCIceConnectionState)newState; + +/** Called any time the PeerConnectionState changes. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didChangeConnectionState:(RTCPeerConnectionState)newState; + +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didStartReceivingOnTransceiver: + (RTC_OBJC_TYPE(RTCRtpTransceiver) *)transceiver; + +/** Called when a receiver and its track are created. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didAddReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)rtpReceiver + streams:(NSArray *)mediaStreams; + +/** Called when the receiver and its track are removed. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didRemoveReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)rtpReceiver; + +/** Called when the selected ICE candidate pair is changed. */ +- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection + didChangeLocalCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)local + remoteCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)remote + 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 +@interface RTC_OBJC_TYPE (RTCPeerConnection) : NSObject + +/** The object that will be notifed about events such as state changes and + * streams being added or removed. + */ +@property(nonatomic, weak, nullable) id delegate; +/** This property is not available with RTCSdpSemanticsUnifiedPlan. Please use + * `senders` instead. + */ +@property(nonatomic, readonly) + NSArray *localStreams; +@property(nonatomic, readonly, nullable) RTC_OBJC_TYPE(RTCSessionDescription) * + localDescription; +@property(nonatomic, readonly, nullable) RTC_OBJC_TYPE(RTCSessionDescription) * + remoteDescription; +@property(nonatomic, readonly) RTCSignalingState signalingState; +@property(nonatomic, readonly) RTCIceConnectionState iceConnectionState; +@property(nonatomic, readonly) RTCPeerConnectionState connectionState; +@property(nonatomic, readonly) RTCIceGatheringState iceGatheringState; +@property(nonatomic, readonly, copy) RTC_OBJC_TYPE(RTCConfiguration) * + configuration; + +/** Gets all RTCRtpSenders associated with this peer connection. + * Note: reading this property returns different instances of RTCRtpSender. + * Use isEqual: instead of == to compare RTCRtpSender instances. + */ +@property(nonatomic, readonly) NSArray *senders; + +/** Gets all RTCRtpReceivers associated with this peer connection. + * Note: reading this property returns different instances of RTCRtpReceiver. + * Use isEqual: instead of == to compare RTCRtpReceiver instances. + */ +@property(nonatomic, readonly) + NSArray *receivers; + +/** Gets all RTCRtpTransceivers associated with this peer connection. + * Note: reading this property returns different instances of + * RTCRtpTransceiver. Use isEqual: instead of == to compare + * RTCRtpTransceiver instances. This is only available with + * RTCSdpSemanticsUnifiedPlan specified. + */ +@property(nonatomic, readonly) + NSArray *transceivers; + +- (instancetype)init NS_UNAVAILABLE; + +/** 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 + * cannot be changed with this method. + */ +- (BOOL)setConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration; + +/** Terminate all media and close the transport. */ +- (void)close; + +/** Provide a remote candidate to the ICE Agent. */ +- (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 *)candidates; + +/** Add a new media stream to be sent on this peer connection. + * This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use + * addTrack instead. + */ +- (void)addStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream; + +/** Remove the given media stream from this peer connection. + * This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use + * removeTrack instead. + */ +- (void)removeStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream; + +/** 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. + * + * Errors: If an error occurs, returns nil. An error can occur if: + * - A sender already exists for the track. + * - The peer connection is closed. + */ +- (nullable RTC_OBJC_TYPE(RTCRtpSender) *) + addTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track + streamIds:(NSArray *)streamIds; + +/** With PlanB semantics, removes an RTCRtpSender from this peer connection. + * + * With UnifiedPlan semantics, sets sender's track to null and removes the + * send component from the associated RTCRtpTransceiver's direction. + * + * Returns YES on success. + */ +- (BOOL)removeTrack:(RTC_OBJC_TYPE(RTCRtpSender) *)sender; + +/** addTransceiver creates a new RTCRtpTransceiver and adds it to the set of + * 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 + * new session description may change it to a non-nil value. + * + * https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver + * + * Optionally, an RtpTransceiverInit structure can be specified to configure + * the transceiver from construction. If not specified, the transceiver will + * default to having a direction of kSendRecv and not be part of any streams. + * + * These methods are only available when Unified Plan is enabled (see + * RTCConfiguration). + */ + +/** Adds a transceiver with a sender set to transmit the given track. The kind + * of the transceiver (and sender/receiver) will be derived from the kind of + * the track. + */ +- (nullable RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverWithTrack: + (RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track; +- (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. + */ +- (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: + (RTCCreateSessionDescriptionCompletionHandler)completionHandler; + +/** Generate an SDP answer. */ +- (void)answerForConstraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints + completionHandler: + (RTCCreateSessionDescriptionCompletionHandler)completionHandler; + +/** Apply the supplied RTCSessionDescription as the local description. */ +- (void)setLocalDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)sdp + 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: + (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 + * value. Returns YES if the parameters were successfully updated. + */ +- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps + currentBitrateBps:(nullable NSNumber *)currentBitrateBps + maxBitrateBps:(nullable NSNumber *)maxBitrateBps; + +/** Start or stop recording an Rtc EventLog. */ +- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath + maxSizeInBytes:(int64_t)maxSizeInBytes; +- (void)stopRtcEventLog; + +@end + +@interface RTC_OBJC_TYPE (RTCPeerConnection) +(Media) + + /** Create an RTCRtpSender with the specified kind and media stream ID. + * See RTCMediaStreamTrack.h for available kinds. + * This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use + * addTransceiver instead. + */ + - (RTC_OBJC_TYPE(RTCRtpSender) *)senderWithKind : (NSString *)kind streamId + : (NSString *)streamId; + +@end + +@interface RTC_OBJC_TYPE (RTCPeerConnection) +(DataChannel) + + /** Create a new data channel with the given label and configuration. */ + - (nullable RTC_OBJC_TYPE(RTCDataChannel) *)dataChannelForLabel + : (NSString *)label configuration + : (RTC_OBJC_TYPE(RTCDataChannelConfiguration) *)configuration; + +@end + +typedef void (^RTCStatisticsCompletionHandler)( + RTC_OBJC_TYPE(RTCStatisticsReport) *); + +@interface RTC_OBJC_TYPE (RTCPeerConnection) +(Stats) + + /** Gather stats for the given RTCMediaStreamTrack. If `mediaStreamTrack` is + * nil statistics are gathered for all tracks. + */ + - (void)statsForTrack : (nullable RTC_OBJC_TYPE(RTCMediaStreamTrack) *) + mediaStreamTrack statsOutputLevel + : (RTCStatsOutputLevel)statsOutputLevel completionHandler + : (nullable void (^)(NSArray *stats)) + completionHandler; + +/** Gather statistic through the v2 statistics API. */ +- (void)statisticsWithCompletionHandler: + (RTCStatisticsCompletionHandler)completionHandler; + +/** Spec-compliant getStats() performing the stats selection algorithm with the + * sender. + */ +- (void)statisticsForSender:(RTC_OBJC_TYPE(RTCRtpSender) *)sender + completionHandler:(RTCStatisticsCompletionHandler)completionHandler; + +/** Spec-compliant getStats() performing the stats selection algorithm with the + * receiver. + */ +- (void)statisticsForReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)receiver + completionHandler:(RTCStatisticsCompletionHandler)completionHandler; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnectionFactory.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnectionFactory.h new file mode 100644 index 0000000..7396bea --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnectionFactory.h @@ -0,0 +1,147 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RTC_OBJC_TYPE(RTCRtpCapabilities); +@class RTC_OBJC_TYPE(RTCAudioSource); +@class RTC_OBJC_TYPE(RTCAudioTrack); +@class RTC_OBJC_TYPE(RTCConfiguration); +@class RTC_OBJC_TYPE(RTCMediaConstraints); +@class RTC_OBJC_TYPE(RTCMediaStream); +@class RTC_OBJC_TYPE(RTCPeerConnection); +@class RTC_OBJC_TYPE(RTCVideoSource); +@class RTC_OBJC_TYPE(RTCVideoTrack); +@class RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions); +@protocol RTC_OBJC_TYPE +(RTCPeerConnectionDelegate); +@protocol RTC_OBJC_TYPE +(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 and default ADM */ +- (instancetype)init; + +/* Initialize object with injectable video encoder/decoder factories and default + * ADM */ +- (instancetype) + initWithEncoderFactory: + (nullable id)encoderFactory + decoderFactory:(nullable id) + decoderFactory; + +/* Initialize object with injectable video encoder/decoder factories and + * injectable ADM */ +- (instancetype) + initWithEncoderFactory: + (nullable id)encoderFactory + decoderFactory:(nullable id) + decoderFactory + audioDevice: + (nullable id)audioDevice; + +/** + * Valid kind values are kRTCMediaStreamTrackKindAudio and + * kRTCMediaStreamTrackKindVideo. + */ +- (RTC_OBJC_TYPE(RTCRtpCapabilities) *)rtpSenderCapabilitiesForKind: + (NSString *)kind; + +/** + * Valid kind values are kRTCMediaStreamTrackKindAudio and + * kRTCMediaStreamTrackKindVideo. + */ +- (RTC_OBJC_TYPE(RTCRtpCapabilities) *)rtpReceiverCapabilitiesForKind: + (NSString *)kind; + +/** Initialize an RTCAudioSource with constraints. */ +- (RTC_OBJC_TYPE(RTCAudioSource) *)audioSourceWithConstraints: + (nullable RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints; + +/** Initialize an RTCAudioTrack with an id. Convenience ctor to use an audio + * source with no constraints. + */ +- (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithTrackId:(NSString *)trackId; + +/** Initialize an RTCAudioTrack with a source and an id. */ +- (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithSource: + (RTC_OBJC_TYPE(RTCAudioSource) *)source + trackId:(NSString *)trackId; + +/** Initialize a generic RTCVideoSource. The RTCVideoSource should be + * passed to a RTCVideoCapturer implementation, e.g. + * RTCCameraVideoCapturer, in order to produce frames. + */ +- (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; + +/** Initialize an RTCMediaStream with an id. */ +- (RTC_OBJC_TYPE(RTCMediaStream) *)mediaStreamWithStreamId:(NSString *)streamId; + +/** Initialize an RTCPeerConnection with a configuration, constraints, and + * delegate. + */ +- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *) + peerConnectionWithConfiguration: + (RTC_OBJC_TYPE(RTCConfiguration) *)configuration + constraints: + (RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints + delegate:(nullable id)delegate; + +- (nullable RTC_OBJC_TYPE(RTCPeerConnection) *) + peerConnectionWithConfiguration: + (RTC_OBJC_TYPE(RTCConfiguration) *)configuration + constraints: + (RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints + certificateVerifier: + (id) + certificateVerifier + delegate:(nullable id)delegate; + +/** Set the options to be used for subsequently created RTCPeerConnections */ +- (void)setOptions: + (nonnull RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions) *)options; + +/** Start an AecDump recording. This API call will likely change in the future. + */ +- (BOOL)startAecDumpWithFilePath:(NSString *)filePath + maxSizeInBytes:(int64_t)maxSizeInBytes; + +/* Stop an active AecDump recording */ +- (void)stopAecDump; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnectionFactoryOptions.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnectionFactoryOptions.h new file mode 100644 index 0000000..1c7a10d --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCPeerConnectionFactoryOptions.h @@ -0,0 +1,38 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCPeerConnectionFactoryOptions) : NSObject + +@property(nonatomic, assign) BOOL disableEncryption; + +@property(nonatomic, assign) BOOL disableNetworkMonitor; + +@property(nonatomic, assign) BOOL ignoreLoopbackNetworkAdapter; + +@property(nonatomic, assign) BOOL ignoreVPNNetworkAdapter; + +@property(nonatomic, assign) BOOL ignoreCellularNetworkAdapter; + +@property(nonatomic, assign) BOOL ignoreWiFiNetworkAdapter; + +@property(nonatomic, assign) BOOL ignoreEthernetNetworkAdapter; + +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtcpParameters.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtcpParameters.h new file mode 100644 index 0000000..8449500 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtcpParameters.h @@ -0,0 +1,30 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtcpParameters) : NSObject + +/** The Canonical Name used by RTCP. */ +@property(nonatomic, readonly, copy) NSString *cname; + +/** Whether reduced size RTCP is configured or compound RTCP. */ +@property(nonatomic, assign) BOOL isReducedSize; + +- (instancetype)init; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCapabilities.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCapabilities.h new file mode 100644 index 0000000..c44d0b8 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCapabilities.h @@ -0,0 +1,31 @@ +/* + * Copyright 2024 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RTC_OBJC_TYPE(RTCRtpCodecCapability); +@class RTC_OBJC_TYPE(RTCRtpHeaderExtensionCapability); + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpCapabilities) : NSObject + +@property(nonatomic, copy) NSArray *codecs; +@property(nonatomic, copy) + NSArray *headerExtensions; + +- (instancetype)init; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCodecCapability.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCodecCapability.h new file mode 100644 index 0000000..ee953e1 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCodecCapability.h @@ -0,0 +1,58 @@ +/* + * Copyright 2024 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpCodecCapability) : NSObject + +/** The preferred RTP payload type. */ +@property(nonatomic, readonly, nullable) NSNumber *preferredPayloadType; + +/** + * The codec MIME subtype. Valid types are listed in: + * http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2 + * + * Several supported types are represented by the constants above. + */ +@property(nonatomic, readonly) NSString *name; + +/** + * The media type of this codec. Equivalent to MIME top-level type. + * + * Valid values are kRTCMediaStreamTrackKindAudio and + * kRTCMediaStreamTrackKindVideo. + */ +@property(nonatomic, readonly) NSString *kind; + +/** The codec clock rate expressed in Hertz. */ +@property(nonatomic, readonly, nullable) NSNumber *clockRate; + +/** + * The number of audio channels (mono=1, stereo=2). + * Set to null for video codecs. + **/ +@property(nonatomic, readonly, nullable) NSNumber *numChannels; + +/** The "format specific parameters" field from the "a=fmtp" line in the SDP */ +@property(nonatomic, readonly) NSDictionary *parameters; + +/** The MIME type of the codec. */ +@property(nonatomic, readonly) NSString *mimeType; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCodecParameters.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCodecParameters.h new file mode 100644 index 0000000..9f96220 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpCodecParameters.h @@ -0,0 +1,72 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_EXTERN const NSString *const kRTCRtxCodecName; +RTC_EXTERN const NSString *const kRTCRedCodecName; +RTC_EXTERN const NSString *const kRTCUlpfecCodecName; +RTC_EXTERN const NSString *const kRTCFlexfecCodecName; +RTC_EXTERN const NSString *const kRTCOpusCodecName; +RTC_EXTERN const NSString *const kRTCIsacCodecName; +RTC_EXTERN const NSString *const kRTCL16CodecName; +RTC_EXTERN const NSString *const kRTCG722CodecName; +RTC_EXTERN const NSString *const kRTCPcmuCodecName; +RTC_EXTERN const NSString *const kRTCPcmaCodecName; +RTC_EXTERN const NSString *const kRTCDtmfCodecName; +RTC_EXTERN const NSString *const kRTCComfortNoiseCodecName; +RTC_EXTERN const NSString *const kRTCVp8CodecName; +RTC_EXTERN const NSString *const kRTCVp9CodecName; +RTC_EXTERN const NSString *const kRTCH264CodecName; + +/** Defined in https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcodecparameters */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpCodecParameters) : NSObject + +/** The RTP payload type. */ +@property(nonatomic, assign) int payloadType; + +/** + * The codec MIME subtype. Valid types are listed in: + * http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2 + * + * Several supported types are represented by the constants above. + */ +@property(nonatomic, readonly, nonnull) NSString *name; + +/** + * The media type of this codec. Equivalent to MIME top-level type. + * + * Valid values are kRTCMediaStreamTrackKindAudio and + * kRTCMediaStreamTrackKindVideo. + */ +@property(nonatomic, readonly, nonnull) NSString *kind; + +/** The codec clock rate expressed in Hertz. */ +@property(nonatomic, readonly, nullable) NSNumber *clockRate; + +/** + * The number of channels (mono=1, stereo=2). + * Set to null for video codecs. + **/ +@property(nonatomic, readonly, nullable) NSNumber *numChannels; + +/** The "format specific parameters" field from the "a=fmtp" line in the SDP */ +@property(nonatomic, readonly, nonnull) NSDictionary *parameters; + +- (instancetype)init; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpEncodingParameters.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpEncodingParameters.h new file mode 100644 index 0000000..a4ad10a --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpEncodingParameters.h @@ -0,0 +1,77 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Corresponds to webrtc::Priority. */ +typedef NS_ENUM(NSInteger, RTCPriority) { + RTCPriorityVeryLow, + RTCPriorityLow, + RTCPriorityMedium, + RTCPriorityHigh +}; + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpEncodingParameters) : NSObject + +/** The idenfifier for the encoding layer. This is used in simulcast. */ +@property(nonatomic, copy, nullable) NSString *rid; + +/** Controls whether the encoding is currently transmitted. */ +@property(nonatomic, assign) BOOL isActive; + +/** The maximum bitrate to use for the encoding, or nil if there is no + * limit. + */ +@property(nonatomic, copy, nullable) NSNumber *maxBitrateBps; + +/** The minimum bitrate to use for the encoding, or nil if there is no + * limit. + */ +@property(nonatomic, copy, nullable) NSNumber *minBitrateBps; + +/** The maximum framerate to use for the encoding, or nil if there is no + * limit. + */ +@property(nonatomic, copy, nullable) NSNumber *maxFramerate; + +/** The requested number of temporal layers to use for the encoding, or nil + * if the default should be used. + */ +@property(nonatomic, copy, nullable) NSNumber *numTemporalLayers; + +/** Scale the width and height down by this factor for video. If nil, + * implementation default scaling factor will be used. + */ +@property(nonatomic, copy, nullable) NSNumber *scaleResolutionDownBy; + +/** The SSRC being used by this encoding. */ +@property(nonatomic, readonly, nullable) NSNumber *ssrc; + +/** The relative bitrate priority. */ +@property(nonatomic, assign) double bitratePriority; + +/** The relative DiffServ Code Point priority. */ +@property(nonatomic, assign) RTCPriority networkPriority; + +/** Allow dynamic frame length changes for audio: + https://w3c.github.io/webrtc-extensions/#dom-rtcrtpencodingparameters-adaptiveptime + */ +@property(nonatomic, assign) BOOL adaptiveAudioPacketTime; + +- (instancetype)init; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpHeaderExtension.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpHeaderExtension.h new file mode 100644 index 0000000..d3f1fda --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpHeaderExtension.h @@ -0,0 +1,33 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpHeaderExtension) : NSObject + +/** The URI of the RTP header extension, as defined in RFC5285. */ +@property(nonatomic, readonly, copy) NSString *uri; + +/** The value put in the RTP packet to identify the header extension. */ +@property(nonatomic, readonly) int id; + +/** Whether the header extension is encrypted or not. */ +@property(nonatomic, readonly, getter=isEncrypted) BOOL encrypted; + +- (instancetype)init; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpHeaderExtensionCapability.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpHeaderExtensionCapability.h new file mode 100644 index 0000000..2fbcce3 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpHeaderExtensionCapability.h @@ -0,0 +1,39 @@ +/* + * Copyright 2024 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 + +#import + +typedef NS_ENUM(NSInteger, RTCRtpTransceiverDirection); + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpHeaderExtensionCapability) : NSObject + +/** The URI of the RTP header extension, as defined in RFC5285. */ +@property(nonatomic, readonly, copy) NSString *uri; + +/** The value put in the RTP packet to identify the header extension. */ +@property(nonatomic, readonly, nullable) NSNumber* preferredId; + +/** Whether the header extension is encrypted or not. */ +@property(nonatomic, readonly, getter=isPreferredEncrypted) + BOOL preferredEncrypted; + +/** Direction of the header extension. */ +@property(nonatomic) RTCRtpTransceiverDirection direction; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpParameters.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpParameters.h new file mode 100644 index 0000000..0e97364 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpParameters.h @@ -0,0 +1,65 @@ +/* + * 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 + +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Corresponds to webrtc::DegradationPreference. */ +typedef NS_ENUM(NSInteger, RTCDegradationPreference) { + RTCDegradationPreferenceMaintainFramerateAndResolution, + // TODO(webrtc:450044904): Switch downstream projects to + // RTCDegradationPreferenceMaintainFramerateAndResolution and remove + // RTCDegradationPreferenceDisabled. + RTCDegradationPreferenceDisabled = + RTCDegradationPreferenceMaintainFramerateAndResolution, + RTCDegradationPreferenceMaintainFramerate, + RTCDegradationPreferenceMaintainResolution, + RTCDegradationPreferenceBalanced +}; + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpParameters) : NSObject + +/** A unique identifier for the last set of parameters applied. */ +@property(nonatomic, copy) NSString *transactionId; + +/** Parameters used for RTCP. */ +@property(nonatomic, readonly, copy) RTC_OBJC_TYPE(RTCRtcpParameters) * rtcp; + +/** An array containing parameters for RTP header extensions. */ +@property(nonatomic, readonly, copy) + NSArray *headerExtensions; + +/** The currently active encodings in the order of preference. */ +@property(nonatomic, copy) + NSArray *encodings; + +/** The negotiated set of send codecs in order of preference. */ +@property(nonatomic, copy) + NSArray *codecs; + +/** + * Degradation preference in case of CPU adaptation or constrained bandwidth. + * If nil, implementation default degradation preference will be used. + */ +@property(nonatomic, copy, nullable) NSNumber *degradationPreference; + +- (instancetype)init; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpReceiver.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpReceiver.h new file mode 100644 index 0000000..ad5a6c1 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpReceiver.h @@ -0,0 +1,105 @@ +/* + * 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 + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Represents the media type of the RtpReceiver. */ +typedef NS_ENUM(NSInteger, RTCRtpMediaType) { + RTCRtpMediaTypeAudio, + RTCRtpMediaTypeVideo, + RTCRtpMediaTypeData, + RTCRtpMediaTypeUnsupported, + RTCRtpMediaTypeAny, +}; + +@class RTC_OBJC_TYPE(RTCRtpReceiver); +@class RTC_OBJC_TYPE(RTCRtpSource); + +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCRtpReceiverDelegate) + + /** Called when the first RTP packet is received. + * + * Note: Currently if there are multiple RtpReceivers of the same media + * type, they will all call OnFirstPacketReceived at once. + * + * For example, if we create three audio receivers, A/B/C, they will listen + * to the same signal from the underneath network layer. Whenever the first + * audio packet is received, the underneath signal will be fired. All the + * receivers A/B/C will be notified and the callback of the receiver's + * delegate will be called. + * + * The process is the same for video receivers. + */ + - (void)rtpReceiver : (RTC_OBJC_TYPE(RTCRtpReceiver) *) + rtpReceiver didReceiveFirstPacketForMediaType + : (RTCRtpMediaType)mediaType; +/** Called when the first RTP packet is received after a change in + * receptiveness. + */ +// TODO: crbug.com/40821064 - remove @optional. +@optional +- (void)rtpReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)rtpReceiver + didReceiveFirstPacketForMediaTypeAfterReceptiveChange: + (RTCRtpMediaType)mediaType; + +@end + +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCRtpReceiver) + + /** A unique identifier for this receiver. */ + @property(nonatomic, readonly) NSString *receiverId; + +/** The currently active RTCRtpParameters, as defined in + * https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters. + * + * The WebRTC specification only defines RTCRtpParameters in terms of senders, + * but this API also applies them to receivers, similar to ORTC: + * http://ortc.org/wp-content/uploads/2016/03/ortc.html#rtcrtpparameters*. + */ +@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCRtpParameters) * parameters; + +/** The RTCMediaStreamTrack associated with the receiver. + * Note: reading this property returns a new instance of + * RTCMediaStreamTrack. Use isEqual: instead of == to compare + * RTCMediaStreamTrack instances. + */ +@property(nonatomic, readonly, nullable) RTC_OBJC_TYPE(RTCMediaStreamTrack) * + track; + +/** +Returns an array that contains an object for each unique SSRC (synchronization +source) identifier and for each unique CSRC (contributing source) received by +the current RTCRtpReceiver in the last ten seconds. +*/ +@property(nonatomic, readonly) NSArray *sources; + +/** The delegate for this RtpReceiver. */ +@property(nonatomic, weak) id delegate; + +@end + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpReceiver) : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpSender.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpSender.h new file mode 100644 index 0000000..841a65e --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpSender.h @@ -0,0 +1,55 @@ +/* + * 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 + +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCRtpSender) + + /** A unique identifier for this sender. */ + @property(nonatomic, readonly) NSString *senderId; + +/** The currently active RTCRtpParameters, as defined in + * https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters. + */ +@property(nonatomic, copy) RTC_OBJC_TYPE(RTCRtpParameters) * parameters; + +/** The RTCMediaStreamTrack associated with the sender. + * Note: reading this property returns a new instance of + * RTCMediaStreamTrack. Use isEqual: instead of == to compare + * RTCMediaStreamTrack instances. + */ +@property(nonatomic, copy, nullable) RTC_OBJC_TYPE(RTCMediaStreamTrack) * track; + +/** IDs of streams associated with the RTP sender */ +@property(nonatomic, copy) NSArray *streamIds; + +/** The RTCDtmfSender accociated with the RTP sender. */ +@property(nonatomic, readonly, nullable) id + dtmfSender; + +@end + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpSender) : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpSource.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpSource.h new file mode 100644 index 0000000..a36a0bc --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpSource.h @@ -0,0 +1,66 @@ +/* + * Copyright 2024 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Represents the source type of received media. */ +typedef NS_ENUM(NSInteger, RTCRtpSourceType) { + RTCRtpSourceTypeSSRC, + RTCRtpSourceTypeCSRC, +}; + +@class RTC_OBJC_TYPE(RTCRtpSource); + +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCRtpSource) + + /** + A positive integer value specifying the CSRC identifier of the contributing + source or SSRC identifier of the synchronization source. This uniquely + identifies the source of the particular stream RTP packets. */ + @property(nonatomic, readonly) uint32_t sourceId; + +@property(nonatomic, readonly) RTCRtpSourceType sourceType; + +/** +A floating-point value between 0.0 and 1.0 specifying the audio level contained +in the last RTP packet played from the contributing source. +*/ +@property(nonatomic, readonly, nullable) NSNumber *audioLevel; + +/** +A timestamp indicating the most recent time at which a frame originating from +this source was delivered to the receiver's track +*/ +@property(nonatomic, readonly) CFTimeInterval timestampUs; + +/** +The RTP timestamp of the media. This source-generated timestamp indicates the +time at which the media in this packet, scheduled for play out at the time +indicated by timestamp, was initially sampled or generated. It may be useful for +sequencing and synchronization purposes. +*/ +@property(nonatomic, readonly) uint32_t rtpTimestamp; + +@end + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpSource) : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpTransceiver.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpTransceiver.h new file mode 100644 index 0000000..2c5084b --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCRtpTransceiver.h @@ -0,0 +1,177 @@ +/* + * 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 + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const kRTCRtpTransceiverErrorDomain; + +/** https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverdirection */ +typedef NS_ENUM(NSInteger, RTCRtpTransceiverDirection) { + RTCRtpTransceiverDirectionSendRecv, + RTCRtpTransceiverDirectionSendOnly, + RTCRtpTransceiverDirectionRecvOnly, + RTCRtpTransceiverDirectionInactive, + RTCRtpTransceiverDirectionStopped +}; + +/** Structure for initializing an RTCRtpTransceiver in a call to + * RTCPeerConnection.addTransceiver. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverinit + */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpTransceiverInit) : NSObject + +/** Direction of the RTCRtpTransceiver. See RTCRtpTransceiver.direction. */ +@property(nonatomic) RTCRtpTransceiverDirection direction; + +/** The added RTCRtpTransceiver will be added to these streams. */ +@property(nonatomic) NSArray *streamIds; + +/** TODO(bugs.webrtc.org/7600): Not implemented. */ +@property(nonatomic) + NSArray *sendEncodings; + +@end + +@class RTC_OBJC_TYPE(RTCRtpTransceiver); +@class RTC_OBJC_TYPE(RTCRtpCodecCapability); +@class RTC_OBJC_TYPE(RTCRtpHeaderExtensionCapability); + +/** The RTCRtpTransceiver maps to the RTCRtpTransceiver defined by the + * WebRTC specification. A transceiver represents a combination of an + * RTCRtpSender and an RTCRtpReceiver that share a common mid. As defined in + * JSEP, an RTCRtpTransceiver is said to be associated with a media description + * if its mid property is non-nil; otherwise, it is said to be disassociated. + * JSEP: https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24 + * + * Note that RTCRtpTransceivers are only supported when using + * RTCPeerConnection with Unified Plan SDP. + * + * WebRTC specification for RTCRtpTransceiver, the JavaScript analog: + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver + */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCRtpTransceiver) + + /** Media type of the transceiver. The sender and receiver will also have + * this type. + */ + @property(nonatomic, readonly) RTCRtpMediaType mediaType; + +/** The mid attribute is the mid negotiated and present in the local and + * remote descriptions. Before negotiation is complete, the mid value may be + * nil. After rollbacks, the value may change from a non-nil value to nil. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-mid + */ +@property(nonatomic, readonly) NSString *mid; + +/** The sender attribute exposes the RTCRtpSender corresponding to the RTP + * media that may be sent with the transceiver's mid. The sender is always + * present, regardless of the direction of media. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-sender + */ +@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCRtpSender) * sender; + +/** The receiver attribute exposes the RTCRtpReceiver corresponding to the RTP + * media that may be received with the transceiver's mid. The receiver is + * always present, regardless of the direction of media. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-receiver + */ +@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCRtpReceiver) * receiver; + +/** The isStopped attribute indicates that the sender of this transceiver will + * no longer send, and that the receiver will no longer receive. It is true if + * either stop has been called or if setting the local or remote description + * has caused the RTCRtpTransceiver to be stopped. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stopped + */ +@property(nonatomic, readonly) BOOL isStopped; + +/** The direction attribute indicates the preferred direction of this + * transceiver, which will be used in calls to createOffer and createAnswer. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-direction + */ +@property(nonatomic, readonly) RTCRtpTransceiverDirection direction; + +/** It will contain all the RTP header extensions that are supported. + * The direction attribute for all extensions that are mandatory to use MUST be + * initialized to an appropriate value other than + * RTCRtpTransceiverDirectionStopped. The direction attribute for extensions + * that will not be offered by default in an initial offer MUST be initialized + * to RTCRtpTransceiverDirectionStopped. + */ +@property(nonatomic, readonly, copy) + NSArray + *headerExtensionsToNegotiate; +@property(nonatomic, readonly, copy) + NSArray + *negotiatedHeaderExtensions; + +/** The currentDirection attribute indicates the current direction negotiated + * for this transceiver. If this transceiver has never been represented in an + * offer/answer exchange, or if the transceiver is stopped, the value is not + * present and this method returns NO. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-currentdirection + */ +- (BOOL)currentDirection:(RTCRtpTransceiverDirection *)currentDirectionOut; + +/** The stop method irreversibly stops the RTCRtpTransceiver. The sender of + * this transceiver will no longer send, the receiver will no longer receive. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop + */ +- (void)stopInternal; + +/** The setCodecPreferences method overrides the default codec preferences used + * by WebRTC for this transceiver. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-setcodecpreferences + */ +- (BOOL)setCodecPreferences: + (NSArray *_Nullable)codecs + error:(NSError **_Nullable)error; + +/** Deprecated version of [RTCRtpTransceiver setCodecPreferences:error:] */ +- (void)setCodecPreferences: + (NSArray *_Nullable)codecs + RTC_OBJC_DEPRECATED("Use setCodecPreferences:error: instead."); + +/** The setHeaderExtensionsToNegotiate method overrides the default header + * extensions used by WebRTC for this transceiver. + * https://w3c.github.io/webrtc-extensions/#ref-for-dom-rtcrtptransceiver-setheaderextensionstonegotiate + */ +- (BOOL)setHeaderExtensionsToNegotiate: + (NSArray *) + extensions + error:(NSError **)error; + +/** An update of directionality does not take effect immediately. Instead, + * future calls to createOffer and createAnswer mark the corresponding media + * descriptions as sendrecv, sendonly, recvonly, or inactive. + * https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-direction + */ +- (void)setDirection:(RTCRtpTransceiverDirection)direction + error:(NSError **)error; + +@end + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCRtpTransceiver) : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSSLAdapter.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSSLAdapter.h new file mode 100644 index 0000000..a0da827 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSSLAdapter.h @@ -0,0 +1,20 @@ +/* + * 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 + +#import + +/** + * Initialize and clean up the SSL library. Failure is fatal. These call the + * corresponding functions in webrtc/rtc_base/ssladapter.h. + */ +RTC_EXTERN BOOL RTCInitializeSSL(void); +RTC_EXTERN BOOL RTCCleanupSSL(void); diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSSLCertificateVerifier.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSSLCertificateVerifier.h new file mode 100644 index 0000000..d5acafa --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSSLCertificateVerifier.h @@ -0,0 +1,25 @@ +/* + * Copyright 2022 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT @protocol RTC_OBJC_TYPE +(RTCSSLCertificateVerifier) + + /** The certificate to verify */ + - (BOOL)verify : (NSData *)derCertificate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSessionDescription.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSessionDescription.h new file mode 100644 index 0000000..e513c16 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCSessionDescription.h @@ -0,0 +1,49 @@ +/* + * 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 + +#import + +/** + * Represents the session description type. This exposes the same types that are + * in C++, which doesn't include the rollback type that is in the W3C spec. + */ +typedef NS_ENUM(NSInteger, RTCSdpType) { + RTCSdpTypeOffer, + RTCSdpTypePrAnswer, + RTCSdpTypeAnswer, + RTCSdpTypeRollback, +}; + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCSessionDescription) : NSObject + +/** The type of session description. */ +@property(nonatomic, readonly) RTCSdpType type; + +/** The SDP string representation of this session description. */ +@property(nonatomic, readonly) NSString *sdp; + +- (instancetype)init NS_UNAVAILABLE; + +/** Initialize a session description with a type and SDP string. */ +- (instancetype)initWithType:(RTCSdpType)type + sdp:(NSString *)sdp NS_DESIGNATED_INITIALIZER; + ++ (NSString *)stringForType:(RTCSdpType)type; + ++ (RTCSdpType)typeForString:(NSString *)string; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCStatisticsReport.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCStatisticsReport.h new file mode 100644 index 0000000..785d949 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCStatisticsReport.h @@ -0,0 +1,58 @@ +/* + * Copyright 2019 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 + +#import + +@class RTC_OBJC_TYPE(RTCStatistics); + +NS_ASSUME_NONNULL_BEGIN + +/** A statistics report. Encapsulates a number of RTCStatistics objects. */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCStatisticsReport) : NSObject + +/** The timestamp of the report in microseconds since 1970-01-01T00:00:00Z. */ +@property(nonatomic, readonly) CFTimeInterval timestamp_us; + +/** RTCStatistics objects by id. */ +@property(nonatomic, readonly) + NSDictionary *statistics; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +/** A part of a report (a subreport) covering a certain area. */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCStatistics) : NSObject + +/** The id of this subreport, e.g. "RTCMediaStreamTrack_receiver_2". */ +@property(nonatomic, readonly) NSString *id; + +/** The timestamp of the subreport in microseconds since 1970-01-01T00:00:00Z. + */ +@property(nonatomic, readonly) CFTimeInterval timestamp_us; + +/** The type of the subreport, e.g. "track", "codec". */ +@property(nonatomic, readonly) NSString *type; + +/** The keys and values of the subreport, e.g. "totalFramesDuration = 5.551". + The values are either NSNumbers or NSStrings or NSArrays encapsulating + NSNumbers or NSStrings, or NSDictionary of NSString keys to NSNumber values. + */ +@property(nonatomic, readonly) NSDictionary *values; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCTracing.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCTracing.h new file mode 100644 index 0000000..899a570 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCTracing.h @@ -0,0 +1,21 @@ +/* + * 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 + +#import + +RTC_EXTERN void RTCSetupInternalTracer(void); +/** Starts capture to specified file. Must be a valid writable path. + * Returns YES if capture starts. + */ +RTC_EXTERN BOOL RTCStartInternalCapture(NSString* filePath); +RTC_EXTERN void RTCStopInternalCapture(void); +RTC_EXTERN void RTCShutdownInternalTracer(void); diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoCapturer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoCapturer.h new file mode 100644 index 0000000..78b1bef --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoCapturer.h @@ -0,0 +1,37 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RTC_OBJC_TYPE(RTCVideoCapturer); + +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoCapturerDelegate) - + (void)capturer + : (RTC_OBJC_TYPE(RTCVideoCapturer) *)capturer didCaptureVideoFrame + : (RTC_OBJC_TYPE(RTCVideoFrame) *)frame; +@end + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoCapturer) : NSObject + +@property(nonatomic, weak) id delegate; + +- (instancetype)initWithDelegate: + (id)delegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoCodecInfo.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoCodecInfo.h new file mode 100644 index 0000000..0a2c285 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoCodecInfo.h @@ -0,0 +1,43 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Holds information to identify a codec. Corresponds to + * webrtc::SdpVideoFormat. */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoCodecInfo) : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +- (instancetype)initWithName:(NSString *)name; + +- (instancetype)initWithName:(NSString *)name + parameters:(nullable NSDictionary *) + parameters; + +- (instancetype)initWithName:(NSString *)name + parameters:(NSDictionary *)parameters + scalabilityModes:(NSArray *)scalabilityModes + NS_DESIGNATED_INITIALIZER; + +- (BOOL)isEqualToCodecInfo:(RTC_OBJC_TYPE(RTCVideoCodecInfo) *)info; + +@property(nonatomic, readonly) NSString *name; +@property(nonatomic, readonly) NSDictionary *parameters; +@property(nonatomic, readonly) NSArray *scalabilityModes; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoder.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoder.h new file mode 100644 index 0000000..e7bd636 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoder.h @@ -0,0 +1,41 @@ +/* + * 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 + +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Callback block for decoder. */ +typedef void (^RTCVideoDecoderCallback)(RTC_OBJC_TYPE(RTCVideoFrame) * frame); + +/** Protocol for decoder implementations. */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoDecoder) + + - (void)setCallback : (RTCVideoDecoderCallback)callback; +- (NSInteger)startDecodeWithNumberOfCores:(int)numberOfCores; +- (NSInteger)releaseDecoder; +// TODO(bugs.webrtc.org/15444): Remove obsolete missingFrames param. +- (NSInteger)decode:(RTC_OBJC_TYPE(RTCEncodedImage) *)encodedImage + missingFrames:(BOOL)missingFrames + codecSpecificInfo:(nullable id)info + renderTimeMs:(int64_t)renderTimeMs; +- (NSString *)implementationName; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderAV1.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderAV1.h new file mode 100644 index 0000000..c6cb38c --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderAV1.h @@ -0,0 +1,25 @@ +/* + * Copyright 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoDecoderAV1) : NSObject + +/* This returns a AV1 decoder that can be returned from a RTCVideoDecoderFactory injected into + * RTCPeerConnectionFactory. Even though it implements the RTCVideoDecoder protocol, it can not be + * used independently from the RTCPeerConnectionFactory. + */ ++ (id)av1Decoder; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderFactory.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderFactory.h new file mode 100644 index 0000000..5eb598a --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderFactory.h @@ -0,0 +1,33 @@ +/* + * 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 + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** RTCVideoDecoderFactory is an Objective-C version of + * webrtc::VideoDecoderFactory. + */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoDecoderFactory) + + - (nullable id)createDecoder + : (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)info; +- (NSArray *) + supportedCodecs; // TODO(andersc): "supportedFormats" instead? + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderFactoryH264.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderFactoryH264.h new file mode 100644 index 0000000..d5ce05e --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderFactoryH264.h @@ -0,0 +1,18 @@ +/* + * 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoDecoderFactoryH264) : NSObject +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderH264.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderH264.h new file mode 100644 index 0000000..f1c8468 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderH264.h @@ -0,0 +1,18 @@ +/* + * 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoDecoderH264) : NSObject +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderVP8.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderVP8.h new file mode 100644 index 0000000..9e3af0d --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderVP8.h @@ -0,0 +1,25 @@ +/* + * 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoDecoderVP8) : NSObject + +/* This returns a VP8 decoder that can be returned from a RTCVideoDecoderFactory injected into + * RTCPeerConnectionFactory. Even though it implements the RTCVideoDecoder protocol, it can not be + * used independently from the RTCPeerConnectionFactory. + */ ++ (id)vp8Decoder; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderVP9.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderVP9.h new file mode 100644 index 0000000..6c76eba --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoDecoderVP9.h @@ -0,0 +1,27 @@ +/* + * 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoDecoderVP9) : NSObject + +/* This returns a VP9 decoder that can be returned from a RTCVideoDecoderFactory injected into + * RTCPeerConnectionFactory. Even though it implements the RTCVideoDecoder protocol, it can not be + * used independently from the RTCPeerConnectionFactory. + */ ++ (id)vp9Decoder; + ++ (bool)isSupported; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoder.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoder.h new file mode 100644 index 0000000..1b0a16d --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoder.h @@ -0,0 +1,62 @@ +/* + * 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 + +#import +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Callback block for encoder. */ +typedef BOOL (^RTCVideoEncoderCallback)( + RTC_OBJC_TYPE(RTCEncodedImage) * frame, + id info); + +/** Protocol for encoder implementations. */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoEncoder) + + - (void)setCallback : (nullable RTCVideoEncoderCallback)callback; +- (NSInteger)startEncodeWithSettings: + (RTC_OBJC_TYPE(RTCVideoEncoderSettings) *)settings + numberOfCores:(int)numberOfCores; +- (NSInteger)releaseEncoder; +- (NSInteger)encode:(RTC_OBJC_TYPE(RTCVideoFrame) *)frame + codecSpecificInfo:(nullable id)info + frameTypes:(NSArray *)frameTypes; +- (int)setBitrate:(uint32_t)bitrateKbit framerate:(uint32_t)framerate; +- (NSString *)implementationName; + +/** Returns QP scaling settings for encoder. The quality scaler adjusts the + * resolution in order to keep the QP from the encoded images within the given + * range. Returning nil from this function disables quality scaling. */ +- (nullable RTC_OBJC_TYPE(RTCVideoEncoderQpThresholds) *)scalingSettings; + +/** Resolutions should be aligned to this value. */ +@property(nonatomic, readonly) NSInteger resolutionAlignment; + +/** If enabled, resolution alignment is applied to all simulcast layers + simultaneously so that when scaled, all resolutions comply with + 'resolutionAlignment'. */ +@property(nonatomic, readonly) BOOL applyAlignmentToAllSimulcastLayers; + +/** If YES, the receiver is expected to resample/scale the source texture to the + expected output size. */ +@property(nonatomic, readonly) BOOL supportsNativeHandle; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderAV1.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderAV1.h new file mode 100644 index 0000000..4c97563 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderAV1.h @@ -0,0 +1,32 @@ +/* + * Copyright 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoEncoderAV1) : NSObject + +/* This returns a AV1 encoder that can be returned from a RTCVideoEncoderFactory injected into + * RTCPeerConnectionFactory. Even though it implements the RTCVideoEncoder protocol, it can not be + * used independently from the RTCPeerConnectionFactory. + */ ++ (nonnull id)av1Encoder; + +/* Returns list of scalability modes supported by the encoder that can be + * created with `av1Encoder` method above. + */ ++ (nonnull NSArray*)supportedScalabilityModes; + ++ (bool)isSupported; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderFactory.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderFactory.h new file mode 100644 index 0000000..8574545 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderFactory.h @@ -0,0 +1,78 @@ +/* + * 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 + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** RTCVideoEncoderFactory is an Objective-C version of + webrtc::VideoEncoderFactory::VideoEncoderSelector. + */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoEncoderSelector) + + - (void)registerCurrentEncoderInfo + : (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)info; +- (nullable RTC_OBJC_TYPE(RTCVideoCodecInfo) *)encoderForBitrate: + (NSInteger)bitrate; +- (nullable RTC_OBJC_TYPE(RTCVideoCodecInfo) *)encoderForBrokenEncoder; + +@optional +- (nullable RTC_OBJC_TYPE(RTCVideoCodecInfo) *)encoderForResolutionChangeBySize: + (CGSize)size; + +@end + +/** RTCVideoEncoderCodecSupport is an Objective-C version of + * webrtc::VideoEncoderFactory::CodecSupport. */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoEncoderCodecSupport) : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +- (instancetype)initWithSupported:(bool)isSupported; +- (instancetype)initWithSupported:(bool)isSupported + isPowerEfficient:(bool)isPowerEfficient + NS_DESIGNATED_INITIALIZER; + +@property(nonatomic, readonly) bool isSupported; +@property(nonatomic, readonly) bool isPowerEfficient; + +@end + +/** RTCVideoEncoderFactory is an Objective-C version of + * webrtc::VideoEncoderFactory. + */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoEncoderFactory) + + - (nullable id)createEncoder + : (RTC_OBJC_TYPE(RTCVideoCodecInfo) *)info; +- (NSArray *) + supportedCodecs; // TODO(andersc): "supportedFormats" instead? + +@optional +- (NSArray *)implementations; +- (nullable id)encoderSelector; +/* TODO: b/299588022 - move to non-optional section when implemented by all + * derived classes. */ +- (RTC_OBJC_TYPE(RTCVideoEncoderCodecSupport) *) + queryCodecSupport:(RTC_OBJC_TYPE(RTCVideoCodecInfo) *)info + scalabilityMode:(nullable NSString *)scalabilityMode; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderFactoryH264.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderFactoryH264.h new file mode 100644 index 0000000..ac9bac8 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderFactoryH264.h @@ -0,0 +1,18 @@ +/* + * 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoEncoderFactoryH264) : NSObject +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderH264.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderH264.h new file mode 100644 index 0000000..37ff4e4 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderH264.h @@ -0,0 +1,22 @@ +/* + * 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 + +#import +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoEncoderH264) : NSObject + +- (instancetype)initWithCodecInfo:(RTC_OBJC_TYPE(RTCVideoCodecInfo) *)codecInfo; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderQpThresholds.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderQpThresholds.h new file mode 100644 index 0000000..818c272 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderQpThresholds.h @@ -0,0 +1,29 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** QP thresholds for encoder. Corresponds to + * webrtc::VideoEncoder::QpThresholds. */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoEncoderQpThresholds) : NSObject + +- (instancetype)initWithThresholdsLow:(NSInteger)low high:(NSInteger)high; + +@property(nonatomic, readonly) NSInteger low; +@property(nonatomic, readonly) NSInteger high; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderSettings.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderSettings.h new file mode 100644 index 0000000..efbdb5e --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderSettings.h @@ -0,0 +1,42 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, RTCVideoCodecMode) { + RTCVideoCodecModeRealtimeVideo, + RTCVideoCodecModeScreensharing, +}; + +/** Settings for encoder. Corresponds to webrtc::VideoCodec. */ +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoEncoderSettings) : NSObject + +@property(nonatomic, strong) NSString *name; + +@property(nonatomic, assign) unsigned short width; +@property(nonatomic, assign) unsigned short height; + +@property(nonatomic, assign) unsigned int startBitrate; // kilobits/sec. +@property(nonatomic, assign) unsigned int maxBitrate; +@property(nonatomic, assign) unsigned int minBitrate; + +@property(nonatomic, assign) uint32_t maxFramerate; + +@property(nonatomic, assign) unsigned int qpMax; +@property(nonatomic, assign) RTCVideoCodecMode mode; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderVP8.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderVP8.h new file mode 100644 index 0000000..789ae28 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderVP8.h @@ -0,0 +1,30 @@ +/* + * 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoEncoderVP8) : NSObject + +/* This returns a VP8 encoder that can be returned from a RTCVideoEncoderFactory injected into + * RTCPeerConnectionFactory. Even though it implements the RTCVideoEncoder protocol, it can not be + * used independently from the RTCPeerConnectionFactory. + */ ++ (nonnull id)vp8Encoder; + +/* Returns list of scalability modes supported by the encoder that can be + * created with `vp8Encoder` method above. + */ ++ (nonnull NSArray*)supportedScalabilityModes; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderVP9.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderVP9.h new file mode 100644 index 0000000..86c3ddf --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoEncoderVP9.h @@ -0,0 +1,32 @@ +/* + * 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 + +#import +#import + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoEncoderVP9) : NSObject + +/* This returns a VP9 encoder that can be returned from a RTCVideoEncoderFactory injected into + * RTCPeerConnectionFactory. Even though it implements the RTCVideoEncoder protocol, it can not be + * used independently from the RTCPeerConnectionFactory. + */ ++ (nullable id)vp9Encoder; + +/* Returns list of scalability modes supported by the encoder that can be + * created with `vp9Encoder` method above. + */ ++ (nonnull NSArray*)supportedScalabilityModes; + ++ (bool)isSupported; + +@end diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoFrame.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoFrame.h new file mode 100644 index 0000000..c9f7cfc --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoFrame.h @@ -0,0 +1,64 @@ +/* + * 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 +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, RTCVideoRotation) { + RTCVideoRotation_0 = 0, + RTCVideoRotation_90 = 90, + RTCVideoRotation_180 = 180, + RTCVideoRotation_270 = 270, +}; + +@protocol RTC_OBJC_TYPE +(RTCVideoFrameBuffer); + +// RTCVideoFrame is an ObjectiveC version of webrtc::VideoFrame. +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoFrame) : NSObject + +/** Width without rotation applied. */ +@property(nonatomic, readonly) int width; + +/** Height without rotation applied. */ +@property(nonatomic, readonly) int height; +@property(nonatomic, readonly) RTCVideoRotation rotation; + +/** Timestamp in nanoseconds. */ +@property(nonatomic, readonly) int64_t timeStampNs; + +/** Timestamp 90 kHz. */ +@property(nonatomic, assign) int32_t timeStamp; + +@property(nonatomic, readonly) id buffer; + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)new NS_UNAVAILABLE; + +/** Initialize an RTCVideoFrame from a frame buffer, rotation, and timestamp. + */ +- (instancetype)initWithBuffer: + (id)frameBuffer + rotation:(RTCVideoRotation)rotation + timeStampNs:(int64_t)timeStampNs; + +/** Return a frame that is guaranteed to be I420, i.e. it is possible to access + * the YUV data on it. + */ +- (RTC_OBJC_TYPE(RTCVideoFrame) *)newI420VideoFrame; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoFrameBuffer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoFrameBuffer.h new file mode 100644 index 0000000..7efbd2b --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoFrameBuffer.h @@ -0,0 +1,40 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol RTC_OBJC_TYPE +(RTCI420Buffer); + +// RTCVideoFrameBuffer is an ObjectiveC version of webrtc::VideoFrameBuffer. +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoFrameBuffer) + + @property(nonatomic, readonly) int width; +@property(nonatomic, readonly) int height; + +- (id)toI420; + +@optional +- (id)cropAndScaleWith:(int)offsetX + offsetY:(int)offsetY + cropWidth:(int)cropWidth + cropHeight:(int)cropHeight + scaleWidth:(int)scaleWidth + scaleHeight:(int)scaleHeight; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoRenderer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoRenderer.h new file mode 100644 index 0000000..1182844 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoRenderer.h @@ -0,0 +1,44 @@ +/* + * 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 +#if TARGET_OS_IPHONE +#import +#endif + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RTC_OBJC_TYPE(RTCVideoFrame); + +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoRenderer) + + /** The size of the frame. */ + - (void)setSize : (CGSize)size; + +/** The frame to be displayed. */ +- (void)renderFrame:(nullable RTC_OBJC_TYPE(RTCVideoFrame) *)frame; + +@end + +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoViewDelegate) + + - (void)videoView + : (id)videoView didChangeVideoSize + : (CGSize)size; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoSource.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoSource.h new file mode 100644 index 0000000..2428527 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoSource.h @@ -0,0 +1,37 @@ +/* + * 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 + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +RTC_OBJC_EXPORT + +@interface RTC_OBJC_TYPE (RTCVideoSource) : RTC_OBJC_TYPE(RTCMediaSource) + +- (instancetype)init NS_UNAVAILABLE; + +/** + * Calling this function will cause frames to be scaled down to the + * requested resolution. Also, frames will be cropped to match the + * requested aspect ratio, and frames will be dropped to match the + * requested fps. The requested aspect ratio is orientation agnostic and + * will be adjusted to maintain the input orientation, so it doesn't + * matter if e.g. 1280x720 or 720x1280 is requested. + */ +- (void)adaptOutputFormatToWidth:(int)width height:(int)height fps:(int)fps; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoTrack.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoTrack.h new file mode 100644 index 0000000..1836816 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoTrack.h @@ -0,0 +1,38 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol RTC_OBJC_TYPE +(RTCVideoRenderer); +@class RTC_OBJC_TYPE(RTCPeerConnectionFactory); +@class RTC_OBJC_TYPE(RTCVideoSource); + +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCVideoTrack) : RTC_OBJC_TYPE(RTCMediaStreamTrack) + +/** The video source for this video track. */ +@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCVideoSource) *source; + +- (instancetype)init NS_UNAVAILABLE; + +/** Register a renderer that will render all frames received on this track. */ +- (void)addRenderer:(id)renderer; + +/** Deregister a renderer. */ +- (void)removeRenderer:(id)renderer; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoViewShading.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoViewShading.h new file mode 100644 index 0000000..afba015 --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCVideoViewShading.h @@ -0,0 +1,39 @@ +/* + * 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 + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * RTCVideoViewShading provides a way for apps to customize the OpenGL(ES + * shaders used in rendering for the RTCEAGLVideoView/RTCNSGLVideoView. + */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCVideoViewShading) + + /** Callback for I420 frames. Each plane is given as a texture. */ + - (void)applyShadingForFrameWithWidth : (int)width height + : (int)height rotation : (RTCVideoRotation)rotation yPlane + : (GLuint)yPlane uPlane : (GLuint)uPlane vPlane : (GLuint)vPlane; + +/** Callback for NV12 frames. Each plane is given as a texture. */ +- (void)applyShadingForFrameWithWidth:(int)width + height:(int)height + rotation:(RTCVideoRotation)rotation + yPlane:(GLuint)yPlane + uvPlane:(GLuint)uvPlane; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCYUVPlanarBuffer.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCYUVPlanarBuffer.h new file mode 100644 index 0000000..20a154c --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/RTCYUVPlanarBuffer.h @@ -0,0 +1,46 @@ +/* + * 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 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** Protocol for RTCVideoFrameBuffers containing YUV planar data. */ +RTC_OBJC_EXPORT +@protocol RTC_OBJC_TYPE +(RTCYUVPlanarBuffer) + + @property(nonatomic, readonly) int chromaWidth; +@property(nonatomic, readonly) int chromaHeight; +@property(nonatomic, readonly) const uint8_t *dataY; +@property(nonatomic, readonly) const uint8_t *dataU; +@property(nonatomic, readonly) const uint8_t *dataV; +@property(nonatomic, readonly) int strideY; +@property(nonatomic, readonly) int strideU; +@property(nonatomic, readonly) int strideV; + +- (instancetype)initWithWidth:(int)width + height:(int)height + dataY:(const uint8_t *)dataY + dataU:(const uint8_t *)dataU + dataV:(const uint8_t *)dataV; +- (instancetype)initWithWidth:(int)width height:(int)height; +- (instancetype)initWithWidth:(int)width + height:(int)height + strideY:(int)strideY + strideU:(int)strideU + strideV:(int)strideV; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Vendor/WebRTCHeaders/M147/include/WebRTC/WebRTC.h b/Vendor/WebRTCHeaders/M147/include/WebRTC/WebRTC.h new file mode 100644 index 0000000..8b1a57c --- /dev/null +++ b/Vendor/WebRTCHeaders/M147/include/WebRTC/WebRTC.h @@ -0,0 +1,94 @@ +/* + * Copyright 2026 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 +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/VoidDisplay.xcworkspace/xcshareddata/swiftpm/Package.resolved b/VoidDisplay.xcworkspace/xcshareddata/swiftpm/Package.resolved index 9da22ef..3096497 100644 --- a/VoidDisplay.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/VoidDisplay.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,15 +1,6 @@ { - "originHash" : "b1bdc254920b52ec654b6704c5c5270640b266cffca48a3dce5611186629d894", "pins" : [ - { - "identity" : "webrtc", - "kind" : "remoteSourceControl", - "location" : "https://github.com/stasel/WebRTC.git", - "state" : { - "revision" : "86dbb5cb57e4da009b859a6245b1c10d610f215a", - "version" : "140.0.0" - } - } + ], "version" : 3 } diff --git a/scripts/ci/release_smoke.sh b/scripts/ci/release_smoke.sh index e4f7f80..0687eeb 100755 --- a/scripts/ci/release_smoke.sh +++ b/scripts/ci/release_smoke.sh @@ -11,6 +11,8 @@ source "$TOOL_ROOT/scripts/lib/xcode.sh" source "$TOOL_ROOT/scripts/lib/architecture.sh" # shellcheck source=scripts/lib/artifacts.sh source "$TOOL_ROOT/scripts/lib/artifacts.sh" +# shellcheck source=scripts/lib/release_binaries.sh +source "$TOOL_ROOT/scripts/lib/release_binaries.sh" cd "$ROOT_DIR" @@ -72,6 +74,7 @@ env ROOT_DIR="$ROOT_DIR" TOOL_ROOT="$TOOL_ROOT" bash "$TOOL_ROOT/scripts/ci/rele --log-path "$OUT_DIR/xcode-release-build.log" app_path="$(cat "$APP_OUTPUT_FILE")" +validate_release_app_binaries "$app_path" "$ARCH" write_json_file "$SUMMARY_PATH" \ --arg status "passed" \ --arg arch "$ARCH" \ diff --git a/scripts/ci/static.sh b/scripts/ci/static.sh index a59ac16..238aa3c 100755 --- a/scripts/ci/static.sh +++ b/scripts/ci/static.sh @@ -8,7 +8,7 @@ source "$TOOL_ROOT/scripts/lib/common.sh" cd "$ROOT_DIR" -require_command actionlint shellcheck shfmt swiftformat swiftlint rg +require_command actionlint jq shellcheck shfmt shasum swift swiftformat swiftlint rg validate_runner_labels() { local invalid @@ -281,6 +281,152 @@ validate_xcode_log_scanner() { scan_xcode_log_for_diagnostics "Xcode negative log fixture" "$fixture_dir/negative-ordinary-text.log" } +validate_webrtc_header_overlay() { + local overlay_root="$ROOT_DIR/Vendor/WebRTCHeaders/M147" + local include_dir="$overlay_root/include/WebRTC" + local checksum_file="$overlay_root/SHA256SUMS" + local forbidden_header + local invalid + local expected_paths + local actual_paths + local required_source + local manifest_json + + if ! manifest_json="$(swift package dump-package 2>/dev/null)"; then + die "Package.swift must be readable by SwiftPM." + fi + + if ! jq -e \ + --arg url 'https://github.com/stasel/WebRTC/releases/download/147.0.0/WebRTC-M147.xcframework.zip' \ + --arg checksum '49f9b1713432c19f408e3218fc8526c7692fafca5869f7ec5f5991614276ed40' \ + '.targets[] | select(.name == "WebRTCBinary" and .type == "binary" and .url == $url and .checksum == $checksum)' \ + <<<"$manifest_json" >/dev/null; then + die "Package.swift must define WebRTCBinary from the stasel/WebRTC 147.0.0 asset." + fi + if ! jq -e \ + '.targets[] | select(.name == "WebRTC" and .type == "regular" and .path == "Vendor/WebRTCHeaders/M147" and .publicHeadersPath == "include" and any(.dependencies[]?; .byName[0] == "WebRTCBinary"))' \ + <<<"$manifest_json" >/dev/null; then + die "Package.swift must expose the WebRTC M147 overlay through the local WebRTC target." + fi + if ! jq -e \ + '.targets[] | select(.name == "VoidDisplaySharing" and any(.dependencies[]?; .byName[0] == "WebRTC"))' \ + <<<"$manifest_json" >/dev/null; then + die "VoidDisplaySharing must depend on the local WebRTC wrapper target." + fi + if ! jq -e '(.dependencies // []) | length == 0' <<<"$manifest_json" >/dev/null; then + die "Package.swift must not retain remote source package dependencies." + fi + if rg -F 'https://github.com/stasel/WebRTC.git' "$ROOT_DIR/Package.swift" >/dev/null; then + die "Package.swift must use the local WebRTC wrapper target instead of the remote stasel package." + fi + invalid="$(rg -n 'https://github.com/stasel/WebRTC.git|\"identity\"[[:space:]]*:[[:space:]]*\"webrtc\"' \ + "$ROOT_DIR/Package.resolved" \ + "$ROOT_DIR/Apps/VoidDisplay/VoidDisplay.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved" \ + "$ROOT_DIR/VoidDisplay.xcworkspace/xcshareddata/swiftpm/Package.resolved" || true)" + if [[ -n "$invalid" ]]; then + printf '%s\n' "$invalid" >&2 + die "Package.resolved files must not retain stale stasel/WebRTC source pins." + fi + + [[ -f "$overlay_root/SOURCES.md" ]] || die "WebRTC M147 header overlay must document sources." + [[ -f "$checksum_file" ]] || die "WebRTC M147 header overlay must include SHA256SUMS." + [[ -f "$overlay_root/WebRTCHeaderOverlayAnchor.c" ]] || die "WebRTC M147 header overlay target must include its anchor C file." + [[ -f "$include_dir/WebRTC.h" ]] || die "WebRTC M147 header overlay must include WebRTC.h." + [[ -f "$include_dir/RTCMTLNSVideoView.h" ]] || die "WebRTC M147 header overlay must include RTCMTLNSVideoView.h." + + for required_source in \ + 'https://github.com/stasel/WebRTC/releases/download/147.0.0/WebRTC-M147.xcframework.zip' \ + '49f9b1713432c19f408e3218fc8526c7692fafca5869f7ec5f5991614276ed40' \ + 'refs/branch-heads/7727' \ + 'macos-x86_64_arm64/WebRTC.framework/Versions/A/Headers/WebRTC.h' \ + 'RTCMTLNSVideoView.h'; do + if ! rg -F "$required_source" "$overlay_root/SOURCES.md" >/dev/null; then + die "WebRTC M147 SOURCES.md is missing required source detail: $required_source" + fi + done + + invalid="$( + find "$overlay_root" -type f \ + ! -path "$include_dir/*.h" \ + ! -path "$overlay_root/SOURCES.md" \ + ! -path "$overlay_root/SHA256SUMS" \ + ! -path "$overlay_root/WebRTCHeaderOverlayAnchor.c" \ + -print + )" + if [[ -n "$invalid" ]]; then + printf '%s\n' "$invalid" >&2 + die "WebRTC M147 overlay may only contain headers, source metadata, checksums, and the anchor C file." + fi + + if ! rg -F '#import ' "$include_dir/RTCMTLNSVideoView.h" >/dev/null; then + die "RTCMTLNSVideoView.h must import RTCVideoRenderer.h through the WebRTC framework path." + fi + + for forbidden_header in RTCEAGLVideoView.h RTCCameraPreviewView.h UIDevice+RTCDevice.h; do + [[ ! -e "$include_dir/$forbidden_header" ]] || die "WebRTC M147 overlay must not include iOS-only header: $forbidden_header" + done + + invalid="$(rg -n '^[[:space:]]*#(import|include)[[:space:]]+"[^"]+"' "$include_dir" || true)" + if [[ -n "$invalid" ]]; then + printf '%s\n' "$invalid" >&2 + die "WebRTC M147 overlay must not use WebRTC-local quoted imports." + fi + + invalid="$( + while IFS=: read -r file line_number import_path; do + [[ -n "$import_path" ]] || continue + import_path="${import_path#\n' "$file" "$line_number" "WebRTC/$import_path" + done < <(rg -n -o ']+>' "$include_dir" || true) + )" + if [[ -n "$invalid" ]]; then + printf '%s\n' "$invalid" >&2 + die "WebRTC M147 overlay has unresolved recursive WebRTC imports." + fi + + invalid="$( + awk ' + FNR == 1 { + depth = 0 + iphone_guard_depth = 0 + } + /^[[:space:]]*#[[:space:]]*if/ { + depth += 1 + if ($0 ~ /TARGET_OS_IPHONE/) { + iphone_guard_depth = depth + } + } + /UIKit/ && iphone_guard_depth == 0 { + print FILENAME ":" FNR ":" $0 + } + /^[[:space:]]*#[[:space:]]*endif/ { + if (iphone_guard_depth == depth) { + iphone_guard_depth = 0 + } + if (depth > 0) { + depth -= 1 + } + } + ' "$include_dir"/*.h + )" + if [[ -n "$invalid" ]]; then + printf '%s\n' "$invalid" >&2 + die "WebRTC M147 overlay may only reference UIKit inside TARGET_OS_IPHONE guards." + fi + + if ! (cd "$overlay_root" && shasum -a 256 -c SHA256SUMS >/dev/null); then + (cd "$overlay_root" && shasum -a 256 -c SHA256SUMS) >&2 || true + die "WebRTC M147 overlay checksums do not match." + fi + + expected_paths="$(awk '{ print $2 }' "$checksum_file" | sort)" + actual_paths="$(cd "$overlay_root" && find include/WebRTC -type f -name '*.h' -print | sort)" + if ! diff -u <(printf '%s\n' "$expected_paths") <(printf '%s\n' "$actual_paths") >&2; then + die "WebRTC M147 overlay SHA256SUMS must cover every header and only headers." + fi +} + validate_swift_style() { swiftformat --lint --config "$ROOT_DIR/.swiftformat" Sources Tests UITests Package.swift swiftlint lint --config "$ROOT_DIR/.swiftlint.yml" --quiet @@ -294,6 +440,7 @@ validate_script_contract validate_workflow_script_contract validate_xcode_shell_build_phase validate_xcode_log_scanner +validate_webrtc_header_overlay validate_swift_style info "Static gate passed."