Skip to content

Commit

Permalink
Merge branch 'dev/4.4.x' into dev/pip_example
Browse files Browse the repository at this point in the history
# Conflicts:
#	iOS/APIExample/APIExample.xcodeproj/project.pbxproj
  • Loading branch information
qinhui committed Sep 24, 2024
2 parents 0af4707 + 164ca6b commit 4fe6c99
Show file tree
Hide file tree
Showing 20 changed files with 1,054 additions and 28 deletions.
16 changes: 5 additions & 11 deletions iOS/APIExample-Audio/APIExample-Audio.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -982,12 +982,10 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = JDPG69R49Z;
DEVELOPMENT_TEAM = YS397FG5PA;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -1038,7 +1036,6 @@
PRODUCT_BUNDLE_IDENTIFIER = io.agora.api.examples.audio;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = AgoraLab2020;
SWIFT_OBJC_BRIDGING_HEADER = "APIExample-Audio/APIExample-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -1056,11 +1053,9 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = JDPG69R49Z;
DEVELOPMENT_TEAM = YS397FG5PA;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -1111,7 +1106,6 @@
PRODUCT_BUNDLE_IDENTIFIER = io.agora.api.examples.audio;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = AgoraLab2020;
SWIFT_OBJC_BRIDGING_HEADER = "APIExample-Audio/APIExample-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class CustomPcmAudioSourceMain: BaseViewController {
// the token has to match the ones used for channel join
let option = AgoraRtcChannelMediaOptions()
option.publishCameraTrack = false
option.publishMicrophoneTrack = GlobalSettings.shared.getUserRole() == .broadcaster
option.publishMicrophoneTrack = false
option.publishCustomAudioTrack = GlobalSettings.shared.getUserRole() == .broadcaster
option.publishCustomAudioTrackId = Int(trackId)
option.clientRoleType = GlobalSettings.shared.getUserRole()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -18,7 +18,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lC2-dZ-ofF">
<rect key="frame" x="20" y="293.5" width="374" height="138"/>
<rect key="frame" x="20" y="295" width="374" height="138"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter channel name" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="SdL-FU-6ht" userLabel="channelName">
<rect key="frame" x="37.5" y="20" width="299" height="34"/>
Expand Down Expand Up @@ -70,7 +70,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="a0t-ZI-lHz" userLabel="pcm">
<rect key="frame" x="0.0" y="632" width="414" height="48"/>
<rect key="frame" x="0.0" y="633" width="414" height="48"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Push PCM" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dbo-LJ-5lv">
<rect key="frame" x="20" y="16" width="62.5" height="16"/>
Expand All @@ -90,19 +90,41 @@
<constraint firstItem="dV6-q6-Gqm" firstAttribute="centerY" secondItem="a0t-ZI-lHz" secondAttribute="centerY" id="1ke-Ze-5Yg"/>
<constraint firstAttribute="trailing" secondItem="dV6-q6-Gqm" secondAttribute="trailing" constant="20" id="BwJ-mH-gcE"/>
<constraint firstItem="dV6-q6-Gqm" firstAttribute="centerY" secondItem="Dbo-LJ-5lv" secondAttribute="centerY" id="Tce-t9-8sl"/>
<constraint firstItem="dV6-q6-Gqm" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Dbo-LJ-5lv" secondAttribute="trailing" constant="8" symbolic="YES" id="bdQ-Sc-Zh4"/>
<constraint firstAttribute="height" constant="48" id="gMu-3X-Ejl"/>
<constraint firstItem="Dbo-LJ-5lv" firstAttribute="leading" secondItem="a0t-ZI-lHz" secondAttribute="leading" constant="20" id="ykF-lp-vEa"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6aN-r3-OBp" userLabel="mic">
<rect key="frame" x="0.0" y="680" width="414" height="48"/>
<rect key="frame" x="0.0" y="681" width="414" height="48"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="2th-LX-ugB">
<rect key="frame" x="345" y="8" width="51" height="32"/>
<connections>
<action selector="pushMicrophone:" destination="wEj-TK-x0n" eventType="valueChanged" id="SQ0-gC-2Cf"/>
</connections>
</switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Push Microphone" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3Sp-t2-4ZJ" userLabel="Push Microphone">
<rect key="frame" x="19" y="15" width="106" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="2K6-1p-G5S"/>
<constraint firstAttribute="trailing" secondItem="2th-LX-ugB" secondAttribute="trailing" constant="20" id="4ah-Fm-UGP"/>
<constraint firstItem="3Sp-t2-4ZJ" firstAttribute="centerY" secondItem="2th-LX-ugB" secondAttribute="centerY" id="FNf-GW-5sM"/>
<constraint firstItem="3Sp-t2-4ZJ" firstAttribute="top" secondItem="6aN-r3-OBp" secondAttribute="top" constant="15" id="N4p-jC-NET"/>
<constraint firstItem="2th-LX-ugB" firstAttribute="top" secondItem="6aN-r3-OBp" secondAttribute="topMargin" id="NFK-L9-gNC"/>
<constraint firstItem="2th-LX-ugB" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="3Sp-t2-4ZJ" secondAttribute="trailing" constant="8" symbolic="YES" id="Zi2-Tk-iuF"/>
<constraint firstItem="2th-LX-ugB" firstAttribute="centerY" secondItem="6aN-r3-OBp" secondAttribute="centerY" id="ePY-DC-OMx"/>
<constraint firstItem="3Sp-t2-4ZJ" firstAttribute="leading" secondItem="6aN-r3-OBp" secondAttribute="leading" constant="19" id="r6z-OE-ha4"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dyj-wd-Iae" customClass="AGEVideoContainer" customModule="AGEVideoLayout">
<rect key="frame" x="0.0" y="44" width="414" height="540"/>
<rect key="frame" x="0.0" y="48" width="414" height="537"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</subviews>
Expand All @@ -123,6 +145,7 @@
</view>
<connections>
<outlet property="container" destination="Dyj-wd-Iae" id="YY7-wi-33p"/>
<outlet property="pushMicrophoneSwitch" destination="2th-LX-ugB" id="T0r-uv-ZMs"/>
<outlet property="pushPcmSwitch" destination="dV6-q6-Gqm" id="9b8-1h-vN4"/>
</connections>
</viewController>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ class CustomPcmAudioSourceMain: BaseViewController {
var audioViews: [UInt: VideoView] = [:]
@IBOutlet weak var playAudioView: UIView!
@IBOutlet weak var pushPcmSwitch: UISwitch!
@IBOutlet weak var pushMicrophoneSwitch: UISwitch!
private var trackId: Int32 = 0

// indicate if current instance has joined channel
var isJoined: Bool = false {
didSet {
pushPcmSwitch.isEnabled = isJoined
pushMicrophoneSwitch.isEnabled = pushPcmSwitch.isEnabled
}
}

Expand Down Expand Up @@ -96,9 +98,6 @@ class CustomPcmAudioSourceMain: BaseViewController {
let option = AgoraRtcChannelMediaOptions()
option.publishCameraTrack = false
option.publishMicrophoneTrack = false
option.publishCustomAudioTrack = GlobalSettings.shared.getUserRole() == .broadcaster
option.publishCustomAudioTrackId = Int(trackId)
option.clientRoleType = GlobalSettings.shared.getUserRole()
NetworkManager.shared.generateToken(channelName: channelName, success: { token in
let result = self.agoraKit.joinChannel(byToken: token, channelId: channelName, uid: 0, mediaOptions: option)
if result != 0 {
Expand Down Expand Up @@ -135,6 +134,13 @@ class CustomPcmAudioSourceMain: BaseViewController {
}
let mediaOption = AgoraRtcChannelMediaOptions()
mediaOption.publishCustomAudioTrack = sender.isOn
mediaOption.publishCustomAudioTrackId = Int(trackId)
agoraKit.updateChannel(with: mediaOption)
}

@IBAction func pushMicrophone(_ sender: UISwitch) {
let mediaOption = AgoraRtcChannelMediaOptions()
mediaOption.publishMicrophoneTrack = sender.isOn
agoraKit.updateChannel(with: mediaOption)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"Cwr-m3-kGh.text" = "麦克风";

/* Class = "UILabel"; text = "Push PCM"; ObjectID = "Dbo-LJ-5lv"; */
"Dbo-LJ-5lv.text" = "播放 PCM";
"Dbo-LJ-5lv.text" = "发布本地音频";

/* Class = "UILabel"; text = "Push Microphone"; ObjectID = "3Sp-t2-4ZJ"; */
"3Sp-t2-4ZJ.text" = "发布麦克风";

/* Class = "UITextField"; placeholder = "Enter channel name"; ObjectID = "SdL-FU-6ht"; */
"SdL-FU-6ht.placeholder" = "输入频道名";
Expand Down
33 changes: 33 additions & 0 deletions windows/APIExample/APIExample/APIExample.rc
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,20 @@ BEGIN
EDITTEXT IDC_EDIT_TOKEN,69,363,128,29,ES_AUTOHSCROLL
END

IDD_DIALOG_TRANSPARENT_BG DIALOGEX 0, 0, 632, 400
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Channel Name",IDC_STATIC_CHANNELNAME,136,360,48,8
EDITTEXT IDC_EDIT_CHANNELNAME,216,358,172,13,ES_AUTOHSCROLL
PUSHBUTTON "JoinChannel",IDC_BUTTON_JOINCHANNEL,420,358,75,14
LTEXT "",IDC_STATIC_DETAIL,23,370,412,27
LTEXT "",IDC_STATIC_VIDEO,0,0,419,147
LTEXT "",IDC_STATIC_VIDEO_RIGHT,233,175,176,136
LTEXT "",IDC_STATIC_VIDEO_LEFT,2,173,171,136
LISTBOX IDC_LIST_INFO_BROADCASTING,491,0,139,312,LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
END


/////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -907,6 +921,14 @@ BEGIN
HORZGUIDE, 163
END

IDD_DIALOG_VOLUME, DIALOG
BEGIN
END

IDD_DIALOG_PEPORT_IN_CALL, DIALOG
BEGIN
END

IDD_DIALOG_REGIONAL_CONNECTION, DIALOG
BEGIN
END
Expand Down Expand Up @@ -1048,6 +1070,12 @@ BEGIN
HORZGUIDE, 348
HORZGUIDE, 363
END

IDD_DIALOG_TRANSPARENT_BG, DIALOG
BEGIN
RIGHTMARGIN, 630
BOTTOMMARGIN, 397
END
END
#endif // APSTUDIO_INVOKED

Expand Down Expand Up @@ -1187,6 +1215,11 @@ BEGIN
0
END

IDD_DIALOG_TRANSPARENT_BG AFX_DIALOG_LAYOUT
BEGIN
0
END


/////////////////////////////////////////////////////////////////////////////
//
Expand Down
12 changes: 10 additions & 2 deletions windows/APIExample/APIExample/APIExample.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(solutionDir)ThirdParty\libFFmpeg\include;$(solutionDir)ThirdParty\Boost;$(SolutionDir)sdk\high_level_api\include;$(solutionDir)ThirdParty\libYUV;$(ProjectDir)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
Expand All @@ -121,7 +121,8 @@ if exist zh-cn.ini (copy zh-cn.ini $(SolutionDir)$(Configuration))
if exist en.ini (copy en.ini $(SolutionDir)$(Configuration))
copy $(SolutionDir)APIExample\Advanced\LocalVideoTranscoding\agora.png $(SolutionDir)$(Configuration)
copy $(SolutionDir)APIExample\Advanced\LocalVideoTranscoding\agora.jpg $(SolutionDir)$(Configuration)
if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Configuration))</Command>
if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Configuration))
if exist $(SolutionDir)APIExample\res\yuvj_full_range_alpha_1280_540_left.mp4 (copy $(SolutionDir)APIExample\res\yuvj_full_range_alpha_1280_540_left.mp4 $(SolutionDir)$(Configuration))</Command>
</PostBuildEvent>
<Manifest>
<AdditionalManifestFiles>
Expand Down Expand Up @@ -167,6 +168,7 @@ if exist en.ini (copy en.ini $(SolutionDir)$(Platform)\$(Configuration))
copy $(SolutionDir)APIExample\Advanced\LocalVideoTranscoding\agora.png $(SolutionDir)$(Platform)\$(Configuration)
copy $(SolutionDir)APIExample\Advanced\LocalVideoTranscoding\agora.jpg $(SolutionDir)$(Platform)\$(Configuration)
if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Platform)$(Configuration))
if exist $(SolutionDir)APIExample\res\yuvj_full_range_alpha_1280_540_left.mp4 (copy $(SolutionDir)APIExample\res\yuvj_full_range_alpha_1280_540_left.mp4 $(SolutionDir)$(Configuration))
</Command>
</PostBuildEvent>
<Manifest>
Expand Down Expand Up @@ -267,6 +269,7 @@ if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Platform)\$(Configuration))
</Manifest>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="AbstractMediaPlayerSourceObserver.h" />
<ClInclude Include="Advanced\AudioEffect\CAgoraEffectDlg.h" />
<ClInclude Include="Advanced\AudioMixing\CAgoraAudioMixingDlg.h" />
<ClInclude Include="Advanced\AudioProfile\CAgoraAudioProfile.h" />
Expand Down Expand Up @@ -295,6 +298,7 @@ if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Platform)\$(Configuration))
<ClInclude Include="Advanced\RTMPStream\AgoraRtmpStreaming.h" />
<ClInclude Include="Advanced\ScreenShare\AgoraScreenCapture.h" />
<ClInclude Include="Advanced\SpatialAudio\CAgoraSpatialAudioDlg.h" />
<ClInclude Include="Advanced\TransparentBg\TransparentBgDialog.h" />
<ClInclude Include="AGVideoTestWnd.h" />
<ClInclude Include="AGVideoWnd.h" />
<ClInclude Include="APIExample.h" />
Expand All @@ -319,6 +323,7 @@ if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Platform)\$(Configuration))
<ClInclude Include="YUVReader.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AbstractMediaPlayerSourceObserver.cpp" />
<ClCompile Include="Advanced\AudioEffect\CAgoraEffectDlg.cpp" />
<ClCompile Include="Advanced\AudioMixing\CAgoraAudioMixingDlg.cpp" />
<ClCompile Include="Advanced\AudioProfile\CAgoraAudioProfile.cpp" />
Expand Down Expand Up @@ -347,6 +352,7 @@ if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Platform)\$(Configuration))
<ClCompile Include="Advanced\RTMPStream\AgoraRtmpStreaming.cpp" />
<ClCompile Include="Advanced\ScreenShare\AgoraScreenCapture.cpp" />
<ClCompile Include="Advanced\SpatialAudio\CAgoraSpatialAudioDlg.cpp" />
<ClCompile Include="Advanced\TransparentBg\TransparentBgDialog.cpp" />
<ClCompile Include="AGVideoTestWnd.cpp" />
<ClCompile Include="AGVideoWnd.cpp" />
<ClCompile Include="APIExample.cpp" />
Expand Down Expand Up @@ -395,6 +401,7 @@ if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Platform)\$(Configuration))
<CopyFileToFolders Include="sample.yuv">
<FileType>Document</FileType>
</CopyFileToFolders>
<None Include="res\wave2.bin" />
<None Include="zh-cn.ini" />
</ItemGroup>
<ItemGroup>
Expand All @@ -418,6 +425,7 @@ if exist sample.yuv (copy sample.yuv $(SolutionDir)$(Platform)\$(Configuration))
<FileType>Document</FileType>
</CopyFileToFolders>
<Media Include="res\ID_TEST_AUDIO.wav" />
<Media Include="res\yuvj_full_range_alpha_1280_540_left.mp4" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
Loading

0 comments on commit 4fe6c99

Please sign in to comment.