Skip to content

Commit cb5c709

Browse files
author
xianing
committed
adapt macos 37200
adapt macos 37200, add mediarelay and screenshare related feature adapt macos 37200, add mediarelay and screenshare related feature
1 parent d11c21d commit cb5c709

13 files changed

Lines changed: 134 additions & 31 deletions

File tree

iOS/SimpleFilter/SimpleFilter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#import <Foundation/Foundation.h>
88

9+
910
//! Project version number for SimpleFilter.
1011
FOUNDATION_EXPORT double SimpleFilterVersionNumber;
1112

iOS/SimpleFilter/SimpleFilterManager.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// Register extension provider
1616
// No need to use quotation marks for input parameter of PROVIDER_NAME
17-
REGISTER_AGORA_EXTENSION_PROVIDER(Agora, agora::extension::ExtensionProvider);
17+
//REGISTER_AGORA_EXTENSION_PROVIDER(Agora, agora::extension::ExtensionProvider);
1818

1919
static NSString *kVendorName = @"Agora";
2020

macOS/APIExample.xcodeproj/project.pbxproj

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@
7979
57AF397B259B31AA00601E02 /* RawAudioData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57AF397A259B31AA00601E02 /* RawAudioData.swift */; };
8080
57AF3981259B329B00601E02 /* RawAudioData.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57AF3980259B329B00601E02 /* RawAudioData.storyboard */; };
8181
596A9F79AF0CD8DC1CA93253 /* Pods_APIExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F65EF2B97B89DE4581B426B /* Pods_APIExample.framework */; };
82+
8B84CA092733A9060005B5A2 /* AgoraRtcKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA032733A9050005B5A2 /* AgoraRtcKit.framework */; };
83+
8B84CA0B2733A9060005B5A2 /* AgoraPvcExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA042733A9050005B5A2 /* AgoraPvcExtension.framework */; };
84+
8B84CA0D2733A9060005B5A2 /* AgoraVideoProcessExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA052733A9060005B5A2 /* AgoraVideoProcessExtension.framework */; };
85+
8B84CA0F2733A9060005B5A2 /* AgoraVideoSegmentation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA062733A9060005B5A2 /* AgoraVideoSegmentation.framework */; };
86+
8B84CA112733A9060005B5A2 /* Agoraffmpeg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA072733A9060005B5A2 /* Agoraffmpeg.framework */; };
87+
8B84CA122733AB0A0005B5A2 /* Agoraffmpeg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA072733A9060005B5A2 /* Agoraffmpeg.framework */; };
88+
8B84CA132733AB0A0005B5A2 /* Agoraffmpeg.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA072733A9060005B5A2 /* Agoraffmpeg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
89+
8B84CA142733AB0B0005B5A2 /* AgoraPvcExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA042733A9050005B5A2 /* AgoraPvcExtension.framework */; };
90+
8B84CA152733AB0B0005B5A2 /* AgoraPvcExtension.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA042733A9050005B5A2 /* AgoraPvcExtension.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
91+
8B84CA162733AB0C0005B5A2 /* AgoraRtcKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA032733A9050005B5A2 /* AgoraRtcKit.framework */; };
92+
8B84CA172733AB0C0005B5A2 /* AgoraRtcKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA032733A9050005B5A2 /* AgoraRtcKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
93+
8B84CA182733AB0D0005B5A2 /* AgoraVideoProcessExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA052733A9060005B5A2 /* AgoraVideoProcessExtension.framework */; };
94+
8B84CA192733AB0D0005B5A2 /* AgoraVideoProcessExtension.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA052733A9060005B5A2 /* AgoraVideoProcessExtension.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
95+
8B84CA1A2733AB100005B5A2 /* AgoraVideoSegmentation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA062733A9060005B5A2 /* AgoraVideoSegmentation.framework */; };
96+
8B84CA1B2733AB100005B5A2 /* AgoraVideoSegmentation.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8B84CA062733A9060005B5A2 /* AgoraVideoSegmentation.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
8297
8BCCA45B26271F7A001FD4CE /* AgoraYUVImageSourcePush.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BCCA45A26271F7A001FD4CE /* AgoraYUVImageSourcePush.m */; };
8398
8BD4AE73272513FF00E95B87 /* SimpleFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD4AE72272513FF00E95B87 /* SimpleFilter.swift */; };
8499
8BD4AE90272519BA00E95B87 /* SimpleFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BD4AE80272519BA00E95B87 /* SimpleFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -107,6 +122,11 @@
107122
dstPath = "";
108123
dstSubfolderSpec = 10;
109124
files = (
125+
8B84CA172733AB0C0005B5A2 /* AgoraRtcKit.framework in Embed Frameworks */,
126+
8B84CA192733AB0D0005B5A2 /* AgoraVideoProcessExtension.framework in Embed Frameworks */,
127+
8B84CA132733AB0A0005B5A2 /* Agoraffmpeg.framework in Embed Frameworks */,
128+
8B84CA1B2733AB100005B5A2 /* AgoraVideoSegmentation.framework in Embed Frameworks */,
129+
8B84CA152733AB0B0005B5A2 /* AgoraPvcExtension.framework in Embed Frameworks */,
110130
);
111131
name = "Embed Frameworks";
112132
runOnlyForDeploymentPostprocessing = 0;
@@ -210,6 +230,11 @@
210230
6F65EF2B97B89DE4581B426B /* Pods_APIExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
211231
7330EE777B818DE1FD428DA3 /* Pods_SimpleFilter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SimpleFilter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
212232
84C863718A380DFD36ABF19F /* Pods-APIExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIExample.debug.xcconfig"; path = "Target Support Files/Pods-APIExample/Pods-APIExample.debug.xcconfig"; sourceTree = "<group>"; };
233+
8B84CA032733A9050005B5A2 /* AgoraRtcKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AgoraRtcKit.framework; sourceTree = "<group>"; };
234+
8B84CA042733A9050005B5A2 /* AgoraPvcExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AgoraPvcExtension.framework; sourceTree = "<group>"; };
235+
8B84CA052733A9060005B5A2 /* AgoraVideoProcessExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AgoraVideoProcessExtension.framework; sourceTree = "<group>"; };
236+
8B84CA062733A9060005B5A2 /* AgoraVideoSegmentation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AgoraVideoSegmentation.framework; sourceTree = "<group>"; };
237+
8B84CA072733A9060005B5A2 /* Agoraffmpeg.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Agoraffmpeg.framework; sourceTree = "<group>"; };
213238
8BCCA45926271F7A001FD4CE /* AgoraYUVImageSourcePush.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AgoraYUVImageSourcePush.h; sourceTree = "<group>"; };
214239
8BCCA45A26271F7A001FD4CE /* AgoraYUVImageSourcePush.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AgoraYUVImageSourcePush.m; sourceTree = "<group>"; };
215240
8BD4AE72272513FF00E95B87 /* SimpleFilter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleFilter.swift; sourceTree = "<group>"; };
@@ -237,15 +262,25 @@
237262
isa = PBXFrameworksBuildPhase;
238263
buildActionMask = 2147483647;
239264
files = (
265+
8B84CA182733AB0D0005B5A2 /* AgoraVideoProcessExtension.framework in Frameworks */,
266+
8B84CA122733AB0A0005B5A2 /* Agoraffmpeg.framework in Frameworks */,
267+
8B84CA162733AB0C0005B5A2 /* AgoraRtcKit.framework in Frameworks */,
240268
8BE63B4127251FA800597DB1 /* SimpleFilter.framework in Frameworks */,
241269
596A9F79AF0CD8DC1CA93253 /* Pods_APIExample.framework in Frameworks */,
270+
8B84CA142733AB0B0005B5A2 /* AgoraPvcExtension.framework in Frameworks */,
271+
8B84CA1A2733AB100005B5A2 /* AgoraVideoSegmentation.framework in Frameworks */,
242272
);
243273
runOnlyForDeploymentPostprocessing = 0;
244274
};
245275
8BD4AE76272518D600E95B87 /* Frameworks */ = {
246276
isa = PBXFrameworksBuildPhase;
247277
buildActionMask = 2147483647;
248278
files = (
279+
8B84CA0B2733A9060005B5A2 /* AgoraPvcExtension.framework in Frameworks */,
280+
8B84CA0D2733A9060005B5A2 /* AgoraVideoProcessExtension.framework in Frameworks */,
281+
8B84CA092733A9060005B5A2 /* AgoraRtcKit.framework in Frameworks */,
282+
8B84CA0F2733A9060005B5A2 /* AgoraVideoSegmentation.framework in Frameworks */,
283+
8B84CA112733A9060005B5A2 /* Agoraffmpeg.framework in Frameworks */,
249284
3CD1D961EB36C1CAA0A379A8 /* Pods_SimpleFilter.framework in Frameworks */,
250285
);
251286
runOnlyForDeploymentPostprocessing = 0;
@@ -486,6 +521,11 @@
486521
03896D2E24F8A00F008593CD /* APIExample */ = {
487522
isa = PBXGroup;
488523
children = (
524+
8B84CA072733A9060005B5A2 /* Agoraffmpeg.framework */,
525+
8B84CA042733A9050005B5A2 /* AgoraPvcExtension.framework */,
526+
8B84CA032733A9050005B5A2 /* AgoraRtcKit.framework */,
527+
8B84CA052733A9060005B5A2 /* AgoraVideoProcessExtension.framework */,
528+
8B84CA062733A9060005B5A2 /* AgoraVideoSegmentation.framework */,
489529
033AA004252EBBEC00BC26E1 /* Localizable.strings */,
490530
034C629D25297ABB00296ECF /* Resources */,
491531
03267E262500C779004A91A6 /* APIExample-Bridging-Header.h */,
@@ -1203,7 +1243,7 @@
12031243
CODE_SIGN_IDENTITY = "Apple Development";
12041244
CODE_SIGN_STYLE = Automatic;
12051245
COMBINE_HIDPI_IMAGES = YES;
1206-
DEVELOPMENT_TEAM = JDPG69R49Z;
1246+
DEVELOPMENT_TEAM = YS397FG5PA;
12071247
ENABLE_HARDENED_RUNTIME = YES;
12081248
FRAMEWORK_SEARCH_PATHS = (
12091249
"$(inherited)",
@@ -1231,7 +1271,7 @@
12311271
CODE_SIGN_IDENTITY = "Apple Development";
12321272
CODE_SIGN_STYLE = Automatic;
12331273
COMBINE_HIDPI_IMAGES = YES;
1234-
DEVELOPMENT_TEAM = JDPG69R49Z;
1274+
DEVELOPMENT_TEAM = YS397FG5PA;
12351275
ENABLE_HARDENED_RUNTIME = YES;
12361276
FRAMEWORK_SEARCH_PATHS = (
12371277
"$(inherited)",
@@ -1254,18 +1294,21 @@
12541294
isa = XCBuildConfiguration;
12551295
baseConfigurationReference = 1D2C9FD747B518ECC54253C0 /* Pods-SimpleFilter.debug.xcconfig */;
12561296
buildSettings = {
1257-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
12581297
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
12591298
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
12601299
CODE_SIGN_STYLE = Automatic;
12611300
COMBINE_HIDPI_IMAGES = YES;
12621301
CURRENT_PROJECT_VERSION = 1;
12631302
DEFINES_MODULE = YES;
1264-
DEVELOPMENT_TEAM = JDPG69R49Z;
1303+
DEVELOPMENT_TEAM = YS397FG5PA;
12651304
DRIVERKIT_DEPLOYMENT_TARGET = 20.4;
12661305
DYLIB_COMPATIBILITY_VERSION = 1;
12671306
DYLIB_CURRENT_VERSION = 1;
12681307
DYLIB_INSTALL_NAME_BASE = "@rpath";
1308+
FRAMEWORK_SEARCH_PATHS = (
1309+
"$(inherited)",
1310+
"$(PROJECT_DIR)/APIExample",
1311+
);
12691312
GENERATE_INFOPLIST_FILE = YES;
12701313
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 Agora Corp. All rights reserved.";
12711314
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -1290,18 +1333,21 @@
12901333
isa = XCBuildConfiguration;
12911334
baseConfigurationReference = 1476E0A207E49E1B380D7B0F /* Pods-SimpleFilter.release.xcconfig */;
12921335
buildSettings = {
1293-
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
12941336
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
12951337
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
12961338
CODE_SIGN_STYLE = Automatic;
12971339
COMBINE_HIDPI_IMAGES = YES;
12981340
CURRENT_PROJECT_VERSION = 1;
12991341
DEFINES_MODULE = YES;
1300-
DEVELOPMENT_TEAM = JDPG69R49Z;
1342+
DEVELOPMENT_TEAM = YS397FG5PA;
13011343
DRIVERKIT_DEPLOYMENT_TARGET = 20.4;
13021344
DYLIB_COMPATIBILITY_VERSION = 1;
13031345
DYLIB_CURRENT_VERSION = 1;
13041346
DYLIB_INSTALL_NAME_BASE = "@rpath";
1347+
FRAMEWORK_SEARCH_PATHS = (
1348+
"$(inherited)",
1349+
"$(PROJECT_DIR)/APIExample",
1350+
);
13051351
GENERATE_INFOPLIST_FILE = YES;
13061352
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 Agora Corp. All rights reserved.";
13071353
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";

macOS/APIExample/Commons/RawDataApi/AgoraMediaDataPlugin.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ virtual bool onTranscodedVideoFrame(VideoFrame& videoFrame) override
149149
// return VIDEO_FRAME_TYPE(mediaDataPlugin.videoFormatter.type);
150150
// }
151151

152-
virtual int getRotationApplied() override
152+
virtual bool getRotationApplied() override
153153
{
154154
return mediaDataPlugin.videoFormatter.rotationApplied;
155155
}

macOS/APIExample/Examples/Advanced/AudioMixing/AudioMixing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class AudioMixing: BaseViewController {
392392
agoraKit.setClientRole(.broadcaster)
393393

394394
// enable volume indicator
395-
agoraKit.enableAudioVolumeIndication(200, smooth: 3)
395+
agoraKit.enableAudioVolumeIndication(200, smooth: 3, reportvad: false)
396396

397397
// update slider values
398398
mixingPlaybackVolumeSlider.slider.doubleValue = Double(agoraKit.getAudioMixingPlayoutVolume())

macOS/APIExample/Examples/Advanced/ChannelMediaRelay/Base.lproj/ChannelMediaRelay.storyboard

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="19162" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17701"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19162"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<scenes>
@@ -44,10 +44,23 @@
4444
<action selector="onRelayPressed:" target="IBJ-wZ-9Xx" id="n9w-gL-fWZ"/>
4545
</connections>
4646
</button>
47+
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wHy-mt-GOp" userLabel="Pause Relay Button">
48+
<rect key="frame" x="22" y="349" width="270" height="32"/>
49+
<buttonCell key="cell" type="push" title="Pause Relay" bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="1CI-ah-KbX">
50+
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
51+
<font key="font" metaFont="system"/>
52+
</buttonCell>
53+
<connections>
54+
<action selector="onPauseRelayPressed:" target="IBJ-wZ-9Xx" id="uSZ-BV-p3F"/>
55+
</connections>
56+
</button>
4757
</subviews>
4858
<constraints>
59+
<constraint firstItem="wHy-mt-GOp" firstAttribute="trailing" secondItem="S1D-au-Bpo" secondAttribute="trailing" id="8OP-wB-9DZ"/>
4960
<constraint firstItem="S1D-au-Bpo" firstAttribute="top" secondItem="1cB-LP-tqM" secondAttribute="bottom" constant="20" symbolic="YES" id="Hwa-v1-1BK"/>
5061
<constraint firstItem="S1D-au-Bpo" firstAttribute="centerX" secondItem="1cB-LP-tqM" secondAttribute="centerX" id="KTt-Jb-OTT"/>
62+
<constraint firstItem="wHy-mt-GOp" firstAttribute="leading" secondItem="S1D-au-Bpo" secondAttribute="leading" id="b2r-o5-f9M"/>
63+
<constraint firstItem="wHy-mt-GOp" firstAttribute="top" secondItem="S1D-au-Bpo" secondAttribute="bottom" constant="12" symbolic="YES" id="mae-cc-AKQ"/>
5164
<constraint firstItem="S1D-au-Bpo" firstAttribute="leading" secondItem="Kbr-bS-aeU" secondAttribute="leading" constant="29" id="ouc-Zp-ngu"/>
5265
</constraints>
5366
</view>
@@ -120,6 +133,7 @@
120133
<outlet property="Container" destination="jTl-EW-spm" id="8Kx-nB-tkg"/>
121134
<outlet property="channelField" destination="x6g-v9-tlo" id="E0B-6B-vPy"/>
122135
<outlet property="joinChannelButton" destination="AiY-Xl-Ubt" id="yx0-tu-O6E"/>
136+
<outlet property="pauseRelayButton" destination="wHy-mt-GOp" id="D5i-8i-rhg"/>
123137
<outlet property="relayButton" destination="S1D-au-Bpo" id="bd3-en-u6K"/>
124138
<outlet property="relayChannelField" destination="1cB-LP-tqM" id="pgF-93-R6n"/>
125139
</connections>

macOS/APIExample/Examples/Advanced/ChannelMediaRelay/ChannelMediaRelay.swift

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ChannelMediaRelay: BaseViewController {
4343
}
4444

4545
/**
46-
--- Join Button ---
46+
--- Relay Button ---
4747
*/
4848
@IBOutlet weak var relayButton: NSButton!
4949
func initRelayButton() {
@@ -66,12 +66,35 @@ class ChannelMediaRelay: BaseViewController {
6666
let destinationInfo = AgoraChannelMediaRelayInfo(token: nil)
6767
config.setDestinationInfo(destinationInfo, forChannelName: destinationChannelName)
6868
agoraKit.startChannelMediaRelay(config)
69+
pauseRelayButton.isEnabled = true
6970
} else {
7071
isProcessing = true
72+
isPauseRelaying = false
7173
agoraKit.stopChannelMediaRelay()
74+
pauseRelayButton.isEnabled = false
7275
}
7376

7477
}
78+
79+
/**
80+
--- Pause Relay Button ---
81+
*/
82+
@IBOutlet weak var pauseRelayButton: NSButton!
83+
func initPauseRelayButton() {
84+
pauseRelayButton.title = isPauseRelaying ? "Resume Relay".localized : "Pause Relay".localized
85+
}
86+
@IBAction func onPauseRelayPressed(_ sender: Any) {
87+
if isProcessing, !isRelaying { return }
88+
if !isPauseRelaying {
89+
isPauseRelaying = true
90+
agoraKit.pauseAllChannelMediaRelay()
91+
92+
}
93+
else {
94+
isPauseRelaying = false
95+
agoraKit.resumeAllChannelMediaRelay()
96+
}
97+
}
7598

7699
// indicate if current instance has joined channel
77100
var isJoined: Bool = false {
@@ -95,6 +118,12 @@ class ChannelMediaRelay: BaseViewController {
95118
}
96119
}
97120

121+
var isPauseRelaying: Bool = false {
122+
didSet {
123+
initPauseRelayButton()
124+
}
125+
}
126+
98127
override func viewDidLoad() {
99128
super.viewDidLoad()
100129
layoutVideos(2)
@@ -107,6 +136,7 @@ class ChannelMediaRelay: BaseViewController {
107136

108137
initRelayChannelField()
109138
initRelayButton()
139+
initPauseRelayButton()
110140
initChannelField()
111141
initJoinChannelButton()
112142
}

macOS/APIExample/Examples/Advanced/CustomVideoSourcePush/CustomVideoSourcePush.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ class CustomVideoSourcePush: BaseViewController {
207207

208208
// setup my own camera as custom video source
209209
customCamera = AgoraCameraSourcePush(delegate: self, videoView: localPreview!)
210-
agoraKit.setExternalVideoSource(true, useTexture: true, encodedFrame: true)
210+
agoraKit.setExternalVideoSource(true, useTexture: true, sourceType: .videoFrame)
211+
// agoraKit.setExternalVideoSource(true, useTexture: true, encodedFrame: true)
211212
customCamera?.startCapture(ofCamera: .defaultCamera())
212213
// enable video module and set up video encoding configs
213214
agoraKit.setVideoEncoderConfiguration(

0 commit comments

Comments
 (0)